Commit 2e0c7d09f9fe0585301f0d9054d7b7e281edc044
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-biz-service/src/main/resources/mainOrm/Roles.xml
View file @
2e0c7d0
... | ... | @@ -34,6 +34,9 @@ |
34 | 34 | <if test="publishId != null and publishId >= 0"> |
35 | 35 | publish_id = #{publishId,jdbcType=INTEGER}, |
36 | 36 | </if> |
37 | +<if test="permissiontype != null and permissiontype >= 0"> | |
38 | + permissiontype = #{permissiontype,jdbcType=INTEGER}, | |
39 | +</if> | |
37 | 40 | <if test="publishName != null and publishName != ''"> |
38 | 41 | publish_name = #{publishName,jdbcType=VARCHAR}, |
39 | 42 | </if> |
... | ... | @@ -128,7 +131,7 @@ |
128 | 131 | |
129 | 132 | |
130 | 133 | <select id="queryRoles" resultMap="RolesResultMap" parameterType="com.lyms.platform.permission.model.RolesQuery"> |
131 | -select id,type,name,publish_id,publish_name,yn,enable,modified,created,remarks,shortCode | |
134 | +select id,type,name,publish_id,publish_name,yn,enable,modified,created,remarks,shortCode,permissiontype | |
132 | 135 | from roles |
133 | 136 | <include refid="RolesCondition" /> |
134 | 137 | <include refid="orderAndLimit" /> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java
View file @
2e0c7d0
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | @TokenRequired |
103 | 103 | public void updateUserPermission(HttpServletResponse response, |
104 | 104 | @RequestParam(value = "id") Integer id, |
105 | - @RequestParam(value = "type") String accessPermType) { | |
105 | + @RequestParam(value = "type") Integer accessPermType) { | |
106 | 106 | Roles roles = rolesService.getRoles(id); |
107 | 107 | |
108 | 108 | Assert.notNull(roles,"角色为空."); |
... | ... | @@ -135,6 +135,13 @@ |
135 | 135 | return; |
136 | 136 | } |
137 | 137 | |
138 | + RolesQuery rolesQuery = new RolesQuery(); | |
139 | + rolesQuery.setName(name); | |
140 | + if(0 < rolesService.queryRolesCount(rolesQuery)) { | |
141 | + ResultUtils.buildResultAndWrite(response,ErrorCodeConstants.NAME_EXIST, "角色名称已存在"); | |
142 | + return; | |
143 | + } | |
144 | + | |
138 | 145 | Roles roles = new Roles(); |
139 | 146 | roles.setType(1); |
140 | 147 | roles.setName(name); |
... | ... | @@ -171,6 +178,13 @@ |
171 | 178 | |
172 | 179 | if (StringUtils.isBlank(name) || null == users) { |
173 | 180 | ResultUtils.buildParameterErrorResultAndWrite(response); |
181 | + return; | |
182 | + } | |
183 | + | |
184 | + RolesQuery rolesQuery = new RolesQuery(); | |
185 | + rolesQuery.setName(name); | |
186 | + if(0 < rolesService.queryRolesCount(rolesQuery)) { | |
187 | + ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.NAME_EXIST, "角色名称已存在"); | |
174 | 188 | return; |
175 | 189 | } |
176 | 190 |