Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
0b8cb56ed9

+ 1 - 1
conf/app.conf View File

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

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

@@ -48,7 +48,7 @@ func (this *DoctorAdviceAPIController) ScheduleAdvices() {
48 48
 	//获取透析处方
49 49
 	blood_prescriptions, _ := service.GetAllPrescriptionByListOne(orgID, date.Unix())
50 50
 	//获取上机
51
-	blood_dialysisOrders, _ := service.GetAllDialysisOrdersByListTwo(orgID, date.Unix())
51
+	blood_dialysisOrders, _ := service.GetAllDialysisOrdersByListSeven(orgID, date.Unix())
52 52
 
53 53
 	for key, schedule := range scheduals {
54 54
 		for _, patient := range blood_patients {
@@ -111,7 +111,7 @@ func (this *DoctorAdviceAPIController) ScheduleAdvices() {
111 111
 		prescriptions, _ := service.GetAllPrescriptionByListOne(orgID, date.Unix())
112 112
 
113 113
 		//获取上机
114
-		dialysisOrders, _ := service.GetAllDialysisOrdersByListTwo(orgID, date.Unix())
114
+		dialysisOrders, _ := service.GetAllDialysisOrdersByListSeven(orgID, date.Unix())
115 115
 
116 116
 		for key, item := range project {
117 117
 			for _, patient := range patients {

+ 0 - 1
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go View File

@@ -714,7 +714,6 @@ func (c *StaffScheduleApiController) GetSolutionSchedule() {
714 714
 	timeLayout := "2006-01-02"
715 715
 	loc, _ := time.LoadLocation("Local")
716 716
 	theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", scheduleDate+" 00:00:00", loc)
717
-	fmt.Println("时间错2332233323223", theTime.Unix())
718 717
 	schedule, _ := service.GetSolutionScheduleBySchedule(orgId, zoneid, classtype, theTime.Unix())
719 718
 	c.ServeSuccessJSON(map[string]interface{}{
720 719
 		"schedule": schedule,

+ 13 - 8
service/patient_service.go View File

@@ -1378,7 +1378,7 @@ func GetPatientDialysisRecord(orgID, patientID int64, page, limit, start, end, m
1378 1378
 		Preload("TreatmentSummary", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1379 1379
 		Preload("Device", "org_id=? and status=1", orgID).
1380 1380
 		Preload("UserAdminRole", func(db *gorm.DB) *gorm.DB {
1381
-			return readUserDb.Where("org_id=? and status = 1", orgID)
1381
+			return readUserDb.Where("org_id=?", orgID)
1382 1382
 		}).
1383 1383
 		Joins("JOIN xt_schedule as s ON s.patient_id=? and FROM_UNIXTIME(s.schedule_date, '%Y-%m-%d')=FROM_UNIXTIME(do.dialysis_date, '%Y-%m-%d')", patientID).
1384 1384
 		Joins("JOIN xt_device_zone as dz ON dz.org_id = ? and dz.id=s.partition_id", orgID).
@@ -2267,13 +2267,12 @@ func GetAllDialysisOrdersByListTwo(orgID int64, scheduleDate int64) (dialysisOrd
2267 2267
 	defer redis.Close()
2268 2268
 	key := strconv.FormatInt(orgID, 10) + ":" + ":dialysis_orders_list_all"
2269 2269
 	dialysis_orders_list_all, _ := redis.Get(key).Result()
2270
-	//fmt.Println("hhhahdfhadhfhahfhahfh",scheduleDate)
2271
-	//fmt.Println("hhhahdfhadhfhahfhahfh",key)
2272
-	//if (scheduleDate==1669132800){
2273
-	//  redis.Set(key, "", time.Second)
2274
-	//}
2275
-	//
2276
-	//fmt.Println("hhhahdfhadhfhahfhahfh",dialysis_orders_list_all)
2270
+
2271
+	if scheduleDate < 1669132800 {
2272
+		fmt.Println("key233232232332323232", key)
2273
+		redis.Set(key, "", time.Second)
2274
+	}
2275
+	fmt.Println("dialysis_orders_list_all", dialysis_orders_list_all)
2277 2276
 	if len(dialysis_orders_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
2278 2277
 		err = readDb.Model(&MDialysisOrderVM{}).Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).Where("status = 1 AND user_org_id = ? AND dialysis_date = ?", orgID, scheduleDate).Find(&dialysisOrders).Error
2279 2278
 		if err != nil {
@@ -2328,6 +2327,12 @@ func GetAllZoneByList(orgID int64) (zone []*models.DeviceZone, err error) {
2328 2327
 	}
2329 2328
 }
2330 2329
 
2330
+func GetAllDialysisOrdersByListSeven(orgID int64, scheduleDate int64) (dialysisOrders []*MDialysisOrderVM, err error) {
2331
+
2332
+	err = readDb.Model(&MDialysisOrderVM{}).Preload("DeviceNumber", "status = 1 AND org_id = ?", orgID).Where("status = 1 AND user_org_id = ? AND dialysis_date = ?", orgID, scheduleDate).Find(&dialysisOrders).Error
2333
+	return dialysisOrders, err
2334
+}
2335
+
2331 2336
 func GetAllPrescriptionByList(orgID int64, scheduleDate int64) (prescriptions []*models.VMDialysisPrescription, err error) {
2332 2337
 
2333 2338
 	redis := RedisClient()