|
@@ -87,6 +87,8 @@ func ScheduleApiRegistRouters() {
|
87
|
87
|
|
88
|
88
|
beego.Router("/api/schedule/create_two", &ScheduleApiController{}, "Post:CreateScheduleTwo")
|
89
|
89
|
|
|
90
|
+ beego.Router("/api/schedule/changeschedule", &ScheduleApiController{}, "Put:ChangeScheduleTen")
|
|
91
|
+
|
90
|
92
|
}
|
91
|
93
|
func (c *ScheduleApiController) CoverSch() {
|
92
|
94
|
id_one, _ := c.GetInt64("id_one")
|
|
@@ -1983,29 +1985,29 @@ func (c *ScheduleApiController) ChangeSchedule() {
|
1983
|
1985
|
var DialysisMachineName string
|
1984
|
1986
|
if filedRecordOne.IsShow == 1 {
|
1985
|
1987
|
DialysisMachineName = so.DialysisDialyszers
|
1986
|
|
- fmt.Println("1111")
|
|
1988
|
+ //fmt.Println("1111")
|
1987
|
1989
|
fmt.Println(DialysisMachineName)
|
1988
|
1990
|
|
1989
|
1991
|
}
|
1990
|
1992
|
if filedRecordThree.IsShow == 1 {
|
1991
|
1993
|
if len(schedule.DialysisMachineName) > 0 {
|
1992
|
1994
|
DialysisMachineName = DialysisMachineName + "," + so.DialyzerPerfusionApparatus
|
1993
|
|
- fmt.Println("22222")
|
|
1995
|
+ //fmt.Println("22222")
|
1994
|
1996
|
fmt.Println(DialysisMachineName)
|
1995
|
1997
|
} else {
|
1996
|
1998
|
DialysisMachineName = so.DialyzerPerfusionApparatus
|
1997
|
|
- fmt.Println("333333")
|
|
1999
|
+ //fmt.Println("333333")
|
1998
|
2000
|
fmt.Println(DialysisMachineName)
|
1999
|
2001
|
}
|
2000
|
2002
|
}
|
2001
|
2003
|
if filedRecordTwo.IsShow == 1 {
|
2002
|
2004
|
if len(DialysisMachineName) > 0 {
|
2003
|
2005
|
DialysisMachineName = DialysisMachineName + "," + so.DialysisIrrigation
|
2004
|
|
- fmt.Println("55555555")
|
|
2006
|
+ //fmt.Println("55555555")
|
2005
|
2007
|
fmt.Println(DialysisMachineName)
|
2006
|
2008
|
} else {
|
2007
|
2009
|
DialysisMachineName = so.DialysisIrrigation
|
2008
|
|
- fmt.Println("66666666")
|
|
2010
|
+ //fmt.Println("66666666")
|
2009
|
2011
|
fmt.Println(DialysisMachineName)
|
2010
|
2012
|
}
|
2011
|
2013
|
}
|
|
@@ -3788,11 +3790,11 @@ func (this *ScheduleApiController) GetCopyPatientSchedules() {
|
3788
|
3790
|
adminUserInfo := this.GetAdminUserInfo()
|
3789
|
3791
|
orgId := adminUserInfo.CurrentOrgId
|
3790
|
3792
|
start_time, _ := this.GetInt64("start_time")
|
3791
|
|
- fmt.Println("start_time", start_time)
|
|
3793
|
+
|
3792
|
3794
|
end_time, _ := this.GetInt64("end_time")
|
3793
|
|
- fmt.Println("end_time", end_time)
|
|
3795
|
+
|
3794
|
3796
|
copy_startime, _ := this.GetInt64("copy_startime")
|
3795
|
|
- fmt.Println("copy_startime", copy_startime)
|
|
3797
|
+
|
3796
|
3798
|
copy_endtime, _ := this.GetInt64("copy_endtime")
|
3797
|
3799
|
|
3798
|
3800
|
//获取本周患者排班
|
|
@@ -4394,7 +4396,7 @@ func (c *ScheduleApiController) GetScheduleOne() {
|
4394
|
4396
|
}
|
4395
|
4397
|
schdules, _ := service.GetWeekScheduleTwo(adminInfo.CurrentOrgId, weekStartPoint, weekEndPoint, ids, schedule_type)
|
4396
|
4398
|
|
4397
|
|
- if adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10346 {
|
|
4399
|
+ if adminInfo.CurrentOrgId == 10346 {
|
4398
|
4400
|
|
4399
|
4401
|
if len(schdules) > 0 {
|
4400
|
4402
|
//获取长期医嘱里面的透析器灌流器
|
|
@@ -4420,7 +4422,6 @@ func (c *ScheduleApiController) GetScheduleTwo() {
|
4420
|
4422
|
|
4421
|
4423
|
week, _ := c.GetInt64("weekTime", 0) //1:last, 2:this 3:next 4 nextTwo
|
4422
|
4424
|
|
4423
|
|
- fmt.Println("weekwoowowowowowowowowowo", week)
|
4424
|
4425
|
patitionIdStr := c.GetString("patitionid")
|
4425
|
4426
|
|
4426
|
4427
|
ids := strings.Split(patitionIdStr, ",")
|
|
@@ -4429,7 +4430,7 @@ func (c *ScheduleApiController) GetScheduleTwo() {
|
4429
|
4430
|
|
4430
|
4431
|
adminInfo := c.GetAdminUserInfo()
|
4431
|
4432
|
weekDateStr := c.GetString("week_date")
|
4432
|
|
- fmt.Println("weekDateStr--------------------", weekDateStr)
|
|
4433
|
+
|
4433
|
4434
|
WeekDayIds := strings.Split(weekDateStr, ",")
|
4434
|
4435
|
|
4435
|
4436
|
thisTime := time.Now()
|
|
@@ -4901,3 +4902,103 @@ func (c *ScheduleApiController) DeleteScheduleTwo() {
|
4901
|
4902
|
}
|
4902
|
4903
|
|
4903
|
4904
|
}
|
|
4905
|
+
|
|
4906
|
+func (c *ScheduleApiController) ChangeScheduleTen() {
|
|
4907
|
+
|
|
4908
|
+ id, _ := c.GetInt64("id", 0)
|
|
4909
|
+ bed_id, _ := c.GetInt64("bed_id")
|
|
4910
|
+ mode_id, _ := c.GetInt64("mode_id")
|
|
4911
|
+ schedule_type, _ := c.GetInt64("schedule_type")
|
|
4912
|
+ if id <= 0 {
|
|
4913
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
4914
|
+ return
|
|
4915
|
+ }
|
|
4916
|
+
|
|
4917
|
+ adminINfo := c.GetAdminUserInfo()
|
|
4918
|
+
|
|
4919
|
+ schedule, _ := service.GetSchedule(adminINfo.CurrentOrgId, id)
|
|
4920
|
+
|
|
4921
|
+ //获取分区号
|
|
4922
|
+ number, _ := service.GetZoneId(bed_id, adminINfo.CurrentOrgId)
|
|
4923
|
+ if schedule == nil {
|
|
4924
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeScheduleNotExist)
|
|
4925
|
+ return
|
|
4926
|
+ }
|
|
4927
|
+ //如果透析模式相等 床位号相等,班次相等
|
|
4928
|
+ if mode_id == schedule.ModeId && bed_id == schedule.BedId && schedule_type == schedule.ScheduleType && number.ZoneID == schedule.PartitionId {
|
|
4929
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorScheduleCode)
|
|
4930
|
+ return
|
|
4931
|
+ } else {
|
|
4932
|
+
|
|
4933
|
+ //查询该床位今天是否存在排班
|
|
4934
|
+ sch, _ := service.GetScheduleByBedId(bed_id, schedule_type, adminINfo.CurrentOrgId, schedule.ScheduleDate)
|
|
4935
|
+ fmt.Println("schwowowoowowowowowo", sch.ID)
|
|
4936
|
+ if sch.ID == 0 {
|
|
4937
|
+ //删除排班
|
|
4938
|
+ service.UpdateScheduleByScheduleId(id)
|
|
4939
|
+ xtSchedule := models.XtSchedule{
|
|
4940
|
+ UserOrgId: adminINfo.CurrentOrgId,
|
|
4941
|
+ PartitionId: number.ZoneID,
|
|
4942
|
+ BedId: bed_id,
|
|
4943
|
+ PatientId: schedule.PatientId,
|
|
4944
|
+ ScheduleDate: schedule.ScheduleDate,
|
|
4945
|
+ ScheduleType: schedule.ScheduleType,
|
|
4946
|
+ ScheduleWeek: schedule.ScheduleWeek,
|
|
4947
|
+ ModeId: mode_id,
|
|
4948
|
+ Status: 1,
|
|
4949
|
+ CreatedTime: time.Now().Unix(),
|
|
4950
|
+ UpdatedTime: 0,
|
|
4951
|
+ IsExport: 999999,
|
|
4952
|
+ DialysisMachineName: "",
|
|
4953
|
+ }
|
|
4954
|
+ service.CreateNewSchedule(xtSchedule)
|
|
4955
|
+ }
|
|
4956
|
+
|
|
4957
|
+ //存在排班
|
|
4958
|
+ if sch.ID > 0 {
|
|
4959
|
+ //删除排班
|
|
4960
|
+ //service.UpdateScheduleByScheduleId(id)
|
|
4961
|
+ //查询该患者的透析模式对应的透析器灌流器
|
|
4962
|
+ //service.GetDialysisSolutionByMode(schedule.PatientId)
|
|
4963
|
+ xtSchedule := models.XtSchedule{
|
|
4964
|
+ UserOrgId: adminINfo.CurrentOrgId,
|
|
4965
|
+ PartitionId: number.ZoneID,
|
|
4966
|
+ BedId: bed_id,
|
|
4967
|
+ PatientId: schedule.PatientId,
|
|
4968
|
+ ScheduleDate: schedule.ScheduleDate,
|
|
4969
|
+ ScheduleType: schedule_type,
|
|
4970
|
+ ScheduleWeek: schedule.ScheduleWeek,
|
|
4971
|
+ ModeId: mode_id,
|
|
4972
|
+ Status: 1,
|
|
4973
|
+ CreatedTime: time.Now().Unix(),
|
|
4974
|
+ UpdatedTime: time.Now().Unix(),
|
|
4975
|
+ IsExport: 8888,
|
|
4976
|
+ DialysisMachineName: "",
|
|
4977
|
+ }
|
|
4978
|
+
|
|
4979
|
+ service.UpdateScheduleSixTy(sch.ID, xtSchedule)
|
|
4980
|
+
|
|
4981
|
+ msch := models.XtSchedule{
|
|
4982
|
+ UserOrgId: adminINfo.CurrentOrgId,
|
|
4983
|
+ PartitionId: number.ZoneID,
|
|
4984
|
+ BedId: bed_id,
|
|
4985
|
+ PatientId: sch.PatientId,
|
|
4986
|
+ ScheduleDate: sch.ScheduleDate,
|
|
4987
|
+ ScheduleType: sch.ScheduleType,
|
|
4988
|
+ ScheduleWeek: sch.ScheduleWeek,
|
|
4989
|
+ ModeId: sch.ModeId,
|
|
4990
|
+ IsExport: 88888,
|
|
4991
|
+ CreatedTime: time.Now().Unix(),
|
|
4992
|
+ UpdatedTime: time.Now().Unix(),
|
|
4993
|
+ }
|
|
4994
|
+
|
|
4995
|
+ service.UpdateScheduleSixTy(id, msch)
|
|
4996
|
+
|
|
4997
|
+ }
|
|
4998
|
+ }
|
|
4999
|
+
|
|
5000
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
5001
|
+ "msg": "ok",
|
|
5002
|
+ })
|
|
5003
|
+
|
|
5004
|
+}
|