Browse Source

8月21日优先级去除

lijianlin/feature-20250728171217-三期金豆消费相关
sunjiabei 2 days ago
parent
commit
03f114a34a
  1. 1
      src/main/java/com/example/demo/domain/vo/coin/RoleVo.java
  2. 13
      src/main/java/com/example/demo/serviceImpl/coin/RoleServiceImpl.java
  3. 5
      src/main/resources/mapper/RoleMapper.xml

1
src/main/java/com/example/demo/domain/vo/coin/RoleVo.java

@ -28,7 +28,6 @@ public class RoleVo implements Serializable {
private Integer id; // 角色id
private String roleName; // 角色名
private String roleKey; // 角色标识符
private Integer priority;//优先级
private Integer fatherId;//上级角色id
private String fatherName;//上级角色名称
private String market;//所属市场

13
src/main/java/com/example/demo/serviceImpl/coin/RoleServiceImpl.java

@ -59,12 +59,6 @@ public class RoleServiceImpl implements RoleService {
}
if (roleVo.getPriority() == null) {
return Result.error("优先级为空");
}
if (roleVo.getPriority() <= 0 || roleVo.getPriority() > 999) {
return Result.error("优先级不在1-999");
}
if (roleVo.getMenuIds() == null || roleVo.getMenuIds().isEmpty()) {
return Result.error("权限为空");
}
@ -115,13 +109,6 @@ public class RoleServiceImpl implements RoleService {
return Result.error("角色名重复");
}
if (roleVo.getPriority() == null) {
return Result.error("优先级为空");
}
if (roleVo.getPriority() <= 0 || roleVo.getPriority() > 999) {
return Result.error("优先级不在1-999");
}
if (roleVo.getMenuIds() == null || roleVo.getMenuIds().isEmpty()) {
return Result.error("权限为空");
} else {

5
src/main/resources/mapper/RoleMapper.xml

@ -56,7 +56,7 @@
<!-- 插入角色信息 -->
<insert id="addRole" parameterType="com.example.demo.domain.vo.coin.RoleVo" useGeneratedKeys="true" keyProperty="id">
INSERT INTO role
(role_name, priority, father_id, market)
(role_name,father_id, market)
VALUES (#{roleName}, #{priority}, #{fatherId}, #{market})
</insert>
@ -73,7 +73,6 @@
<select id="selectBy" resultType="com.example.demo.domain.vo.coin.RoleVo">
SELECT r.id AS id,
r.role_name AS roleName,
r.priority AS priority,
r.father_id AS fatherId,
r.market AS market,
r.create_time AS createTime,
@ -98,7 +97,7 @@
</foreach>
</if>
</where>
ORDER BY r.update_time DESC,r.priority DESC
ORDER BY r.update_time DESC
</select>
<!--获取当前角色的上级角色-->
<select id="selectFather" resultType="com.example.demo.domain.vo.coin.RoleVo">

Loading…
Cancel
Save