|
@@ -9,6 +9,7 @@ import (
|
9
|
9
|
"fmt"
|
10
|
10
|
"github.com/astaxie/beego"
|
11
|
11
|
"github.com/jinzhu/gorm"
|
|
12
|
+ "github.com/shopspring/decimal"
|
12
|
13
|
"strconv"
|
13
|
14
|
"time"
|
14
|
15
|
)
|
|
@@ -17,24 +18,36 @@ func XcxApiControllersRegisterRouters() {
|
17
|
18
|
////传送codeinit
|
18
|
19
|
beego.Router("/xcx/m/api/code", &XcxApiController{}, "Get:GetCodeInit")
|
19
|
20
|
//获取验证码
|
20
|
|
- beego.Router("/xcx/api/mobile/code", &XcxApiController{}, "Get:GetCodeInfo")
|
|
21
|
+ beego.Router("/xcx/api/mobile/code", &XcxApiController{}, "Post:GetCodeInfo")
|
21
|
22
|
//用户绑定
|
22
|
23
|
beego.Router("/xcx/api/mobile/register", &XcxApiController{}, "Get:GetUserNameRegister")
|
23
|
|
- //登录
|
|
24
|
+ //手机号登录
|
24
|
25
|
beego.Router("/xcx/api/mobile/login", &XcxApiController{}, "Get:GetLoginInfor")
|
25
|
26
|
|
|
27
|
+ //openid登录
|
|
28
|
+ beego.Router("/xcx/api/openid/login", &XcxApiController{}, "Get:GetLoginInfoByOpenid")
|
|
29
|
+
|
26
|
30
|
//获取二维码信息
|
27
|
31
|
beego.Router("/xcx/api/mobile/patient", &XcxApiController{}, "Get:GetPatientList")
|
28
|
32
|
|
29
|
33
|
//获取登录后的信息
|
30
|
34
|
beego.Router("/xcx/api/mobile/getdatainfo", &XcxApiController{}, "Get:GetDataInfo")
|
31
|
35
|
|
|
36
|
+ //获取排班数据
|
|
37
|
+ beego.Router("/xcx/api/mobile/schedulebyweek", &XcxApiController{}, "Post:GetSchedulesByWeek")
|
|
38
|
+
|
32
|
39
|
//获取排班数据
|
33
|
40
|
beego.Router("/xcx/api/mobile/schedule", &XcxApiController{}, "Get:GetScheduleInfo")
|
34
|
41
|
|
35
|
42
|
//获取透析记录
|
36
|
43
|
beego.Router("/xcx/api/mobile/dialysis", &XcxApiController{}, "Get:GetMobileSchedule")
|
37
|
44
|
|
|
45
|
+ //获取体重纪录
|
|
46
|
+ beego.Router("/xcx/api/mobile/signweight", &XcxApiController{}, "Get:GetSignsByWeight")
|
|
47
|
+
|
|
48
|
+ //获取血压纪录
|
|
49
|
+ beego.Router("/xcx/api/mobile/signblood", &XcxApiController{}, "Get:GetSignsByBlood")
|
|
50
|
+
|
38
|
51
|
//获取患者的电子病历
|
39
|
52
|
beego.Router("/xcx/api/mobile/getpatientinfo", &XcxApiController{}, "Get:GetPatientInfo")
|
40
|
53
|
|
|
@@ -56,9 +69,12 @@ func XcxApiControllersRegisterRouters() {
|
56
|
69
|
//获取数据字典数据
|
57
|
70
|
beego.Router("/xcx/api/mobile/getdataconfig", &XcxApiController{}, "Get:GetDataConfig")
|
58
|
71
|
|
59
|
|
- //检验检查
|
|
72
|
+ //检验检查列表
|
60
|
73
|
beego.Router("/xcx/api/mobile/getinspectionlist", &XcxApiController{}, "Get:GetInspectionList")
|
61
|
74
|
|
|
75
|
+ //检验检查详情
|
|
76
|
+ beego.Router("/xcx/api/mobile/getinspectioninfo", &XcxApiController{}, "Get:GetInspectionInfo")
|
|
77
|
+
|
62
|
78
|
//肾有杯
|
63
|
79
|
beego.Router("/xcx/api/mobile/getarticlist", &XcxApiController{}, "Get:GetArticList")
|
64
|
80
|
|
|
@@ -68,26 +84,108 @@ func XcxApiControllersRegisterRouters() {
|
68
|
84
|
|
69
|
85
|
//获取appid
|
70
|
86
|
beego.Router("/xcx/api/mobile/getappid", &XcxApiController{}, "Get:GetAppId")
|
|
87
|
+
|
|
88
|
+ // 获取充值当前余额信息
|
|
89
|
+ beego.Router("/xcx/api/mobile/getbalance", &XcxApiController{}, "Get:IdToBalance")
|
|
90
|
+
|
|
91
|
+ // 获取一段时间内
|
|
92
|
+ beego.Router("/xcx/api/mobile/getbalanceinfo", &XcxApiController{}, "Get:DepositFlow")
|
71
|
93
|
}
|
72
|
94
|
|
73
|
95
|
type XcxApiController struct {
|
74
|
96
|
mobile_api_controllers.MobileBaseAPIController
|
75
|
97
|
}
|
76
|
98
|
|
|
99
|
+// 根据id获取押金流水
|
|
100
|
+func (this *XcxApiController) DepositFlow() {
|
|
101
|
+ orgid, _ := this.GetInt64("org_id", 0)
|
|
102
|
+ patient_id, _ := this.GetInt64("patient_id", 0) //患者id
|
|
103
|
+ //获取当前患者的姓名
|
|
104
|
+ tmp, _ := service.GetHisUserName(orgid, patient_id)
|
|
105
|
+ name := tmp.Name
|
|
106
|
+
|
|
107
|
+ start_time := this.GetString("start_time", "") //开始时间
|
|
108
|
+ end_time := this.GetString("end_time", "") //结束时间
|
|
109
|
+ timeLayout := "2006-01-02"
|
|
110
|
+ loc, _ := time.LoadLocation("Local")
|
|
111
|
+ var stime int64 //开始时间
|
|
112
|
+ var etime int64 //结束时间
|
|
113
|
+ if start_time == "" || end_time == "" {
|
|
114
|
+ //如果为空则查全部的
|
|
115
|
+ stime, etime = service.GetMonth()
|
|
116
|
+ } else {
|
|
117
|
+ stmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
118
|
+ etmp, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
119
|
+ stime = stmp.Unix()
|
|
120
|
+ etime = etmp.Unix()
|
|
121
|
+ }
|
|
122
|
+ ////获取该角色当前时间段的余额
|
|
123
|
+ //decimal := service.GetMoneyforTime(id, orgid, etime)
|
|
124
|
+ //获取列表
|
|
125
|
+ deposirhistory, errs := service.GetFlowList(patient_id, orgid, stime, etime)
|
|
126
|
+ if errs != nil {
|
|
127
|
+ utils.ErrorLog("获取列表失败,原因为:", errs.Error())
|
|
128
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, errs.Error())
|
|
129
|
+ return
|
|
130
|
+ }
|
|
131
|
+ var expenditure, recharge decimal.Decimal
|
|
132
|
+
|
|
133
|
+ for i := 0; i < len(deposirhistory); i++ {
|
|
134
|
+ //如果为扣费,或退费 则把订单id变为就诊号
|
|
135
|
+ if deposirhistory[i].DepositStatus == 1 || deposirhistory[i].DepositStatus == 3 || deposirhistory[i].DepositStatus == 4 {
|
|
136
|
+ recharge = recharge.Add(deposirhistory[i].Deposit)
|
|
137
|
+ }
|
|
138
|
+
|
|
139
|
+ if deposirhistory[i].DepositStatus == 2 {
|
|
140
|
+ expenditure = expenditure.Add(deposirhistory[i].Deposit)
|
|
141
|
+ }
|
|
142
|
+
|
|
143
|
+ }
|
|
144
|
+
|
|
145
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
146
|
+ "list": deposirhistory,
|
|
147
|
+ "name": name,
|
|
148
|
+ "start_time": time.Unix(stime, 0).Format("2006-01-02"),
|
|
149
|
+ "end_time": time.Unix(etime, 0).Format("2006-01-02"),
|
|
150
|
+ "expenditure": expenditure,
|
|
151
|
+ "recharge": recharge,
|
|
152
|
+ })
|
|
153
|
+ return
|
|
154
|
+}
|
|
155
|
+
|
|
156
|
+// 根据患者id查询患者的余额
|
|
157
|
+func (this *XcxApiController) IdToBalance() {
|
|
158
|
+
|
|
159
|
+ orgid, _ := this.GetInt64("org_id", 0)
|
|
160
|
+ his_patient_id, _ := this.GetInt64("patient_id", 0)
|
|
161
|
+ if orgid <= 0 || his_patient_id <= 0 {
|
|
162
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
163
|
+ "error_code": 1001,
|
|
164
|
+ "error_msg": "参数错误",
|
|
165
|
+ })
|
|
166
|
+ }
|
|
167
|
+ balance := service.GetUserMoney(his_patient_id, orgid)
|
|
168
|
+ patient, _ := service.GetPatientByIdXcx(his_patient_id)
|
|
169
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
170
|
+ "balance": balance,
|
|
171
|
+ "patient": patient,
|
|
172
|
+ })
|
|
173
|
+ return
|
|
174
|
+}
|
|
175
|
+
|
77
|
176
|
func (this *XcxApiController) GetCodeInit() {
|
78
|
177
|
redisClient := service.RedisClient()
|
79
|
178
|
defer redisClient.Close()
|
80
|
179
|
req := this.Ctx.Request
|
81
|
180
|
addr := utils.GetIP(req)
|
82
|
181
|
cur_time := time.Now().Format("2006-01-02")
|
83
|
|
- _, err := redisClient.Get(redisClient.Context(),"ip:host_" + cur_time + "_" + addr).Result()
|
|
182
|
+ _, err := redisClient.Get("ip:host_" + cur_time + "_" + addr).Result()
|
84
|
183
|
if err != nil {
|
85
|
|
- redisClient.Set(redisClient.Context(),"ip:host_"+cur_time+"_"+addr, 0, time.Second*24*60*60)
|
|
184
|
+ redisClient.Set("ip:host_"+cur_time+"_"+addr, 0, time.Second*24*60*60)
|
86
|
185
|
}
|
87
|
186
|
//将客户端的ip加密传给前端,作为短信验证的密钥,来验证短信发送的IP地址
|
88
|
187
|
aespass := utils.AESEncrypt(addr)
|
89
|
188
|
|
90
|
|
- fmt.Println("hhhhhhh3223323232332", aespass)
|
91
|
189
|
this.ServeSuccessJSON(map[string]interface{}{
|
92
|
190
|
"aespass": aespass,
|
93
|
191
|
})
|
|
@@ -95,65 +193,94 @@ func (this *XcxApiController) GetCodeInit() {
|
95
|
193
|
}
|
96
|
194
|
|
97
|
195
|
func (this *XcxApiController) GetUserNameRegister() {
|
98
|
|
- name := this.GetString("name")
|
|
196
|
+ // name := this.GetString("name")
|
|
197
|
+ // relationship := this.GetString("relationship")
|
99
|
198
|
id_card_no := this.GetString("id_card_no")
|
100
|
199
|
mobile := this.GetString("mobile")
|
101
|
|
- patient, errcodes := service.GetNamePatient(name, id_card_no)
|
|
200
|
+ // code := this.GetString("code")
|
|
201
|
+ openid := this.GetString("openid")
|
|
202
|
+
|
|
203
|
+ if len(mobile) == 0 || len(openid) == 0 {
|
|
204
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
205
|
+ return
|
|
206
|
+ }
|
|
207
|
+
|
|
208
|
+ // redisClient := service.RedisClient()
|
|
209
|
+ // defer redisClient.Close()
|
|
210
|
+ // cache_code, _ := redisClient.Get("code_msg_" + mobile).Result()
|
|
211
|
+ // utils.TraceLog("cache_code:%v code:%v", cache_code, code)
|
|
212
|
+ // if cache_code != code {
|
|
213
|
+ // this.ServeSuccessJSON(map[string]interface{}{
|
|
214
|
+ // "err_code": "1001",
|
|
215
|
+ // "err_msg": "验证码错误",
|
|
216
|
+ // })
|
|
217
|
+ // return
|
|
218
|
+ // }
|
|
219
|
+
|
|
220
|
+ // this.Ctx.SetCookie("mobile", mobile)
|
|
221
|
+ // // 注册成功后验证码就要使其失效
|
|
222
|
+ // redisClient.Del("code_msg_" + mobile)
|
|
223
|
+
|
|
224
|
+ patient, errcodes := service.GetPatientByIdcardno(id_card_no)
|
102
|
225
|
if errcodes == nil {
|
103
|
226
|
role := models.XcxAdminUserRole{
|
104
|
|
- PatientName: name,
|
105
|
|
- IdCardNo: id_card_no,
|
106
|
|
- Mobile: mobile,
|
107
|
|
- Code: "000000",
|
108
|
|
- PatientId: patient.ID,
|
109
|
|
- UserOrgId: patient.UserOrgId,
|
110
|
|
- Status: 1,
|
111
|
|
- Ctime: time.Now().Unix(),
|
112
|
|
- Mtime: 0,
|
113
|
|
- Appid: "",
|
114
|
|
- Appsecret: "",
|
115
|
|
- SessionKey: "",
|
|
227
|
+ PatientName: patient.Name,
|
|
228
|
+ // Relationship: relationship,
|
|
229
|
+ IdCardNo: id_card_no,
|
|
230
|
+ Mobile: mobile,
|
|
231
|
+ // Code: code,
|
|
232
|
+ PatientId: patient.ID,
|
|
233
|
+ UserOrgId: patient.UserOrgId,
|
|
234
|
+ Status: 1,
|
|
235
|
+ Ctime: time.Now().Unix(),
|
|
236
|
+ Mtime: 0,
|
|
237
|
+ Appid: "",
|
|
238
|
+ Appsecret: "",
|
|
239
|
+ SessionKey: "",
|
|
240
|
+ Openid: openid,
|
116
|
241
|
}
|
117
|
242
|
err := service.CreateXcxAdminUser(role)
|
118
|
243
|
if err == nil {
|
119
|
|
- mobilePatient, _ := service.GetNamePatient(name, id_card_no)
|
120
|
|
- template_id, _ := service.GetTemplateMode(mobilePatient.UserOrgId)
|
121
|
|
- //处方
|
122
|
|
- prescripition_config, _ := service.GetPrescripionFieldConfig(mobilePatient.UserOrgId)
|
123
|
|
-
|
124
|
|
- //接诊评估
|
125
|
|
- receive_treatement_config, _ := service.GetReceiveTreatmentAssess(mobilePatient.UserOrgId)
|
126
|
|
-
|
127
|
|
- //透前评估
|
128
|
|
- dialysis_befor, _ := service.GetDialysisBefor(mobilePatient.UserOrgId)
|
129
|
|
-
|
130
|
|
- //透析上机
|
131
|
|
- dialysis_order, _ := service.GetDialysisOrderConfig(mobilePatient.UserOrgId)
|
132
|
|
-
|
133
|
|
- //透析监测
|
134
|
|
- monitor_record, _ := service.GetMonitorRecordConfig(mobilePatient.UserOrgId)
|
135
|
|
-
|
136
|
|
- //透后评估
|
137
|
|
- dialysis_after, _ := service.GetDialysisAfeterConfig(mobilePatient.UserOrgId)
|
138
|
|
-
|
139
|
|
- treate_ment, _ := service.GetTreatMentConfig(mobilePatient.UserOrgId)
|
140
|
|
- var configList interface{}
|
141
|
|
- configList, _ = service.GetConfigList(mobilePatient.UserOrgId)
|
|
244
|
+ //mobilePatient, _ := service.GetNamePatient(name, id_card_no)
|
|
245
|
+ //template_id, _ := service.GetTemplateMode(mobilePatient.UserOrgId)
|
|
246
|
+ ////处方
|
|
247
|
+ //prescripition_config, _ := service.GetPrescripionFieldConfig(mobilePatient.UserOrgId)
|
|
248
|
+ //
|
|
249
|
+ ////接诊评估
|
|
250
|
+ //receive_treatement_config, _ := service.GetReceiveTreatmentAssess(mobilePatient.UserOrgId)
|
|
251
|
+ //
|
|
252
|
+ ////透前评估
|
|
253
|
+ //dialysis_befor, _ := service.GetDialysisBefor(mobilePatient.UserOrgId)
|
|
254
|
+ //
|
|
255
|
+ ////透析上机
|
|
256
|
+ //dialysis_order, _ := service.GetDialysisOrderConfig(mobilePatient.UserOrgId)
|
|
257
|
+ //
|
|
258
|
+ ////透析监测
|
|
259
|
+ //monitor_record, _ := service.GetMonitorRecordConfig(mobilePatient.UserOrgId)
|
|
260
|
+ //
|
|
261
|
+ ////透后评估
|
|
262
|
+ //dialysis_after, _ := service.GetDialysisAfeterConfig(mobilePatient.UserOrgId)
|
|
263
|
+ //
|
|
264
|
+ //treate_ment, _ := service.GetTreatMentConfig(mobilePatient.UserOrgId)
|
|
265
|
+ //var configList interface{}
|
|
266
|
+ //configList, _ = service.GetConfigList(mobilePatient.UserOrgId)
|
142
|
267
|
this.ServeSuccessJSON(map[string]interface{}{
|
143
|
|
- "role": role,
|
144
|
|
- "is_bind": true,
|
145
|
|
- "patient": mobilePatient,
|
146
|
|
- "template_id": template_id,
|
147
|
|
- "user_org_id": mobilePatient.UserOrgId,
|
148
|
|
- "prescripition_config": prescripition_config,
|
149
|
|
- "receive_treatement_config": receive_treatement_config,
|
150
|
|
- "dialysis_befor": dialysis_befor,
|
151
|
|
- "dialysis_order": dialysis_order,
|
152
|
|
- "monitor_record": monitor_record,
|
153
|
|
- "dialysis_after": dialysis_after,
|
154
|
|
- "treate_ment": treate_ment,
|
155
|
|
- "configList": configList,
|
156
|
|
- "result": false,
|
|
268
|
+ "role": role,
|
|
269
|
+ "is_bind": true,
|
|
270
|
+ "err_code": "0",
|
|
271
|
+ "err_msg": "",
|
|
272
|
+ //"patient": mobilePatient,
|
|
273
|
+ //"template_id": template_id,
|
|
274
|
+ "user_org_id": patient.UserOrgId,
|
|
275
|
+ //"prescripition_config": prescripition_config,
|
|
276
|
+ //"receive_treatement_config": receive_treatement_config,
|
|
277
|
+ //"dialysis_befor": dialysis_befor,
|
|
278
|
+ //"dialysis_order": dialysis_order,
|
|
279
|
+ //"monitor_record": monitor_record,
|
|
280
|
+ //"dialysis_after": dialysis_after,
|
|
281
|
+ //"treate_ment": treate_ment,
|
|
282
|
+ //"configList": configList,
|
|
283
|
+ //"result": false,
|
157
|
284
|
})
|
158
|
285
|
} else {
|
159
|
286
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -165,7 +292,7 @@ func (this *XcxApiController) GetUserNameRegister() {
|
165
|
292
|
} else {
|
166
|
293
|
this.ServeSuccessJSON(map[string]interface{}{
|
167
|
294
|
"is_bind": false,
|
168
|
|
- "msg": "绑定失败",
|
|
295
|
+ "msg": "绑定失败,没有对应的患者信息",
|
169
|
296
|
"result": false,
|
170
|
297
|
})
|
171
|
298
|
}
|
|
@@ -307,7 +434,7 @@ func (this *XcxApiController) GetUserRegister() {
|
307
|
434
|
} else {
|
308
|
435
|
redisClient := service.RedisClient()
|
309
|
436
|
defer redisClient.Close()
|
310
|
|
- cache_code, _ := redisClient.Get(redisClient.Context(),"code_msg_" + mobile).Result()
|
|
437
|
+ cache_code, _ := redisClient.Get("code_msg_" + mobile).Result()
|
311
|
438
|
fmt.Println("cache_code9999999293323232322323", cache_code)
|
312
|
439
|
if cache_code != code {
|
313
|
440
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -317,7 +444,7 @@ func (this *XcxApiController) GetUserRegister() {
|
317
|
444
|
} else {
|
318
|
445
|
this.Ctx.SetCookie("mobile", mobile)
|
319
|
446
|
// 注册成功后验证码就要使其失效
|
320
|
|
- redisClient.Del(redisClient.Context(),"code_msg_" + mobile)
|
|
447
|
+ redisClient.Del("code_msg_" + mobile)
|
321
|
448
|
patient, errcodes := service.GetMobilePatient(mobile, id_card_no)
|
322
|
449
|
fmt.Println("errcodes2323232232", errcodes)
|
323
|
450
|
if errcodes == nil {
|
|
@@ -445,7 +572,9 @@ func (this *XcxApiController) GetCodeInfo() {
|
445
|
572
|
|
446
|
573
|
mobile := this.GetString("phone")
|
447
|
574
|
aespass := this.GetString("aespass")
|
|
575
|
+
|
448
|
576
|
utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
|
|
577
|
+
|
449
|
578
|
if utils.CellPhoneRegexp().MatchString(mobile) == false {
|
450
|
579
|
this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
|
451
|
580
|
this.ServeJSON()
|
|
@@ -466,91 +595,50 @@ func (this *XcxApiController) GetCodeInfo() {
|
466
|
595
|
})
|
467
|
596
|
}
|
468
|
597
|
|
469
|
|
-func (this *XcxApiController) GetLoginInfor() {
|
|
598
|
+func (this *XcxApiController) GetLoginInfoByOpenid() {
|
|
599
|
+ openid := this.GetString("openid")
|
|
600
|
+ user_admin, errcodes := service.GetXcxOpneidInformation(openid)
|
|
601
|
+ if errcodes == gorm.ErrRecordNotFound {
|
|
602
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
603
|
+ "patient": "",
|
|
604
|
+ "patient_id": 0,
|
|
605
|
+ "user_org_id": 0,
|
|
606
|
+ "role": user_admin,
|
|
607
|
+ "is_bind": false,
|
|
608
|
+ })
|
|
609
|
+ } else if errcodes == nil {
|
|
610
|
+ info, _ := service.GetPatientListByPatientId(user_admin.PatientId)
|
|
611
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
612
|
+ "patient": info,
|
|
613
|
+ "role": user_admin,
|
|
614
|
+ "is_bind": true,
|
|
615
|
+ "user_org_id": info.UserOrgId,
|
|
616
|
+ "patient_id": user_admin.PatientId,
|
|
617
|
+ })
|
|
618
|
+ }
|
|
619
|
+}
|
470
|
620
|
|
|
621
|
+func (this *XcxApiController) GetLoginInfor() {
|
471
|
622
|
mobile := this.GetString("mobile")
|
472
|
|
- fmt.Println(mobile)
|
473
|
623
|
user_admin, errcodes := service.GetXcxMobileInformation(mobile)
|
474
|
624
|
if errcodes == gorm.ErrRecordNotFound {
|
475
|
|
- info, _ := service.GetMobilePatientInfo(mobile)
|
476
|
|
- template_id, _ := service.GetTemplateMode(info.UserOrgId)
|
477
|
|
- //处方
|
478
|
|
- prescripition_config, _ := service.GetPrescripionFieldConfig(info.UserOrgId)
|
479
|
|
-
|
480
|
|
- //接诊评估
|
481
|
|
- receive_treatement_config, _ := service.GetReceiveTreatmentAssess(info.UserOrgId)
|
482
|
|
-
|
483
|
|
- //透前评估
|
484
|
|
- dialysis_befor, _ := service.GetDialysisBefor(info.UserOrgId)
|
485
|
|
-
|
486
|
|
- //透析上机
|
487
|
|
- dialysis_order, _ := service.GetDialysisOrderConfig(info.UserOrgId)
|
488
|
|
-
|
489
|
|
- //透析监测
|
490
|
|
- monitor_record, _ := service.GetMonitorRecordConfig(info.UserOrgId)
|
491
|
|
-
|
492
|
|
- //透后评估
|
493
|
|
- dialysis_after, _ := service.GetDialysisAfeterConfig(info.UserOrgId)
|
494
|
|
-
|
495
|
|
- treate_ment, _ := service.GetTreatMentConfig(info.UserOrgId)
|
496
|
|
- var configList interface{}
|
497
|
|
- configList, _ = service.GetConfigList(info.UserOrgId)
|
498
|
625
|
this.ServeSuccessJSON(map[string]interface{}{
|
499
|
|
- "patient": info,
|
500
|
|
- "template_id": template_id,
|
501
|
|
- "user_org_id": info.UserOrgId,
|
502
|
|
- "prescripition_config": prescripition_config,
|
503
|
|
- "receive_treatement_config": receive_treatement_config,
|
504
|
|
- "dialysis_befor": dialysis_befor,
|
505
|
|
- "dialysis_order": dialysis_order,
|
506
|
|
- "monitor_record": monitor_record,
|
507
|
|
- "dialysis_after": dialysis_after,
|
508
|
|
- "treate_ment": treate_ment,
|
509
|
|
- "role": user_admin,
|
510
|
|
- "is_bind": false,
|
511
|
|
- "list": configList,
|
|
626
|
+ "patient": "",
|
|
627
|
+ "patient_id": 0,
|
|
628
|
+ "user_org_id": 0,
|
|
629
|
+ "role": user_admin,
|
|
630
|
+ "is_bind": false,
|
512
|
631
|
})
|
513
|
632
|
} else if errcodes == nil {
|
514
|
633
|
info, _ := service.GetPatientListByPatientId(user_admin.PatientId)
|
515
|
|
- template_id, _ := service.GetTemplateMode(info.UserOrgId)
|
516
|
|
- //处方
|
517
|
|
- prescripition_config, _ := service.GetPrescripionFieldConfig(info.UserOrgId)
|
518
|
|
-
|
519
|
|
- //接诊评估
|
520
|
|
- receive_treatement_config, _ := service.GetReceiveTreatmentAssess(info.UserOrgId)
|
521
|
|
-
|
522
|
|
- //透前评估
|
523
|
|
- dialysis_befor, _ := service.GetDialysisBefor(info.UserOrgId)
|
524
|
|
-
|
525
|
|
- //透析上机
|
526
|
|
- dialysis_order, _ := service.GetDialysisOrderConfig(info.UserOrgId)
|
527
|
|
-
|
528
|
|
- //透析监测
|
529
|
|
- monitor_record, _ := service.GetMonitorRecordConfig(info.UserOrgId)
|
530
|
|
-
|
531
|
|
- //透后评估
|
532
|
|
- dialysis_after, _ := service.GetDialysisAfeterConfig(info.UserOrgId)
|
533
|
|
-
|
534
|
|
- treate_ment, _ := service.GetTreatMentConfig(info.UserOrgId)
|
535
|
|
- var configList interface{}
|
536
|
|
- configList, _ = service.GetConfigList(info.UserOrgId)
|
537
|
634
|
this.ServeSuccessJSON(map[string]interface{}{
|
538
|
|
- "patient": info,
|
539
|
|
- "role": user_admin,
|
540
|
|
- "is_bind": true,
|
541
|
|
- "template_id": template_id,
|
542
|
|
- "user_org_id": info.UserOrgId,
|
543
|
|
- "prescripition_config": prescripition_config,
|
544
|
|
- "receive_treatement_config": receive_treatement_config,
|
545
|
|
- "dialysis_befor": dialysis_befor,
|
546
|
|
- "dialysis_order": dialysis_order,
|
547
|
|
- "monitor_record": monitor_record,
|
548
|
|
- "dialysis_after": dialysis_after,
|
549
|
|
- "treate_ment": treate_ment,
|
550
|
|
- "list": configList,
|
|
635
|
+ "patient": info,
|
|
636
|
+ "role": user_admin,
|
|
637
|
+ "is_bind": true,
|
|
638
|
+ "user_org_id": info.UserOrgId,
|
|
639
|
+ "patient_id": user_admin.PatientId,
|
551
|
640
|
})
|
552
|
641
|
}
|
553
|
|
-
|
554
|
642
|
}
|
555
|
643
|
|
556
|
644
|
func (this *XcxApiController) GetPatientList() {
|
|
@@ -592,7 +680,217 @@ func (this *XcxApiController) GetDataInfo() {
|
592
|
680
|
})
|
593
|
681
|
}
|
594
|
682
|
|
|
683
|
+func (this *XcxApiController) GetSignsByBlood() {
|
|
684
|
+ start := this.GetString("start", "")
|
|
685
|
+ end := this.GetString("end", "")
|
|
686
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
687
|
+ org_id, _ := this.GetInt64("org_id", 0)
|
|
688
|
+
|
|
689
|
+ if len(start) <= 0 || len(end) <= 0 || patient_id <= 0 || org_id <= 0 {
|
|
690
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
691
|
+ "err_code": 1001,
|
|
692
|
+ "err_msg": "缺少参数",
|
|
693
|
+ "data": "",
|
|
694
|
+ })
|
|
695
|
+ }
|
|
696
|
+ loc, _ := time.LoadLocation("Local")
|
|
697
|
+ startTime, _ := time.ParseInLocation("2006-01-02", start, loc)
|
|
698
|
+ startTimeUnix := startTime.Unix()
|
|
699
|
+ endTime, _ := time.ParseInLocation("2006-01-02", end, loc)
|
|
700
|
+ endTimeUinx := endTime.Unix()
|
|
701
|
+
|
|
702
|
+ utils.TraceLog("startTime:%v endTime:%v", startTime, endTime)
|
|
703
|
+ utils.TraceLog("startTimeUnix:%v endTimeUinx:%v", startTimeUnix, endTimeUinx)
|
|
704
|
+ if startTimeUnix < 0 || endTimeUinx < 0 {
|
|
705
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
706
|
+ "err_code": 1001,
|
|
707
|
+ "err_msg": "时间超出范围",
|
|
708
|
+ "data": "",
|
|
709
|
+ })
|
|
710
|
+ }
|
|
711
|
+ if startTimeUnix > endTimeUinx {
|
|
712
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
713
|
+ "err_code": 1001,
|
|
714
|
+ "err_msg": "开始时间大于结束时间",
|
|
715
|
+ "data": "",
|
|
716
|
+ })
|
|
717
|
+ }
|
|
718
|
+
|
|
719
|
+ if endTimeUinx-startTimeUnix > 60*60*24*60 {
|
|
720
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
721
|
+ "err_code": 1001,
|
|
722
|
+ "err_msg": "时间范围超过60天",
|
|
723
|
+ "data": "",
|
|
724
|
+ })
|
|
725
|
+ }
|
|
726
|
+
|
|
727
|
+ beforeblood, _ := service.GetSignsByBlood(org_id, startTimeUnix, endTimeUinx, patient_id)
|
|
728
|
+ afterblood, _ := service.GetSignsByAfterBlood(org_id, startTimeUnix, endTimeUinx, patient_id)
|
|
729
|
+
|
|
730
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
731
|
+ "err_code": 0,
|
|
732
|
+ "err_msg": "",
|
|
733
|
+ "before_blood": beforeblood,
|
|
734
|
+ "after_blood": afterblood,
|
|
735
|
+ })
|
|
736
|
+
|
|
737
|
+ //now := time.Now()
|
|
738
|
+ //offset := int(time.Monday - now.Weekday())
|
|
739
|
+ //if offset > 0 {
|
|
740
|
+ // offset = -6
|
|
741
|
+ //}
|
|
742
|
+ //monday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset)
|
|
743
|
+ //endday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset+6)
|
|
744
|
+ //startTime := monday.Unix()
|
|
745
|
+ //endTime := endday.Unix()
|
|
746
|
+ //
|
|
747
|
+ //this.ServeSuccessJSON(map[string]interface{}{
|
|
748
|
+ // "monday": startTime,
|
|
749
|
+ // "endday": endTime,
|
|
750
|
+ //})
|
|
751
|
+}
|
|
752
|
+
|
|
753
|
+func (this *XcxApiController) GetSignsByWeight() {
|
|
754
|
+ start := this.GetString("start", "")
|
|
755
|
+ end := this.GetString("end", "")
|
|
756
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
757
|
+ org_id, _ := this.GetInt64("org_id", 0)
|
|
758
|
+
|
|
759
|
+ if len(start) <= 0 || len(end) <= 0 || patient_id <= 0 || org_id <= 0 {
|
|
760
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
761
|
+ "err_code": 1001,
|
|
762
|
+ "err_msg": "缺少参数",
|
|
763
|
+ "data": "",
|
|
764
|
+ })
|
|
765
|
+ }
|
|
766
|
+ loc, _ := time.LoadLocation("Local")
|
|
767
|
+ startTime, _ := time.ParseInLocation("2006-01-02", start, loc)
|
|
768
|
+ startTimeUnix := startTime.Unix()
|
|
769
|
+ endTime, _ := time.ParseInLocation("2006-01-02", end, loc)
|
|
770
|
+ endTimeUinx := endTime.Unix()
|
|
771
|
+
|
|
772
|
+ utils.TraceLog("startTime:%v endTime:%v", startTime, endTime)
|
|
773
|
+ utils.TraceLog("startTimeUnix:%v endTimeUinx:%v", startTimeUnix, endTimeUinx)
|
|
774
|
+ if startTimeUnix < 0 || endTimeUinx < 0 {
|
|
775
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
776
|
+ "err_code": 1001,
|
|
777
|
+ "err_msg": "时间超出范围",
|
|
778
|
+ "data": "",
|
|
779
|
+ })
|
|
780
|
+ }
|
|
781
|
+ if startTimeUnix > endTimeUinx {
|
|
782
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
783
|
+ "err_code": 1001,
|
|
784
|
+ "err_msg": "开始时间大于结束时间",
|
|
785
|
+ "data": "",
|
|
786
|
+ })
|
|
787
|
+ }
|
|
788
|
+
|
|
789
|
+ if endTimeUinx-startTimeUnix > 60*60*24*60 {
|
|
790
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
791
|
+ "err_code": 1001,
|
|
792
|
+ "err_msg": "时间范围超过60天",
|
|
793
|
+ "data": "",
|
|
794
|
+ })
|
|
795
|
+ }
|
|
796
|
+
|
|
797
|
+ beforeweight, _ := service.GetSignsByWeight(org_id, startTimeUnix, endTimeUinx, patient_id)
|
|
798
|
+ dryweight, _ := service.GetSignsByDryWeight(org_id, startTimeUnix, endTimeUinx, patient_id)
|
|
799
|
+ afterweight, _ := service.GetSignsByAfterWeight(org_id, startTimeUnix, endTimeUinx, patient_id)
|
|
800
|
+
|
|
801
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
802
|
+ "err_code": 0,
|
|
803
|
+ "err_msg": "",
|
|
804
|
+ "before_eweight": beforeweight,
|
|
805
|
+ "dry_eweight": dryweight,
|
|
806
|
+ "after_eweight": afterweight,
|
|
807
|
+ })
|
|
808
|
+
|
|
809
|
+ //now := time.Now()
|
|
810
|
+ //offset := int(time.Monday - now.Weekday())
|
|
811
|
+ //if offset > 0 {
|
|
812
|
+ // offset = -6
|
|
813
|
+ //}
|
|
814
|
+ //monday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset)
|
|
815
|
+ //endday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset+6)
|
|
816
|
+ //startTime := monday.Unix()
|
|
817
|
+ //endTime := endday.Unix()
|
|
818
|
+ //
|
|
819
|
+ //this.ServeSuccessJSON(map[string]interface{}{
|
|
820
|
+ // "monday": startTime,
|
|
821
|
+ // "endday": endTime,
|
|
822
|
+ //})
|
|
823
|
+}
|
|
824
|
+
|
|
825
|
+func (this *XcxApiController) GetSchedulesByWeek() {
|
|
826
|
+ start := this.GetString("start", "")
|
|
827
|
+ end := this.GetString("end", "")
|
|
828
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
829
|
+ org_id, _ := this.GetInt64("org_id", 0)
|
|
830
|
+
|
|
831
|
+ if len(start) <= 0 || len(end) <= 0 || patient_id <= 0 || org_id <= 0 {
|
|
832
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
833
|
+ "err_code": 1001,
|
|
834
|
+ "err_msg": "缺少参数",
|
|
835
|
+ "data": "",
|
|
836
|
+ })
|
|
837
|
+ }
|
|
838
|
+ loc, _ := time.LoadLocation("Local")
|
|
839
|
+ startTime, _ := time.ParseInLocation("2006-01-02", start, loc)
|
|
840
|
+ startTimeUnix := startTime.Unix()
|
|
841
|
+ endTime, _ := time.ParseInLocation("2006-01-02", end, loc)
|
|
842
|
+ endTimeUinx := endTime.Unix()
|
|
843
|
+
|
|
844
|
+ utils.TraceLog("startTime:%v endTime:%v", startTime, endTime)
|
|
845
|
+ utils.TraceLog("startTimeUnix:%v endTimeUinx:%v", startTimeUnix, endTimeUinx)
|
|
846
|
+ if startTimeUnix < 0 || endTimeUinx < 0 {
|
|
847
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
848
|
+ "err_code": 1001,
|
|
849
|
+ "err_msg": "时间超出范围",
|
|
850
|
+ "data": "",
|
|
851
|
+ })
|
|
852
|
+ }
|
|
853
|
+ if startTimeUnix > endTimeUinx {
|
|
854
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
855
|
+ "err_code": 1001,
|
|
856
|
+ "err_msg": "开始时间大于结束时间",
|
|
857
|
+ "data": "",
|
|
858
|
+ })
|
|
859
|
+ }
|
|
860
|
+
|
|
861
|
+ if endTimeUinx-startTimeUnix > 60*60*24*60 {
|
|
862
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
863
|
+ "err_code": 1001,
|
|
864
|
+ "err_msg": "时间范围超过60天",
|
|
865
|
+ "data": "",
|
|
866
|
+ })
|
|
867
|
+ }
|
|
868
|
+
|
|
869
|
+ schedule, _ := service.GetScheduleByXcx(org_id, startTimeUnix, endTimeUinx, patient_id)
|
|
870
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
871
|
+ "err_code": 0,
|
|
872
|
+ "err_msg": "",
|
|
873
|
+ "data": schedule,
|
|
874
|
+ })
|
|
875
|
+
|
|
876
|
+ //now := time.Now()
|
|
877
|
+ //offset := int(time.Monday - now.Weekday())
|
|
878
|
+ //if offset > 0 {
|
|
879
|
+ // offset = -6
|
|
880
|
+ //}
|
|
881
|
+ //monday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset)
|
|
882
|
+ //endday := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset+6)
|
|
883
|
+ //startTime := monday.Unix()
|
|
884
|
+ //endTime := endday.Unix()
|
|
885
|
+ //
|
|
886
|
+ //this.ServeSuccessJSON(map[string]interface{}{
|
|
887
|
+ // "monday": startTime,
|
|
888
|
+ // "endday": endTime,
|
|
889
|
+ //})
|
|
890
|
+}
|
|
891
|
+
|
595
|
892
|
func (this *XcxApiController) GetScheduleInfo() {
|
|
893
|
+
|
596
|
894
|
patient_id, _ := this.GetInt64("patient_id")
|
597
|
895
|
fmt.Println(patient_id)
|
598
|
896
|
thisWeekMonday := service.GetFirstDateOfWeek()
|
|
@@ -633,7 +931,7 @@ func (this *XcxApiController) GetScheduleInfo() {
|
633
|
931
|
return
|
634
|
932
|
}
|
635
|
933
|
|
636
|
|
- var one = startTime.Unix() + 86400
|
|
934
|
+ var one = startTime.Unix()
|
637
|
935
|
fmt.Println("one2322332", one)
|
638
|
936
|
var two = one + 86400
|
639
|
937
|
var three = two + 86400
|
|
@@ -658,7 +956,6 @@ func (this *XcxApiController) GetScheduleInfo() {
|
658
|
956
|
var lastsix = lastfive + 86400
|
659
|
957
|
var lastseven = lastsix + 86400
|
660
|
958
|
|
661
|
|
- fmt.Println("各地好当家232332323232", lastseven)
|
662
|
959
|
array := []interface{}{
|
663
|
960
|
map[string]string{"schedule_type": "1", "schedule_date": strconv.FormatInt(one, 10), "schedule_week": "1", "mode_id": "", "name": ""},
|
664
|
961
|
map[string]string{"schedule_type": "2", "schedule_date": strconv.FormatInt(one, 10), "schedule_week": "1", "mode_id": "", "name": ""},
|
|
@@ -738,18 +1035,14 @@ func (this *XcxApiController) GetScheduleInfo() {
|
738
|
1035
|
func (this *XcxApiController) GetMobileSchedule() {
|
739
|
1036
|
|
740
|
1037
|
patientID, _ := this.GetInt64("patient_id")
|
741
|
|
- fmt.Println("1", patientID)
|
742
|
1038
|
info, _ := service.GetXcxPatientInfo(patientID)
|
743
|
1039
|
timeLayout := "2006-01-02"
|
744
|
1040
|
loc, _ := time.LoadLocation("Local")
|
745
|
1041
|
time_now := time.Now().Format("2006-01-02")
|
746
|
1042
|
timeNowUnix, _ := time.ParseInLocation(timeLayout+"15:04:05", time_now+"00:00:00", loc)
|
747
|
|
-
|
748
|
|
- fmt.Println("timeNowUnix", timeNowUnix.Unix())
|
749
|
1043
|
//获取该患者最后一次排班
|
750
|
1044
|
list, _ := service.GetLastScheduleListOne(patientID, timeNowUnix.Unix())
|
751
|
|
- fmt.Println("hh2332323232323223", list)
|
752
|
|
- fmt.Println("list233232232332", list.ScheduleDate)
|
|
1045
|
+
|
753
|
1046
|
patient, getPatientErr := service.MobileGetPatientDetail(info.UserOrgId, patientID)
|
754
|
1047
|
if getPatientErr != nil {
|
755
|
1048
|
this.ErrorLog("获取患者信息失败:%v", getPatientErr)
|
|
@@ -968,9 +1261,9 @@ func (this *XcxApiController) GetDoctorAdvice() {
|
968
|
1261
|
startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
969
|
1262
|
endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
970
|
1263
|
info, _ := service.GetXcxPatientInfo(patient_id)
|
971
|
|
- config, _ := service.GetDoctorAdviceConfig(info.UserOrgId)
|
972
|
|
- fmt.Println(startTime, endTime, config.IsOpenRemind)
|
973
|
|
- if config.IsOpenRemind == 0 || config.IsOpenRemind == 2 {
|
|
1264
|
+ _, config := service.FindXTHisRecordByOrgId(info.UserOrgId)
|
|
1265
|
+ fmt.Println(startTime, endTime, config.IsOpen)
|
|
1266
|
+ if config.IsOpen == 0 {
|
974
|
1267
|
list, _ := service.GetDoctorAdviceGroup(patient_id, startTime.Unix(), endTime.Unix())
|
975
|
1268
|
advice, _ := service.GetDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())
|
976
|
1269
|
for _, item := range list {
|
|
@@ -986,7 +1279,7 @@ func (this *XcxApiController) GetDoctorAdvice() {
|
986
|
1279
|
})
|
987
|
1280
|
}
|
988
|
1281
|
|
989
|
|
- if config.IsOpenRemind == 1 {
|
|
1282
|
+ if config.IsOpen == 1 {
|
990
|
1283
|
list, _ := service.GetHisDoctorAdviceGroup(patient_id, startTime.Unix(), endTime.Unix())
|
991
|
1284
|
advice, _ := service.GetHisDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())
|
992
|
1285
|
for _, item := range list {
|
|
@@ -1064,27 +1357,46 @@ func (this *XcxApiController) GetDataConfig() {
|
1064
|
1357
|
|
1065
|
1358
|
func (this *XcxApiController) GetInspectionList() {
|
1066
|
1359
|
|
1067
|
|
- start_time := this.GetString("start_time")
|
1068
|
|
- end_time := this.GetString("end_time")
|
1069
|
|
- patient_id, _ := this.GetInt64("patient_id")
|
1070
|
|
- fmt.Println("patient_id", patient_id)
|
1071
|
|
- timeLayout := "2006-01-02"
|
1072
|
|
- loc, _ := time.LoadLocation("Local")
|
1073
|
|
- startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
1074
|
|
- endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
1360
|
+ page, _ := this.GetInt64("page", 0)
|
|
1361
|
+ number, _ := this.GetInt64("number", 10)
|
|
1362
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
1363
|
+ //fmt.Println("patient_id", patient_id)
|
|
1364
|
+ //timeLayout := "2006-01-02"
|
|
1365
|
+ //loc, _ := time.LoadLocation("Local")
|
|
1366
|
+ //startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
1367
|
+ //endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
1368
|
+
|
|
1369
|
+ list, err := service.GetInspectionGroupListByXcx(patient_id, page, number)
|
|
1370
|
+
|
|
1371
|
+ if err == gorm.ErrRecordNotFound {
|
|
1372
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1373
|
+ "error_code": "1001",
|
|
1374
|
+ "error_msg": "没有更多数据",
|
|
1375
|
+ })
|
|
1376
|
+ }
|
1075
|
1377
|
|
1076
|
|
- list, _ := service.GetInspectionGroupList(patient_id, startTime.Unix(), endTime.Unix())
|
|
1378
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1379
|
+ "error_code": "0",
|
|
1380
|
+ "error_msg": "",
|
|
1381
|
+ "list": list,
|
|
1382
|
+ })
|
|
1383
|
+}
|
1077
|
1384
|
|
1078
|
|
- insepctionList, _ := service.GetInsepctionList(patient_id, startTime.Unix(), endTime.Unix())
|
|
1385
|
+func (this *XcxApiController) GetInspectionInfo() {
|
1079
|
1386
|
|
1080
|
|
- for _, item := range list {
|
1081
|
|
- for _, it := range insepctionList {
|
1082
|
|
- if item.ProjectId == it.ProjectId && item.InspectDate == it.InspectDate {
|
1083
|
|
- item.Childs = append(item.Childs, it)
|
1084
|
|
- }
|
1085
|
|
- }
|
|
1387
|
+ project_id, _ := this.GetInt64("project_id", 0)
|
|
1388
|
+ inspect_date, _ := this.GetInt64("inspect_date", 0)
|
|
1389
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
1390
|
+
|
|
1391
|
+ if project_id <= 0 || inspect_date <= 0 || patient_id <= 0 {
|
|
1392
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1393
|
+ "error_code": 1001,
|
|
1394
|
+ "error_msg": "缺少参数",
|
|
1395
|
+ })
|
1086
|
1396
|
}
|
1087
|
1397
|
|
|
1398
|
+ list, _ := service.GetInspectionInfoByXcx(patient_id, project_id, inspect_date)
|
|
1399
|
+
|
1088
|
1400
|
this.ServeSuccessJSON(map[string]interface{}{
|
1089
|
1401
|
"list": list,
|
1090
|
1402
|
})
|