|
@@ -685,7 +685,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
685
|
685
|
privateDrugConfig, _ := service.GetDrugSetByUserOrgId(adminUserInfo.Org.Id)
|
686
|
686
|
|
687
|
687
|
storeHouseConfig, _ := service.GetAllStoreHouseConfig(adminUserInfo.Org.Id)
|
688
|
|
- fmt.Println("drugStockConfig.IsOpen32232323232", drugStockConfig.IsOpen)
|
|
688
|
+
|
689
|
689
|
if drugStockConfig.IsOpen == 1 {
|
690
|
690
|
if groupno > 0 {
|
691
|
691
|
advices, _ := service.FindAllDoctorAdviceByGoroupNo(adminUserInfo.Org.Id, groupno)
|
|
@@ -1241,9 +1241,38 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1241
|
1241
|
if config.IsOpen != 1 {
|
1242
|
1242
|
if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
|
1243
|
1243
|
service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1244
|
+ fmt.Println("处方1111111111111")
|
|
1245
|
+ if adminInfo.Org.Id == 3877 || adminInfo.Org.Id == 10265 {
|
|
1246
|
+ //查询该药品是否有出库记录
|
|
1247
|
+ flowMap, _ := service.GetDrugFLowByAdviceById(advice.DrugId, advice.PatientId, advice.UserOrgId, advice.AdviceDate)
|
|
1248
|
+ if len(flowMap) == 0 {
|
|
1249
|
+ service.UpdateHisAdviceById(advice.ID)
|
|
1250
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1251
|
+ "msg": "6",
|
|
1252
|
+ "advice": advice,
|
|
1253
|
+ "ids": ids,
|
|
1254
|
+ })
|
|
1255
|
+ return
|
|
1256
|
+ }
|
|
1257
|
+ }
|
1244
|
1258
|
}
|
1245
|
1259
|
if pharmacyConfig.IsOpen != 1 {
|
|
1260
|
+ fmt.Println("处方我33333333323")
|
1246
|
1261
|
service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1262
|
+ if adminInfo.Org.Id == 3877 || adminInfo.Org.Id == 10265 {
|
|
1263
|
+ //查询该药品是否有出库记录
|
|
1264
|
+ flowMap, _ := service.GetDrugFLowByAdviceById(advice.DrugId, advice.PatientId, advice.UserOrgId, advice.AdviceDate)
|
|
1265
|
+ fmt.Println("flowMap----------", flowMap)
|
|
1266
|
+ if len(flowMap) == 0 {
|
|
1267
|
+ service.UpdateHisAdviceById(advice.ID)
|
|
1268
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1269
|
+ "msg": "6",
|
|
1270
|
+ "advice": advice,
|
|
1271
|
+ "ids": ids,
|
|
1272
|
+ })
|
|
1273
|
+ return
|
|
1274
|
+ }
|
|
1275
|
+ }
|
1247
|
1276
|
}
|
1248
|
1277
|
|
1249
|
1278
|
//更新字典里面的库存
|
|
@@ -1263,6 +1292,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1263
|
1292
|
}
|
1264
|
1293
|
}
|
1265
|
1294
|
}
|
|
1295
|
+
|
1266
|
1296
|
//
|
1267
|
1297
|
//if config.IsOpen == 1 && item.UserOrgId == 10088 {
|
1268
|
1298
|
//
|