|
@@ -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
|
|
- beego.Router("/xcx/api/mobile/register", &XcxApiController{}, "Get:GetUserRegister")
|
23
|
|
- //登录
|
|
23
|
+ beego.Router("/xcx/api/mobile/register", &XcxApiController{}, "Get:GetUserNameRegister")
|
|
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,21 +69,110 @@ 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
|
|
65
|
81
|
beego.Router("/xcx/api/mobile/getarticlistdetail", &XcxApiController{}, "Get:GetArticListDetail")
|
66
|
82
|
|
67
|
83
|
beego.Router("/xcx/api/mobile/getstoryscore", &XcxApiController{}, "Get:GetStoryScoreList")
|
|
84
|
+
|
|
85
|
+ //获取appid
|
|
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")
|
68
|
93
|
}
|
69
|
94
|
|
70
|
95
|
type XcxApiController struct {
|
71
|
96
|
mobile_api_controllers.MobileBaseAPIController
|
72
|
97
|
}
|
73
|
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
|
+
|
74
|
176
|
func (this *XcxApiController) GetCodeInit() {
|
75
|
177
|
redisClient := service.RedisClient()
|
76
|
178
|
defer redisClient.Close()
|
|
@@ -84,13 +186,118 @@ func (this *XcxApiController) GetCodeInit() {
|
84
|
186
|
//将客户端的ip加密传给前端,作为短信验证的密钥,来验证短信发送的IP地址
|
85
|
187
|
aespass := utils.AESEncrypt(addr)
|
86
|
188
|
|
87
|
|
- fmt.Println("hhhhhhh3223323232332", aespass)
|
88
|
189
|
this.ServeSuccessJSON(map[string]interface{}{
|
89
|
190
|
"aespass": aespass,
|
90
|
191
|
})
|
91
|
192
|
|
92
|
193
|
}
|
93
|
194
|
|
|
195
|
+func (this *XcxApiController) GetUserNameRegister() {
|
|
196
|
+ // name := this.GetString("name")
|
|
197
|
+ // relationship := this.GetString("relationship")
|
|
198
|
+ id_card_no := this.GetString("id_card_no")
|
|
199
|
+ mobile := this.GetString("mobile")
|
|
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)
|
|
225
|
+ if errcodes == nil {
|
|
226
|
+ role := models.XcxAdminUserRole{
|
|
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,
|
|
241
|
+ }
|
|
242
|
+ err := service.CreateXcxAdminUser(role)
|
|
243
|
+ if err == nil {
|
|
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)
|
|
267
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
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,
|
|
284
|
+ })
|
|
285
|
+ } else {
|
|
286
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
287
|
+ "is_bind": false,
|
|
288
|
+ "msg": "绑定失败",
|
|
289
|
+ "result": false,
|
|
290
|
+ })
|
|
291
|
+ }
|
|
292
|
+ } else {
|
|
293
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
294
|
+ "is_bind": false,
|
|
295
|
+ "msg": "绑定失败,没有对应的患者信息",
|
|
296
|
+ "result": false,
|
|
297
|
+ })
|
|
298
|
+ }
|
|
299
|
+}
|
|
300
|
+
|
94
|
301
|
func (this *XcxApiController) GetUserRegister() {
|
95
|
302
|
|
96
|
303
|
//用户绑定
|
|
@@ -365,7 +572,9 @@ func (this *XcxApiController) GetCodeInfo() {
|
365
|
572
|
|
366
|
573
|
mobile := this.GetString("phone")
|
367
|
574
|
aespass := this.GetString("aespass")
|
|
575
|
+
|
368
|
576
|
utils.TraceLog("mobile:%v aespass:%v", mobile, aespass)
|
|
577
|
+
|
369
|
578
|
if utils.CellPhoneRegexp().MatchString(mobile) == false {
|
370
|
579
|
this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeMobileFormat)
|
371
|
580
|
this.ServeJSON()
|
|
@@ -386,95 +595,55 @@ func (this *XcxApiController) GetCodeInfo() {
|
386
|
595
|
})
|
387
|
596
|
}
|
388
|
597
|
|
389
|
|
-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
|
+}
|
390
|
620
|
|
|
621
|
+func (this *XcxApiController) GetLoginInfor() {
|
391
|
622
|
mobile := this.GetString("mobile")
|
392
|
|
- fmt.Println(mobile)
|
393
|
623
|
user_admin, errcodes := service.GetXcxMobileInformation(mobile)
|
394
|
624
|
if errcodes == gorm.ErrRecordNotFound {
|
395
|
|
- info, _ := service.GetMobilePatientInfo(mobile)
|
396
|
|
- template_id, _ := service.GetTemplateMode(info.UserOrgId)
|
397
|
|
- //处方
|
398
|
|
- prescripition_config, _ := service.GetPrescripionFieldConfig(info.UserOrgId)
|
399
|
|
-
|
400
|
|
- //接诊评估
|
401
|
|
- receive_treatement_config, _ := service.GetReceiveTreatmentAssess(info.UserOrgId)
|
402
|
|
-
|
403
|
|
- //透前评估
|
404
|
|
- dialysis_befor, _ := service.GetDialysisBefor(info.UserOrgId)
|
405
|
|
-
|
406
|
|
- //透析上机
|
407
|
|
- dialysis_order, _ := service.GetDialysisOrderConfig(info.UserOrgId)
|
408
|
|
-
|
409
|
|
- //透析监测
|
410
|
|
- monitor_record, _ := service.GetMonitorRecordConfig(info.UserOrgId)
|
411
|
|
-
|
412
|
|
- //透后评估
|
413
|
|
- dialysis_after, _ := service.GetDialysisAfeterConfig(info.UserOrgId)
|
414
|
|
-
|
415
|
|
- treate_ment, _ := service.GetTreatMentConfig(info.UserOrgId)
|
416
|
|
- var configList interface{}
|
417
|
|
- configList, _ = service.GetConfigList(info.UserOrgId)
|
418
|
625
|
this.ServeSuccessJSON(map[string]interface{}{
|
419
|
|
- "patient": info,
|
420
|
|
- "template_id": template_id,
|
421
|
|
- "user_org_id": info.UserOrgId,
|
422
|
|
- "prescripition_config": prescripition_config,
|
423
|
|
- "receive_treatement_config": receive_treatement_config,
|
424
|
|
- "dialysis_befor": dialysis_befor,
|
425
|
|
- "dialysis_order": dialysis_order,
|
426
|
|
- "monitor_record": monitor_record,
|
427
|
|
- "dialysis_after": dialysis_after,
|
428
|
|
- "treate_ment": treate_ment,
|
429
|
|
- "role": user_admin,
|
430
|
|
- "is_bind": false,
|
431
|
|
- "list": configList,
|
|
626
|
+ "patient": "",
|
|
627
|
+ "patient_id": 0,
|
|
628
|
+ "user_org_id": 0,
|
|
629
|
+ "role": user_admin,
|
|
630
|
+ "is_bind": false,
|
432
|
631
|
})
|
433
|
632
|
} else if errcodes == nil {
|
434
|
633
|
info, _ := service.GetPatientListByPatientId(user_admin.PatientId)
|
435
|
|
- template_id, _ := service.GetTemplateMode(info.UserOrgId)
|
436
|
|
- //处方
|
437
|
|
- prescripition_config, _ := service.GetPrescripionFieldConfig(info.UserOrgId)
|
438
|
|
-
|
439
|
|
- //接诊评估
|
440
|
|
- receive_treatement_config, _ := service.GetReceiveTreatmentAssess(info.UserOrgId)
|
441
|
|
-
|
442
|
|
- //透前评估
|
443
|
|
- dialysis_befor, _ := service.GetDialysisBefor(info.UserOrgId)
|
444
|
|
-
|
445
|
|
- //透析上机
|
446
|
|
- dialysis_order, _ := service.GetDialysisOrderConfig(info.UserOrgId)
|
447
|
|
-
|
448
|
|
- //透析监测
|
449
|
|
- monitor_record, _ := service.GetMonitorRecordConfig(info.UserOrgId)
|
450
|
|
-
|
451
|
|
- //透后评估
|
452
|
|
- dialysis_after, _ := service.GetDialysisAfeterConfig(info.UserOrgId)
|
453
|
|
-
|
454
|
|
- treate_ment, _ := service.GetTreatMentConfig(info.UserOrgId)
|
455
|
|
- var configList interface{}
|
456
|
|
- configList, _ = service.GetConfigList(info.UserOrgId)
|
457
|
634
|
this.ServeSuccessJSON(map[string]interface{}{
|
458
|
|
- "patient": info,
|
459
|
|
- "role": user_admin,
|
460
|
|
- "is_bind": true,
|
461
|
|
- "template_id": template_id,
|
462
|
|
- "user_org_id": info.UserOrgId,
|
463
|
|
- "prescripition_config": prescripition_config,
|
464
|
|
- "receive_treatement_config": receive_treatement_config,
|
465
|
|
- "dialysis_befor": dialysis_befor,
|
466
|
|
- "dialysis_order": dialysis_order,
|
467
|
|
- "monitor_record": monitor_record,
|
468
|
|
- "dialysis_after": dialysis_after,
|
469
|
|
- "treate_ment": treate_ment,
|
470
|
|
- "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,
|
471
|
640
|
})
|
472
|
641
|
}
|
473
|
|
-
|
474
|
642
|
}
|
475
|
643
|
|
476
|
644
|
func (this *XcxApiController) GetPatientList() {
|
477
|
|
- appid := "wx20b60369111b063a"
|
|
645
|
+ //appid := "wx20b60369111b063a"
|
|
646
|
+ appid := "wxcdf53b48b7df107e"
|
478
|
647
|
key := "Yz1HgsFX3yJvWPJSEdwJDA=="
|
479
|
648
|
strs := "uSevGQ5ShkiHjQuqz7s36SKZisVGA4fHH/dy+etg0W7ibVeidl6TyFS+kQZ6B9AI2T+1kOtKXeyveQR7q2TXJdu3fhKCFoLKVFzICNEvkiHMnchJ0T0OpRO3oT+icYq80+egvT+jMSgP7yi0cAgmiKaK/4QURD7+nvxRAj9drzz77sbeFt8KElb1LN/+Wn8dIoQzisxbON9G1VJYYtyBkQ=="
|
480
|
649
|
iv := "JgsbDhJ613uaAgAoBVh0Zw=="
|
|
@@ -511,7 +680,217 @@ func (this *XcxApiController) GetDataInfo() {
|
511
|
680
|
})
|
512
|
681
|
}
|
513
|
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
|
+
|
514
|
892
|
func (this *XcxApiController) GetScheduleInfo() {
|
|
893
|
+
|
515
|
894
|
patient_id, _ := this.GetInt64("patient_id")
|
516
|
895
|
fmt.Println(patient_id)
|
517
|
896
|
thisWeekMonday := service.GetFirstDateOfWeek()
|
|
@@ -522,8 +901,8 @@ func (this *XcxApiController) GetScheduleInfo() {
|
522
|
901
|
nextWeekMonday := weekDays.AddDate(0, 0, +13)
|
523
|
902
|
var weekMonday = lastWeekMonday.Format("2006-01-02")
|
524
|
903
|
var weekDay = nextWeekMonday.Format("2006-01-02")
|
525
|
|
- fmt.Println("weekmodonday", weekMonday)
|
526
|
|
- fmt.Println("nextweeekday", weekDay)
|
|
904
|
+ //fmt.Println("weekmodonday", weekMonday)
|
|
905
|
+ //fmt.Println("nextweeekday", weekDay)
|
527
|
906
|
|
528
|
907
|
timeLayout := "2006-01-02"
|
529
|
908
|
loc, _ := time.LoadLocation("Local")
|
|
@@ -541,7 +920,7 @@ func (this *XcxApiController) GetScheduleInfo() {
|
541
|
920
|
|
542
|
921
|
//获取今日下机日期
|
543
|
922
|
order, _ := service.GetTodayDialysis(timeNowUnix.Unix(), patient_id)
|
544
|
|
-
|
|
923
|
+ devicenumber, _ := service.GetAllBedNumberListTwo(schedule[0].UserOrgId)
|
545
|
924
|
//获取今日的处方
|
546
|
925
|
prescription, _ := service.GetTodayPrescription(timeNowUnix.Unix(), patient_id)
|
547
|
926
|
|
|
@@ -552,7 +931,7 @@ func (this *XcxApiController) GetScheduleInfo() {
|
552
|
931
|
return
|
553
|
932
|
}
|
554
|
933
|
|
555
|
|
- var one = startTime.Unix() + 86400
|
|
934
|
+ var one = startTime.Unix()
|
556
|
935
|
fmt.Println("one2322332", one)
|
557
|
936
|
var two = one + 86400
|
558
|
937
|
var three = two + 86400
|
|
@@ -577,7 +956,6 @@ func (this *XcxApiController) GetScheduleInfo() {
|
577
|
956
|
var lastsix = lastfive + 86400
|
578
|
957
|
var lastseven = lastsix + 86400
|
579
|
958
|
|
580
|
|
- fmt.Println("各地好当家232332323232", lastseven)
|
581
|
959
|
array := []interface{}{
|
582
|
960
|
map[string]string{"schedule_type": "1", "schedule_date": strconv.FormatInt(one, 10), "schedule_week": "1", "mode_id": "", "name": ""},
|
583
|
961
|
map[string]string{"schedule_type": "2", "schedule_date": strconv.FormatInt(one, 10), "schedule_week": "1", "mode_id": "", "name": ""},
|
|
@@ -645,30 +1023,28 @@ func (this *XcxApiController) GetScheduleInfo() {
|
645
|
1023
|
map[string]string{"schedule_type": "2", "schedule_date": strconv.FormatInt(lastseven, 10), "schedule_week": "7", "mode_id": "", "name": ""},
|
646
|
1024
|
map[string]string{"schedule_type": "3", "schedule_date": strconv.FormatInt(lastseven, 10), "schedule_week": "7", "mode_id": "", "name": ""},
|
647
|
1025
|
}
|
|
1026
|
+
|
648
|
1027
|
this.ServeSuccessJSON(map[string]interface{}{
|
649
|
1028
|
"list": schedule,
|
650
|
1029
|
"array": array,
|
651
|
1030
|
"order": order,
|
652
|
1031
|
"patientSchedule": patientSchedule,
|
653
|
1032
|
"prescription": prescription,
|
|
1033
|
+ "devicenumber": devicenumber,
|
654
|
1034
|
})
|
655
|
1035
|
}
|
656
|
1036
|
|
657
|
1037
|
func (this *XcxApiController) GetMobileSchedule() {
|
658
|
1038
|
|
659
|
1039
|
patientID, _ := this.GetInt64("patient_id")
|
660
|
|
- fmt.Println("1", patientID)
|
661
|
1040
|
info, _ := service.GetXcxPatientInfo(patientID)
|
662
|
1041
|
timeLayout := "2006-01-02"
|
663
|
1042
|
loc, _ := time.LoadLocation("Local")
|
664
|
1043
|
time_now := time.Now().Format("2006-01-02")
|
665
|
1044
|
timeNowUnix, _ := time.ParseInLocation(timeLayout+"15:04:05", time_now+"00:00:00", loc)
|
666
|
|
-
|
667
|
|
- fmt.Println("timeNowUnix", timeNowUnix.Unix())
|
668
|
1045
|
//获取该患者最后一次排班
|
669
|
1046
|
list, _ := service.GetLastScheduleListOne(patientID, timeNowUnix.Unix())
|
670
|
|
- fmt.Println("hh2332323232323223", list)
|
671
|
|
- fmt.Println("list233232232332", list.ScheduleDate)
|
|
1047
|
+
|
672
|
1048
|
patient, getPatientErr := service.MobileGetPatientDetail(info.UserOrgId, patientID)
|
673
|
1049
|
if getPatientErr != nil {
|
674
|
1050
|
this.ErrorLog("获取患者信息失败:%v", getPatientErr)
|
|
@@ -887,9 +1263,9 @@ func (this *XcxApiController) GetDoctorAdvice() {
|
887
|
1263
|
startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
888
|
1264
|
endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
889
|
1265
|
info, _ := service.GetXcxPatientInfo(patient_id)
|
890
|
|
- config, _ := service.GetDoctorAdviceConfig(info.UserOrgId)
|
891
|
|
- fmt.Println(startTime, endTime, config.IsOpenRemind)
|
892
|
|
- if config.IsOpenRemind == 0 || config.IsOpenRemind == 2 {
|
|
1266
|
+ _, config := service.FindXTHisRecordByOrgId(info.UserOrgId)
|
|
1267
|
+ fmt.Println(startTime, endTime, config.IsOpen)
|
|
1268
|
+ if config.IsOpen == 0 {
|
893
|
1269
|
list, _ := service.GetDoctorAdviceGroup(patient_id, startTime.Unix(), endTime.Unix())
|
894
|
1270
|
advice, _ := service.GetDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())
|
895
|
1271
|
for _, item := range list {
|
|
@@ -905,7 +1281,7 @@ func (this *XcxApiController) GetDoctorAdvice() {
|
905
|
1281
|
})
|
906
|
1282
|
}
|
907
|
1283
|
|
908
|
|
- if config.IsOpenRemind == 1 {
|
|
1284
|
+ if config.IsOpen == 1 {
|
909
|
1285
|
list, _ := service.GetHisDoctorAdviceGroup(patient_id, startTime.Unix(), endTime.Unix())
|
910
|
1286
|
advice, _ := service.GetHisDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())
|
911
|
1287
|
for _, item := range list {
|
|
@@ -983,27 +1359,46 @@ func (this *XcxApiController) GetDataConfig() {
|
983
|
1359
|
|
984
|
1360
|
func (this *XcxApiController) GetInspectionList() {
|
985
|
1361
|
|
986
|
|
- start_time := this.GetString("start_time")
|
987
|
|
- end_time := this.GetString("end_time")
|
988
|
|
- patient_id, _ := this.GetInt64("patient_id")
|
989
|
|
- fmt.Println("patient_id", patient_id)
|
990
|
|
- timeLayout := "2006-01-02"
|
991
|
|
- loc, _ := time.LoadLocation("Local")
|
992
|
|
- startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
993
|
|
- endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
1362
|
+ page, _ := this.GetInt64("page", 0)
|
|
1363
|
+ number, _ := this.GetInt64("number", 10)
|
|
1364
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
1365
|
+ //fmt.Println("patient_id", patient_id)
|
|
1366
|
+ //timeLayout := "2006-01-02"
|
|
1367
|
+ //loc, _ := time.LoadLocation("Local")
|
|
1368
|
+ //startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
1369
|
+ //endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
994
|
1370
|
|
995
|
|
- list, _ := service.GetInspectionGroupList(patient_id, startTime.Unix(), endTime.Unix())
|
|
1371
|
+ list, err := service.GetInspectionGroupListByXcx(patient_id, page, number)
|
996
|
1372
|
|
997
|
|
- insepctionList, _ := service.GetInsepctionList(patient_id, startTime.Unix(), endTime.Unix())
|
|
1373
|
+ if err == gorm.ErrRecordNotFound {
|
|
1374
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1375
|
+ "error_code": "1001",
|
|
1376
|
+ "error_msg": "没有更多数据",
|
|
1377
|
+ })
|
|
1378
|
+ }
|
998
|
1379
|
|
999
|
|
- for _, item := range list {
|
1000
|
|
- for _, it := range insepctionList {
|
1001
|
|
- if item.ProjectId == it.ProjectId && item.InspectDate == it.InspectDate {
|
1002
|
|
- item.Childs = append(item.Childs, it)
|
1003
|
|
- }
|
1004
|
|
- }
|
|
1380
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1381
|
+ "error_code": "0",
|
|
1382
|
+ "error_msg": "",
|
|
1383
|
+ "list": list,
|
|
1384
|
+ })
|
|
1385
|
+}
|
|
1386
|
+
|
|
1387
|
+func (this *XcxApiController) GetInspectionInfo() {
|
|
1388
|
+
|
|
1389
|
+ project_id, _ := this.GetInt64("project_id", 0)
|
|
1390
|
+ inspect_date, _ := this.GetInt64("inspect_date", 0)
|
|
1391
|
+ patient_id, _ := this.GetInt64("patient_id", 0)
|
|
1392
|
+
|
|
1393
|
+ if project_id <= 0 || inspect_date <= 0 || patient_id <= 0 {
|
|
1394
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1395
|
+ "error_code": 1001,
|
|
1396
|
+ "error_msg": "缺少参数",
|
|
1397
|
+ })
|
1005
|
1398
|
}
|
1006
|
1399
|
|
|
1400
|
+ list, _ := service.GetInspectionInfoByXcx(patient_id, project_id, inspect_date)
|
|
1401
|
+
|
1007
|
1402
|
this.ServeSuccessJSON(map[string]interface{}{
|
1008
|
1403
|
"list": list,
|
1009
|
1404
|
})
|
|
@@ -1041,3 +1436,19 @@ func (this *XcxApiController) GetStoryScoreList() {
|
1041
|
1436
|
"total": total,
|
1042
|
1437
|
})
|
1043
|
1438
|
}
|
|
1439
|
+
|
|
1440
|
+func (this *XcxApiController) GetAppId() {
|
|
1441
|
+
|
|
1442
|
+ var appid = "wxcdf53b48b7df107e"
|
|
1443
|
+ var secret = "94e944a69ad1d43ac447f5a8769ab801"
|
|
1444
|
+ var grant_type = "authorization_code"
|
|
1445
|
+ code := this.GetString("js_code")
|
|
1446
|
+ //var code = "041pXnGa1eLxTB0iypFa1W6USs1pXnGK"
|
|
1447
|
+
|
|
1448
|
+ openId, _ := service.SendWxAuthAPI(appid, secret, grant_type, code)
|
|
1449
|
+ //session_key, _ := service.SendWxAuthAPIOne(appid, secret, grant_type, code)
|
|
1450
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1451
|
+ "data": openId,
|
|
1452
|
+ //"session_key": session_key,
|
|
1453
|
+ })
|
|
1454
|
+}
|