|
@@ -259,6 +259,75 @@ func (this *StaffScheduleApiController) GetAllZone() {
|
259
|
259
|
})
|
260
|
260
|
}
|
261
|
261
|
|
|
262
|
+func (this *StaffScheduleApiController) GetAllZonePb() {
|
|
263
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
264
|
+ timeLayout := "2006-01-02"
|
|
265
|
+ loc, _ := time.LoadLocation("Local")
|
|
266
|
+ start_time := this.GetString("start_time")
|
|
267
|
+ var startTime int64
|
|
268
|
+ if len(start_time) > 0 {
|
|
269
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
270
|
+ if err != nil {
|
|
271
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
272
|
+ return
|
|
273
|
+ }
|
|
274
|
+ startTime = theTime.Unix()
|
|
275
|
+ }
|
|
276
|
+ zoneid, _ := this.GetInt64("zoneid")
|
|
277
|
+ classtype, _ := this.GetInt64("classtype")
|
|
278
|
+
|
|
279
|
+ // is_open, _ := this.GetInt64("is_open")
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+ //获取空床位的排班数据
|
|
283
|
+ list, _ := service.GetPatientScheduleByPd(startTime, zoneid, orgid, classtype)
|
|
284
|
+ if len(list) > 0 {
|
|
285
|
+ for _, item := range list {
|
|
286
|
+ for _, device := range item.DeviceNumber {
|
|
287
|
+ item.TotalBed += 1
|
|
288
|
+ for _, schedule := range device.Schedule {
|
|
289
|
+ if schedule.ScheduleType == 1 {
|
|
290
|
+ item.SwBed += 1
|
|
291
|
+ }
|
|
292
|
+ if schedule.ScheduleType == 2 {
|
|
293
|
+ item.XwBed += 1
|
|
294
|
+ }
|
|
295
|
+ if schedule.ScheduleType == 3 {
|
|
296
|
+ item.WsBed += 1
|
|
297
|
+ }
|
|
298
|
+ }
|
|
299
|
+ }
|
|
300
|
+ }
|
|
301
|
+ }
|
|
302
|
+
|
|
303
|
+ // stockType, _ := service.GetStockType(orgid)
|
|
304
|
+ // zonelist, _ := service.GetPatientScheduleListByZone(startTime, classtype, orgid)
|
|
305
|
+ // if err != nil {
|
|
306
|
+ // this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
|
307
|
+ // return
|
|
308
|
+ // }
|
|
309
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
310
|
+ "schedule": list,
|
|
311
|
+ // "stockType": stockType,
|
|
312
|
+ // "zonelist": zonelist,
|
|
313
|
+ })
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+ // id := this.GetMobileAdminUserInfo().Org.Id
|
|
319
|
+ // zone, err := service.GetAllMobileZonePb(id)
|
|
320
|
+
|
|
321
|
+ // if err != nil {
|
|
322
|
+ // this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
|
323
|
+ // return
|
|
324
|
+ // }
|
|
325
|
+ // this.ServeSuccessJSON(map[string]interface{}{
|
|
326
|
+ // "zone": zone,
|
|
327
|
+ // })
|
|
328
|
+}
|
|
329
|
+
|
|
330
|
+
|
262
|
331
|
func (this *StaffScheduleApiController) GetPatientScheduleList() {
|
263
|
332
|
orgid := this.GetMobileAdminUserInfo().Org.Id
|
264
|
333
|
fmt.Println("orgid", orgid)
|