Browse Source

11月9日库存管理

XMLWAN 1 year ago
parent
commit
bdfceac9ed

+ 1 - 1
conf/app.conf View File

1
 appname = 血透
1
 appname = 血透
2
-httpport = 9529
2
+httpport = 9531
3
 runmode =dev
3
 runmode =dev
4
 #dev/prod
4
 #dev/prod
5
 
5
 

+ 2 - 2
controllers/dialysis_api_controller.go View File

2962
 
2962
 
2963
 	check, _ := service.FindDoubleCheckById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2963
 	check, _ := service.FindDoubleCheckById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2964
 
2964
 
2965
-	if adminUserInfo.CurrentOrgId != 10101 && adminUserInfo.CurrentOrgId != 10445 {
2965
+	if adminUserInfo.CurrentOrgId != 10101 && adminUserInfo.CurrentOrgId != 10445 && adminUserInfo.CurrentOrgId != 10345 {
2966
 		dialysis_count, _ := service.GetDialysisOrderCount(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2966
 		dialysis_count, _ := service.GetDialysisOrderCount(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2967
 		patientInfo.TotalDialysis = dialysis_count
2967
 		patientInfo.TotalDialysis = dialysis_count
2968
 	}
2968
 	}
2969
-	if adminUserInfo.CurrentOrgId == 10101 || adminUserInfo.CurrentOrgId == 10445 {
2969
+	if adminUserInfo.CurrentOrgId == 10101 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 10345 {
2970
 
2970
 
2971
 		if xttime <= 1640966400 {
2971
 		if xttime <= 1640966400 {
2972
 			dialysis_count, _ := service.GetDialysisOrderCountOne(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2972
 			dialysis_count, _ := service.GetDialysisOrderCountOne(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)

+ 2 - 2
controllers/dialysis_record_api_controller.go View File

1015
 	//
1015
 	//
1016
 	//service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.CurrentOrgId, dialysisCount.Count)
1016
 	//service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.CurrentOrgId, dialysisCount.Count)
1017
 
1017
 
1018
-	if adminUserInfo.CurrentOrgId != 10101 && adminUserInfo.CurrentOrgId != 10445 && adminUserInfo.CurrentOrgId != 3877 {
1018
+	if adminUserInfo.CurrentOrgId != 10101 && adminUserInfo.CurrentOrgId != 10445 && adminUserInfo.CurrentOrgId != 3877 && adminUserInfo.CurrentOrgId != 10345 {
1019
 		//统计该患者总次数
1019
 		//统计该患者总次数
1020
 		dialysisCount, _ := service.GetDialysisTotalCount(adminUserInfo.CurrentOrgId, patientID)
1020
 		dialysisCount, _ := service.GetDialysisTotalCount(adminUserInfo.CurrentOrgId, patientID)
1021
 		service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.CurrentOrgId, dialysisCount.Count)
1021
 		service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.CurrentOrgId, dialysisCount.Count)
1022
 	}
1022
 	}
1023
 
1023
 
1024
-	if adminUserInfo.CurrentOrgId == 10101 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 3877 {
1024
+	if adminUserInfo.CurrentOrgId == 10101 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10345 {
1025
 		//统计该患者总次数
1025
 		//统计该患者总次数
1026
 		dialysisCount, _ := service.GetDialysisTotalCountOne(adminUserInfo.CurrentOrgId, patientID)
1026
 		dialysisCount, _ := service.GetDialysisTotalCountOne(adminUserInfo.CurrentOrgId, patientID)
1027
 		service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.CurrentOrgId, dialysisCount.Count)
1027
 		service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.CurrentOrgId, dialysisCount.Count)

+ 50 - 41
controllers/his_api_controller.go View File

2356
 					StorehouseId: houseConfig.StorehouseOutInfo,
2356
 					StorehouseId: houseConfig.StorehouseOutInfo,
2357
 					ProjectId:    item.ID,
2357
 					ProjectId:    item.ID,
2358
 				}
2358
 				}
2359
+				goodinfo, _ := service.GetGoodInformationByGoodIdThirty(item.ProjectId)
2360
+				if goodinfo.IsUser == 2 || goodinfo.IsUser == 0 {
2361
+					service.ConsumablePrescriptionDelivery(adminInfo.CurrentOrgId, item.PatientId, item.RecordDate, &dialyPrepareOne, &lastOut, creater, parseIntCount)
2359
 
2362
 
2360
-				service.ConsumablePrescriptionDelivery(adminInfo.CurrentOrgId, item.PatientId, item.RecordDate, &dialyPrepareOne, &lastOut, creater, parseIntCount)
2363
+					//查询剩余库存
2364
+					goodList, _ := service.GetAllGoodSumCount(item.ProjectId, adminInfo.CurrentOrgId, houseConfig.StorehouseOutInfo)
2365
+					var sum_count int64
2366
+					for _, item := range goodList {
2367
+						sum_count += item.StockCount
2368
+					}
2361
 
2369
 
2362
-				//查询剩余库存
2363
-				goodList, _ := service.GetAllGoodSumCount(item.ProjectId, adminInfo.CurrentOrgId, houseConfig.StorehouseOutInfo)
2364
-				var sum_count int64
2365
-				for _, item := range goodList {
2366
-					sum_count += item.StockCount
2367
-				}
2370
+					//更新剩余库存
2371
+					service.UpdateGoodFlushCount(houseConfig.StorehouseOutInfo, item.ProjectId, adminInfo.CurrentOrgId, sum_count)
2368
 
2372
 
2369
-				//更新剩余库存
2370
-				service.UpdateGoodFlushCount(houseConfig.StorehouseOutInfo, item.ProjectId, adminInfo.CurrentOrgId, sum_count)
2373
+					//耗材
2374
+					service.UpdateGoodSumCountSeven(sum_count, item.ProjectId, adminInfo.CurrentOrgId)
2375
+				}
2371
 
2376
 
2372
-				//耗材
2373
-				service.UpdateGoodSumCountSeven(sum_count, item.ProjectId, adminInfo.CurrentOrgId)
2374
 			}
2377
 			}
2375
 		}
