|
@@ -49,10 +49,40 @@ func (this *StaffScheduleApiController) GetMobileDoctorList() {
|
49
|
49
|
func (this *StaffScheduleApiController) GetMobileStaffScheduleList() {
|
50
|
50
|
|
51
|
51
|
orgId := this.GetMobileAdminUserInfo().Org.Id
|
52
|
|
- start_time, _ := this.GetInt64("start_time")
|
53
|
|
- fmt.Println("staft_time", start_time)
|
54
|
|
- end_time, _ := this.GetInt64("end_time")
|
55
|
|
- staffList, err := service.GetStaffScheduleList(orgId, start_time, end_time)
|
|
52
|
+ //start_time, _ := this.GetInt64("start_time")
|
|
53
|
+ //fmt.Println("staft_time", start_time)
|
|
54
|
+ //end_time, _ := this.GetInt64("end_time")
|
|
55
|
+ //fmt.Println("start_time",start_time)
|
|
56
|
+ //fmt.Println("end_time",end_time)
|
|
57
|
+ start_time_one := this.GetString("start_time_one")
|
|
58
|
+ end_time_one := this.GetString("end_time_one")
|
|
59
|
+ fmt.Println("start_time_one--------", len(start_time_one))
|
|
60
|
+ fmt.Println("end_time_one-------", end_time_one)
|
|
61
|
+ timeLayout := "2006-01-02"
|
|
62
|
+ loc, _ := time.LoadLocation("Local")
|
|
63
|
+ var startTime int64
|
|
64
|
+ if len(start_time_one) > 0 {
|
|
65
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_one+" 00:00:00", loc)
|
|
66
|
+ fmt.Println("err-----------", err)
|
|
67
|
+ if err != nil {
|
|
68
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
69
|
+ return
|
|
70
|
+ }
|
|
71
|
+ startTime = theTime.Unix()
|
|
72
|
+ }
|
|
73
|
+ var endTime int64
|
|
74
|
+ if len(end_time_one) > 0 {
|
|
75
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_one+" 23:59:59", loc)
|
|
76
|
+ if err != nil {
|
|
77
|
+ utils.ErrorLog(err.Error())
|
|
78
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
79
|
+ return
|
|
80
|
+ }
|
|
81
|
+ endTime = theTime.Unix()
|
|
82
|
+ }
|
|
83
|
+ fmt.Println("starti_time233232323232", startTime)
|
|
84
|
+ fmt.Println("end_time2323223232323", endTime)
|
|
85
|
+ staffList, err := service.GetStaffScheduleList(orgId, startTime, endTime)
|
56
|
86
|
if err != nil {
|
57
|
87
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
58
|
88
|
return
|
|
@@ -66,10 +96,33 @@ func (this *StaffScheduleApiController) GetMobileStaffScheduleList() {
|
66
|
96
|
func (this *StaffScheduleApiController) GetMobileNextWeekScheduleLIst() {
|
67
|
97
|
|
68
|
98
|
orgId := this.GetMobileAdminUserInfo().Org.Id
|
69
|
|
- start_time, _ := this.GetInt64("start_time")
|
70
|
|
- end_time, _ := this.GetInt64("end_time")
|
|
99
|
+ //start_time, _ := this.GetInt64("start_time")
|
|
100
|
+ //end_time, _ := this.GetInt64("end_time")
|
|
101
|
+ start_time_one := this.GetString("start_time_one")
|
|
102
|
+ end_time_one := this.GetString("end_time_one")
|
|
103
|
+ timeLayout := "2006-01-02"
|
|
104
|
+ loc, _ := time.LoadLocation("Local")
|
|
105
|
+ var startTime int64
|
|
106
|
+ if len(start_time_one) > 0 {
|
|
107
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_one+" 00:00:00", loc)
|
|
108
|
+ if err != nil {
|
|
109
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
110
|
+ return
|
|
111
|
+ }
|
|
112
|
+ startTime = theTime.Unix()
|
|
113
|
+ }
|
|
114
|
+ var endTime int64
|
|
115
|
+ if len(end_time_one) > 0 {
|
|
116
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_one+" 23:59:59", loc)
|
|
117
|
+ if err != nil {
|
|
118
|
+ utils.ErrorLog(err.Error())
|
|
119
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
120
|
+ return
|
|
121
|
+ }
|
|
122
|
+ endTime = theTime.Unix()
|
|
123
|
+ }
|
71
|
124
|
|
72
|
|
- staffList, err := service.GetStaffScheduleList(orgId, start_time, end_time)
|
|
125
|
+ staffList, err := service.GetStaffScheduleList(orgId, startTime, endTime)
|
73
|
126
|
if err != nil {
|
74
|
127
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
75
|
128
|
return
|
|
@@ -82,10 +135,33 @@ func (this *StaffScheduleApiController) GetMobileNextWeekScheduleLIst() {
|
82
|
135
|
|
83
|
136
|
func (this *StaffScheduleApiController) GetScheduleByUserType() {
|
84
|
137
|
doctor_id, _ := this.GetInt64("doctor_id")
|
85
|
|
- start_time, _ := this.GetInt64("start_time")
|
86
|
|
- end_time, _ := this.GetInt64("end_time")
|
|
138
|
+ //start_time, _ := this.GetInt64("start_time")
|
|
139
|
+ //end_time, _ := this.GetInt64("end_time")
|
|
140
|
+ start_time_one := this.GetString("start_time_one")
|
|
141
|
+ end_time_one := this.GetString("end_time_one")
|
|
142
|
+ timeLayout := "2006-01-02"
|
|
143
|
+ loc, _ := time.LoadLocation("Local")
|
|
144
|
+ var startTime int64
|
|
145
|
+ if len(start_time_one) > 0 {
|
|
146
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_one+" 00:00:00", loc)
|
|
147
|
+ if err != nil {
|
|
148
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
149
|
+ return
|
|
150
|
+ }
|
|
151
|
+ startTime = theTime.Unix()
|
|
152
|
+ }
|
|
153
|
+ var endTime int64
|
|
154
|
+ if len(end_time_one) > 0 {
|
|
155
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_one+" 23:59:59", loc)
|
|
156
|
+ if err != nil {
|
|
157
|
+ utils.ErrorLog(err.Error())
|
|
158
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
159
|
+ return
|
|
160
|
+ }
|
|
161
|
+ endTime = theTime.Unix()
|
|
162
|
+ }
|
87
|
163
|
orgId := this.GetMobileAdminUserInfo().Org.Id
|
88
|
|
- staffList, err := service.GetScheduleByDoctorId(doctor_id, start_time, end_time, orgId)
|
|
164
|
+ staffList, err := service.GetScheduleByDoctorId(doctor_id, startTime, endTime, orgId)
|
89
|
165
|
if err != nil {
|
90
|
166
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
91
|
167
|
return
|
|
@@ -100,9 +176,34 @@ func (this *StaffScheduleApiController) GetSearchPatientByDoctorId() {
|
100
|
176
|
|
101
|
177
|
orgId := this.GetMobileAdminUserInfo().Org.Id
|
102
|
178
|
user_name := this.GetString("user_name")
|
103
|
|
- start_time, _ := this.GetInt64("start_time")
|
104
|
|
- end_time, _ := this.GetInt64("end_time")
|
105
|
|
- staffList, err := service.ToSearchSeacheduleList(user_name, start_time, end_time, orgId)
|
|
179
|
+ //start_time, _ := this.GetInt64("start_time")
|
|
180
|
+ //end_time, _ := this.GetInt64("end_time")
|
|
181
|
+
|
|
182
|
+ start_time_one := this.GetString("start_time_one")
|
|
183
|
+ end_time_one := this.GetString("end_time_one")
|
|
184
|
+ timeLayout := "2006-01-02"
|
|
185
|
+ loc, _ := time.LoadLocation("Local")
|
|
186
|
+ var startTime int64
|
|
187
|
+ if len(start_time_one) > 0 {
|
|
188
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time_one+" 00:00:00", loc)
|
|
189
|
+ if err != nil {
|
|
190
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
191
|
+ return
|
|
192
|
+ }
|
|
193
|
+ startTime = theTime.Unix()
|
|
194
|
+ }
|
|
195
|
+ var endTime int64
|
|
196
|
+ if len(end_time_one) > 0 {
|
|
197
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time_one+" 23:59:59", loc)
|
|
198
|
+ if err != nil {
|
|
199
|
+ utils.ErrorLog(err.Error())
|
|
200
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
201
|
+ return
|
|
202
|
+ }
|
|
203
|
+ endTime = theTime.Unix()
|
|
204
|
+ }
|
|
205
|
+ //
|
|
206
|
+ staffList, err := service.ToSearchSeacheduleList(user_name, startTime, endTime, orgId)
|
106
|
207
|
if err != nil {
|
107
|
208
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
|
108
|
209
|
return
|
|
@@ -812,7 +913,7 @@ func (c *StaffScheduleApiController) ChangeScheduleById() {
|
812
|
913
|
patient_id, _ := c.GetInt64("patient_id")
|
813
|
914
|
org_id := c.GetMobileAdminUserInfo().Org.Id
|
814
|
915
|
err := service.ChangeScheduleById(id, mode_id)
|
815
|
|
- fmt.Println("9999999999999999", err)
|
|
916
|
+ fmt.Println("err", err)
|
816
|
917
|
err = service.ChangeDialysisSolution(patient_id, schedule_date, org_id, mode_id)
|
817
|
918
|
c.ServeSuccessJSON(map[string]interface{}{
|
818
|
919
|
"msg": "ok",
|