|
@@ -543,7 +543,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
543
|
543
|
|
544
|
544
|
if prescribingNumberUnit == drug.MinUnit {
|
545
|
545
|
if prescribing_number > drug.Total {
|
546
|
|
- //c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
|
546
|
+ c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
547
|
547
|
//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
|
548
|
548
|
return
|
549
|
549
|
}
|
|
@@ -551,7 +551,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
551
|
551
|
if prescribingNumberUnit == drug.MaxUnit {
|
552
|
552
|
num := prescribing_number * float64(drug.MinNumber)
|
553
|
553
|
if num > drug.Total {
|
554
|
|
- //c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
|
554
|
+ c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
|
555
|
555
|
//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
|
556
|
556
|
return
|
557
|
557
|
}
|
|
@@ -596,8 +596,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
596
|
596
|
return
|
597
|
597
|
}
|
598
|
598
|
if totals > good.Total {
|
599
|
|
- //c.ServeDynamicFailJsonSend(good.GoodName + "库存不足")
|
600
|
|
-
|
|
599
|
+ c.ServeDynamicFailJsonSend(good.GoodName + "库存不足")
|
601
|
600
|
//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOutOfStockParamWrong)
|
602
|
601
|
return
|
603
|
602
|
}
|
|
@@ -3220,6 +3219,12 @@ func (c *HisApiController) RefundNumber() {
|
3220
|
3219
|
his_patient_id, _ := c.GetInt64("id")
|
3221
|
3220
|
info, _ := service.GetNewHisPatientInfo(his_patient_id)
|
3222
|
3221
|
info.Status = 0
|
|
3222
|
+ count, _ := service.GetOrderCountByNumber(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.RecordDate, info.Number)
|
|
3223
|
+ if count > 0 {
|
|
3224
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrong)
|
|
3225
|
+ return
|
|
3226
|
+ }
|
|
3227
|
+
|
3223
|
3228
|
err := service.SaveHisPatient(info)
|
3224
|
3229
|
if err == nil {
|
3225
|
3230
|
c.ServeSuccessJSON(map[string]interface{}{
|