see999 3 vuotta sitten
vanhempi
commit
6563abf0ff
2 muutettua tiedostoa jossa 46 lisäystä ja 5 poistoa
  1. 40 5
      controllers/his_api_controller.go
  2. 6 0
      service/his_service.go

+ 40 - 5
controllers/his_api_controller.go Näytä tiedosto

@@ -94,8 +94,27 @@ func HisManagerApiRegistRouters() {
94 94
 
95 95
 	beego.Router("/api/changemedtype/post", &HisApiController{}, "post:ChangeMedType")
96 96
 
97
+	beego.Router("/api/refunddetail/post", &HisApiController{}, "post:RefudDetail")
98
+	
99
+
100
+}
101
+
102
+func (c *HisApiController) RefudDetail() {
103
+	order_id, _ := c.GetInt64("order_id")
104
+	order, _ := service.GetHisOrderByID(order_id)
105
+	adminUser := c.GetAdminUserInfo()
106
+	err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId)
107
+	if err == nil {
108
+		c.ServeSuccessJSON(map[string]interface{}{
109
+			"msg": "撤销成功",
110
+		})
111
+	} else {
112
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
113
+		return
114
+	}
97 115
 }
98 116
 
117
+
99 118
 func (c *HisApiController) Sscard() {
100 119
 	//r := CardInit()
101 120
 	//if r == 0 {
@@ -2778,12 +2797,16 @@ func (c *HisApiController) GetUploadInfo() {
2778 2797
 	var start_time int64
2779 2798
 	var end_time int64
2780 2799
 
2781
-	if tempOrder.ID == 0 {
2782 2800
 
2801
+	ids_str := c.GetString("ids")
2802
+ 	ids_arr := strings.Split(ids_str,  ",")
2803
+	if tempOrder.ID == 0 {
2783 2804
 		if settle_accounts_type == 1 { //日结
2784
-
2785
-			prescriptions, _ = service.GetSettleHisPrescription(adminUser.CurrentOrgId, id, his_patient_id, recordDateTime, reg_type)
2786
-
2805
+			if reg_type == 11{
2806
+				prescriptions,_ = service.GetPrescriptionByIds(ids_arr,adminUser.CurrentOrgId)
2807
+			   }else{
2808
+				prescriptions, _ = service.GetSettleHisPrescription(adminUser.CurrentOrgId, id, his_patient_id, recordDateTime, reg_type)
2809
+			   }
2787 2810
 		} else { //月结
2788 2811
 			start_time_str := c.GetString("start_time")
2789 2812
 			end_time_str := c.GetString("end_time")
@@ -4418,6 +4441,7 @@ func (c *HisApiController) PreSettle() {
4418 4441
 	record_time := c.GetString("record_time")
4419 4442
 	his_patient_id, _ := c.GetInt64("his_patient_id")
4420 4443
 
4444
+	
4421 4445
 	timeLayout := "2006-01-02"
4422 4446
 	loc, _ := time.LoadLocation("Local")
4423 4447
 	settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
@@ -4438,10 +4462,21 @@ func (c *HisApiController) PreSettle() {
4438 4462
 	var start_time int64
4439 4463
 	var end_time int64
4440 4464
 
4465
+	ids_str := c.GetString("ids")
4466
+	ids_arr := strings.Split(ids_str,  ",")
4467
+
4468
+
4469
+
4441 4470
 	if settle_accounts_type == 1 { //日结
4442 4471
 
4443
-		prescriptions, _ = service.GetSettleHisPrescription(adminUser.CurrentOrgId, id, his_patient_id, recordDateTime, reg_type)
4472
+		if reg_type == 11{
4473
+
4474
+			prescriptions,_ = service.GetPrescriptionByIds(ids_arr,adminUser.CurrentOrgId)
4475
+		}else{
4476
+			prescriptions, _ = service.GetSettleHisPrescription(adminUser.CurrentOrgId, id, his_patient_id, recordDateTime, reg_type)
4477
+		}
4444 4478
 
4479
+		
4445 4480
 	} else { //月结
4446 4481
 		start_time_str := c.GetString("start_time")
4447 4482
 		end_time_str := c.GetString("end_time")

+ 6 - 0
service/his_service.go Näytä tiedosto

@@ -2045,3 +2045,9 @@ func SaveHisOrder(his *models.HisOrder) (err error) {
2045 2045
 	err = writeDb.Save(&his).Error
2046 2046
 	return
2047 2047
 }
2048
+
2049
+
2050
+func GetPrescriptionByIds(ids []string, org_id int64) (prescription []*models.HisPrescription, err error) {
2051
+	err = readDb.Model(&models.HisPrescription{}).Where("id in (?) AND user_org_id = ? AND status = 1", ids, org_id).Find(&prescription).Error
2052
+	return
2053
+}