Ver código fonte

11月9日库存管理

XMLWAN 2 anos atrás
pai
commit
0b8cb56ed9

+ 1 - 1
conf/app.conf Ver arquivo

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/mobile_api_controllers/doctor_advice_api_controller.go Ver arquivo

48
 	//获取透析处方
48
 	//获取透析处方
49
 	blood_prescriptions, _ := service.GetAllPrescriptionByListOne(orgID, date.Unix())
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
 	for key, schedule := range scheduals {
53
 	for key, schedule := range scheduals {
54
 		for _, patient := range blood_patients {
54
 		for _, patient := range blood_patients {
111
 		prescriptions, _ := service.GetAllPrescriptionByListOne(orgID, date.Unix())
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
 		for key, item := range project {
116
 		for key, item := range project {
117
 			for _, patient := range patients {
117
 			for _, patient := range patients {

+ 0 - 1
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go Ver arquivo

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

+ 13 - 8
service/patient_service.go Ver arquivo

1378
 		Preload("TreatmentSummary", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1378
 		Preload("TreatmentSummary", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1379
 		Preload("Device", "org_id=? and status=1", orgID).
1379
 		Preload("Device", "org_id=? and status=1", orgID).
1380
 		Preload("UserAdminRole", func(db *gorm.DB) *gorm.DB {
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
 		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).
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
 		Joins("JOIN xt_device_zone as dz ON dz.org_id = ? and dz.id=s.partition_id", orgID).
1384
 		Joins("JOIN xt_device_zone as dz ON dz.org_id = ? and dz.id=s.partition_id", orgID).
2267
 	defer redis.Close()
2267
 	defer redis.Close()
2268
 	key := strconv.FormatInt(orgID, 10) + ":" + ":dialysis_orders_list_all"
2268
 	key := strconv.FormatInt(orgID, 10) + ":" + ":dialysis_orders_list_all"
2269
 	dialysis_orders_list_all, _ := redis.Get(key).Result()
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
 	if len(dialysis_orders_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
2276
 	if len(dialysis_orders_list_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
2278
 		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
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
 		if err != nil {
2278
 		if err != nil {
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
 func GetAllPrescriptionByList(orgID int64, scheduleDate int64) (prescriptions []*models.VMDialysisPrescription, err error) {
2336
 func GetAllPrescriptionByList(orgID int64, scheduleDate int64) (prescriptions []*models.VMDialysisPrescription, err error) {
2332
 
2337
 
2333
 	redis := RedisClient()
2338
 	redis := RedisClient()