Explorar el Código

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

csx hace 4 años
padre
commit
e8bc97ca67

+ 1 - 1
conf/app.conf Ver fichero

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9531
3
-runmode = dev
3
+runmode = prod
4 4
 
5 5
 
6 6
 copyrequestbody = true

+ 3 - 3
controllers/new_mobile_api_controllers/role.json Ver fichero

@@ -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"
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 Ver fichero

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

+ 2 - 2
controllers/role.json Ver fichero

@@ -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"
34 34
     }
35 35
   ]
36 36
 }

+ 15 - 15
service/app_version.go Ver fichero

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