|
@@ -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)
|
|
@@ -1253,9 +1253,38 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1253
|
1253
|
if config.IsOpen != 1 {
|
1254
|
1254
|
if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
|
1255
|
1255
|
service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1256
|
+ fmt.Println("处方1111111111111")
|
|
1257
|
+ if adminInfo.Org.Id == 3877 || adminInfo.Org.Id == 10265 {
|
|
1258
|
+ //查询该药品是否有出库记录
|
|
1259
|
+ flowMap, _ := service.GetDrugFLowByAdviceById(advice.DrugId, advice.PatientId, advice.UserOrgId, advice.AdviceDate)
|
|
1260
|
+ if len(flowMap) == 0 {
|
|
1261
|
+ service.UpdateHisAdviceById(advice.ID)
|
|
1262
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1263
|
+ "msg": "6",
|
|
1264
|
+ "advice": advice,
|
|
1265
|
+ "ids": ids,
|
|
1266
|
+ })
|
|
1267
|
+ return
|
|
1268
|
+ }
|
|
1269
|
+ }
|
1256
|
1270
|
}
|
1257
|
1271
|
if pharmacyConfig.IsOpen != 1 {
|
|
1272
|
+ fmt.Println("处方我33333333323")
|
1258
|
1273
|
service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1274
|
+ if adminInfo.Org.Id == 3877 || adminInfo.Org.Id == 10265 {
|
|
1275
|
+ //查询该药品是否有出库记录
|
|
1276
|
+ flowMap, _ := service.GetDrugFLowByAdviceById(advice.DrugId, advice.PatientId, advice.UserOrgId, advice.AdviceDate)
|
|
1277
|
+ fmt.Println("flowMap----------", flowMap)
|
|
1278
|
+ if len(flowMap) == 0 {
|
|
1279
|
+ service.UpdateHisAdviceById(advice.ID)
|
|
1280
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1281
|
+ "msg": "6",
|
|
1282
|
+ "advice": advice,
|
|
1283
|
+ "ids": ids,
|
|
1284
|
+ })
|
|
1285
|
+ return
|
|
1286
|
+ }
|
|
1287
|
+ }
|
1259
|
1288
|
}
|
1260
|
1289
|
|
1261
|
1290
|
//更新字典里面的库存
|
|
@@ -1275,6 +1304,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1275
|
1304
|
}
|
1276
|
1305
|
}
|
1277
|
1306
|
}
|
|
1307
|
+
|
1278
|
1308
|
//
|
1279
|
1309
|
//if config.IsOpen == 1 && item.UserOrgId == 10088 {
|
1280
|
1310
|
//
|