2378
 		}
2376
 	}
2379
 	}
2673
 	prescription_id, _ := c.GetInt64("id")
2676
 	prescription_id, _ := c.GetInt64("id")
2674
 	projects, _ := service.GetHisPrescriptionProjectsByID(prescription_id)
2677
 	projects, _ := service.GetHisPrescriptionProjectsByID(prescription_id)
2675
 	advices, _ := service.GetHisPrescriptionAdviceByID(prescription_id)
2678
 	advices, _ := service.GetHisPrescriptionAdviceByID(prescription_id)
2676
-	_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
2679
+	//_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
2677
 
2680
 
2678
 	_, stockConfig := service.FindAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
2681
 	_, stockConfig := service.FindAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
2679
 
2682
 
2683
+	drugOutConfig, _ := service.FindDrugOutConfigById(c.GetAdminUserInfo().CurrentOrgId)
2680
 	//耗材保存处方出库
2684
 	//耗材保存处方出库
2681
 	goodOutConfig, _ := service.FindGoodOutConfigById(c.GetAdminUserInfo().CurrentOrgId)
2685
 	goodOutConfig, _ := service.FindGoodOutConfigById(c.GetAdminUserInfo().CurrentOrgId)
2682
 	//已收费和已发药限制逻辑
2686
 	//已收费和已发药限制逻辑
