浏览代码

no message

张保健 4 年前
父节点
当前提交
5502a06dd5

+ 239 - 0
conf/app.conf 查看文件

@@ -0,0 +1,239 @@
1
+appname = 血透
2
+httpport = 9529
3
+runmode = dev
4
+
5
+
6
+copyrequestbody = true
7
+sessionon = true
8
+sessiongcmaxlifetime = 64800
9
+
10
+tokencookiemaxlifetime = 7200
11
+enablexsrf = false
12
+xsrfkey = 61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o
13
+xsrfexpire = 3600
14
+
15
+qiniu_accesskey = -l_Pcc1YJs0gh3w0YwN2uoaZO_5fY5J9SIYnSjg0
16
+qiniu_secretkey = DmZSp_Bmnp-9aUB7xUvoyViZpzmx1Rs2RL69GvlW
17
+qiniu_domain = https://images.shengws.com/
18
+qiniu_bucket = syhclub-storage
19
+
20
+
21
+
22
+aes_key = "xuetou-201807319"
23
+
24
+wxtoken = gh_ac6cd0cdde3d
25
+wxoriId = gh_ac6cd0cdde3d
26
+wxappId = wxbb9223f20bc11612
27
+# wxappsecret = a78c793c377268db25dde2eb971a2ebb
28
+# wxEncodingAESKey = 1vRDzqltXYOc9iMqhsQT7AkIRRpUaGl8MZlUcP7x4UK
29
+
30
+sms_appId = dcabb3aa7afd402794046ebbbf652bce
31
+sms_sid = a26cb0ceb3a811ca82143972f4ef38a4
32
+sms_token = ea475ed8d3de6c54c2b3f9d78db76d1e
33
+sms_baseUrl = https://open.ucpaas.com/ol/sms/
34
+ip_max_send_count = 20
35
+moblie_max_send_count = 5
36
+sms_verification_code_templateid = 358429
37
+
38
+
39
+appid = "wx43ad410d9eef426e"
40
+mchid = "1509573721"
41
+key = "e4SHrkiZu0pQEwVoGBapDBTf9N1Q6MxV"
42
+appsecret="61ee2e6268497d5aa9de0b0187c39aea"
43
+
44
+
45
+
46
+[prod]
47
+mobile_token_expiration_second = 86400
48
+httpdomain = https://api.xt.kuyicloud.com
49
+sso_domain = https://sso.kuyicloud.com
50
+front_end_domain = "https://xt.kuyicloud.com/#"
51
+
52
+readmysqlhost = shengws1.mysql.rds.aliyuncs.com
53
+readmysqlport = 3306
54
+readmysqluser = syh
55
+readmysqlpass = xhPECP2nFObR8aUK
56
+readmysqlname = sgj_xt
57
+
58
+writemysqlhost = shengws1.mysql.rds.aliyuncs.com
59
+writemysqlport = 3306
60
+writemysqluser = syh
61
+writemysqlpass = xhPECP2nFObR8aUK
62
+writemysqlname = sgj_xt
63
+
64
+
65
+readuserhost = shengws1.mysql.rds.aliyuncs.com
66
+readuserport = 3306
67
+readuseruser = syh
68
+readuserpass = xhPECP2nFObR8aUK
69
+readusername = sgj_users
70
+
71
+writeuserhost = shengws1.mysql.rds.aliyuncs.com
72
+writeuserport = 3306
73
+writeuseruser = syh
74
+writeuserpass = xhPECP2nFObR8aUK
75
+writeusername = sgj_users
76
+
77
+readmiddlehost = shengws1.mysql.rds.aliyuncs.com
78
+readmiddleport = 3306
79
+readmiddleuser = syh
80
+readmiddlepass = xhPECP2nFObR8aUK
81
+readmiddlename = ky_xt_middle
82
+
83
+writemiddlehost = shengws1.mysql.rds.aliyuncs.com
84
+writemiddleport = 3306
85
+writemiddleuser = syh
86
+writemiddlepass = xhPECP2nFObR8aUK
87
+writemiddlename = ky_xt_middle
88
+
89
+
90
+readsgjpatientmysqlhost = shengws1.mysql.rds.aliyuncs.com
91
+readsgjpatientmysqlport = 3306
92
+readsgjpatientmysqluser = syh
93
+readsgjpatientmysqlpass = xhPECP2nFObR8aUK
94
+readsgjpatientmysqlname = sgj_patient
95
+
96
+writesgjpatientmysqlhost = shengws1.mysql.rds.aliyuncs.com
97
+writesgjpatientmysqlport = 3306
98
+writesgjpatientmysqluser = syh
99
+writesgjpatientmysqlpass = xhPECP2nFObR8aUK
100
+writesgjpatientmysqlname = sgj_patient
101
+
102
+
103
+readpatienthost = shengws1.mysql.rds.aliyuncs.com
104
+readpatientport = 3306
105
+readpatientuser = syh
106
+readpatientpass = xhPECP2nFObR8aUK
107
+readpatientname = sgj_cdm
108
+
109
+writepatienthost = shengws1.mysql.rds.aliyuncs.com
110
+writepatientport = 3306
111
+writepatientuser = syh
112
+writepatientpass = xhPECP2nFObR8aUK
113
+writepatientname = sgj_cdm
114
+
115
+redishost = 349e580b2a524290.redis.rds.aliyuncs.com
116
+redisport = 6379
117
+redispasswrod = TZtBW098WId3i27clkpj3q8dnUaVFP
118
+redisdb = 0
119
+
120
+
121
+
122
+
123
+
124
+
125
+niprocart =  63
126
+jms = 58
127
+fistula_needle_set = 65
128
+fistula_needle_set_16 = 64
129
+hemoperfusion = 55
130
+dialyser_sterilised = 12
131
+filtryzer = 53
132
+dialyzers = 8
133
+injector = 81
134
+bloodlines = 42
135
+tubingHemodialysis = 30
136
+package = 82
137
+aliquid = 83
138
+
139
+
140
+
141
+[dev]
142
+mobile_token_expiration_second = 3600
143
+httpdomain = http://api.xt.test.sgjyun.com
144
+sso_domain = https://testsso.sgjyun.com
145
+front_end_domain = "http://xt.test.sgjyun.com/#"
146
+
147
+readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
148
+readmysqlport = 3306
149
+readmysqluser = root
150
+readmysqlpass = 1Q2W3e4r!@#$
151
+readmysqlname = test_xt
152
+//readmysqlname = sgj_xt
153
+
154
+writemysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
155
+writemysqlport = 3306
156
+writemysqluser = root
157
+writemysqlpass = 1Q2W3e4r!@#$
158
+writemysqlname = test_xt
159
+//writemysqlname = sgj_xt
160
+
161
+readuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
162
+readuserport = 3306
163
+readuseruser = root
164
+readuserpass = 1Q2W3e4r!@#$
165
+readusername = test_users
166
+//readusername = test_users
167
+
168
+writeuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
169
+writeuserport = 3306
170
+writeuseruser = root
171
+writeuserpass = 1Q2W3e4r!@#$
172
+writeusername = test_users
173
+//writeusername = test_users
174
+
175
+
176
+readmiddlehost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
177
+readmiddleport = 3306
178
+readmiddleuser = root
179
+readmiddlepass = 1Q2W3e4r!@#$
180
+readmiddlename = ky_xt_middle
181
+
182
+writemiddlehost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
183
+writemiddleport = 3306
184
+writemiddleuser = root
185
+writemiddlepass = 1Q2W3e4r!@#$
186
+writemiddlename = ky_xt_middle
187
+
188
+
189
+
190
+readpatienthost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
191
+readpatientport = 3306
192
+readpatientuser = root
193
+readpatientpass = 1Q2W3e4r!@#$
194
+readpatientname = sgj_cdm
195
+
196
+writepatienthost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
197
+writepatientport = 3306
198
+writepatientuser = root
199
+writepatientpass = 1Q2W3e4r!@#$
200
+writepatientname = sgj_cdm
201
+
202
+readsgjpatientmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
203
+readsgjpatientmysqlport = 3306
204
+readsgjpatientmysqluser = root
205
+readsgjpatientmysqlpass = 1Q2W3e4r!@#$
206
+readsgjpatientmysqlname = sgj_patient
207
+
208
+writesgjpatientmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
209
+writesgjpatientmysqlport = 3306
210
+writesgjpatientmysqluser = root
211
+writesgjpatientmysqlpass = 1Q2W3e4r!@#$
212
+writesgjpatientmysqlname = sgj_patient
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+#redishost = 120.77.235.13
221
+#redishost = 112.74.16.180
222
+redishost = localhost
223
+redisport = 6379
224
+redispasswrod = syh@#$%123456!
225
+redisdb = 0
226
+
227
+niprocart =  83
228
+jms = 80
229
+fistula_needle_set = 81
230
+fistula_needle_set_16 = 82
231
+hemoperfusion = 85
232
+dialyser_sterilised = 84
233
+filtryzer = 79
234
+dialyzers = 10000
235
+injector = 10001
236
+bloodlines = 10002
237
+tubingHemodialysis = 10003
238
+package = 10004
239
+aliquid = 10005

