|
@@ -25,6 +25,27 @@ func siteRouters() {
|
25
|
25
|
beego.Router("/api/site/getdoctorinfo",&Microwebsite{},"Get:GetDoctorInfo")
|
26
|
26
|
beego.Router("/api/site/keenvironment",&Microwebsite{},"Post:AddKeEnvironment")
|
27
|
27
|
beego.Router("/api/site/getOffEnvironment",&Microwebsite{},"Get:GetOffEnvironment")
|
|
28
|
+ beego.Router("/api/site/addrotationupload",&Microwebsite{},"Post:AddRotationUpload")
|
|
29
|
+ beego.Router("/api/site/addworktime",&Microwebsite{},"Post:AddWorkTime")
|
|
30
|
+ beego.Router("/api/site/addrideway",&Microwebsite{},"Post:AddRideway")
|
|
31
|
+ beego.Router("/api/site/addconnection",&Microwebsite{},"Post:AddConnection")
|
|
32
|
+ beego.Router("/api/site/queryconnetion",&Microwebsite{},"Get:GetQueryConnection")
|
|
33
|
+ beego.Router("/api/site/delete",&Microwebsite{},"Get:DeleteConnecWay")
|
|
34
|
+ beego.Router("/api/site/editconnecway",&Microwebsite{},"Get:EditConnecWay")
|
|
35
|
+ beego.Router("/api/site/saveconnection",&Microwebsite{},"Post:SaveConnection")
|
|
36
|
+ beego.Router("/api/site/addcontract",&Microwebsite{},"Post:AddContract")
|
|
37
|
+ beego.Router("/api/site/getuserdmodel",&Microwebsite{},"Post:GetUserdModel")
|
|
38
|
+ beego.Router("/api/site/eidtmodel",&Microwebsite{},"Get:GetEditModel")
|
|
39
|
+ beego.Router("/api/site/editrideway",&Microwebsite{},"Get:EditRideWay")
|
|
40
|
+ beego.Router("/api/site/saveworktime",&Microwebsite{},"Post:SaveWorktTime")
|
|
41
|
+ beego.Router("/api/site/saverideway",&Microwebsite{},"Post:Saverideway")
|
|
42
|
+ beego.Router("/api/site/getquerynewmodel",&Microwebsite{},"Post:GetQueryNewModel")
|
|
43
|
+ beego.Router("/api/site/getquerydocinfo",&Microwebsite{},"Post:GetQueryDocInfo")
|
|
44
|
+ beego.Router("/api/site/change",&Microwebsite{},"Get:Change")
|
|
45
|
+ beego.Router("/api/site/getquerydochead",&Microwebsite{},"Post:GetQueryDocHead")
|
|
46
|
+ beego.Router("/api/site/editdoctor",&Microwebsite{},"Get:Editdoctor")
|
|
47
|
+ beego.Router("/api/site/savedocinfo",&Microwebsite{},"Post:SaveDocInfo")
|
|
48
|
+ beego.Router("/api/site/deletedoctor",&Microwebsite{},"Get:DeleteDoctor")
|
28
|
49
|
}
|
29
|
50
|
|
30
|
51
|
type Microwebsite struct {
|
|
@@ -44,7 +65,6 @@ func (this *Microwebsite) AddRotaionChart() {
|
44
|
65
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
45
|
66
|
return
|
46
|
67
|
}
|
47
|
|
-
|
48
|
68
|
title := dataBody["title"].(string)
|
49
|
69
|
if len(title) == 0 {
|
50
|
70
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
@@ -64,15 +84,30 @@ func (this *Microwebsite) AddRotaionChart() {
|
64
|
84
|
fmt.Println("姓名:",rotationImages)
|
65
|
85
|
fmt.Println("字符串",replace)
|
66
|
86
|
|
67
|
|
- rotation := models.SgjPatientRotation{
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+ model := models.SgjPatientModel{
|
68
|
90
|
Title: title,
|
69
|
91
|
Sort: sortt,
|
70
|
|
- RotationImages:replace,
|
71
|
92
|
UserOrgId: userOrgID,
|
72
|
|
- Status:1,
|
|
93
|
+ Status: 1,
|
73
|
94
|
Ctime: time.Now().Unix(),
|
74
|
95
|
}
|
75
|
|
- err = site_service.AddRotationChart(rotation)
|
|
96
|
+ //fmt.Println(model)
|
|
97
|
+ site_service.AddPatientModel(&model)
|
|
98
|
+ fmt.Println("rotation是什么",model)
|
|
99
|
+ patientModel, err := site_service.QueryModel(userOrgID)
|
|
100
|
+ fmt.Println("patientModel是什麽",patientModel)
|
|
101
|
+ rotation := models.SgjPatientRotation{
|
|
102
|
+ Title: title,
|
|
103
|
+ Sort: sortt,
|
|
104
|
+ RotationImages: replace,
|
|
105
|
+ UserOrgId: userOrgID,
|
|
106
|
+ Status: 1,
|
|
107
|
+ Ctime: time.Now().Unix(),
|
|
108
|
+ ModelId:patientModel.ID,
|
|
109
|
+ }
|
|
110
|
+ site_service.AddRotation(rotation)
|
76
|
111
|
if err !=nil{
|
77
|
112
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加医院失败")
|
78
|
113
|
return
|
|
@@ -82,9 +117,6 @@ func (this *Microwebsite) AddRotaionChart() {
|
82
|
117
|
})
|
83
|
118
|
}
|
84
|
119
|
|
85
|
|
-
|
86
|
|
-
|
87
|
|
-
|
88
|
120
|
//医院介绍
|
89
|
121
|
func (this *Microwebsite) SaveHispital() {
|
90
|
122
|
adminUserInfo := this.GetAdminUserInfo()
|
|
@@ -119,15 +151,28 @@ func (this *Microwebsite) SaveHispital() {
|
119
|
151
|
}
|
120
|
152
|
fmt.Println("姓名是什么?",title,"排序是什么",sortt,"医院介绍不能为空",introduction)
|
121
|
153
|
|
|
154
|
+ model := models.SgjPatientModel{
|
|
155
|
+ Title: title,
|
|
156
|
+ Sort: sortt,
|
|
157
|
+ UserOrgId: userOrgID,
|
|
158
|
+ Ctime: time.Now().Unix(),
|
|
159
|
+ Status: 1,
|
|
160
|
+ }
|
|
161
|
+
|
|
162
|
+ site_service.AddPatientModel(&model)
|
|
163
|
+
|
|
164
|
+ patientModel, err := site_service.QueryModel(userOrgID)
|
|
165
|
+
|
122
|
166
|
hospital := models.SgjPatientHospital{
|
123
|
|
- Title: title,
|
124
|
|
- Sort: sortt,
|
|
167
|
+ Title: title,
|
|
168
|
+ Sort: sortt,
|
125
|
169
|
Introduction: introduction,
|
126
|
|
- UserOrgId:userOrgID,
|
127
|
|
- Ctime:time.Now().Unix(),
|
128
|
|
- Status:1,
|
129
|
|
-
|
|
170
|
+ UserOrgId: userOrgID,
|
|
171
|
+ Ctime: time.Now().Unix(),
|
|
172
|
+ Status: 1,
|
|
173
|
+ Modleid: patientModel.ID,
|
130
|
174
|
}
|
|
175
|
+
|
131
|
176
|
err = site_service.AddHispital(hospital)
|
132
|
177
|
if err !=nil{
|
133
|
178
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加医院失败")
|
|
@@ -171,13 +216,27 @@ func (this *Microwebsite) AddOffices() {
|
171
|
216
|
return
|
172
|
217
|
}
|
173
|
218
|
fmt.Println("姓名是什么?",title,"排序是什么",sortt,"医院介绍不能为空",introduction)
|
|
219
|
+
|
|
220
|
+ model := models.SgjPatientModel{
|
|
221
|
+ Title: title,
|
|
222
|
+ Sort: sortt,
|
|
223
|
+ UserOrgId: userOrgID,
|
|
224
|
+ Ctime: time.Now().Unix(),
|
|
225
|
+ Status: 1,
|
|
226
|
+ }
|
|
227
|
+
|
|
228
|
+ site_service.AddPatientModel(&model)
|
|
229
|
+
|
|
230
|
+ patientModel, err := site_service.QueryModel(userOrgID)
|
|
231
|
+
|
174
|
232
|
offices := models.SgjPatientOffices{
|
175
|
|
- Title: title,
|
176
|
|
- Sort: sortt,
|
|
233
|
+ Title: title,
|
|
234
|
+ Sort: sortt,
|
177
|
235
|
Introduction: introduction,
|
178
|
|
- UserOrgId: userOrgID,
|
179
|
|
- Ctime: time.Now().Unix(),
|
180
|
|
- Status: 1,
|
|
236
|
+ UserOrgId: userOrgID,
|
|
237
|
+ Ctime: time.Now().Unix(),
|
|
238
|
+ Status: 1,
|
|
239
|
+ Modleid:patientModel.ID,
|
181
|
240
|
}
|
182
|
241
|
err = site_service.AddOffices(offices)
|
183
|
242
|
if err !=nil{
|
|
@@ -202,7 +261,6 @@ func (this *Microwebsite) AddDoctor() {
|
202
|
261
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
203
|
262
|
return
|
204
|
263
|
}
|
205
|
|
-
|
206
|
264
|
title := dataBody["title"].(string)
|
207
|
265
|
if len(title) == 0 {
|
208
|
266
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
@@ -216,20 +274,33 @@ func (this *Microwebsite) AddDoctor() {
|
216
|
274
|
}
|
217
|
275
|
sortt, err := strconv.ParseInt(sort, 10, 64)
|
218
|
276
|
fmt.Println("排序:",sortt)
|
219
|
|
- image := dataBody["image"].(string)
|
220
|
|
- if len(image) == 0 {
|
221
|
|
- this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "医院介绍不能为空")
|
222
|
|
- return
|
|
277
|
+
|
|
278
|
+ images := dataBody["docimages"]
|
|
279
|
+ replace := strings.Replace(strings.Trim(fmt.Sprint(images), "[]"), " ", ",", -1)
|
|
280
|
+ //if len(image) == 0 {
|
|
281
|
+ // this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "医院介绍不能为空")
|
|
282
|
+ // return
|
|
283
|
+ //}
|
|
284
|
+ fmt.Println("姓名是什么?",title,"排序是什么",sortt,"图片",replace)
|
|
285
|
+ model := models.SgjPatientModel{
|
|
286
|
+ Title: title,
|
|
287
|
+ Sort: sortt,
|
|
288
|
+ UserOrgId: userOrgID,
|
|
289
|
+ Ctime: time.Now().Unix(),
|
|
290
|
+ Status: 1,
|
223
|
291
|
}
|
224
|
|
- fmt.Println("姓名是什么?",title,"排序是什么",sortt,"医院介绍不能为空",image)
|
225
|
292
|
|
|
293
|
+ site_service.AddPatientModel(&model)
|
|
294
|
+
|
|
295
|
+ patientModel, err := site_service.QueryModel(userOrgID)
|
226
|
296
|
doctor := models.SgjPatientDoctor{
|
227
|
297
|
Title: title,
|
228
|
298
|
Sort: sortt,
|
229
|
|
- Images: image,
|
|
299
|
+ Images: replace,
|
230
|
300
|
UserOrgId:userOrgID,
|
231
|
301
|
Ctime:time.Now().Unix(),
|
232
|
302
|
Status:1,
|
|
303
|
+ Modelid:patientModel.ID,
|
233
|
304
|
}
|
234
|
305
|
|
235
|
306
|
err = site_service.AddDoctor(doctor)
|
|
@@ -256,39 +327,48 @@ func (this *Microwebsite) AddDoctorInfo() {
|
256
|
327
|
return
|
257
|
328
|
}
|
258
|
329
|
|
259
|
|
- docname := dataBody["docname"].(string)
|
|
330
|
+ docname := dataBody["name"].(string)
|
260
|
331
|
if len(docname) == 0 {
|
261
|
332
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "医生姓名不能为空")
|
262
|
333
|
return
|
263
|
334
|
}
|
264
|
335
|
fmt.Println("医生姓名:",docname)
|
265
|
|
- docHead := dataBody["docHead"].(string)
|
|
336
|
+ docHead := dataBody["dochead"].(string)
|
266
|
337
|
if len(docHead) == 0 {
|
267
|
338
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "医生头像不能为空")
|
268
|
339
|
return
|
269
|
340
|
}
|
270
|
341
|
fmt.Println("医生头像:",docHead)
|
271
|
|
- docpositional := dataBody["docpositional"].(string)
|
272
|
|
- if len(docpositional) == 0 {
|
|
342
|
+ sort := dataBody["sort"].(string)
|
|
343
|
+ if len(sort) == 0 {
|
|
344
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
|
345
|
+ return
|
|
346
|
+ }
|
|
347
|
+ sortt, err := strconv.ParseInt(sort, 10, 64)
|
|
348
|
+ fmt.Println("排序:",sortt)
|
|
349
|
+ docpositional := int64(dataBody["user_title"].(float64))
|
|
350
|
+ if docpositional <= 0 {
|
273
|
351
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "医生职位不能为空")
|
274
|
352
|
return
|
275
|
353
|
}
|
276
|
354
|
fmt.Println("医生职位",docpositional)
|
277
|
|
- docintroduction := dataBody["docintroduction"].(string)
|
|
355
|
+ docintroduction := dataBody["content"].(string)
|
278
|
356
|
fmt.Println("医生简介",docintroduction)
|
279
|
357
|
if len(docintroduction) == 0 {
|
280
|
358
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "医生简介不能为空")
|
281
|
359
|
return
|
282
|
360
|
}
|
283
|
361
|
fmt.Println("医生姓名",docname,"医生职位",docpositional,"医生头像",docHead,"医生简介",docintroduction)
|
|
362
|
+
|
284
|
363
|
doctor := models.SgjPatientDoctor{
|
285
|
|
- Dochead: docHead,
|
286
|
364
|
Docname: docname,
|
|
365
|
+ Dochead: docHead,
|
|
366
|
+ DocPosition: docpositional,
|
287
|
367
|
Docintroduction: docintroduction,
|
288
|
|
- Docpositional: docpositional,
|
289
|
|
- UserOrgId:userOrgID,
|
290
|
|
- Ctime:time.Now().Unix(),
|
291
|
|
- Status:1,
|
|
368
|
+ Ctime: time.Now().Unix(),
|
|
369
|
+ UserOrgId: userOrgID,
|
|
370
|
+ DocSort:sortt,
|
|
371
|
+ Status: 1,
|
292
|
372
|
}
|
293
|
373
|
err = site_service.AddDoctorInfo(doctor)
|
294
|
374
|
if err !=nil{
|
|
@@ -332,21 +412,43 @@ func (this *Microwebsite) AddKeEnvironment() {
|
332
|
412
|
replace := strings.Replace(strings.Trim(fmt.Sprint(keImages), "[]"), " ", ",", -1)
|
333
|
413
|
fmt.Println("图片:",keImages)
|
334
|
414
|
fmt.Println("字符串",replace)
|
335
|
|
- offenvironment := models.SgjPatientOffenvironment{
|
|
415
|
+ //offenvironment := models.SgjPatientOffenvironment{
|
|
416
|
+ // Title: title,
|
|
417
|
+ // Sort: sortt,
|
|
418
|
+ // Keimages: replace,
|
|
419
|
+ // Mtime: time.Now().Unix(),
|
|
420
|
+ // UserOrgId: userOrgID,
|
|
421
|
+ // Status: 1,
|
|
422
|
+ //}
|
|
423
|
+
|
|
424
|
+ model := models.SgjPatientModel{
|
336
|
425
|
Title: title,
|
337
|
426
|
Sort: sortt,
|
338
|
|
- Keimages: replace,
|
339
|
|
- Mtime: time.Now().Unix(),
|
340
|
427
|
UserOrgId: userOrgID,
|
|
428
|
+ Ctime: time.Now().Unix(),
|
341
|
429
|
Status: 1,
|
342
|
430
|
}
|
343
|
|
- err = site_service.AddOffEnvironment(offenvironment)
|
|
431
|
+
|
|
432
|
+ site_service.AddPatientModel(&model)
|
|
433
|
+ patientModel, err := site_service.QueryModel(userOrgID)
|
|
434
|
+
|
|
435
|
+ officenviroment := models.SgjPatientOffenvironment{
|
|
436
|
+ Title: title,
|
|
437
|
+ Sort: sortt,
|
|
438
|
+ Keimages: replace,
|
|
439
|
+ Mtime: time.Now().Unix(),
|
|
440
|
+ UserOrgId: userOrgID,
|
|
441
|
+ Status: 1,
|
|
442
|
+ Modelid:patientModel.ID,
|
|
443
|
+ }
|
|
444
|
+
|
|
445
|
+ err = site_service.AddOffEnvironment(officenviroment)
|
344
|
446
|
if err !=nil{
|
345
|
447
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加科室环境失败")
|
346
|
448
|
return
|
347
|
449
|
}
|
348
|
450
|
this.ServeSuccessJSON(map[string]interface{}{
|
349
|
|
- "offenvironment":offenvironment,
|
|
451
|
+ "offenvironment":officenviroment,
|
350
|
452
|
})
|
351
|
453
|
}
|
352
|
454
|
|
|
@@ -413,6 +515,32 @@ func (this * Microwebsite) GetDoctorInfo() {
|
413
|
515
|
})
|
414
|
516
|
}
|
415
|
517
|
|
|
518
|
+func (this * Microwebsite) GetQueryDocInfo(){
|
|
519
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
520
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
521
|
+ doc, err := site_service.GetQueryDocInfo(userOrgID)
|
|
522
|
+ if err !=nil{
|
|
523
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取名医介绍失败")
|
|
524
|
+ return
|
|
525
|
+ }
|
|
526
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
527
|
+ "doctor":doc,
|
|
528
|
+ })
|
|
529
|
+}
|
|
530
|
+
|
|
531
|
+func (this * Microwebsite) GetQueryDocHead() {
|
|
532
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
533
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
534
|
+ docHead, err := site_service.GetQueryDocHead(userOrgID)
|
|
535
|
+ if err !=nil{
|
|
536
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取名医介绍失败")
|
|
537
|
+ return
|
|
538
|
+ }
|
|
539
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
540
|
+ "docHead":docHead,
|
|
541
|
+ })
|
|
542
|
+}
|
|
543
|
+
|
416
|
544
|
//获取科室环境
|
417
|
545
|
func (this * Microwebsite) GetOffEnvironment() {
|
418
|
546
|
adminUserInfo := this.GetAdminUserInfo()
|
|
@@ -425,4 +553,583 @@ func (this * Microwebsite) GetOffEnvironment() {
|
425
|
553
|
this.ServeSuccessJSON(map[string]interface{}{
|
426
|
554
|
"offenvironment":offenvironment,
|
427
|
555
|
})
|
|
556
|
+}
|
|
557
|
+
|
|
558
|
+//添加联系我们的轮播图
|
|
559
|
+func (this * Microwebsite) AddRotationUpload() {
|
|
560
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
561
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
562
|
+ dataBody := make(map[string]interface{}, 0)
|
|
563
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
564
|
+ fmt.Println("错误是什么呢",err)
|
|
565
|
+ fmt.Println("机构ID",userOrgID)
|
|
566
|
+ if err != nil {
|
|
567
|
+ utils.ErrorLog(err.Error())
|
|
568
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
569
|
+ return
|
|
570
|
+ }
|
|
571
|
+
|
|
572
|
+ title := dataBody["title"].(string)
|
|
573
|
+ if len(title) == 0 {
|
|
574
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
575
|
+ return
|
|
576
|
+ }
|
|
577
|
+ fmt.Println("姓名:",title)
|
|
578
|
+ sort := dataBody["sort"].(string)
|
|
579
|
+ if len(sort) == 0 {
|
|
580
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
|
581
|
+ return
|
|
582
|
+ }
|
|
583
|
+ sortt, err := strconv.ParseInt(sort, 10, 64)
|
|
584
|
+ fmt.Println("排序:",sortt)
|
|
585
|
+ rotationImages := dataBody["rotationImages"]
|
|
586
|
+ //图片数组转为字符串保存到数据库
|
|
587
|
+ replace := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
|
|
588
|
+ fmt.Println("姓名:",rotationImages)
|
|
589
|
+ fmt.Println("字符串",replace)
|
|
590
|
+
|
|
591
|
+ connecmodel := models.SgjPatientConnecmodel{
|
|
592
|
+ Title: title,
|
|
593
|
+ Sort: sortt,
|
|
594
|
+ RotationImages: replace,
|
|
595
|
+ UserOrgId: userOrgID,
|
|
596
|
+ Status: 1,
|
|
597
|
+ ModeType: 1,
|
|
598
|
+ Ctime: time.Now().Unix(),
|
|
599
|
+ }
|
|
600
|
+
|
|
601
|
+ err = site_service.AddRotationUpload(&connecmodel)
|
|
602
|
+ if err !=nil{
|
|
603
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取名医介绍失败")
|
|
604
|
+ return
|
|
605
|
+ }
|
|
606
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
607
|
+ "connecmodel":connecmodel,
|
|
608
|
+ })
|
|
609
|
+}
|
|
610
|
+//添加工作时间
|
|
611
|
+func (this * Microwebsite) AddWorkTime() {
|
|
612
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
613
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
614
|
+ dataBody := make(map[string]interface{}, 0)
|
|
615
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
616
|
+ fmt.Println("错误是什么呢", err)
|
|
617
|
+ fmt.Println("机构ID", userOrgID)
|
|
618
|
+ if err != nil {
|
|
619
|
+ utils.ErrorLog(err.Error())
|
|
620
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
621
|
+ return
|
|
622
|
+ }
|
|
623
|
+ title := dataBody["title"].(string)
|
|
624
|
+ if len(title) == 0 {
|
|
625
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
626
|
+ return
|
|
627
|
+ }
|
|
628
|
+ sort := dataBody["sort"].(string)
|
|
629
|
+ if len(sort) == 0 {
|
|
630
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
|
631
|
+ return
|
|
632
|
+ }
|
|
633
|
+ sortt, err := strconv.ParseInt(sort, 10, 64)
|
|
634
|
+ fmt.Println("排序:", sortt)
|
|
635
|
+
|
|
636
|
+ worktime := dataBody["worktime"].(string)
|
|
637
|
+ if len(worktime) == 0 {
|
|
638
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "工作时间不能为空")
|
|
639
|
+ return
|
|
640
|
+ }
|
|
641
|
+
|
|
642
|
+ sgjworktime := models.SgjPatientConnecmodel{
|
|
643
|
+ Title: title,
|
|
644
|
+ Sort: sortt,
|
|
645
|
+ Status: 1,
|
|
646
|
+ UserOrgId: userOrgID,
|
|
647
|
+ Worktime: worktime,
|
|
648
|
+ ModeType: 4,
|
|
649
|
+ Ctime: time.Now().Unix(),
|
|
650
|
+ }
|
|
651
|
+
|
|
652
|
+ //添加模块
|
|
653
|
+ err = site_service.AddWorkTime(sgjworktime);
|
|
654
|
+ if err !=nil{
|
|
655
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加乘车方式失败")
|
|
656
|
+ return
|
|
657
|
+ }
|
|
658
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
659
|
+ "sgjworktime":sgjworktime,
|
|
660
|
+ })
|
|
661
|
+}
|
|
662
|
+
|
|
663
|
+//添加乘车方式
|
|
664
|
+func (this * Microwebsite) AddRideway() {
|
|
665
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
666
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
667
|
+ dataBody := make(map[string]interface{}, 0)
|
|
668
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
669
|
+ fmt.Println("错误是什么呢", err)
|
|
670
|
+ fmt.Println("机构ID", userOrgID)
|
|
671
|
+ if err != nil {
|
|
672
|
+ utils.ErrorLog(err.Error())
|
|
673
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
674
|
+ return
|
|
675
|
+ }
|
|
676
|
+
|
|
677
|
+ title := dataBody["title"].(string)
|
|
678
|
+ if len(title) == 0 {
|
|
679
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
680
|
+ return
|
|
681
|
+ }
|
|
682
|
+ fmt.Println("姓名:", title)
|
|
683
|
+ sort := dataBody["sort"].(string)
|
|
684
|
+ if len(sort) == 0 {
|
|
685
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
|
686
|
+ return
|
|
687
|
+ }
|
|
688
|
+ sortt, err := strconv.ParseInt(sort, 10, 64)
|
|
689
|
+ fmt.Println("排序:", sortt)
|
|
690
|
+ content := dataBody["content"].(string)
|
|
691
|
+ if len(content) == 0 {
|
|
692
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "乘车方式不能为空")
|
|
693
|
+ return
|
|
694
|
+ }
|
|
695
|
+
|
|
696
|
+ rideway := models.SgjPatientConnecmodel{
|
|
697
|
+ Title: title,
|
|
698
|
+ Sort: sortt,
|
|
699
|
+ UserOrgId: userOrgID,
|
|
700
|
+ Rideway:content,
|
|
701
|
+ Status: 1,
|
|
702
|
+ ModeType: 5,
|
|
703
|
+ Ctime: time.Now().Unix(),
|
|
704
|
+ }
|
|
705
|
+
|
|
706
|
+ err = site_service.AddRideWay(rideway)
|
|
707
|
+ if err !=nil{
|
|
708
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加乘车方式失败")
|
|
709
|
+ return
|
|
710
|
+ }
|
|
711
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
712
|
+ "rideway":rideway,
|
|
713
|
+ })
|
|
714
|
+
|
|
715
|
+}
|
|
716
|
+
|
|
717
|
+//添加联系方式
|
|
718
|
+func (this * Microwebsite) AddConnection() {
|
|
719
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
720
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
721
|
+ dataBody := make(map[string]interface{}, 0)
|
|
722
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
723
|
+ fmt.Println("错误是什么呢", err)
|
|
724
|
+ if err != nil {
|
|
725
|
+ utils.ErrorLog(err.Error())
|
|
726
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
727
|
+ return
|
|
728
|
+ }
|
|
729
|
+ title := dataBody["title"].(string)
|
|
730
|
+ if len(title) == 0 {
|
|
731
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
732
|
+ return
|
|
733
|
+ }
|
|
734
|
+ fmt.Println("姓名:", title)
|
|
735
|
+ connecway :=int64( dataBody["connecway"].(float64))
|
|
736
|
+ if connecway < 0{
|
|
737
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "联系方式不能为空")
|
|
738
|
+ return
|
|
739
|
+ }
|
|
740
|
+ fmt.Println("联系方式",connecway)
|
|
741
|
+ content := dataBody["content"].(string)
|
|
742
|
+ if len(content) == 0 {
|
|
743
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
744
|
+ return
|
|
745
|
+ }
|
|
746
|
+ fmt.Println("内容",content)
|
|
747
|
+
|
|
748
|
+ connection := models.SgjPatientConnection{
|
|
749
|
+ Title: title,
|
|
750
|
+ Connecway: connecway,
|
|
751
|
+ Content: content,
|
|
752
|
+ Status: 1,
|
|
753
|
+ Ctime: time.Now().Unix(),
|
|
754
|
+ UserOrgId:userOrgID,
|
|
755
|
+ }
|
|
756
|
+ err = site_service.AddConnetion(connection);
|
|
757
|
+ if err !=nil{
|
|
758
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加联系方式失败")
|
|
759
|
+ return
|
|
760
|
+ }
|
|
761
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
762
|
+ "connection":connection,
|
|
763
|
+ })
|
|
764
|
+
|
|
765
|
+}
|
|
766
|
+
|
|
767
|
+//获取联系方式
|
|
768
|
+func (this * Microwebsite) GetQueryConnection() {
|
|
769
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
770
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
771
|
+ conection, err := site_service.GetQueryConnection(userOrgID)
|
|
772
|
+ fmt.Println("conections是啥",conection)
|
|
773
|
+ if err !=nil{
|
|
774
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加乘车方式失败")
|
|
775
|
+ return
|
|
776
|
+ }
|
|
777
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
778
|
+ "conection":conection,
|
|
779
|
+ })
|
|
780
|
+}
|
|
781
|
+
|
|
782
|
+//删除联系人
|
|
783
|
+func (this * Microwebsite) DeleteConnecWay() {
|
|
784
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
785
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
786
|
+ id, _ := this.GetInt64("id")
|
|
787
|
+ fmt.Println("id是啥?",id)
|
|
788
|
+ err := site_service.DeleteConnecWay(userOrgID, id)
|
|
789
|
+ if err !=nil{
|
|
790
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
791
|
+ return
|
|
792
|
+ }
|
|
793
|
+
|
|
794
|
+ returnData := make(map[string]interface{}, 0)
|
|
795
|
+ returnData["msg"] = "ok"
|
|
796
|
+ this.ServeSuccessJSON(returnData)
|
|
797
|
+ return
|
|
798
|
+}
|
|
799
|
+
|
|
800
|
+//编辑联系人
|
|
801
|
+func (this *Microwebsite) EditConnecWay() {
|
|
802
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
803
|
+ id, _ := this.GetInt64("id")
|
|
804
|
+ fmt.Println("id是啥?",id)
|
|
805
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
806
|
+ connection, err := site_service.EditConnecWay(userOrgID, id)
|
|
807
|
+ if err !=nil{
|
|
808
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
809
|
+ return
|
|
810
|
+ }
|
|
811
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
812
|
+ "connection":connection,
|
|
813
|
+ })
|
|
814
|
+}
|
|
815
|
+
|
|
816
|
+func (this *Microwebsite) SaveConnection() {
|
|
817
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
818
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
819
|
+ fmt.Println("机构ID",userOrgID)
|
|
820
|
+ id, _ := this.GetInt64("id")
|
|
821
|
+ fmt.Println("id是啥?",id)
|
|
822
|
+ dataBody := make(map[string]interface{}, 0)
|
|
823
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
824
|
+ if err != nil {
|
|
825
|
+ utils.ErrorLog(err.Error())
|
|
826
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
827
|
+ return
|
|
828
|
+ }
|
|
829
|
+ title := dataBody["title"].(string)
|
|
830
|
+ fmt.Println("title",title)
|
|
831
|
+ if len(title) == 0 {
|
|
832
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
833
|
+ return
|
|
834
|
+ }
|
|
835
|
+ connecway := int64(dataBody["connecway"].(float64))
|
|
836
|
+ fmt.Println("connecway",connecway)
|
|
837
|
+
|
|
838
|
+ content := dataBody["content"].(string)
|
|
839
|
+ fmt.Println("content",content)
|
|
840
|
+ if len(content) == 0 {
|
|
841
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong,"联系方式不能为空")
|
|
842
|
+ return
|
|
843
|
+ }
|
|
844
|
+ connection := models.SgjPatientConnection{
|
|
845
|
+ Title: title,
|
|
846
|
+ Connecway: connecway,
|
|
847
|
+ Content: content,
|
|
848
|
+ }
|
|
849
|
+
|
|
850
|
+ site_service.UpadateConnec(&connection,userOrgID,id)
|
|
851
|
+
|
|
852
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
853
|
+ "connection":connection,
|
|
854
|
+ })
|
|
855
|
+
|
|
856
|
+}
|
|
857
|
+
|
|
858
|
+//新增联系方式
|
|
859
|
+func (this *Microwebsite) AddContract() {
|
|
860
|
+
|
|
861
|
+}
|
|
862
|
+
|
|
863
|
+func (this *Microwebsite) GetUserdModel() {
|
|
864
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
865
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
866
|
+ model, err := site_service.GetUserModel(userOrgID)
|
|
867
|
+ if err !=nil{
|
|
868
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
869
|
+ return
|
|
870
|
+ }
|
|
871
|
+ fmt.Println("err")
|
|
872
|
+ fmt.Println("模型是什么",model)
|
|
873
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
874
|
+ "model":model,
|
|
875
|
+ })
|
|
876
|
+}
|
|
877
|
+
|
|
878
|
+func (this *Microwebsite) GetQueryNewModel() {
|
|
879
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
880
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
881
|
+ model, err := site_service.GetQueryNewModel(userOrgID)
|
|
882
|
+ fmt.Println("查询新增模块数据是什么?",model)
|
|
883
|
+ if err !=nil{
|
|
884
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
885
|
+ return
|
|
886
|
+ }
|
|
887
|
+ fmt.Println("err")
|
|
888
|
+ fmt.Println("返回新增模块模型是什么",model)
|
|
889
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
890
|
+ "model":model,
|
|
891
|
+ })
|
|
892
|
+}
|
|
893
|
+
|
|
894
|
+func (this *Microwebsite) GetEditModel() {
|
|
895
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
896
|
+ id, _ := this.GetInt64("id")
|
|
897
|
+ fmt.Println("模块id是啥?",id)
|
|
898
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
899
|
+ connecmodel, err := site_service.GetEditModel(userOrgID, id)
|
|
900
|
+ if err !=nil{
|
|
901
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
902
|
+ return
|
|
903
|
+ }
|
|
904
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
905
|
+ "connecmodel":connecmodel,
|
|
906
|
+ })
|
|
907
|
+}
|
|
908
|
+
|
|
909
|
+func (this *Microwebsite) EditRideWay() {
|
|
910
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
911
|
+ id, _ := this.GetInt64("id")
|
|
912
|
+ fmt.Println("模块id是啥?",id)
|
|
913
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
914
|
+ connecmodel, err := site_service.GetEditModel(userOrgID, id)
|
|
915
|
+ if err !=nil{
|
|
916
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
917
|
+ return
|
|
918
|
+ }
|
|
919
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
920
|
+ "connecmodel":connecmodel,
|
|
921
|
+ })
|
|
922
|
+}
|
|
923
|
+
|
|
924
|
+//保存编辑后的工作时间
|
|
925
|
+func (this *Microwebsite) SaveWorktTime() {
|
|
926
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
927
|
+ id, _ := this.GetInt64("id")
|
|
928
|
+ fmt.Println("模块id是啥?",id)
|
|
929
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
930
|
+
|
|
931
|
+ dataBody := make(map[string]interface{}, 0)
|
|
932
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
933
|
+ if err != nil {
|
|
934
|
+ utils.ErrorLog(err.Error())
|
|
935
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
936
|
+ return
|
|
937
|
+ }
|
|
938
|
+
|
|
939
|
+ title := dataBody["title"].(string)
|
|
940
|
+ if len(title) == 0 {
|
|
941
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
942
|
+ return
|
|
943
|
+ }
|
|
944
|
+ fmt.Println("姓名:", title)
|
|
945
|
+ sort := int64(dataBody["sort"].(float64))
|
|
946
|
+ if sort <= 0 {
|
|
947
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
|
948
|
+ return
|
|
949
|
+ }
|
|
950
|
+ //sortt, err := strconv.ParseInt(sort, 10, 64)
|
|
951
|
+ fmt.Println("排序:", sort)
|
|
952
|
+ worktime := dataBody["worktime"].(string)
|
|
953
|
+ fmt.Println("工作时间",worktime)
|
|
954
|
+ if len(worktime) == 0 {
|
|
955
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
956
|
+ return
|
|
957
|
+ }
|
|
958
|
+
|
|
959
|
+ connecmodel := models.SgjPatientConnecmodel{
|
|
960
|
+ Title: title,
|
|
961
|
+ Sort: sort,
|
|
962
|
+ Worktime: worktime,
|
|
963
|
+ }
|
|
964
|
+ site_service.UpdateWorkTime(id,userOrgID,connecmodel);
|
|
965
|
+ if err !=nil{
|
|
966
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
967
|
+ return
|
|
968
|
+ }
|
|
969
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
970
|
+ "connecmodel":connecmodel,
|
|
971
|
+ })
|
|
972
|
+}
|
|
973
|
+
|
|
974
|
+//保存编辑后的乘车方式
|
|
975
|
+func (this *Microwebsite) Saverideway() {
|
|
976
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
977
|
+ id, _ := this.GetInt64("id")
|
|
978
|
+ fmt.Println("模块id是啥?",id)
|
|
979
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
980
|
+ dataBody := make(map[string]interface{}, 0)
|
|
981
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
982
|
+ if err != nil {
|
|
983
|
+ utils.ErrorLog(err.Error())
|
|
984
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
985
|
+ return
|
|
986
|
+ }
|
|
987
|
+
|
|
988
|
+ title := dataBody["title"].(string)
|
|
989
|
+ if len(title) == 0 {
|
|
990
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
991
|
+ return
|
|
992
|
+ }
|
|
993
|
+ fmt.Println("标题:", title)
|
|
994
|
+ sort := int64(dataBody["sort"].(float64))
|
|
995
|
+ if sort <= 0 {
|
|
996
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
|
997
|
+ return
|
|
998
|
+ }
|
|
999
|
+ //sortt, err := strconv.ParseInt(sort, 10, 64)
|
|
1000
|
+ fmt.Println("排序:", sort)
|
|
1001
|
+ rideway := dataBody["rideway"].(string)
|
|
1002
|
+ fmt.Println("工作时间",rideway)
|
|
1003
|
+ if len(rideway) == 0 {
|
|
1004
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
1005
|
+ return
|
|
1006
|
+ }
|
|
1007
|
+ ridewaymodel := models.SgjPatientConnecmodel{
|
|
1008
|
+ Title: title,
|
|
1009
|
+ Sort: sort,
|
|
1010
|
+ Rideway: rideway,
|
|
1011
|
+ }
|
|
1012
|
+
|
|
1013
|
+ err = site_service.UpdateRideWay(id, userOrgID, ridewaymodel)
|
|
1014
|
+ fmt.Println("错误是什么?",err)
|
|
1015
|
+ if err !=nil{
|
|
1016
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
1017
|
+ return
|
|
1018
|
+ }
|
|
1019
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1020
|
+ "ridewaymodel":ridewaymodel,
|
|
1021
|
+ })
|
|
1022
|
+}
|
|
1023
|
+
|
|
1024
|
+//编辑医生信息
|
|
1025
|
+func (this *Microwebsite) Editdoctor() {
|
|
1026
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1027
|
+ id, _ := this.GetInt64("id")
|
|
1028
|
+ fmt.Println("医生id是啥?",id)
|
|
1029
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1030
|
+ fmt.Println("机构id",userOrgID)
|
|
1031
|
+ docinfo, err := site_service.EditDoctorInfo(id, userOrgID)
|
|
1032
|
+ fmt.Println("错误是什么",err)
|
|
1033
|
+ fmt.Println("docinfo",docinfo)
|
|
1034
|
+ if err !=nil{
|
|
1035
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
1036
|
+ return
|
|
1037
|
+ }
|
|
1038
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1039
|
+ "docinfo":docinfo,
|
|
1040
|
+ })
|
|
1041
|
+}
|
|
1042
|
+
|
|
1043
|
+func (this *Microwebsite) Change() {
|
|
1044
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1045
|
+ id, _ := this.GetInt64("id")
|
|
1046
|
+ fmt.Println("医生id是啥?",id)
|
|
1047
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1048
|
+ fmt.Println("机构id",userOrgID)
|
|
1049
|
+ docinfo, err := site_service.QueryDocById(userOrgID, id)
|
|
1050
|
+ if err !=nil{
|
|
1051
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
1052
|
+ return
|
|
1053
|
+ }
|
|
1054
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1055
|
+ "docinfo":docinfo,
|
|
1056
|
+ })
|
|
1057
|
+}
|
|
1058
|
+
|
|
1059
|
+func (this *Microwebsite) SaveDocInfo() {
|
|
1060
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1061
|
+ id, _ := this.GetInt64("id")
|
|
1062
|
+ fmt.Println("保存id是啥?",id)
|
|
1063
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1064
|
+ fmt.Println("机构id",userOrgID)
|
|
1065
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1066
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
1067
|
+ if err != nil {
|
|
1068
|
+ utils.ErrorLog(err.Error())
|
|
1069
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
1070
|
+ return
|
|
1071
|
+ }
|
|
1072
|
+ docname := dataBody["docname"].(string)
|
|
1073
|
+ if len(docname) == 0 {
|
|
1074
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "姓名不能为空")
|
|
1075
|
+ return
|
|
1076
|
+ }
|
|
1077
|
+ fmt.Println("姓名:",docname)
|
|
1078
|
+
|
|
1079
|
+ docpostion := int64(dataBody["doc_position"].(float64))
|
|
1080
|
+ if docpostion < 0 {
|
|
1081
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "职称不能为空")
|
|
1082
|
+ return
|
|
1083
|
+ }
|
|
1084
|
+
|
|
1085
|
+ fmt.Println("职位",docpostion)
|
|
1086
|
+ dochead := dataBody["dochead"].(string)
|
|
1087
|
+ if len(dochead) == 0 {
|
|
1088
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "头像不能为空")
|
|
1089
|
+ return
|
|
1090
|
+ }
|
|
1091
|
+ fmt.Println("头像",dochead)
|
|
1092
|
+ docsort := int64(dataBody["doc_sort"].(float64))
|
|
1093
|
+ if docsort <= 0 {
|
|
1094
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序不能为空")
|
|
1095
|
+ return
|
|
1096
|
+ }
|
|
1097
|
+ fmt.Println("排序",docsort)
|
|
1098
|
+ docintroduction := dataBody["docintroduction"].(string)
|
|
1099
|
+ if len(docintroduction) == 0 {
|
|
1100
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "头像不能为空")
|
|
1101
|
+ return
|
|
1102
|
+ }
|
|
1103
|
+ fmt.Println("简介",docintroduction)
|
|
1104
|
+ doctor := models.SgjPatientDoctor{
|
|
1105
|
+ Docname: docname,
|
|
1106
|
+ DocPosition: docpostion,
|
|
1107
|
+ Dochead: dochead,
|
|
1108
|
+ DocSort: docsort,
|
|
1109
|
+ Docintroduction: docintroduction,
|
|
1110
|
+ }
|
|
1111
|
+ err = site_service.UpdateDocInfo(id, userOrgID, doctor)
|
|
1112
|
+ if err !=nil{
|
|
1113
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
1114
|
+ return
|
|
1115
|
+ }
|
|
1116
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1117
|
+ "doctor":doctor,
|
|
1118
|
+ })
|
|
1119
|
+}
|
|
1120
|
+
|
|
1121
|
+func (this *Microwebsite) DeleteDoctor() {
|
|
1122
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1123
|
+ id, _ := this.GetInt64("id")
|
|
1124
|
+ fmt.Println("保存id是啥?",id)
|
|
1125
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1126
|
+ err := site_service.DeleteDoctor(id, userOrgID)
|
|
1127
|
+ if err !=nil{
|
|
1128
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除成功")
|
|
1129
|
+ return
|
|
1130
|
+ }
|
|
1131
|
+ returnData := make(map[string]interface{}, 0)
|
|
1132
|
+ returnData["msg"] = "ok"
|
|
1133
|
+ this.ServeSuccessJSON(returnData)
|
|
1134
|
+ return
|
428
|
1135
|
}
|