|
@@ -7943,9 +7943,68 @@ func (this *DialysisAPIController) ExectionMobileAdvice() {
|
7943
|
7943
|
if config.IsOpen != 1 {
|
7944
|
7944
|
if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
|
7945
|
7945
|
service.HisDrugsDelivery(orgId, creater, &advice)
|
|
7946
|
+ if orgId == 3877 || orgId == 10265 {
|
|
7947
|
+ //查询该药品是否有出库记录
|
|
7948
|
+ flowMap, _ := service.GetDrugFLowByAdviceById(advice.DrugId, advice.PatientId, advice.UserOrgId, advice.AdviceDate)
|
|
7949
|
+ if len(flowMap) == 0 {
|
|
7950
|
+ errs := service.UpdateHisAdviceById(advice.ID)
|
|
7951
|
+ if errs != nil {
|
|
7952
|
+ drugError := models.XtDrugError{
|
|
7953
|
+ UserOrgId: orgId,
|
|
7954
|
+ DrugId: item.DrugId,
|
|
7955
|
+ RecordDate: item.AdviceDate,
|
|
7956
|
+ PatientId: item.PatientId,
|
|
7957
|
+ Remark: "透析医嘱页面出库记录为空,更新执行人失败",
|
|
7958
|
+ Status: 1,
|
|
7959
|
+ Ctime: time.Now().Unix(),
|
|
7960
|
+ Mtime: 0,
|
|
7961
|
+ SumCount: 0,
|
|
7962
|
+ Prescribingnumber: advice.PrescribingNumber,
|
|
7963
|
+ PrescribingNumberUnit: advice.PrescribingNumberUnit,
|
|
7964
|
+ }
|
|
7965
|
+ service.CreateDrugError(drugError)
|
|
7966
|
+ }
|
|
7967
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
7968
|
+ "msg": "2",
|
|
7969
|
+ "drug": medical,
|
|
7970
|
+ "ids": ids,
|
|
7971
|
+ })
|
|
7972
|
+ return
|
|
7973
|
+
|
|
7974
|
+ }
|
|
7975
|
+ }
|
7946
|
7976
|
}
|
7947
|
7977
|
if pharmacyConfig.IsOpen != 1 {
|
7948
|
7978
|
service.HisDrugsDelivery(orgId, creater, &advice)
|
|
7979
|
+ if orgId == 3877 || orgId == 10265 {
|
|
7980
|
+ //查询该药品是否有出库记录
|
|
7981
|
+ flowMap, _ := service.GetDrugFLowByAdviceById(advice.DrugId, advice.PatientId, advice.UserOrgId, advice.AdviceDate)
|
|
7982
|
+ if len(flowMap) == 0 {
|
|
7983
|
+ errs := service.UpdateHisAdviceById(advice.ID)
|
|
7984
|
+ if errs != nil {
|
|
7985
|
+ drugError := models.XtDrugError{
|
|
7986
|
+ UserOrgId: orgId,
|
|
7987
|
+ DrugId: item.DrugId,
|
|
7988
|
+ RecordDate: item.AdviceDate,
|
|
7989
|
+ PatientId: item.PatientId,
|
|
7990
|
+ Remark: "透析医嘱页面出库记录为空,更新执行人失败",
|
|
7991
|
+ Status: 1,
|
|
7992
|
+ Ctime: time.Now().Unix(),
|
|
7993
|
+ Mtime: 0,
|
|
7994
|
+ SumCount: 0,
|
|
7995
|
+ Prescribingnumber: advice.PrescribingNumber,
|
|
7996
|
+ PrescribingNumberUnit: advice.PrescribingNumberUnit,
|
|
7997
|
+ }
|
|
7998
|
+ service.CreateDrugError(drugError)
|
|
7999
|
+ }
|
|
8000
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8001
|
+ "msg": "2",
|
|
8002
|
+ "drug": medical,
|
|
8003
|
+ "ids": ids,
|
|
8004
|
+ })
|
|
8005
|
+ return
|
|
8006
|
+ }
|
|
8007
|
+ }
|
7949
|
8008
|
}
|
7950
|
8009
|
|
7951
|
8010
|
//更新字典里面的库存
|