Pārlūkot izejas kodu

Merge branch 'master' of http://git.shengws.com/csx/XT_New

张保健 4 gadus atpakaļ
vecāks
revīzija
f5013687b3

+ 8 - 4
conf/app.conf Parādīt failu

@@ -148,25 +148,29 @@ readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
148 148
 readmysqlport = 3306
149 149
 readmysqluser = root
150 150
 readmysqlpass = 1Q2W3e4r!@#$
151
-readmysqlname = test_xt
151
+//readmysqlname = test_xt
152
+readmysqlname = sgj_xt
152 153
 
153 154
 writemysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
154 155
 writemysqlport = 3306
155 156
 writemysqluser = root
156 157
 writemysqlpass = 1Q2W3e4r!@#$
157
-writemysqlname = test_xt
158
+//writemysqlname = test_xt
159
+writemysqlname = sgj_xt
158 160
 
159 161
 readuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
160 162
 readuserport = 3306
161 163
 readuseruser = root
162 164
 readuserpass = 1Q2W3e4r!@#$
163
-readusername = test_users
165
+//readusername = test_users
166
+readusername = sgj_users
164 167
 
165 168
 writeuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
166 169
 writeuserport = 3306
167 170
 writeuseruser = root
168 171
 writeuserpass = 1Q2W3e4r!@#$
169
-writeusername = test_users
172
+//writeusername = test_users
173
+writeusername = sgj_users
170 174
 
171 175
 
172 176
 readmiddlehost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com

+ 2 - 1
controllers/dialysis_api_controller.go Parādīt failu

@@ -3283,7 +3283,8 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3283 3283
 			assessmentBeforeDislysis.AssessmentDoctor = adminUserInfo.AdminUser.Id
3284 3284
 			assessmentBeforeDislysis.AssessmentTime = time.Now().Unix()
3285 3285
 		}