3021
 			if goodOutConfig.IsOpen == 1 {
3025
 			if goodOutConfig.IsOpen == 1 {
3022
 
3026
 
3023
 				if item.Type == 3 {
3027
 				if item.Type == 3 {
3024
-					fmt.Println("出库数量99999999999999999999999999", item.Count)
3025
 					good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
3028
 					good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
3026
 					f_count, _ := strconv.ParseFloat(item.Count, 64)
3029
 					f_count, _ := strconv.ParseFloat(item.Count, 64)
3027
 					good.Total = good.Total + f_count
3030
 					good.Total = good.Total + f_count
3275
 		}
3278
 		}
3276
 
3279
 
3277
 	} else {
3280
 	} else {
3278
-		if drugStockConfig.IsOpen == 1 {
3281
+		if drugOutConfig.IsOpen == 1 {
3279
 			if len(advices) > 0 {
3282
 			if len(advices) > 0 {
3280
 				for _, item := range advices {
3283
 				for _, item := range advices {
3281
 					creater := c.GetAdminUserInfo().AdminUser.Id
3284
 					creater := c.GetAdminUserInfo().AdminUser.Id
3296
 	id, _ := c.GetInt64("id")
3299
 	id, _ := c.GetInt64("id")
3297
 	advice, _ := service.GetHisDoctorAdvicesById(id)
3300
 	advice, _ := service.GetHisDoctorAdvicesById(id)
3298
 
3301
 
3299
-	_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
3302
+	//_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(c.GetAdminUserInfo().CurrentOrgId)
3303
+
3304
+	drugOutConfig, _ := service.FindDrugOutConfigById(c.GetAdminUserInfo().CurrentOrgId)
3300
 
3305
 
3301
 	//已收费和已发药的限制逻辑
3306
 	//已收费和已发药的限制逻辑
3302
 	isCharge := false
3307
 	isCharge := false
3378
 				service.DrugAutoAddCancelInfo(&advice, creater)
3383
 				service.DrugAutoAddCancelInfo(&advice, creater)
3379
 			}
3384
 			}
3380
 		} else {
3385
 		} else {
3381
-			if drugStockConfig.IsOpen == 1 {
3386
+
3387
+			if drugOutConfig.IsOpen == 1 {
3382
 
3388
 
3383
 				//查询是否在处方中出库
3389
 				//查询是否在处方中出库
3384
 				openConfig, _ := service.GetDrugOpenConfigOne(c.GetAdminUserInfo().CurrentOrgId)
3390
 				openConfig, _ := service.GetDrugOpenConfigOne(c.GetAdminUserInfo().CurrentOrgId)
6278
 
6284
 
6279
 				for _, item := range infoList {
6285
 				for _, item := range infoList {
6280
 					medical, _ := service.GetBaseDrugMedical(item.DrugId)
6286
 					medical, _ := service.GetBaseDrugMedical(item.DrugId)
6281
-					//药品出库
6282
-					service.HisSettleDrugsDelivery(item.UserOrgId, adminUser.AdminUser.Id, item, order.ID)
6283
-					//查询默认仓库
6284
-					storeHouseConfig, _ := service.GetAllStoreHouseConfig(item.UserOrgId)
6285
-					//查询默认仓库剩余多少库存
6286
-					var sum_count int64
6287
-					stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
6288
-					for _, its := range stockInfo {
6289
-						if its.MaxUnit == medical.MaxUnit {
6290
-							its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
6287
+					if medical.IsUse == 2 {
6288
+						//药品出库
6289
+						service.HisSettleDrugsDelivery(item.UserOrgId, adminUser.AdminUser.Id, item, order.ID)
6290
+						//查询默认仓库
6291
+						storeHouseConfig, _ := service.GetAllStoreHouseConfig(item.UserOrgId)
6292
+						//查询默认仓库剩余多少库存
6293
+						var sum_count int64
6294
+						stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
6295
+						for _, its := range stockInfo {
6296
+							if its.MaxUnit == medical.MaxUnit {
6297
+								its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
6298
+							}
6299
+							sum_count += its.StockMaxNumber + its.StockMinNumber
6291
 						}
6300
 						}
6292
-						sum_count += its.StockMaxNumber + its.StockMinNumber
6301
+						service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
6302
+						service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
6293
 					}
6303
 					}
6294
-					service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
6295
-					service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
6296
-
6297
 				}
6304
 				}
6298
 				orgId := c.GetAdminUserInfo().CurrentOrgId
6305
 				orgId := c.GetAdminUserInfo().CurrentOrgId
6299
 
6306
 
6351
 							Status:       1,
6358
 							Status:       1,
6352
 							StorehouseId: houseConfig.StorehouseOutInfo,
6359
 							StorehouseId: houseConfig.StorehouseOutInfo,
6353
 						}
6360
 						}
6361
+						goodInfo, _ := service.GetGoodInformationByGoodIdThirty(item.GoodId)
6362
+						//非零用
6363
+						if goodInfo.IsUser == 2 || goodInfo.IsUser == 0 {
6364
+							service.ConsumableSettleDelivery(adminUser.CurrentOrgId, his.PatientId, his.RecordDate, &dialyPrepareOne, &lastOut, adminUser.AdminUser.Id, order.ID)
6365
+							//查询剩余库存
6366
+							goodList, _ := service.GetAllGoodSumCount(item.GoodId, adminUser.CurrentOrgId, houseConfig.StorehouseOutInfo)
6367
+							var sum_count int64
6368
+							for _, item := range goodList {
6369
+								sum_count += item.StockCount
6370
+							}
6371
+							service.UpdateGoodFlushCount(houseConfig.StorehouseOutInfo, item.GoodId, adminUser.CurrentOrgId, sum_count)
6354
 
6372
 
6355
-						//err = service.CreateDialysisBeforePrepareOne(&dialyPrepareOne)
6356
-
6357
-						service.ConsumableSettleDelivery(adminUser.CurrentOrgId, his.PatientId, his.RecordDate, &dialyPrepareOne, &lastOut, adminUser.AdminUser.Id, order.ID)
6358
-						//查询剩余库存
6359
-						goodList, _ := service.GetAllGoodSumCount(item.GoodId, adminUser.CurrentOrgId, houseConfig.StorehouseOutInfo)
6360
-						var sum_count int64
6361
-						for _, item := range goodList {
6362
-							sum_count += item.StockCount
6373
+							//耗材
6374
+							service.UpdateGoodSumCountSeven(sum_count, item.GoodId, adminUser.CurrentOrgId)
6363
 						}
6375
 						}
6364
-						service.UpdateGoodFlushCount(houseConfig.StorehouseOutInfo, item.GoodId, adminUser.CurrentOrgId, sum_count)
6365
 
6376
 
6366
-						//耗材
6367
-						service.UpdateGoodSumCountSeven(sum_count, item.GoodId, adminUser.CurrentOrgId)
6368
 					}
6377
 					}
6369
 				}
6378
 				}
6370
 
6379
 

+ 2 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go View File

2346
 		createErr := service.MobileCreateDialysisOrder(adminUserInfo.Org.Id, patientID, dialysisRecord)
2346
 		createErr := service.MobileCreateDialysisOrder(adminUserInfo.Org.Id, patientID, dialysisRecord)
2347
 		service.UpdateMobilePatient(adminUserInfo.Org.Id, patientID, schedule_remark)
2347
 		service.UpdateMobilePatient(adminUserInfo.Org.Id, patientID, schedule_remark)
2348
 
2348
 
2349
-		if adminUserInfo.Org.Id != 10101 && adminUserInfo.Org.Id != 10445 && adminUserInfo.Org.Id != 3877 {
2349
+		if adminUserInfo.Org.Id != 10101 && adminUserInfo.Org.Id != 10445 && adminUserInfo.Org.Id != 3877 && adminUserInfo.Org.Id != 10345 {
2350
 			//统计该患者总次数
2350
 			//统计该患者总次数
2351
 			dialysisCount, _ := service.GetDialysisTotalCount(adminUserInfo.Org.Id, patientID)
2351
 			dialysisCount, _ := service.GetDialysisTotalCount(adminUserInfo.Org.Id, patientID)
2352
 			service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.Org.Id, dialysisCount.Count)
2352
 			service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.Org.Id, dialysisCount.Count)
2353
 		}
2353
 		}
