Browse Source

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

csx 4 years ago
parent
commit
e7a52f41fd

+ 1 - 1
controllers/gobal_config_api_controller.go View File

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

+ 3 - 0
controllers/mobile_api_controllers/mobile_api_base_controller.go View File

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

+ 10 - 2
controllers/new_mobile_api_controllers/mobile_regist_controller.go View File

163
 
163
 
164
 	if len(orgPhone) > 0 {
164
 	if len(orgPhone) > 0 {
165
 		if utils.PhoneRegexp().MatchString(orgPhone) == false {
165
 		if utils.PhoneRegexp().MatchString(orgPhone) == false {
166
-			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
166
+			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodePhone)
167
 			this.ServeJSON()
167
 			this.ServeJSON()
168
 			return
168
 			return
169
 		}
169
 		}
515
 
515
 
516
 	//创建两个血透的虚拟病人到新表
516
 	//创建两个血透的虚拟病人到新表
517
 	fmt.Print("patients", patients)
517
 	fmt.Print("patients", patients)
518
-	for _, it := range patients {
518
+	for index, it := range patients {
519
 		patientsNew := models.XtPatientsNew{
519
 		patientsNew := models.XtPatientsNew{
520
 			UserOrgId:               org.Id,
520
 			UserOrgId:               org.Id,
521
 			CreatedTime:             time.Now().Unix(),
521
 			CreatedTime:             time.Now().Unix(),
556
 			FirstTreatmentDate:      it.FirstTreatmentDate,
556
 			FirstTreatmentDate:      it.FirstTreatmentDate,
557
 			ContactName:             it.ContactName,
557
 			ContactName:             it.ContactName,
558
 		}
558
 		}
559
+		if index == 1 {
560
+			patientsNew.IsInfectious = 1
561
+
562
+		} else {
563
+			patientsNew.IsInfectious = 2
564
+
565
+		}
566
+
559
 		service.CreateVMOrgNewPatient(&patientsNew)
567
 		service.CreateVMOrgNewPatient(&patientsNew)
560
 	}
568
 	}
561
 	//创建1个分组
569
 	//创建1个分组

+ 1 - 1
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go View File

1985
 func (this *NewDialysisApiController) LoginOut() {
1985
 func (this *NewDialysisApiController) LoginOut() {
1986
 
1986
 
1987
 	this.DelSession("mobile_admin_user_info")
1987
 	this.DelSession("mobile_admin_user_info")
1988
-	this.Ctx.SetCookie("token_cookie", "")
1989
 	this.Ctx.SetCookie("logout_cookie", "1")
1988
 	this.Ctx.SetCookie("logout_cookie", "1")
1989
+	this.Ctx.SetCookie("token_cookie", "")
1990
 	id, _ := this.GetInt64("id")
1990
 	id, _ := this.GetInt64("id")
1991
 	fmt.Println("id------------------------------------------", id)
1991
 	fmt.Println("id------------------------------------------", id)
1992
 	loginLog := models.SgjUserAdminLoginLog{
1992
 	loginLog := models.SgjUserAdminLoginLog{

+ 5 - 2
controllers/new_mobile_api_controllers/patient.json View File

77
       "expense_kind": 3,
77
       "expense_kind": 3,
78
       "tell_phone": "21212",
78
       "tell_phone": "21212",
79
       "first_treatment_date": 1582560000,
79
       "first_treatment_date": 1582560000,
80
-      "contact_name": "21221"
80
+      "contact_name": "21221",
81
+      " is_infectious":1
81
     },
82
     },
82
     {
83
     {
83
       "avatar": "https://images.shengws.com/201809182128111.png",
84
       "avatar": "https://images.shengws.com/201809182128111.png",
156
       "expense_kind": 3,
157
       "expense_kind": 3,
157
       "tell_phone": "21212",
158
       "tell_phone": "21212",
158
       "first_treatment_date": 1582560000,
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 View File

18
       "is_system": 2,
18
       "is_system": 2,
19
       "number": 9998,
19
       "number": 9998,
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",
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
       "is_system": 3,
30
       "is_system": 3,
31
       "number": 9997,
31
       "number": 9997,
32
       "purview_ids": "49,74,75,73,48,52,110,93,121,122,124,125,120",
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
       "role_name": "库存",
36
       "role_name": "库存",

+ 2 - 2
controllers/role.json View File

18
       "is_system": 2,
18
       "is_system": 2,
19
       "number": 9998,
19
       "number": 9998,
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",
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
       "is_system": 3,
30
       "is_system": 3,
31
       "number": 9997,
31
       "number": 9997,
32
       "purview_ids": "49,74,75,73,48,52,110,93,121,122,124,125,120",
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 View File

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

+ 1 - 1
service/data.go View File

172
 }
172
 }
173
 
173
 
174
 func BatchInsertFiledConfig(org_id int64) (err error) {
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
 	return
176
 	return
177
 }
177
 }
178
 
178