|
@@ -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()
|