Browse Source

医保对接

csx 3 years ago
parent
commit
70f51739cf
3 changed files with 8 additions and 2 deletions
  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 View File

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

+ 4 - 0
enums/error_code.go View File

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

+ 1 - 1
service/his_service.go View File

@@ -2102,7 +2102,7 @@ func GetNewAllUnChargeHisPatientListTwo(org_id int64, keywords string, record_da
2102 2102
 }
2103 2103
 
2104 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 2107
 	return
2108 2108
 }