3286
-		if assessmentBeforeDislysis.Creater == 0 {
3286
+
3287
+		if evaluation.Creater == 0 {
3287 3288
 			assessmentBeforeDislysis.Modifier = adminUserInfo.AdminUser.Id
3288 3289
 			assessmentBeforeDislysis.Creater = adminUserInfo.AdminUser.Id
3289 3290
 		} else {

+ 1 - 1
controllers/gobal_config_api_controller.go Parādīt failu

@@ -187,7 +187,7 @@ func (c *GobalConfigApiController) PostPrintTemplate() {
187 187
 //		//	updateErr := service.UpdateFiledConfig(adminUserInfo.CurrentOrgId)
188 188
 //		//	if updateErr == nil {
189 189
 //		//		//查出该模版对应显示配置字段中所有隐藏的字段
190
-//		//		_, config := service.FindAllHideFiledConfig(template_id)
190
+//				_, config := service.FindAllHideFiledConfig(template_id)
191 191
 //		//
192 192
 //		//		var fileds []string
193 193
 //		//		for _, item := range config {

+ 6 - 8
controllers/mobile_api_controllers/dialysis_api_controller.go Parādīt failu

@@ -1013,7 +1013,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1013 1013
 	safe_package, _ := c.GetInt64("package", 0)
1014 1014
 	a_liquid, _ := c.GetInt64("a_liquid", 0)
1015 1015
 
1016
-	//appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1016
+	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1017 1017
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
1018 1018
 	//
1019 1019
 	//if template.TemplateId == 2 || template.TemplateId == 6 {
@@ -1030,11 +1030,11 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1030 1030
 	//}
1031 1031
 
1032 1032
 	//TODO 需要根据角色去判断
1033
-	//if appRole.UserType == 2 || appRole.UserType == 1 {
1034
-	//	prescription_doctor = appRole.AdminUserId
1035
-	//} else {
1036
-	//	prescription_doctor = 0
1037
-	//}
1033
+	if appRole.UserType == 2 || appRole.UserType == 1 {
1034
+		prescription_doctor = appRole.AdminUserId
1035
+	} else {
1036
+		prescription_doctor = 0
1037
+	}
1038 1038
 
1039 1039
 	prescription := models.DialysisPrescription{
1040 1040
 
@@ -2248,9 +2248,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2248 2248
 
2249 2249
 		prescription.CreatedTime = dialysisPrescription.CreatedTime
2250 2250
 		prescription.Modifier = adminUserInfo.AdminUser.Id
2251
-		prescription.Creater = adminUserInfo.AdminUser.Id
2252 2251
 		prescription.PrescriptionDoctor = adminUserInfo.AdminUser.Id
2253
-
2254 2252
 		prescription.ID = dialysisPrescription.ID
2255 2253
 		err := service.UpDateDialysisPrescription(&prescription)
2256 2254
 		if err == nil {

+ 3 - 0
controllers/mobile_api_controllers/mobile_api_base_controller.go Parādīt failu

@@ -47,6 +47,8 @@ type MobileBaseAPIAuthController struct {
47 47
 
48 48
 func (this *MobileBaseAPIAuthController) Prepare() {
49 49
 	token := this.Ctx.GetCookie("token_cookie")
50
+	//logout_cookie := this.Ctx.GetCookie("logout_cookie")
51
+
50 52
 	//if len(token) == 0{
51 53
 	//	this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
52 54
 	//	this.StopRun()
@@ -61,6 +63,7 @@ func (this *MobileBaseAPIAuthController) Prepare() {
61 63
 	}
62 64
 
63 65
 	if len(token) == 0 {
66
+
64 67
 		this.DelSession("mobile_admin_user_info")
65 68
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeLoginTimeout)
66 69
 		this.StopRun()

+ 18 - 9
controllers/new_mobile_api_controllers/mobile_regist_controller.go Parādīt failu

@@ -160,14 +160,14 @@ func (this *MobileRegistController) CreateOrg() {
160 160
 		return
161 161
 	}
162 162
 	orgPhone := this.GetString("telephone")
163
-
164
-	if len(orgPhone) > 0 {
165
-		if utils.PhoneRegexp().MatchString(orgPhone) == false {
166
-			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
167
-			this.ServeJSON()
168
-			return
169
-		}
170
-	}
163
+	//
164
+	//if len(orgPhone) > 0 {
165
+	//	if utils.PhoneRegexp().MatchString(orgPhone) == false {
166
+	//		this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodePhone)
167
+	//		this.ServeJSON()
168
+	//		return
169
+	//	}
170
+	//}
171 171
 
172 172
 	provinceID := 0
173 173
 	cityID := 0
@@ -221,7 +221,9 @@ func (this *MobileRegistController) CreateOrg() {
221 221
 		ModifyTime:   time.Now().Unix(),
222 222
 	}
223 223
 
224
-	createErr := service.CreateOrg(org, adminUser.Mobile, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
224
+	adminUsers, _ := service.GetAdminUserByUserID(adminUser.Id)
225
+
226
+	createErr := service.CreateOrg(org, adminUsers.Name, openXT, openCDM, openSCRM, openMall) // 创建机构以及所有类型的 app,如果有新类型的平台,则需要在这个方法里面把创建这一新类型的 app 的代码加上
225 227
 
226 228
 	if createErr != nil {
227 229
 		utils.ErrorLog("mobile=%v的超级管理员创建机构失败:%v", adminUser.Mobile, createErr)
@@ -240,6 +242,7 @@ func (this *MobileRegistController) CreateOrg() {
240 242
 		//初始化设备管理org
241 243
 		InitEquitMentInformation(org)
242 244
 		//初始化显示配置
245
+		//InitShowConfig(org)
243 246
 
244 247
 		//创建完机构后进行登录验证操作
245 248
 		ip := utils.GetIP(this.Ctx.Request)
@@ -555,7 +558,9 @@ func InitPatientAndSchedule(org *models.Org) {
555 558
 			TellPhone:               it.TellPhone,
556 559
 			FirstTreatmentDate:      it.FirstTreatmentDate,
557 560
 			ContactName:             it.ContactName,
561
+			IsInfectious:            it.IsInfectious,
558 562
 		}
563
+
559 564
 		service.CreateVMOrgNewPatient(&patientsNew)
560 565
 	}
561 566
 	//创建1个分组
@@ -1168,3 +1173,7 @@ func InitEquitMentInformation(org *models.Org) {
1168 1173
 	}
1169 1174
 	service.CreatedTreateMode(&treatmentmodefive)
1170 1175
 }
1176
+
1177
+func InitShowConfig(org *models.Org) {
1178
+	service.BatchInsertFiledSystemConfig(org.Id)
1179
+}

+ 19 - 4
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Parādīt failu

@@ -1989,8 +1989,8 @@ func (this *NewDialysisApiController) DeleteBed() {
1989 1989
 func (this *NewDialysisApiController) LoginOut() {
1990 1990
 
1991 1991
 	this.DelSession("mobile_admin_user_info")
1992
-	this.Ctx.SetCookie("token_cookie", "")
1993 1992
 	this.Ctx.SetCookie("logout_cookie", "1")
1993
+	this.Ctx.SetCookie("token_cookie", "")
1994 1994
 	id, _ := this.GetInt64("id")
1995 1995
 	fmt.Println("id------------------------------------------", id)
1996 1996
 	loginLog := models.SgjUserAdminLoginLog{
@@ -2161,7 +2161,7 @@ func (this *NewDialysisApiController) EditOrg() {
2161 2161
 			cityID = int(city.ID)
2162 2162
 			district, getDistrictErr := service.GetDistrictWithName(city.ID, districtName)
2163 2163
 			if getDistrictErr != nil {
2164
-				utils.ErrorLog("查询区县名失:%v", getDistrictErr)
2164
+				utils.ErrorLog("查询区县名失:%v", getDistrictErr)
2165 2165
 				this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2166 2166
 				this.ServeJSON()
2167 2167
 				return
@@ -2197,9 +2197,7 @@ func (this *NewDialysisApiController) EditOrg() {
2197 2197
 }
2198 2198
 
2199 2199
 func (this *NewDialysisApiController) GetMyInforName() {
2200
-
2201 2200
 	id, _ := this.GetInt64("id")
2202
-	//Rolename, err := service.GetMyInfoName(id)
2203 2201
 	Username, err := service.GetAdminName(id)
2204 2202
 	if err != nil {
2205 2203
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
@@ -2210,6 +2208,22 @@ func (this *NewDialysisApiController) GetMyInforName() {
2210 2208
 	})
2211 2209
 }
2212 2210
 
2211
+func (this *NewDialysisApiController) GetMyInformationFour() {
2212
+	adminUserInfo := this.GetMobileAdminUserInfo()
2213
+	creatId := adminUserInfo.AdminUser.Id
2214
+	fmt.Println("创建者ID", creatId)
2215
+	orgid := adminUserInfo.Org.Id
2216
+	fmt.Println("orgid", orgid)
2217
+	Username, err := service.GetMyOrgInformationFour(creatId, orgid)
2218
+	if err != nil {
2219
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2220
+		return
2221
+	}
2222
+	this.ServeSuccessJSON(map[string]interface{}{
2223
+		"Username": Username,
2224
+	})
2225
+}
2226
+
2213 2227
 func (this *NewDialysisApiController) GetPartionDetail() {
2214 2228
 	id, _ := this.GetInt64("id")
2215 2229
 	partionDetail, err := service.GetPartionDetail(id)
@@ -2315,6 +2329,7 @@ func (this *NewDialysisApiController) GetMyOrgInformation() {
2315 2329
 	fmt.Println("cretor", creator)
2316 2330
 	adminInfo := this.GetMobileAdminUserInfo()
2317 2331
 	appId := adminInfo.App.Id
2332
+	//fmt.Println("appid------------------------------------",appId)
2318 2333
 	information, err := service.GetMyOrgInformation(creator, appId)
2319 2334
 	if err != nil {
2320 2335
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)

+ 1 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go Parādīt failu

@@ -147,4 +147,5 @@ func NewMobileAPIControllersRegisterRouters() {
147 147
 	beego.Router("/m/api/patient/getmyorginformation", &NewDialysisApiController{}, "Get:GetMyOrgInformation")
148 148
 	beego.Router("/m/api/patient/savenametwo", &NewDialysisApiController{}, "Get:SaveNameTwo")
149 149
 	beego.Router("/m/api/patient/getcurrentorg", &NewDialysisApiController{}, "Get:GetCurrentOrg")
150
+	beego.Router("/m/api/patient/getmyinformationfour", &NewDialysisApiController{}, "Get:GetMyInformationFour")
150 151
 }

+ 7 - 4
controllers/new_mobile_api_controllers/patient.json Parādīt failu

@@ -45,7 +45,7 @@
45 45
       "hospital_first_dialysis_date": 1511366400,
46 46
       "induction_period": 0,
47 47
       "initial_dialysis": 0,
48
-      "total_dialysis": 14,
48
+      "total_dialysis": 0,
49 49
       "attending_doctor_id": 0,
50 50
       "head_nurse_id": 0,
51 51
       "evaluate": "",
@@ -77,7 +77,8 @@
77 77
       "expense_kind": 3,
78 78
       "tell_phone": "21212",
79 79
       "first_treatment_date": 1582560000,
80
-      "contact_name": "21221"
80
+      "contact_name": "21221",
81
+      "is_infectious":1
81 82
     },
82 83
     {
83 84
       "avatar": "https://images.shengws.com/201809182128111.png",
@@ -124,7 +125,7 @@
124 125
       "hospital_first_dialysis_date": 1511366400,
125 126
       "induction_period": 0,
126 127
       "initial_dialysis": 0,
127
-      "total_dialysis": 14,
128
+      "total_dialysis": 0,
128 129
       "attending_doctor_id": 0,
129 130
       "head_nurse_id": 0,
130 131
       "evaluate": "",
@@ -156,7 +157,9 @@
156 157
       "expense_kind": 3,
157 158
       "tell_phone": "21212",
158 159
       "first_treatment_date": 1582560000,
159
-      "contact_name": "21221"
160
+      "contact_name": "21221",
161
+      "is_infectious":2
162
+
160 163
     }
161 164
   ]
162 165
 }

+ 2 - 5
controllers/new_mobile_api_controllers/role.json Parādīt failu

@@ -18,7 +18,7 @@
18 18
       "is_system": 2,
19 19
       "number": 9998,
20 20
       "purview_ids": "49,71,72,70,74,75,73,127,128,48,52,110,93,121,122,124,125,120,101,100,102,156,157,158,159,15571,72,70,74,75,73,127,128,48,52,110,93,121,122,124,125,120,101,100,102,156,157,158,159,155",
21
-      "func_ids": "20001,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20024,20025,20026,20027,20028,20029,20030,20031,20032,20033"
21
+      "func_ids": "20001,20002,20004,20005,20007,20008,20010,20011,20012,20034,20035,20040,20041,20043,20044,20046,20047,20049,20024,20025,20026,20027,20028"
22 22
 
23 23
 
24 24
     },
@@ -30,10 +30,7 @@
30 30
       "is_system": 3,
31 31
       "number": 9997,
32 32
       "purview_ids": "49,74,75,73,48,52,110,93,121,122,124,125,120",
33
-      "func_ids": "20007,20008,20010,20011,20012,20013,20014,20016,20017,20019,20021,20022,20024,20025,20027,20028"
34
-
35
-
36
-
33
+      "func_ids": "20007,20008,20010,20011,20012,20055,20056,20013,20014,20016,20017,20019,20021,20022,20024,20025,20026,20027,20028"
37 34
     },
38 35
     {
39 36
       "role_name": "库存",

+ 2 - 2
controllers/role.json Parādīt failu

@@ -18,7 +18,7 @@
18 18
       "is_system": 2,
19 19
       "number": 9998,
20 20
       "purview_ids": "49,71,72,70,74,75,73,127,128,48,52,110,93,121,122,124,125,120,101,100,102,156,157,158,159,15571,72,70,74,75,73,127,128,48,52,110,93,121,122,124,125,120,101,100,102,156,157,158,159,155",
21
-      "func_ids": "20001,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20024,20025,20026,20027,20028,20029,20030,20031,20032,20033"
21
+      "func_ids": "20001,20002,20004,20005,20007,20008,20010,20011,20012,20034,20035,20040,20041,20043,20044,20046,20047,20049,20024,20025,20026,20027,20028"
22 22
 
23 23
 
24 24
     },
@@ -30,7 +30,7 @@
30 30
       "is_system": 3,
31 31
       "number": 9997,
32 32
       "purview_ids": "49,74,75,73,48,52,110,93,121,122,124,125,120",
33
-      "func_ids": "20007,20008,20010,20011,20012,20013,20014,20016,20017,20019,20021,20022,20024,20025,20027,20028"
33
+      "func_ids": "20007,20008,20010,20011,20012,20055,20056,20013,20014,20016,20017,20019,20021,20022,20024,20025,20026,20027,20028"
34 34
     }
35 35
   ]
36 36
 }

+ 7 - 0
enums/error_code.go Parādīt failu

@@ -192,6 +192,10 @@ const ( // ErrorCode
192 192
 	ErrorCodeRole = 20037
193 193
 
194 194
 	ErrorCodeAdminUserIsExit = 20038
195
+
196
+	ErrorCodePhone = 20039
197
+
198
+	ErrorCodeLogOut = 20049
195 199
 )
196 200
 
197 201
 var ErrCodeMsgs = map[int]string{
@@ -383,6 +387,9 @@ var ErrCodeMsgs = map[int]string{
383 387
 	ErrorCodeRole: "尚未配置角色,无访问权限",
384 388
 
385 389
 	ErrorCodeAdminUserIsExit: "用户不存在",
390
+	ErrorCodePhone:           "请填写正确的联系电话",
391
+
392
+	ErrorCodeLogOut: "退出",
386 393
 }
387 394
 
388 395
 type SGJError struct {

+ 6 - 1
service/data.go Parādīt failu

@@ -172,7 +172,7 @@ func FindFiledByOrgId(org_id int64) (filedConfig []*models.FiledConfig, err erro
172 172
 }
173 173
 
174 174
 func BatchInsertFiledConfig(org_id int64) (err error) {
175
-	err = readDb.Exec("INSERT  INTO sgj_xt.xt_filed_config  ( org_id,  module,  filed_name,  filed_name_cn,  is_show ) SELECT ?,  module,  filed_name,  filed_name_cn,  is_show FROM sgj_xt.xt_filed_config  WHERE org_id = 0", org_id).Error
175
+	err = readDb.Exec("INSERT  INTO sgj_xt.xt_filed_config  ( org_id,  module,  filed_name,  filed_name_cn,  is_show ) SELECT ?,  module,  filed_name,  filed_name_cn,  is_show FROM sgj_xt.xt_filed_config  WHERE org_id = 0 AND is_show = 1", org_id).Error
176 176
 	return
177 177
 }
178 178
 
@@ -185,3 +185,8 @@ func FindSysDialysisFiledByOrgId() (filedConfig []*models.FiledConfig, err error
185 185
 	err = readDb.Model(&models.FiledConfig{}).Where("org_id =? AND id in (11250,11251,11252,11253,11254,11255,11256,11257,11258,11259,11260,11261,11262)", 0).Find(&filedConfig).Error
186 186
 	return
187 187
 }
188
+
189
+func BatchInsertFiledSystemConfig(org_id int64) (err error) {
190
+	err = readDb.Exec("INSERT  INTO sgj_xt.xt_filed_config  ( org_id,  module,  filed_name,  filed_name_cn,  is_show ) SELECT ?,  module,  filed_name,  filed_name_cn,  is_show FROM sgj_xt.xt_filed_config  WHERE org_id = 9442  AND sys_module = 2", org_id).Error
191
+	return
192
+}

+ 6 - 0
service/patientmanage_service.go Parādīt failu

@@ -1261,6 +1261,12 @@ func GetAdminName(id int64) (models.AdminUsers, error) {
1261 1261
 	return user, err
1262 1262
 }
1263 1263
 
1264
+func GetMyOrgInformationFour(creator int64, orgid int64) (models.SgjUserAdminRole, error) {
1265
+	role := models.SgjUserAdminRole{}
1266
+	err := UserReadDB().Model(&role).Where("admin_user_id = ? and org_id = ? and status = 1", creator, orgid).Find(&role).Error
1267
+	return role, err
1268
+}
1269
+
1264 1270
 func GetPartionDetail(id int64) (models.DeviceZone, error) {
1265 1271
 
1266 1272
 	zone := models.DeviceZone{}