|
@@ -759,8 +759,13 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
759
|
759
|
prescriptionConfig, _ := service.FindPrescriptionConfigById(item.UserOrgId)
|
760
|
760
|
pharmacyConfig, _ := service.FindPharmacyConfig(item.UserOrgId)
|
761
|
761
|
if prescriptionConfig.IsOpen == 1 {
|
762
|
|
- if medical.IsUse == 2 && pharmacyConfig.IsOpen != 1 {
|
763
|
|
- service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
762
|
+ if medical.IsUse == 2 {
|
|
763
|
+ if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 2 {
|
|
764
|
+ service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
765
|
+ }
|
|
766
|
+ if pharmacyConfig.IsOpen != 1 {
|
|
767
|
+ service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
768
|
+ }
|
764
|
769
|
|
765
|
770
|
//更新字典里面的库存
|
766
|
771
|
stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
|
|
@@ -773,8 +778,13 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
773
|
778
|
}
|
774
|
779
|
} else {
|
775
|
780
|
pharmacyConfig, _ := service.FindPharmacyConfig(item.UserOrgId)
|
776
|
|
- if medical.IsUse == 2 && pharmacyConfig.IsOpen != 1 {
|
777
|
|
- service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
781
|
+ if medical.IsUse == 2 {
|
|
782
|
+ if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 2 {
|
|
783
|
+ service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
784
|
+ }
|
|
785
|
+ if pharmacyConfig.IsOpen != 1 {
|
|
786
|
+ service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
787
|
+ }
|
778
|
788
|
|
779
|
789
|
stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
|
780
|
790
|
var sum_count int64
|
|
@@ -864,8 +874,13 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
864
|
874
|
|
865
|
875
|
if prescribing_number_total <= total {
|
866
|
876
|
pharmacyConfig, _ := service.FindPharmacyConfig(item.UserOrgId)
|
867
|
|
- if medical.IsUse == 2 && pharmacyConfig.IsOpen != 1 {
|
868
|
|
- service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
877
|
+ if medical.IsUse == 2 {
|
|
878
|
+ if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 2 {
|
|
879
|
+ service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
880
|
+ }
|
|
881
|
+ if pharmacyConfig.IsOpen != 1 {
|
|
882
|
+ service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
|
|
883
|
+ }
|
869
|
884
|
|
870
|
885
|
//更新字典里面的库存
|
871
|
886
|
stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
|
|
@@ -1169,10 +1184,16 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1169
|
1184
|
|
1170
|
1185
|
if prescribing_number_total <= total {
|
1171
|
1186
|
pharmacyConfig, _ := service.FindPharmacyConfig(advice.UserOrgId)
|
1172
|
|
- if medical.IsUse == 2 && pharmacyConfig.IsOpen != 1 {
|
|
1187
|
+ if medical.IsUse == 2 {
|
1173
|
1188
|
|
1174
|
1189
|
if config.IsOpen != 1 {
|
1175
|
|
- service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1190
|
+ if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 2 {
|
|
1191
|
+ service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1192
|
+ }
|
|
1193
|
+ if pharmacyConfig.IsOpen != 1 {
|
|
1194
|
+ service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
|
|
1195
|
+ }
|
|
1196
|
+
|
1176
|
1197
|
//更新字典里面的库存
|
1177
|
1198
|
stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
|
1178
|
1199
|
var sum_count int64
|