test_user 4 semanas atrás
pai
commit
81ec816905
1 arquivos alterados com 14 adições e 10 exclusões
  1. 14 10
      controllers/sg/his_api_controller.go

+ 14 - 10
controllers/sg/his_api_controller.go Ver arquivo

@@ -3211,15 +3211,10 @@ func (c *HisApiController) DeleteXSandBG() {
3211 3211
 func (c *HisApiController) DeleteXSandBGTwo() {
3212 3212
 	id, _ := c.GetInt64("id")
3213 3213
 	admin_user_id, _ := c.GetInt64("admin_user_id")
3214
+	var errs []string
3214 3215
 
3215 3216
 
3216 3217
 	advicelist, _ := service.FindHisAdviceDocAdvice(id)
3217
-	//for _, item := range advicelist {
3218
-	//	flow, _ := service.GetNewDrugFlowInfoByPatient(item.PatientId, item.DrugId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId)
3219
-	//	flows = append(flows, flow...)
3220
-	//}
3221
-	//roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
3222
-	//miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
3223 3218
 	for _, item := range advicelist {
3224 3219
 		prescription := service.GetHisPrescriptionByID(item.PrescriptionId)
3225 3220
 		if prescription.OrderStatus != 2 {
@@ -3249,14 +3244,20 @@ func (c *HisApiController) DeleteXSandBGTwo() {
3249 3244
 		}
3250 3245
 
3251 3246
 	}
3252
-
3247
+	utils.ErrorLog("接口返回数据解析JSON失败: %v", errs)
3248
+	if len(errs) > 0 {
3249
+		c.ServeSuccessJSON(map[string]interface{}{
3250
+			"failed_code": -10,
3251
+			"msg":         errs,
3252
+		})
3253
+		return
3254
+	}
3253 3255
 
3254 3256
 
3255 3257
 	//flows, _ := service.GetNewDrugFlowInfo(c.GetAdminUserInfo().CurrentOrgId, id_arr)
3256 3258
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
3257 3259
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
3258 3260
 
3259
-	var err []string
3260 3261
 	for _, item := range advicelist {
3261 3262
 			flow, _ := service.GetNewDrugFlowInfoByPatient(item.DrugId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId)
3262 3263
 		//Drug ,_ := service.GetDrugLibById( drug.DrugId)
@@ -3299,8 +3300,11 @@ func (c *HisApiController) DeleteXSandBGTwo() {
3299 3300
 				}
3300 3301
 
3301 3302
 			}
3302
-
3303
-
3303
+		if res7.Infcode == 0 {
3304
+			service.SaveDoctoradviceStatus(item.ID,time.Now().Format("2006-01-02"))
3305
+		} else {
3306
+			errs = append(errs, item.AdviceName+",销售失败:"+res.ErrMsg)
3307
+		}
3304 3308
 	}
3305 3309
 
3306 3310
 	c.ServeSuccessJSON(map[string]interface{}{