瀏覽代碼

提交代码

陈少旭 8 月之前
父節點
當前提交
4c840d85df
共有 1 個文件被更改,包括 45 次插入0 次删除
  1. 45 0
      controllers/his_api_controller.go

+ 45 - 0
controllers/his_api_controller.go 查看文件

@@ -10280,6 +10280,51 @@ func (this *HisApiController) GetCallHisPrescription() {
10280 10280
 	endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
10281 10281
 	adminUserInfo := this.GetAdminUserInfo()
10282 10282
 	prescriptions, err := service.GetCallHisPrescriptions(startime.Unix(), endtime.Unix(), adminUserInfo.CurrentOrgId, patient_id, p_type)
10283
+
10284
+	//if
10285
+	//storeConfig, _ := service.GetAllStoreHouseConfig(adminUserInfo.CurrentOrgId)
10286
+	//
10287
+	//lastWarehouse, _ := service.FindLastDrugWarehousingInfoByID(s.DrugId, storeConfig.DrugStorehouseOut)
10288
+
10289
+	if adminUserInfo.CurrentOrgId == 10265 {
10290
+		_, config := service.FindHisStockPriceRecordByOrgId(adminUserInfo.CurrentOrgId)
10291
+		if config.ID > 0 && config.IsOpen == 1 {
10292
+			for _, subitems := range prescriptions {
10293
+				for _, item := range subitems.VMHisPrescription {
10294
+					for _, subItem := range item.HisDoctorAdviceInfo {
10295
+						drug, _ := service.GetDrugByGoodId(subItem.DrugId)
10296
+						info, _ := service.GetWarehoseInfoByDrugId(subItem.DrugId, adminUserInfo.CurrentOrgId)
10297
+						if info.RetailPrice > 0 {
10298
+							if subItem.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
10299
+								subItem.Drug.RetailPrice = info.RetailPrice * float64(drug.MinNumber)
10300
+							}
10301
+							if subItem.PrescribingNumberUnit == drug.MinUnit {
10302
+								subItem.Drug.MinPrice = info.RetailPrice
10303
+								subItem.Drug.RetailPrice = info.RetailPrice
10304
+							}
10305
+
10306
+						}
10307
+					}
10308
+				}
10309
+			}
10310
+		}
10311
+
10312
+		if config.ID > 0 && config.IsOpen == 1 {
10313
+			for _, subitems := range prescriptions {
10314
+				for _, item := range subitems.VMHisPrescription {
10315
+					for _, subItem := range item.HisPrescriptionProject {
10316
+						if subItem.Type == 3 {
10317
+							info, _ := service.GetGoodWarehoseInfoByGoodId(subItem.ProjectId, adminUserInfo.CurrentOrgId)
10318
+							if info.Price > 0 {
10319
+								subItem.GoodInfo.PackingPrice = info.Price
10320
+							}
10321
+						}
10322
+					}
10323
+				}
10324
+			}
10325
+		}
10326
+	}
10327
+
10283 10328
 	if err == nil {
10284 10329
 		this.ServeSuccessJSON(map[string]interface{}{
10285 10330
 			"prescriptions": prescriptions,