浏览代码

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

csx 4 年前
父节点
当前提交
e7a52f41fd

+ 1 - 1
controllers/gobal_config_api_controller.go 查看文件

@@ -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 {

+ 3 - 0
controllers/mobile_api_controllers/mobile_api_base_controller.go 查看文件

@@ -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()

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

@@ -163,7 +163,7 @@ func (this *MobileRegistController) CreateOrg() {
163 163
 
164 164
 	if len(orgPhone) > 0 {
165 165
 		if utils.PhoneRegexp().MatchString(orgPhone) == false {
166
-			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
166
+			this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodePhone)
167 167
 			this.ServeJSON()
168 168
 			return
169 169
 		}
@@ -515,7 +515,7 @@ func InitPatientAndSchedule(org *models.Org) {
515 515
 
516 516
 	//创建两个血透的虚拟病人到新表
517 517
 	fmt.Print("patients", patients)
518
-	for _, it := range patients {
518
+	for index, it := range patients {
519 519
 		patientsNew := models.XtPatientsNew{
520 520
 			UserOrgId:               org.Id,
521 521
 			CreatedTime:             time.Now().Unix(),
@@ -556,6 +556,14 @@ func InitPatientAndSchedule(org *models.Org) {
556 556
 			FirstTreatmentDate:      it.FirstTreatmentDate,
557 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 567
 		service.CreateVMOrgNewPatient(&patientsNew)
560 568
 	}
561 569
 	//创建1个分组

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

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

+ 5 - 2
controllers/new_mobile_api_controllers/patient.json 查看文件

@@ -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",
@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 {

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

@@ -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