|
@@ -692,6 +692,24 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
692
|
692
|
|
693
|
693
|
for _, item := range advices {
|
694
|
694
|
|
|
695
|
+ if item.ExecutionState == 1 {
|
|
696
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExced)
|
|
697
|
+ return
|
|
698
|
+ }
|
|
699
|
+
|
|
700
|
+ if item.Checker >= 0 && item.Checker == adminUserInfo.AdminUser.Id {
|
|
701
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExceAndCheckNotOneUser)
|
|
702
|
+ return
|
|
703
|
+ }
|
|
704
|
+
|
|
705
|
+ //针对普宁
|
|
706
|
+ if adminUserInfo.Org.Id != 10599 {
|
|
707
|
+
|
|
708
|
+ if item.StartTime > theTime.Unix() {
|
|
709
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExceBeforeStart)
|
|
710
|
+ return
|
|
711
|
+ }
|
|
712
|
+ }
|
695
|
713
|
//自备药
|
696
|
714
|
selfPrescriptionOutOpenOne, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
|
697
|
715
|
|
|
@@ -1148,6 +1166,25 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1148
|
1166
|
advicesOne, _ := service.FindDoctorAdviceByIdsOne(adminUserInfo.Org.Id, ids)
|
1149
|
1167
|
for _, item := range advicesOne {
|
1150
|
1168
|
|
|
1169
|
+ if item.ExecutionState == 1 {
|
|
1170
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExced)
|
|
1171
|
+ return
|
|
1172
|
+ }
|
|
1173
|
+
|
|
1174
|
+ if item.Checker >= 0 && item.Checker == adminUserInfo.AdminUser.Id {
|
|
1175
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeExceAndCheckNotOneUser)
|
|
1176
|
+ return
|
|
1177
|
+ }
|
|
1178
|
+
|
|
1179
|
+ //针对普宁
|
|
1180
|
+ if adminUserInfo.Org.Id != 10599 {
|
|
1181
|
+
|
|
1182
|
+ if item.StartTime > theTime.Unix() {
|
|
1183
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeAdviceExceBeforeStart)
|
|
1184
|
+ return
|
|
1185
|
+ }
|
|
1186
|
+ }
|
|
1187
|
+
|
1151
|
1188
|
//自备药
|
1152
|
1189
|
selfPrescriptionOutOpen, _ := service.GetSelfPrescriptionOutOpen(adminUserInfo.Org.Id)
|
1153
|
1190
|
|