|
@@ -3,7 +3,7 @@ package controllers
|
3
|
3
|
import (
|
4
|
4
|
"XT_New/service"
|
5
|
5
|
"strconv"
|
6
|
|
-
|
|
6
|
+ "XT_New/enums"
|
7
|
7
|
"XT_New/models"
|
8
|
8
|
"XT_New/utils"
|
9
|
9
|
"fmt"
|
|
@@ -26,6 +26,50 @@ func DoctorApiRegistRouters() {
|
26
|
26
|
beego.Router("/api/paients/getdryweightdetail", &DoctorsApiController{}, "Get:GetDryWeightDetail")
|
27
|
27
|
beego.Router("/api/patients/modifydryweightdata", &DoctorsApiController{}, "Get:ModifydryWeightData")
|
28
|
28
|
beego.Router("/api/patient/deletedryweight", &DoctorsApiController{}, "Delete:DeleteDryWeight")
|
|
29
|
+ beego.Router("/api/schedule/advices", &DoctorsApiController{}, "Get:ScheduleAdvices")
|
|
30
|
+}
|
|
31
|
+
|
|
32
|
+func (c *DoctorsApiController) ScheduleAdvices() {
|
|
33
|
+ schedualDate := c.GetString("date")
|
|
34
|
+ adviceType, _ := c.GetInt("advice_type")
|
|
35
|
+ patientType, _ := c.GetInt("patient_type")
|
|
36
|
+
|
|
37
|
+ if adviceType != 1 && adviceType != 3 && adviceType != 2 {
|
|
38
|
+ adviceType = 0
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ if patientType != 1 && patientType != 2 {
|
|
42
|
+
|
|
43
|
+ patientType = 0
|
|
44
|
+ }
|
|
45
|
+
|
|
46
|
+ date, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", schedualDate)
|
|
47
|
+ if parseDateErr != nil {
|
|
48
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
49
|
+ return
|
|
50
|
+ }
|
|
51
|
+
|
|
52
|
+ adminUserInfo := c.GetAdminUserInfo()
|
|
53
|
+ orgID := adminUserInfo.CurrentOrgId
|
|
54
|
+
|
|
55
|
+ scheduals, err := service.MobileGetScheduleDoctorAdvices(orgID, date.Unix(), adviceType, patientType, adminUserInfo.AdminUser.Id)
|
|
56
|
+ adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
|
|
57
|
+ if err != nil {
|
|
58
|
+ c.ErrorLog("获取排班信息失败:%v", err)
|
|
59
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
60
|
+ } else {
|
|
61
|
+ filtedScheduals := []*service.MScheduleDoctorAdviceVM{}
|
|
62
|
+ for _, schedual := range scheduals {
|
|
63
|
+ if len(schedual.DoctorAdvices) > 0 {
|
|
64
|
+ filtedScheduals = append(filtedScheduals, schedual)
|
|
65
|
+ }
|
|
66
|
+ }
|
|
67
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
68
|
+ "scheduals": filtedScheduals,
|
|
69
|
+
|
|
70
|
+ "adminUser": adminUser,
|
|
71
|
+ })
|
|
72
|
+ }
|
29
|
73
|
}
|
30
|
74
|
|
31
|
75
|
func (c *DoctorsApiController) GetAllDoctorAndNurse() {
|