|
@@ -89,7 +89,7 @@ func (this *DialysisAPIController) Scheduals() {
|
89
|
89
|
key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
|
90
|
90
|
|
91
|
91
|
scheduals_json_str, _ := redis.Get(key).Result()
|
92
|
|
-
|
|
92
|
+ redis.Set(key, "", time.Second)
|
93
|
93
|
if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
|
94
|
94
|
scheduals, err := service.MobileGetDialysisScheduals(orgID, date.Unix(), schedualType)
|
95
|
95
|
|
|
@@ -188,8 +188,27 @@ func (this *DialysisAPIController) Scheduals() {
|
188
|
188
|
}
|
189
|
189
|
}
|
190
|
190
|
|
|
191
|
+ //获取今日所有的处方开的耗材
|
|
192
|
+ project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
|
|
193
|
+
|
|
194
|
+ //获取今日透析准备的数据
|
|
195
|
+ goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
|
|
196
|
+
|
|
197
|
+ list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
|
|
198
|
+
|
|
199
|
+ for _, item := range goodList {
|
|
200
|
+ for _, it := range list {
|
|
201
|
+ if item.RecordDate == it.RecordDate && it.PatientId == it.PatientId {
|
|
202
|
+ item.Children = append(item.Children, it)
|
|
203
|
+ }
|
|
204
|
+ }
|
|
205
|
+ }
|
|
206
|
+
|
|
207
|
+ fmt.Println("goodlist888888888888888888888", goodList, err)
|
191
|
208
|
this.ServeSuccessJSON(map[string]interface{}{
|
192
|
209
|
"scheduals": scheduals,
|
|
210
|
+ "project": project,
|
|
211
|
+ "goodList": goodList,
|
193
|
212
|
})
|
194
|
213
|
}
|
195
|
214
|
|
|
@@ -201,11 +220,28 @@ func (this *DialysisAPIController) Scheduals() {
|
201
|
220
|
} else {
|
202
|
221
|
|
203
|
222
|
}
|
|
223
|
+ //获取今日所有的处方开的耗材
|
|
224
|
+ project, _ := service.GetAllHisProjectPrescription(orgID, date.Unix())
|
|
225
|
+
|
|
226
|
+ //获取今日透析准备的数据
|
|
227
|
+ goodList, err := service.MobileGetDialysisGoodsSeven(orgID, date.Unix())
|
|
228
|
+ fmt.Println("goodlist23323232323233232332233223323233", goodList, err)
|
|
229
|
+
|
|
230
|
+ list, err := service.MobileGetDialysisGoodsSix(orgID, date.Unix())
|
204
|
231
|
|
|
232
|
+ for _, item := range goodList {
|
|
233
|
+ for _, it := range list {
|
|
234
|
+ if item.RecordDate == it.RecordDate && it.PatientId == it.PatientId {
|
|
235
|
+ item.Children = append(item.Children, it)
|
|
236
|
+ }
|
|
237
|
+ }
|
|
238
|
+ }
|
205
|
239
|
this.ServeSuccessJSON(map[string]interface{}{
|
206
|
240
|
"scheduals": dat,
|
207
|
241
|
"redis": "true",
|
208
|
242
|
"date": schedualDate,
|
|
243
|
+ "project": project,
|
|
244
|
+ "goodList": goodList,
|
209
|
245
|
})
|
210
|
246
|
|
211
|
247
|
}
|
|
@@ -531,7 +567,6 @@ func (this *DialysisAPIController) DialysisRecord() {
|
531
|
567
|
// 先走redis,没有走数据库
|
532
|
568
|
his_advices, _ = service.GetAllHisDoctorAdvice(adminInfo.Org.Id, patientID, date.Unix())
|
533
|
569
|
}
|
534
|
|
-
|
535
|
570
|
returnData := map[string]interface{}{
|
536
|
571
|
"patient": patient,
|
537
|
572
|
"schedual": schedual,
|