2354
 
2354
 
2355
-		if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 3877 {
2355
+		if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10345 {
2356
 			//统计该患者总次数
2356
 			//统计该患者总次数
2357
 			dialysisCount, _ := service.GetDialysisTotalCountOne(adminUserInfo.Org.Id, patientID)
2357
 			dialysisCount, _ := service.GetDialysisTotalCountOne(adminUserInfo.Org.Id, patientID)
2358
 			service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.Org.Id, dialysisCount.Count)
2358
 			service.UpdateDialysisOrder(patientID, recordDate.Unix(), adminUserInfo.Org.Id, dialysisCount.Count)

+ 7 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go View File

2869
 		return
2869
 		return
2870
 	}
2870
 	}
2871
 }
2871
 }
2872
+
2873
+func (this *NewDialysisApiController) CommitDialysisOrder() {
2874
+
2875
+	org_id := this.GetMobileAdminUserInfo().Org.Id
2876
+	fmt.Println("org_id ===23232323232332", org_id)
2877
+
2878
+}

+ 2 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go View File

166
 	beego.Router("/m/api/patient/getvascularaccessdetail", &NewDialysisApiController{}, "Get:GetVascularAccessDetail")
166
 	beego.Router("/m/api/patient/getvascularaccessdetail", &NewDialysisApiController{}, "Get:GetVascularAccessDetail")