+ 60 - 60
controllers/base_api_controller.go 查看文件

@@ -2,7 +2,7 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
-	//"XT_New/models"
5
+	"XT_New/models"
6 6
 	"XT_New/service"
7 7
 	"fmt"
8 8
 	"strconv"
@@ -65,36 +65,36 @@ type BaseAuthAPIController struct {
65 65
 func (this *BaseAuthAPIController) Prepare() {
66 66
 	this.BaseAPIController.Prepare()
67 67
 	if this.GetAdminUserInfo() == nil {
68
-		//var userAdmin models.AdminUser
69
-		//userAdmin.Id = 400
70
-		//userAdmin.Mobile = "13535547901"
71
-		//
72
-		////userAdmin.Id = 597
73
-		////userAdmin.Mobile = "19874122664"
74
-		//userAdmin.IsSuperAdmin = false
75
-		//userAdmin.Status = 1
76
-		//userAdmin.CreateTime = 1530786071
77
-		//userAdmin.ModifyTime = 1530786071
78
-		//var subscibe models.ServeSubscibe
79
-		//subscibe.ID = 1
80
-		//subscibe.OrgId = 12
81
-		//subscibe.PeriodStart = 1538035409
82
-		//subscibe.PeriodEnd = 1569571409
83
-		//subscibe.State = 1
84
-		//subscibe.Status = 1
85
-		//subscibe.CreatedTime = 1538035409
86
-		//subscibe.UpdatedTime = 1538035409
87
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
88
-		//subscibes[4] = &subscibe
89
-		//var adminUserInfo service.AdminUserInfo
90
-		//adminUserInfo.CurrentOrgId = 12
91
-		//adminUserInfo.CurrentAppId = 18
92
-		//adminUserInfo.AdminUser = &userAdmin
93
-		//adminUserInfo.Subscibes = subscibes
94
-		//this.SetSession("admin_user_info", &adminUserInfo)
95
-
96
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
97
-		this.StopRun()
68
+		var userAdmin models.AdminUser
69
+		userAdmin.Id = 400
70
+		userAdmin.Mobile = "13535547901"
71
+
72
+		//userAdmin.Id = 597
73
+		//userAdmin.Mobile = "19874122664"
74
+		userAdmin.IsSuperAdmin = false
75
+		userAdmin.Status = 1
76
+		userAdmin.CreateTime = 1530786071
77
+		userAdmin.ModifyTime = 1530786071
78
+		var subscibe models.ServeSubscibe
79
+		subscibe.ID = 1
80
+		subscibe.OrgId = 12
81
+		subscibe.PeriodStart = 1538035409
82
+		subscibe.PeriodEnd = 1569571409
83
+		subscibe.State = 1
84
+		subscibe.Status = 1
85
+		subscibe.CreatedTime = 1538035409
86
+		subscibe.UpdatedTime = 1538035409
87
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
88
+		subscibes[4] = &subscibe
89
+		var adminUserInfo service.AdminUserInfo
90
+		adminUserInfo.CurrentOrgId = 12
91
+		adminUserInfo.CurrentAppId = 18
92
+		adminUserInfo.AdminUser = &userAdmin
93
+		adminUserInfo.Subscibes = subscibes
94
+		this.SetSession("admin_user_info", &adminUserInfo)
95
+
96
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
97
+		//this.StopRun()
98 98
 	}
99 99
 
100 100
 	adminUserInfo := this.GetAdminUserInfo()
@@ -316,35 +316,35 @@ type BaseServeAPIController struct {
316 316
 func (this *BaseServeAPIController) Prepare() {
317 317
 	this.BaseAPIController.Prepare()
318 318
 	if this.GetAdminUserInfo() == nil {
319
-		//var userAdmin models.AdminUser
320
-		//userAdmin.Id = 400
321
-		//userAdmin.Mobile = "13535547901"
322
-		////userAdmin.Id = 597
323
-		////userAdmin.Mobile = "19874122664"
324
-		//userAdmin.IsSuperAdmin = false
325
-		//userAdmin.Status = 1
326
-		//userAdmin.CreateTime = 1530786071
327
-		//userAdmin.ModifyTime = 1530786071
328
-		//var subscibe models.ServeSubscibe
329
-		//subscibe.ID = 1
330
-		//subscibe.OrgId = 12
331
-		//subscibe.PeriodStart = 1538035409
332
-		//subscibe.PeriodEnd = 1569571409
333
-		//subscibe.State = 1
334
-		//subscibe.Status = 1
335
-		//subscibe.CreatedTime = 1538035409
336
-		//subscibe.UpdatedTime = 1538035409
337
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
-		//subscibes[4] = &subscibe
339
-		//var adminUserInfo service.AdminUserInfo
340
-		//adminUserInfo.CurrentOrgId = 12
341
-		//adminUserInfo.CurrentAppId = 18
342
-		//adminUserInfo.AdminUser = &userAdmin
343
-		//adminUserInfo.Subscibes = subscibes
344
-		//this.SetSession("admin_user_info", &adminUserInfo)
345
-
346
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
347
-		this.StopRun()
319
+		var userAdmin models.AdminUser
320
+		userAdmin.Id = 400
321
+		userAdmin.Mobile = "13535547901"
322
+		//userAdmin.Id = 597
323
+		//userAdmin.Mobile = "19874122664"
324
+		userAdmin.IsSuperAdmin = false
325
+		userAdmin.Status = 1
326
+		userAdmin.CreateTime = 1530786071
327
+		userAdmin.ModifyTime = 1530786071
328
+		var subscibe models.ServeSubscibe
329
+		subscibe.ID = 1
330
+		subscibe.OrgId = 12
331
+		subscibe.PeriodStart = 1538035409
332
+		subscibe.PeriodEnd = 1569571409
333
+		subscibe.State = 1
334
+		subscibe.Status = 1
335
+		subscibe.CreatedTime = 1538035409
336
+		subscibe.UpdatedTime = 1538035409
337
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
+		subscibes[4] = &subscibe
339
+		var adminUserInfo service.AdminUserInfo
340
+		adminUserInfo.CurrentOrgId = 12
341
+		adminUserInfo.CurrentAppId = 18
342
+		adminUserInfo.AdminUser = &userAdmin
343
+		adminUserInfo.Subscibes = subscibes
344
+		this.SetSession("admin_user_info", &adminUserInfo)
345
+
346
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
347
+		//this.StopRun()
348 348
 	}
349 349
 
350 350
 	//if adminUserInfo.AppRole != nil {

+ 0 - 1
controllers/device_api_controller.go 查看文件

@@ -1109,7 +1109,6 @@ func (this *DeviceAPIController) GetAllMachineInfo() {
1109 1109
 	adminUserInfo := this.GetAdminUserInfo()
1110 1110
 	orgid := adminUserInfo.CurrentOrgId
1111 1111
 	addmahcer, total, err := service.GetAllMachineInfo(page, limit, searchKey, zoneid, equipmentid, statusid, orgid)
1112
-	fmt.Println("addmacher", addmahcer)
1113 1112
 	//fmt.Println("err------------------------------------------------------", err)
1114 1113
 	if err != nil {
1115 1114
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "查询设备失败")

+ 21 - 34
controllers/dialysis_api_controller.go 查看文件

@@ -3070,31 +3070,17 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
3070 3070
 	}
3071 3071
 
3072 3072
 	if assessment.ID > 0 {
3073
-		//if appRole.UserType == 3 {
3074
-		//	if assessment.Creater != adminUserInfo.AdminUser.Id && assessment.Creater != 0 {
3075
-		//		headNursePermission, getPermissionErr := service.GetAdminUserSpecialPermission(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, models.SpecialPermissionTypeHeadNurse)
3076
-		//		if getPermissionErr != nil {
3077
-		//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3078
-		//			return
3079
-		//		} else if headNursePermission == nil {
3080
-		//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisPermissionDeniedModify)
3081
-		//			return
3082
-		//		}
3083
-		//	}
3084
-		//}
3073
+
3085 3074
 		if appRole.UserType == 2 || appRole.UserType == 1 {
3086 3075
 			assessment.AssessmentDoctor = adminUserInfo.AdminUser.Id
3087 3076
 			assessment.AssessmentTime = time.Now().Unix()
3088
-
3089
-		}
3090
-		if assessment.Creater == 0 {
3091
-			assessment.Modifier = adminUserInfo.AdminUser.Id
3092
-			assessment.Creater = adminUserInfo.AdminUser.Id
3093
-
3094 3077
 		} else {
3095
-			assessment.Modifier = adminUserInfo.AdminUser.Id
3096
-			assessment.Creater = assessment.Creater
3097
-
3078
+			if assessment.Creater == 0 {
3079
+				assessment.Modifier = adminUserInfo.AdminUser.Id
3080
+				assessment.Creater = adminUserInfo.AdminUser.Id
3081
+			} else {
3082
+				assessment.Modifier = adminUserInfo.AdminUser.Id
3083
+			}
3098 3084
 		}
3099 3085
 
3100 3086
 		assessment.UpdatedTime = time.Now().Unix()
@@ -3103,9 +3089,9 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
3103 3089
 		if appRole.UserType == 2 || appRole.UserType == 1 {
3104 3090
 			assessment.AssessmentDoctor = adminUserInfo.AdminUser.Id
3105 3091
 			assessment.AssessmentTime = time.Now().Unix()
3106
-
3092
+		} else {
3093
+			assessment.Creater = adminUserInfo.AdminUser.Id
3107 3094
 		}
3108
-		assessment.Creater = adminUserInfo.AdminUser.Id
3109 3095
 		assessment.CreatedTime = time.Now().Unix()
3110 3096
 		assessment.UpdatedTime = time.Now().Unix()
3111 3097
 		assessment.UserOrgId = adminUserInfo.CurrentOrgId
@@ -3253,9 +3239,10 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3253 3239
 		if appRole.UserType == 2 || appRole.UserType == 1 {
3254 3240
 			assessmentBeforeDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
3255 3241
 			assessmentBeforeDislysis.AssessmentTime = time.Now().Unix()
3256
-		}
3242
+		} else {
3243
+			assessmentBeforeDislysis.Creater = adminUserInfo.AdminUser.Id
3257 3244
 
3258
-		assessmentBeforeDislysis.Creater = adminUserInfo.AdminUser.Id
3245
+		}
3259 3246
 
3260 3247
 		err := service.AddSigleAssessmentBeforeDislysisRecord(&assessmentBeforeDislysis)
3261 3248
 		if err == nil {
@@ -3284,14 +3271,13 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3284 3271
 		if appRole.UserType == 2 || appRole.UserType == 1 {
3285 3272
 			assessmentBeforeDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
3286 3273
 			assessmentBeforeDislysis.AssessmentTime = time.Now().Unix()
3287
-		}
3288
-
3289
-		if evaluation.Creater == 0 {
3290
-			assessmentBeforeDislysis.Modifier = adminUserInfo.AdminUser.Id
3291
-			assessmentBeforeDislysis.Creater = adminUserInfo.AdminUser.Id
3292 3274
 		} else {
3293
-			assessmentBeforeDislysis.Modifier = adminUserInfo.AdminUser.Id
3294
-			assessmentBeforeDislysis.Creater = evaluation.Creater
3275
+			if evaluation.Creater == 0 {
3276
+				assessmentBeforeDislysis.Modifier = adminUserInfo.AdminUser.Id
3277
+				assessmentBeforeDislysis.Creater = adminUserInfo.AdminUser.Id
3278
+			} else {
3279
+				assessmentBeforeDislysis.Modifier = adminUserInfo.AdminUser.Id
3280
+			}
3295 3281
 		}
3296 3282
 
3297 3283
 		assessmentBeforeDislysis.UpdatedTime = time.Now().Unix()
@@ -4322,11 +4308,12 @@ func (c *DialysisApiController) GetDialysisOrder() {
4322 4308
 	//获取医嘱内容
4323 4309
 	doctor, err := service.FindDoctor(doctorAdvice.AdviceDoctor, adminUserInfo.CurrentAppId, adminUserInfo.CurrentOrgId)
4324 4310
 	DoctorName, err := service.FindDoctorName(doctorAdvice.AdviceDoctor, adminUserInfo.CurrentAppId, adminUserInfo.CurrentOrgId)
4325
-	//fmt.Print("err---------------------------------",err)
4311
+	fmt.Print("err-----------------------------------------------------------------", err)
4326 4312
 	DoctorAdvice, _ := service.FindDoctorAdviceOrderById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4327 4313
 	doctorAdevieInfo, err := service.FindDoctorAdviceByInfo(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4328 4314
 	//获取上次的透后体重
4329
-	assessmentAfterDislysis, _ := service.MobileGetLastTimeAssessmentAfterDislysis(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4315
+	//	assessmentAfterDislysis, _ := service.MobileGetLastTimeAssessmentAfterDislysis(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4316
+	assessmentAfterDislysis, _ := service.MobileGetLast(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4330 4317
 	//获取透析次数
4331 4318
 	_, total, err := service.GetTotalDialysisCout(adminUserInfo.CurrentOrgId, patientInfo.ID)
4332 4319
 

+ 16 - 29
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -872,18 +872,18 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
872 872
 		IsEat:                        is_eat,
873 873
 	}
874 874
 
875
-	//appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
875
+	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
876 876
 
877 877
 	_, assessmentAfter := service.FindAssessmentAfterDislysisByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
878 878
 	if assessmentAfter.ID == 0 { //新增
879
-		//if appRole.UserType == 2 || appRole.UserType == 1 {
880
-		assessmentAfterDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
881
-		assessmentAfterDislysis.AssessmentTime = time.Now().Unix()
879
+		if appRole.UserType == 2 || appRole.UserType == 1 {
880
+			assessmentAfterDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
881
+			assessmentAfterDislysis.AssessmentTime = time.Now().Unix()
882 882
 
883
-		//} else {
884
-		assessmentAfterDislysis.Creater = adminUserInfo.AdminUser.Id
883
+		} else {
884
+			assessmentAfterDislysis.Creater = adminUserInfo.AdminUser.Id
885 885
 
886
-		//}
886
+		}
887 887
 
888 888
 		err := service.AddSigleAssessmentAfterDislysisRecord(&assessmentAfterDislysis)
889 889
 		if err == nil {
@@ -892,29 +892,16 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
892 892
 			})
893 893
 		}
894 894
 	} else { //修改
895
-		//if appRole.UserType == 3 {
896
-		//	if assessmentAfter.Creater != adminUserInfo.AdminUser.Id && assessmentAfter.Creater != 0 {
897
-		//		headNursePermission, getPermissionErr := service.GetAdminUserSpecialPermission(adminUserInfo.Org.Id, adminUserInfo.App.Id, adminUserInfo.AdminUser.Id, models.SpecialPermissionTypeHeadNurse)
898
-		//		if getPermissionErr != nil {
899
-		//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
900
-		//			return
901
-		//		} else if headNursePermission == nil {
902
-		//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisPermissionDeniedModify)
903
-		//			return
904
-		//		}
905
-		//	}
906
-		//}
907 895
 
908
-		//TODO 根据角色判断
909
-		//if appRole.UserType == 2 || appRole.UserType == 1 {
910
-		assessmentAfterDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
911
-		assessmentAfterDislysis.AssessmentTime = time.Now().Unix()
912
-		//} else {
913
-		assessmentAfterDislysis.Modifier = adminUserInfo.AdminUser.Id
914
-		if assessmentAfterDislysis.Creater == 0 {
915
-			assessmentAfterDislysis.Creater = adminUserInfo.AdminUser.Id
896
+		if appRole.UserType == 2 || appRole.UserType == 1 {
897
+			assessmentAfterDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
898
+			assessmentAfterDislysis.AssessmentTime = time.Now().Unix()
899
+		} else {
900
+			assessmentAfterDislysis.Modifier = adminUserInfo.AdminUser.Id
901
+			if assessmentAfterDislysis.Creater == 0 {
902
+				assessmentAfterDislysis.Creater = adminUserInfo.AdminUser.Id
903
+			}
916 904
 		}
917
-		//}
918 905
 
919 906
 		assessmentAfterDislysis.CreatedTime = assessmentAfter.CreatedTime
920 907
 		assessmentAfterDislysis.ID = assessmentAfter.ID
@@ -2248,7 +2235,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2248 2235
 
2249 2236
 		prescription.CreatedTime = dialysisPrescription.CreatedTime
2250 2237
 		prescription.Modifier = adminUserInfo.AdminUser.Id
2251
-		prescription.Creater = dialysisPrescription.Creater
2238
+		prescription.Creater = adminUserInfo.AdminUser.Id
2252 2239
 
2253 2240
 		prescription.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2254 2241
 		prescription.ID = dialysisPrescription.ID

+ 15 - 32
controllers/mobile_api_controllers/patient_api_controller.go 查看文件

@@ -843,27 +843,10 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
843 843
 		return
844 844
 	}
845 845
 	//templateInfo,_ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
846
-	//appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
846
+	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
847 847
 	var evaluation models.PredialysisEvaluation
848 848
 	if theEvaluation != nil {
849
-		//if appRole.UserType == 2 || appRole.UserType == 1 {
850
-
851 849
 		evaluation = *theEvaluation
852
-
853
-		//} else {
854
-		//	if theEvaluation.Creater != adminUserInfo.AdminUser.Id && theEvaluation.Creater != 0 {
855
-		//		headNursePermission, getPermissionErr := service.GetAdminUserSpecialPermission(adminUserInfo.Org.Id, adminUserInfo.App.Id, adminUserInfo.AdminUser.Id, models.SpecialPermissionTypeHeadNurse)
856
-		//		if getPermissionErr != nil {
857
-		//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
858
-		//			return
859
-		//		} else if headNursePermission == nil {
860
-		//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDialysisPermissionDeniedModify)
861
-		//			return
862
-		//		}
863
-		//	} else {
864
-		//		evaluation = *theEvaluation
865
-		//	}
866
-		//}
867 850
 	}
868 851
 
869 852
 	code := predialysisEvaluationFormData(&evaluation, c.Ctx.Input.RequestBody)
@@ -879,24 +862,24 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
879 862
 		evaluation.AssessmentDate = theAssessmentDateTime
880 863
 		evaluation.PatientId = id
881 864
 		evaluation.UserOrgId = adminUserInfo.Org.Id
882
-		//if appRole.UserType == 2 || appRole.UserType == 1 {
883
-		//	evaluation.AssessmentDoctor = adminUserInfo.AdminUser.Id
884
-		//	evaluation.AssessmentTime = time.Now().Unix()
885
-		//} else {
886
-		evaluation.Creater = adminUserInfo.AdminUser.Id
887
-		//}
865
+		if appRole.UserType == 2 || appRole.UserType == 1 {
866
+			evaluation.AssessmentDoctor = adminUserInfo.AdminUser.Id
867
+			evaluation.AssessmentTime = time.Now().Unix()
868
+		} else {
869
+			evaluation.Creater = adminUserInfo.AdminUser.Id
870
+		}
888 871
 	} else {
889 872
 		evaluation.UpdatedTime = time.Now().Unix()
890 873
 		evaluation.Evaluator = adminUserInfo.AdminUser.Id
891
-		//if appRole.UserType == 2 || appRole.UserType == 1 {
892
-		//	evaluation.AssessmentDoctor = adminUserInfo.AdminUser.Id
893
-		//	evaluation.AssessmentTime = time.Now().Unix()
894
-		//} else {
895
-		evaluation.Modifier = adminUserInfo.AdminUser.Id
896
-		if evaluation.Creater == 0 {
897
-			evaluation.Creater = adminUserInfo.AdminUser.Id
874
+		if appRole.UserType == 2 || appRole.UserType == 1 {
875
+			evaluation.AssessmentDoctor = adminUserInfo.AdminUser.Id
876
+			evaluation.AssessmentTime = time.Now().Unix()
877
+		} else {
878
+			evaluation.Modifier = adminUserInfo.AdminUser.Id
879
+			if evaluation.Creater == 0 {
880
+				evaluation.Creater = adminUserInfo.AdminUser.Id
881
+			}
898 882
 		}
899
-		//}
900 883
 	}
901 884
 
902 885
 	//新增逻辑

+ 1 - 9
controllers/new_mobile_api_controllers/home_api_controller.go 查看文件

@@ -283,14 +283,6 @@ func (this *HomeController) CreateOrg() {
283 283
 	}
284 284
 	orgPhone := this.GetString("telephone")
285 285
 
286
-	if len(orgPhone) > 0 {
287
-		if utils.PhoneRegexp().MatchString(orgPhone) == false {
288
-			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
289
-			this.ServeJSON()
290
-			return
291
-		}
292
-	}
293
-
294 286
 	provinceID := 0
295 287
 	cityID := 0
296 288
 	districtID := 0
@@ -377,8 +369,8 @@ func (this *HomeController) CreateOrg() {
377 369
 		InitRoleAndPurviews(org)
378 370
 		//初始化设备管理
379 371
 		InitEquitMentInformation(org)
380
-
381 372
 		//初始化显示配置
373
+		//InitShowConfig(org)
382 374
 
383 375
 		if len(orgs) == 0 {
384 376
 			ip := utils.GetIP(this.Ctx.Request)

+ 0 - 2
controllers/new_mobile_api_controllers/mobile_regist_controller.go 查看文件

@@ -235,8 +235,6 @@ func (this *MobileRegistController) CreateOrg() {
235 235
 		InitPatientAndSchedule(org)
236 236
 		//初始化透析方案
237 237
 		InitSystemPrescrption(org)
238
-		//初始化医嘱模版
239
-		//InitAdviceTemplate(org)
240 238
 		//初始化角色和权限
241 239
 		InitRoleAndPurviews(org)
242 240
 		//初始化设备管理org

+ 4 - 8
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

@@ -8,7 +8,6 @@ import (
8 8
 	"crypto/md5"
9 9
 	"encoding/json"
10 10
 	"fmt"
11
-	"github.com/astaxie/beego"
12 11
 	"github.com/jinzhu/gorm"
13 12
 	"strconv"
14 13
 	"strings"
@@ -1992,7 +1991,6 @@ func (this *NewDialysisApiController) LoginOut() {
1992 1991
 	this.Ctx.SetCookie("logout_cookie", "1")
1993 1992
 	this.Ctx.SetCookie("token_cookie", "")
1994 1993
 	id, _ := this.GetInt64("id")
1995
-	fmt.Println("id------------------------------------------", id)
1996 1994
 	loginLog := models.SgjUserAdminLoginLog{
1997 1995
 		AdminUserId: id,
1998 1996
 		OrgId:       0,
@@ -2161,7 +2159,7 @@ func (this *NewDialysisApiController) EditOrg() {
2161 2159
 			cityID = int(city.ID)
2162 2160
 			district, getDistrictErr := service.GetDistrictWithName(city.ID, districtName)
2163 2161
 			if getDistrictErr != nil {
2164
-				utils.ErrorLog("查询区县名失:%v", getDistrictErr)
2162
+				utils.ErrorLog("查询区县名失:%v", getDistrictErr)
2165 2163
 				this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2166 2164
 				this.ServeJSON()
2167 2165
 				return
@@ -2361,18 +2359,16 @@ func (this *NewDialysisApiController) GetCurrentOrg() {
2361 2359
 	nowTime := time.Now().Unix()
2362 2360
 	adminInfo := this.GetMobileAdminUserInfo()
2363 2361
 	orgId := adminInfo.Org.Id
2364
-	fxKey := beego.AppConfig.String("fxtokenkey")
2365
-	stringA := fmt.Sprintf("org_id=%d&time=%d", orgId, nowTime)
2366 2362
 
2363
+	var key = "kN*5&AHqLP7&IGRKvHoElJm*2YY6Nw*QSScJ4ff&DH&ofGnbfQIks1A1NT9AbIDB"
2364
+	stringA := fmt.Sprintf("org_id=%d&time=%d", orgId, nowTime)
2367 2365
 	data := []byte(stringA)
2368 2366
 	has := md5.Sum(data)
2369 2367
 	md5str := fmt.Sprintf("%x", has)
2370
-	stringB := fmt.Sprintf("string=%s&key=%s", md5str, fxKey)
2371
-
2368
+	stringB := fmt.Sprintf("string=%s&key=%s", md5str, key)
2372 2369
 	data = []byte(stringB)
2373 2370
 	has = md5.Sum(data)
2374 2371
 	signToken := fmt.Sprintf("%x", has)
2375
-
2376 2372
 	name, err := service.GetOrgName(orgId)
2377 2373
 	//var fxlink = signToken + fmt.Sprintf("&fxtoken=%s&fxorgid=%d&timestamp=%d&fxadmin=%d", signToken, orgId, nowTime, name.Creator)
2378 2374
 	//fmt.Println(fxlink)

+ 3 - 3
controllers/new_mobile_api_controllers/role.json 查看文件

@@ -7,7 +7,7 @@
7 7
       "status": 1,
8 8
       "is_system": 1,
9 9
       "number": 9999,
10
-      "purview_ids": "71,72,70,74,75,73,48,52,110,49,77,78,79,80,197,76,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,127,128,201,193,194,196,192,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,101,100,102",
10
+      "purview_ids": "71,72,70,74,75,73,48,49,52,110,49,77,78,79,80,197,76,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,127,128,201,193,194,196,192,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,101,100,102",
11 11
       "func_ids": "20001,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20034,20035,20036,20038,20039,20055,20056,20040,20041,20042,20043,20054,20044,20045,20046,20047,20048,20049,20050,20051,20052,20053,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030"
12 12
     },
13 13
     {
@@ -30,7 +30,7 @@
30 30
       "is_system": 3,
31 31
       "number": 9997,
32 32
       "purview_ids": "71,72,70,74,75,73,127,128,48,49,52,110,111,112,113,114,115,116,117,118,119,129,84,77,78,79,80,197,76",
33
-      "func_ids": "20007,20008,20009,20010,20011,20051,20053,20013,20014,20016,20017,20019,20021,20022,20024,20025,20026,20027,20028,20029"
33
+      "func_ids": "20007,20008,20009,20010,20011,20051,20053,20013,20014,20016,20017,20019,20021,20022,20024,20025,20026,20027,20028,20029,20055,20056,20052,20012"
34 34
     },
35 35
     {
36 36
       "role_name": "库存",
@@ -75,7 +75,7 @@
75 75
       "status": 1,
76 76
       "is_system": 0,
77 77
       "number": 9993,
78
-      "purview_ids": "71,72,70,74,75,73,48,52,110,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,77,78,79,80,197,76,101,100,102,127,128,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,201",
78
+      "purview_ids": "71,72,70,74,75,73,48,49,52,110,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,77,78,79,80,197,76,101,100,102,127,128,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,201",
79 79
       "func_ids": ""
80 80
 
81 81
 

+ 20 - 21
controllers/public_api_controller.go 查看文件

@@ -468,7 +468,6 @@ func (c *PublicApiController) HandleData() {
468 468
 	//			continue
469 469
 	//		}
470 470
 	//
471
-	//
472 471
 	//		app.OrgId = apps.OrgId
473 472
 	//		app.Creator = int(org.Creator)
474 473
 	//		app.Pid = xt_temp_org_app.Id
@@ -503,26 +502,26 @@ func (c *PublicApiController) HandleData() {
503 502
 	//}
504 503
 	////护士医生
505 504
 	//app_roles2  := service.GetAllUserRoleByUserTypeOther()
506
-	//	//for _, item := range app_roles2{
507
-	//	//	var ids string
508
-	//	//	if len(item.RoleIds) == 0{
509
-	//	//		ids = strconv.FormatInt( item.RoleId,10)
510
-	//	//	}else{
511
-	//	//		ids = item.RoleIds + ","+strconv.FormatInt( item.RoleId,10)
512
-	//	//	}
513
-	//	//	if item.UserType == 2{
514
-	//	//		role := service.FindRoleByUserTypeOne(item.OrgId)
515
-	//	//		ids = ids +"," + strconv.FormatInt(role.Id,10)
516
-	//	//
517
-	//	//	} else if item.UserType == 3{
518
-	//	//		role := service.FindRoleByUserTypeTwo(item.OrgId)
519
-	//	//		ids = ids +"," + strconv.FormatInt(role.Id,10)
520
-	//	//	}
521
-	//	//	service.UpdateRoleIds(item.Id, ids)
522
-	//	//}
523
-	c.ServeSuccessJSON(map[string]interface{}{
524
-		"msg": "ok",
525
-	})
505
+	//	for _, item := range app_roles2{
506
+	//		var ids string
507
+	//		if len(item.RoleIds) == 0{
508
+	//			ids = strconv.FormatInt( item.RoleId,10)
509
+	//		}else{
510
+	//			ids = item.RoleIds + ","+strconv.FormatInt( item.RoleId,10)
511
+	//		}
512
+	//		if item.UserType == 2{
513
+	//			role := service.FindRoleByUserTypeOne(item.OrgId)
514
+	//			ids = ids +"," + strconv.FormatInt(role.Id,10)
515
+	//
516
+	//		} else if item.UserType == 3{
517
+	//			role := service.FindRoleByUserTypeTwo(item.OrgId)
518
+	//			ids = ids +"," + strconv.FormatInt(role.Id,10)
519
+	//		}
520
+	//		service.UpdateRoleIds(item.Id, ids)
521
+	//	}
522
+	//c.ServeSuccessJSON(map[string]interface{}{
523
+	//	"msg": "ok",
524
+	//})
526 525
 
527 526
 }
528 527
 

+ 49 - 2
controllers/role.json 查看文件

@@ -7,7 +7,7 @@
7 7
       "status": 1,
8 8
       "is_system": 1,
9 9
       "number": 9999,
10
-      "purview_ids": "71,72,70,74,75,73,48,52,110,49,77,78,79,80,197,76,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,127,128,201,193,194,196,192,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,101,100,102",
10
+      "purview_ids": "71,72,70,74,75,73,48,49,52,110,49,77,78,79,80,197,76,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,127,128,201,193,194,196,192,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,101,100,102",
11 11
       "func_ids": "20001,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20034,20035,20036,20038,20039,20055,20056,20040,20041,20042,20043,20054,20044,20045,20046,20047,20048,20049,20050,20051,20052,20053,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030"
12 12
     },
13 13
     {
@@ -30,7 +30,54 @@
30 30
       "is_system": 3,
31 31
       "number": 9997,
32 32
       "purview_ids": "71,72,70,74,75,73,127,128,48,49,52,110,111,112,113,114,115,116,117,118,119,129,84,77,78,79,80,197,76",
33
-      "func_ids": "20007,20008,20009,20010,20011,20051,20053,20013,20014,20016,20017,20019,20021,20022,20024,20025,20026,20027,20028,20029"
33
+      "func_ids": "20007,20008,20009,20010,20011,20051,20053,20013,20014,20016,20017,20019,20021,20022,20024,20025,20026,20027,20028,20029,20055,20056,20052,20012"
34
+    },{
35
+      "role_name": "库存",
36
+      "role_introduction": "库存角色负责透析耗材的日常管理,对耗材的入库、出库、退库的登记操作",
37
+      "is_super_admin": false,
38
+      "status": 1,
39
+      "is_system": 0,
40
+      "number": 9996,
41
+      "purview_ids": "111,112,113,114,115,116,117,118,119,129,84",
42
+      "func_ids": ""
43
+
44
+
45
+
46
+    },{
47
+      "role_name": "运营",
48
+      "role_introduction": "运营角色能够在SCRM中管理微网站、使用营销工具、做会员管理和分销商品经营的操作",
49
+      "is_super_admin": false,
50
+      "status": 1,
51
+      "is_system": 0,
52
+      "number": 9995,
53
+      "purview_ids": "48,110,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,201",
54
+      "func_ids": ""
55
+
56
+
57
+
58
+    },{
59
+      "role_name": "技师",
60
+      "role_introduction": "技师角色能够进行设备的管理,日常维护维修记录等",
61
+      "is_super_admin": false,
62
+      "status": 1,
63
+      "is_system": 0,
64
+      "number": 9994,
65
+      "purview_ids": "77,78,79,80,197,76",
66
+      "func_ids": ""
67
+
68
+
69
+    },
70
+    {
71
+      "role_name": "院长",
72
+      "role_introduction": "院长角色了解血透患者血液透析质量和相关的大数据,以及掌握透析中心整体运营情况",
73
+      "is_super_admin": false,
74
+      "status": 1,
75
+      "is_system": 0,
76
+      "number": 9993,
77
+      "purview_ids": "71,72,70,74,75,73,48,49,52,110,111,112,113,114,115,116,117,118,119,129,84,93,121,122,124,125,120,77,78,79,80,197,76,101,100,102,127,128,158,157,159,160,161,162,167,166,168,169,170,171,174,173,175,178,177,179,201",
78
+      "func_ids": ""
79
+
80
+
34 81
     }
35 82
   ]
36 83
 }

+ 15 - 15
service/app_version.go 查看文件

@@ -21,7 +21,7 @@ func GetAppVersionByAppType(apptype int64) (*models.AppVersion, error) {
21 21
 
22 22
 func GetAllAppOrg() ([]*models.OrgApp, error) {
23 23
 	var app []*models.OrgApp
24
-	err := readUserDbT.Model(&models.OrgApp{}).Where("status = 1 AND org_id > 0").Group("org_id").Find(&app).Error
24
+	err := readUserDb.Model(&models.OrgApp{}).Where("status = 1 AND org_id > 0").Group("org_id").Find(&app).Error
25 25
 	if err == gorm.ErrRecordNotFound {
26 26
 		return nil, nil
27 27
 	}
@@ -60,7 +60,7 @@ func GetApp() ([]*models.OrgApp, error) {
60 60
 
61 61
 func GetAppByType(orgID int64, app_type int) (*models.OrgApp, error) {
62 62
 	var apps models.OrgApp
63
-	err := readUserDbT.Where("app_type = ? AND org_id = ? AND status = 1", app_type, orgID).First(&apps).Error
63
+	err := readUserDb.Where("app_type = ? AND org_id = ? AND status = 1", app_type, orgID).First(&apps).Error
64 64
 	if err != nil {
65 65
 		return nil, err
66 66
 	}
@@ -68,7 +68,7 @@ func GetAppByType(orgID int64, app_type int) (*models.OrgApp, error) {
68 68
 }
69 69
 
70 70
 func CreateOrgApp(app *models.OrgApp) {
71
-	writeUserDbT.Create(&app)
71
+	writeUserDb.Create(&app)
72 72
 
73 73
 }
74 74
 
@@ -84,7 +84,7 @@ func GetAllUserRole(org_id int64) (appRole []*models.App_Role) {
84 84
 }
85 85
 
86 86
 func GetAllUserRoleByUserTypeOne(org_id int) (appRole []*models.App_Role) {
87
-	readUserDbT.Model(&models.App_Role{}).Where("status = 1 AND user_type = 1").Find(&appRole)
87
+	readUserDb.Model(&models.App_Role{}).Where("status = 1 AND user_type = 1").Find(&appRole)
88 88
 	return
89 89
 }
90 90
 
@@ -92,7 +92,7 @@ func GetAllUserRoleByUserTypeOther() (appRole []*models.App_Role) {
92 92
 	//app, _ := GetOrgApp(int64(org_id), 3)
93 93
 
94 94
 	//if org_id == 0 {
95
-	readUserDbT.Model(&models.App_Role{}).Where("status = 1 AND user_type > 1").Find(&appRole)
95
+	readUserDb.Model(&models.App_Role{}).Where("status = 1 AND user_type > 1").Find(&appRole)
96 96
 	//
97 97
 	//} else {
98 98
 	//	readUserDb.Model(&models.App_Role{}).Where("status = 1 AND org_id = ?  AND user_type > 1 AND app_id = ? ", org_id, app.Id).Find(&appRole)
@@ -102,18 +102,18 @@ func GetAllUserRoleByUserTypeOther() (appRole []*models.App_Role) {
102 102
 }
103 103
 
104 104
 func FindRoleByUserTypeOne(org_id int64) (role models.Role) {
105
-	readUserDbT.Model(&models.Role{}).Where("status = 1 AND org_id = ? AND is_system = 2 AND role_name = '医生'", org_id).First(&role)
105
+	readUserDb.Model(&models.Role{}).Where("status = 1 AND org_id = ? AND is_system = 2 AND role_name = '医生'", org_id).First(&role)
106 106
 	return
107 107
 }
108 108
 
109 109
 func FindRoleByUserTypeTwo(org_id int64) (role models.Role) {
110
-	readUserDbT.Model(&models.Role{}).Where("status = 1 AND org_id = ? AND is_system = 3 AND role_name = '护士'", org_id).First(&role)
110
+	readUserDb.Model(&models.Role{}).Where("status = 1 AND org_id = ? AND is_system = 3 AND role_name = '护士'", org_id).First(&role)
111 111
 	return
112 112
 }
113 113
 
114 114
 func GetAllRole() ([]*models.Role, error) {
115 115
 	var app []*models.Role
116
-	err := readUserDbT.Model(&models.Role{}).Where("status = 1 AND org_id > 0").Group("org_id").Find(&app).Error
116
+	err := readUserDb.Model(&models.Role{}).Where("status = 1 AND org_id > 0").Group("org_id").Find(&app).Error
117 117
 	if err == gorm.ErrRecordNotFound {
118 118
 		return nil, nil
119 119
 	}
@@ -124,13 +124,13 @@ func GetAllRole() ([]*models.Role, error) {
124 124
 }
125 125
 
126 126
 func UpdateRoleIds(id int64, ids string) {
127
-	writeUserDbT.Model(&models.App_Role{}).Where("status = 1 AND id = ?", id).Updates(map[string]interface{}{"role_ids": ids, "mtime": time.Now().Unix()})
127
+	writeUserDb.Model(&models.App_Role{}).Where("status = 1 AND id = ?", id).Updates(map[string]interface{}{"role_ids": ids, "mtime": time.Now().Unix()})
128 128
 
129 129
 }
130 130
 
131 131
 func GetOrgAppA(orgID int64, app_type int) (*models.OrgApp, error) {
132 132
 	var apps models.OrgApp
133
-	err := readUserDbT.Where("app_type = ? AND org_id = ? AND status = 1", app_type, orgID).First(&apps).Error
133
+	err := readUserDb.Where("app_type = ? AND org_id = ? AND status = 1", app_type, orgID).First(&apps).Error
134 134
 	if err != nil {
135 135
 		return nil, err
136 136
 	}
@@ -139,7 +139,7 @@ func GetOrgAppA(orgID int64, app_type int) (*models.OrgApp, error) {
139 139
 
140 140
 func GetOrgByIdB(orgID int64) (*models.Org, error) {
141 141
 	var org models.Org
142
-	err := readUserDbT.Model(&models.Org{}).Where("id = ?", orgID).First(&org).Error
142
+	err := readUserDb.Model(&models.Org{}).Where("id = ?", orgID).First(&org).Error
143 143
 	if err != nil {
144 144
 		if err == gorm.ErrRecordNotFound {
145 145
 			return nil, nil
@@ -152,7 +152,7 @@ func GetOrgByIdB(orgID int64) (*models.Org, error) {
152 152
 
153 153
 func GetOrgAppB(orgID int64, app_type int) (*models.OrgApp, error) {
154 154
 	var apps models.OrgApp
155
-	err := readUserDbT.Where("app_type = ? AND org_id = ? AND status = 1", app_type, orgID).First(&apps).Error
155
+	err := readUserDb.Where("app_type = ? AND org_id = ? AND status = 1", app_type, orgID).First(&apps).Error
156 156
 	if err != nil {
157 157
 		return nil, err
158 158
 	}
@@ -160,16 +160,16 @@ func GetOrgAppB(orgID int64, app_type int) (*models.OrgApp, error) {
160 160
 }
161 161
 
162 162
 func CreateOrgRoleB(role *models.Role) (err error) {
163
-	err = writeUserDbT.Create(&role).Error
163
+	err = writeUserDb.Create(&role).Error
164 164
 	return
165 165
 }
166 166
 
167 167
 func CreateRolePurviewB(purview *models.RolePurview) (err error) {
168
-	err = writeUserDbT.Create(&purview).Error
168
+	err = writeUserDb.Create(&purview).Error
169 169
 	return
170 170
 }
171 171
 
172 172
 func CreateFuncRolePurviewB(purview *models.SgjUserRoleFuncPurview) (err error) {
173
-	err = writeUserDbT.Create(&purview).Error
173
+	err = writeUserDb.Create(&purview).Error
174 174
 	return
175 175
 }

+ 1 - 1
service/gobal_config_service.go 查看文件

@@ -81,7 +81,7 @@ func UpdateFiledConfig(org_id int64) (err error) {
81 81
 }
82 82
 
83 83
 func FindAllHideFiledConfig(template_id int64) (err error, config []*models.FiledConfig) {
84
-	err = readDb.Model(&models.FiledConfig{}).Where("sys_module = 0  AND is_show = 2", template_id).Find(&config).Error
84
+	err = readDb.Model(&models.FiledConfig{}).Where("sys_module = ?  AND is_show = 2", template_id).Find(&config).Error
85 85
 	return
86 86
 }
87 87
 

+ 5 - 0
service/mobile_dialysis_service.go 查看文件

@@ -557,6 +557,11 @@ func MobileGetLastTimeAssessmentAfterDislysis(orgID int64, patientID int64, maxD
557 557
 	}
558 558
 	return &record, nil
559 559
 }
560
+func MobileGetLast(orgID int64, patientID int64, maxDate int64) (models.AssessmentAfterDislysis, error) {
561
+	dislysis := models.AssessmentAfterDislysis{}
562
+	err := readDb.Model(&models.AssessmentAfterDislysis{}).Where("patient_id = ? and user_org_id = ? and status = 1 and assessment_date < ?", patientID, orgID, maxDate).Order("assessment_date desc").First(&dislysis).Error
563
+	return dislysis, err
564
+}
560 565
 
561 566
 // 治疗小结
562 567
 func MobileGetTreatmentSummary(orgID int64, patientID int64, recordDate int64) (*models.TreatmentSummary, error) {