csx пре 3 година
родитељ
комит
70f51739cf
3 измењених фајлова са 8 додато и 2 уклоњено
  1. 3 1
      controllers/his_api_controller.go
  2. 4 0
      enums/error_code.go
  3. 1 1
      service/his_service.go

+ 3 - 1
controllers/his_api_controller.go Прегледај датотеку

3221
 	info.Status = 0
3221
 	info.Status = 0
3222
 	count, _ := service.GetOrderCountByNumber(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.RecordDate, info.Number)
3222
 	count, _ := service.GetOrderCountByNumber(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.RecordDate, info.Number)
3223
 	if count > 0 {
3223
 	if count > 0 {
3224
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrong)
3224
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrongTwo)
3225
 		return
3225
 		return
3226
 	}
3226
 	}
3227
 
3227
 
5012
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrong)
5012
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrong)
5013
 		return
5013
 		return
5014
 	}
5014
 	}
5015
+	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
5015
 	his, _ := service.GetHisPatientByIdThree(his_patient_id)
5016
 	his, _ := service.GetHisPatientByIdThree(his_patient_id)
5016
 	org_id := c.GetAdminUserInfo().CurrentOrgId
5017
 	org_id := c.GetAdminUserInfo().CurrentOrgId
5017
 	adminInfo, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
5018
 	adminInfo, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
5024
 		"admin_info":    adminInfo,
5025
 		"admin_info":    adminInfo,
5025
 		"his":           his,
5026
 		"his":           his,
5026
 		"current_admin": role,
5027
 		"current_admin": role,
5028
+		"org_config":    miConfig,
5027
 	})
5029
 	})
5028
 
5030
 
5029
 }
5031
 }

+ 4 - 0
enums/error_code.go Прегледај датотеку

232
 	ErrorCodeHisPatientParamWrong = 300004
232
 	ErrorCodeHisPatientParamWrong = 300004
233
 
233
 
234
 	ErrorCodeOutOfStockParamWrong = 300300
234
 	ErrorCodeOutOfStockParamWrong = 300300
235
+
236
+	ErrorCodeOrderParamWrongTwo = 300500
235
 )
237
 )
236
 
238
 
237
 var ErrCodeMsgs = map[int]string{
239
 var ErrCodeMsgs = map[int]string{
454
 	ErrorCodeHisPatientParamWrong: "订单正在结算、请先结算完成",
456
 	ErrorCodeHisPatientParamWrong: "订单正在结算、请先结算完成",
455
 
457
 
456
 	ErrorCodeOutOfStockParamWrong: "库存不足",
458
 	ErrorCodeOutOfStockParamWrong: "库存不足",
459
+
460
+	ErrorCodeOrderParamWrongTwo: "该就诊号存在结算记录,需要先退费后再退号",
457
 }
461
 }
458
 
462
 
459
 type SGJError struct {
463
 type SGJError struct {

+ 1 - 1
service/his_service.go Прегледај датотеку

2102
 }
2102
 }
2103
 
2103
 
2104
 func GetOrderCountByNumber(org_id int64, patient_id int64, record_time int64, number string) (count int64, err error) {
2104
 func GetOrderCountByNumber(org_id int64, patient_id int64, record_time int64, number string) (count int64, err error) {
2105
-	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND patient_id = ? AND settle_accounts_date = ? AND order_status = 3 AND mdtrt_id = ?", org_id, patient_id, record_time, number).Count(&count).Error
2105
+	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND patient_id = ? AND settle_accounts_date = ? AND order_status = 2 AND mdtrt_id = ?", org_id, patient_id, record_time, number).Count(&count).Error
2106
 
2106
 
2107
 	return
2107
 	return
2108
 }
2108
 }