167
 	beego.Router("/m/api/patient/getalldoctorlist", &NewDialysisApiController{}, "Get:GetAllDoctorList")
167
 	beego.Router("/m/api/patient/getalldoctorlist", &NewDialysisApiController{}, "Get:GetAllDoctorList")
168
 	beego.Router("/m/api/patient/gettreatesummay", &NewDialysisApiController{}, "Get:GetTreateSummary")
168
 	beego.Router("/m/api/patient/gettreatesummay", &NewDialysisApiController{}, "Get:GetTreateSummary")
169
+	//脚本
170
+	beego.Router("/m/api/patient/commitdialysisOrder", &NewDialysisApiController{}, "Get:CommitDialysisOrder")
169
 
171
 
170
 	//His相关
172
 	//His相关
171
 	beego.Router("/m/api/hispatientlist/get", &MobileHisApiController{}, "Get:GetHisPatientList")
173
 	beego.Router("/m/api/hispatientlist/get", &MobileHisApiController{}, "Get:GetHisPatientList")

+ 23 - 9
controllers/print_data_api_controller.go View File

37
 	idStrs := strings.Split(schIDStr, ",")
37
 	idStrs := strings.Split(schIDStr, ",")
38
 	adminUserInfo := this.GetAdminUserInfo()
38
 	adminUserInfo := this.GetAdminUserInfo()
39
 
39
 
40
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9671 {
40
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 {
41
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
41
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
42
 		for _, item := range schedules {
42
 		for _, item := range schedules {
43
 
43
 
81
 			item.Summer = summerVM
81
 			item.Summer = summerVM
82
 
82
 
83
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
83
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
84
-			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 {
84
+			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 && this.GetAdminUserInfo().CurrentOrgId != 10345 {
85
 				item.Count = list.Count
85
 				item.Count = list.Count
86
 			}
86
 			}
87
-			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 {
87
+			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 {
88
 				if item.ScheduleDate <= 1640966400 {
88
 				if item.ScheduleDate <= 1640966400 {
89
 					listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
89
 					listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
90
 
90
 
127
 		})
127
 		})
128
 	}
128
 	}
129
 
129
 
130
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9671 {
130
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 {
131
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
131
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
132
 		for _, item := range schedules {
132
 		for _, item := range schedules {
133
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
133
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)
134
-			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 {
134
+			if this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 9671 && this.GetAdminUserInfo().CurrentOrgId != 10345 {
135
 				item.Count = list.Count
135
 				item.Count = list.Count
136
 			}
136
 			}
137
-			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 {
138
-				listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
137
+			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 {
138
+				//listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
139
 
139
 
140
-				item.Patient.TotalDialysis = listOne.Count
141
-				item.Count = listOne.Count
140
+				//item.Patient.TotalDialysis = listOne.Count
141
+				//item.Count = listOne.Count
142
+
143
+				if item.ScheduleDate <= 1640966400 {
144
+					listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
145
+
146
+					item.Patient.TotalDialysis = listOne.Count
147
+					item.Count = listOne.Count
148
+				}
149
+
150
+				if item.ScheduleDate >= 1672502400 {
151
+					listOne, _ := service.GetDialysisOrderCountNight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
152
+
153
+					item.Patient.TotalDialysis = listOne.Count
154
+					item.Count = listOne.Count
155
+				}
142
 			}
156
 			}
143
 		}
157
 		}
144
 		if getScheduleErr != nil {
158
 		if getScheduleErr != nil {

+ 1 - 1
main.go View File

15
 
15
 
16
 	//service.BeginAutoCreateWeekDisinfectionJob()
16
 	//service.BeginAutoCreateWeekDisinfectionJob()
17
 	//service.BeginAutoCreatePlanJob()
17
 	//service.BeginAutoCreatePlanJob()
18
-	//service.AutoClearSchedules()
18
+	//	//service.AutoClearSchedules()
19
 	//service.BeginAutoCreateStaffScheduleJob()
19
 	//service.BeginAutoCreateStaffScheduleJob()
20
 	//service.BeginAutoCreateDrugJob()
20
 	//service.BeginAutoCreateDrugJob()
21
 	//service.BeginAutoCreateStockJob()
21
 	//service.BeginAutoCreateStockJob()