|
@@ -89,6 +89,8 @@ func ScheduleApiRegistRouters() {
|
89
|
89
|
|
90
|
90
|
beego.Router("/api/schedule/changeschedule", &ScheduleApiController{}, "Put:ChangeScheduleTen")
|
91
|
91
|
|
|
92
|
+ beego.Router("/api/schedule/getordernumber", &ScheduleApiController{}, "Get:GetNumberListById")
|
|
93
|
+
|
92
|
94
|
}
|
93
|
95
|
func (c *ScheduleApiController) CoverSch() {
|
94
|
96
|
id_one, _ := c.GetInt64("id_one")
|
|
@@ -4934,23 +4936,81 @@ func (c *ScheduleApiController) ChangeScheduleTen() {
|
4934
|
4936
|
|
4935
|
4937
|
//如果床位未发生改变
|
4936
|
4938
|
if bed_id == schedule.BedId {
|
4937
|
|
- //五四的床位
|
4938
|
|
- xtSchedule := models.XtSchedule{
|
4939
|
|
- UserOrgId: adminINfo.CurrentOrgId,
|
4940
|
|
- PartitionId: number.ZoneID,
|
4941
|
|
- BedId: bed_id,
|
4942
|
|
- PatientId: schedule.PatientId,
|
4943
|
|
- ScheduleDate: schedule.ScheduleDate,
|
4944
|
|
- ScheduleType: schedule_type,
|
4945
|
|
- ScheduleWeek: schedule.ScheduleWeek,
|
4946
|
|
- ModeId: mode_id,
|
4947
|
|
- Status: 1,
|
4948
|
|
- CreatedTime: time.Now().Unix(),
|
4949
|
|
- UpdatedTime: 0,
|
4950
|
|
- IsExport: 999999,
|
4951
|
|
- DialysisMachineName: "",
|
|
4939
|
+
|
|
4940
|
+ //查询该床位今天是否存在排班
|
|
4941
|
+ sch, _ := service.GetScheduleByBedId(bed_id, schedule_type, adminINfo.CurrentOrgId, schedule.ScheduleDate)
|
|
4942
|
+ fmt.Println("schwowowoowowowowowo", sch.ID, sch.PatientId)
|
|
4943
|
+
|
|
4944
|
+ if sch.ID == 0 {
|
|
4945
|
+ ////删除排班
|
|
4946
|
+ //service.UpdateScheduleByScheduleId(id)
|
|
4947
|
+
|
|
4948
|
+ //五四的床位
|
|
4949
|
+ xtSchedule := models.XtSchedule{
|
|
4950
|
+ UserOrgId: adminINfo.CurrentOrgId,
|
|
4951
|
+ PartitionId: number.ZoneID,
|
|
4952
|
+ BedId: bed_id,
|
|
4953
|
+ PatientId: schedule.PatientId,
|
|
4954
|
+ ScheduleDate: schedule.ScheduleDate,
|
|
4955
|
+ ScheduleType: schedule_type,
|
|
4956
|
+ ScheduleWeek: schedule.ScheduleWeek,
|
|
4957
|
+ ModeId: mode_id,
|
|
4958
|
+ Status: 1,
|
|
4959
|
+ CreatedTime: time.Now().Unix(),
|
|
4960
|
+ UpdatedTime: 0,
|
|
4961
|
+ IsExport: 999999,
|
|
4962
|
+ DialysisMachineName: "",
|
|
4963
|
+ }
|
|
4964
|
+ //service.CreateNewSchedule(xtSchedule)
|
|
4965
|
+
|
|
4966
|
+ service.UpdateScheduleSixTy(id, xtSchedule)
|
4952
|
4967
|
}
|
4953
|
|
- service.UpdateScheduleSixTy(id, xtSchedule)
|
|
4968
|
+
|
|
4969
|
+ if schedule_type != schedule.ScheduleType && sch.ID > 0 {
|
|
4970
|
+ //存在排班
|
|
4971
|
+ if sch.ID > 0 {
|
|
4972
|
+
|
|
4973
|
+ xtSchedule := models.XtSchedule{
|
|
4974
|
+ UserOrgId: adminINfo.CurrentOrgId,
|
|
4975
|
+ PartitionId: number.ZoneID,
|
|
4976
|
+ BedId: sch.BedId,
|
|
4977
|
+ PatientId: schedule.PatientId,
|
|
4978
|
+ ScheduleDate: sch.ScheduleDate,
|
|
4979
|
+ ScheduleType: sch.ScheduleType,
|
|
4980
|
+ ScheduleWeek: sch.ScheduleWeek,
|
|
4981
|
+ ModeId: sch.ModeId,
|
|
4982
|
+ Status: 1,
|
|
4983
|
+ CreatedTime: time.Now().Unix(),
|
|
4984
|
+ UpdatedTime: time.Now().Unix(),
|
|
4985
|
+ IsExport: 8888,
|
|
4986
|
+ DialysisMachineName: "",
|
|
4987
|
+ }
|
|
4988
|
+ fmt.Println("汪涵我我我哦", id)
|
|
4989
|
+
|
|
4990
|
+ //赵云的ID
|
|
4991
|
+ // 该床位存在的患者
|
|
4992
|
+ service.UpdateScheduleSixTy(id, xtSchedule)
|
|
4993
|
+
|
|
4994
|
+ //赵云的排班
|
|
4995
|
+ msch := models.XtSchedule{
|
|
4996
|
+ UserOrgId: adminINfo.CurrentOrgId,
|
|
4997
|
+ PartitionId: schedule.PartitionId,
|
|
4998
|
+ BedId: schedule.BedId,
|
|
4999
|
+ PatientId: sch.PatientId,
|
|
5000
|
+ ScheduleDate: schedule.ScheduleDate,
|
|
5001
|
+ ScheduleType: schedule.ScheduleType,
|
|
5002
|
+ ScheduleWeek: schedule.ScheduleWeek,
|
|
5003
|
+ ModeId: schedule.ModeId,
|
|
5004
|
+ IsExport: 88888,
|
|
5005
|
+ CreatedTime: time.Now().Unix(),
|
|
5006
|
+ UpdatedTime: time.Now().Unix(),
|
|
5007
|
+ }
|
|
5008
|
+
|
|
5009
|
+ // 历史床位的患者
|
|
5010
|
+ service.UpdateScheduleSixTy(sch.ID, msch)
|
|
5011
|
+ }
|
|
5012
|
+ }
|
|
5013
|
+
|
4954
|
5014
|
}
|
4955
|
5015
|
|
4956
|
5016
|
//如果床位发生改变
|
|
@@ -5036,3 +5096,14 @@ func (c *ScheduleApiController) ChangeScheduleTen() {
|
5036
|
5096
|
})
|
5037
|
5097
|
|
5038
|
5098
|
}
|
|
5099
|
+
|
|
5100
|
+func (c *ScheduleApiController) GetNumberListById() {
|
|
5101
|
+
|
|
5102
|
+ id, _ := c.GetInt64("id")
|
|
5103
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
5104
|
+ number, _ := service.GetNumberListById(id, orgId)
|
|
5105
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
5106
|
+ "number": number,
|
|
5107
|
+ })
|
|
5108
|
+
|
|
5109
|
+}
|