liurunyu
2024-01-12 d86a4a8cd8cf271514e892e992290b4d533a24e5
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
2个文件已添加
25个文件已修改
1241 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRoleMapper.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserRoleMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrIntakeMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRole.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoRole.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoDivide.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRoleMapper.xml 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserRoleMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/DtoRole.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/QueryVo.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java 365 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeSv.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/result/ProjectResultCode.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRoleMapper.java
@@ -2,83 +2,59 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
import com.dy.pipIrrGlobal.voBa.VoRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2024-01-10 11:00
 * @LastEditTime 2024-01-10 11:00
 * @Description
 */
@Mapper
public interface BaRoleMapper extends BaseMapper<BaRole> {
    int deleteByPrimaryKey(Long id);
    /**
     * 查询全部
     * @return List<BaRole>
     */
    List<BaRole> selectAll() ;
    int insert(BaRole record);
    /**
     * 查询某个用户所隶属于的角色
     * @param userId 用户ID
     * @return List<BaRole>
     */
    List<BaRole> selectByUserId(@Param("userId") Long userId) ;
    /**
     * 查询总数
     * @param params 查询条件
     * @return 总数
     */
    Long selectTotal(Map<?, ?> params) ;
    /**
     * 分页查询一些
     * @param params 查询条件
     * @return 实体集合
     */
    List<BaRole> selectSome(Map<?, ?> params) ;
    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int putin(BaRole record);
    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(BaRole record);
    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    BaRole selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(BaRole record);
    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(BaRole record);
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     * 根据角色名称查询记录数量
     * @param roleName
     * @return
     */
    int deleteByPrimaryKey(Long id);
    Integer getRecordCountByName(@Param("roleName") String roleName);
    /**
     * 逻辑删除
     * @param id primaryKey
     * @return update count
     * 根据指定条件获取角色记录数
     * @param params
     * @return
     */
    int deleteLogicById(Long id);
    Long getRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取角色记录
     * @param params
     * @return
     */
    List<VoRole> getRoles(Map<?, ?> params);
    /**
     * 根据roleId逻辑删除角色对象
     * @param roleId
     * @return
     */
    Integer deleteRoleById(@Param("roleId") Long roleId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
@@ -91,6 +91,14 @@
     * 根据用户编号获取用户信息
     * @param userId 用户编号
     * @return 用户信息列表
     * 2024-01-09 废弃
     */
    List<VoUserInfo> getUserInfos(@Param("userId") Long userId);
    /**
     * 根据用户编号获取用户信息
     * @param userId
     * @return
     */
    Map getUserInfoById(@Param("userId") Long userId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserRoleMapper.java
@@ -5,6 +5,9 @@
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface BaUserRoleMapper extends BaseMapper<BaUserRole> {
@@ -43,4 +46,11 @@
     * @return deleteCount
     */
    int deleteByRoleId(@Param("roleId") Long roleId);
    /**
     * 根据用户编号获取权限列表
     * @param userId
     * @return
     */
    List<Map<String, Object>> getPermissionsByUserId(@Param("userId") Long userId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrIntakeMapper.java
@@ -77,12 +77,31 @@
     */
    List<VoIntake> getIntakes(Map<?, ?> params);
    /**
     * 根据下级Id获取上一级地址Id
     * @param vaId 下一级Id
     * @return
     */
    Long getSupperByVillageId(long vaId);
    /**
     * 根据取水口编号获取未删除的取水口数量
     * @param intakeId
     * @return
     * @return  address
     */
    Integer getRecordCountOfIntake(@Param("intakeId") Long intakeId);
    /**
     * 根据村Id获取全部地址
     * @param villageId 村Id
     * @return  address  全部五级地址
     */
    String getAddressByVillageId(long villageId);
    /**
     * 根据区域Id获取区域等级
     * @param regionId 区域Id
     * @return  Level  区域等级
     */
    Integer getLevelByRegionId(long regionId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRole.java
@@ -1,24 +1,26 @@
package com.dy.pipIrrGlobal.pojoBa;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.mybatis.envm.Deleted;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import java.util.List;
import java.util.Date;
/**
 * 角色实体
 * @author ZhuBaoMin
 * @date 2024-01-10 11:00
 * @LastEditTime 2024-01-10 11:00
 * @Description
 */
@TableName(value="ba_role", autoResultMap = true)
@Data
@Builder
@@ -27,33 +29,40 @@
@AllArgsConstructor
@Schema(name = "角色实体")
public class BaRole implements BaseEntity {
    public static final long serialVersionUID = 1L;
    public static final long serialVersionUID = 202310211546001L;
    /**
    * 主键
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Long id ;
    private Long id;
    /**
     * 角色名称
     */
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "名称不能为空") //不能为空也不能为null
    @Length(message = "名称不大于{max}字,不小于{min}字", min = 2, max = 25)
    public String name ;
    @NotBlank(message = "名称不能为空")
    private String name;
    /**
     * 是否删除: 0表示未删除  1表示删除.
    * 操作人编号
    */
    @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "操作人编号必须为大于0的整数")
    private Long operator;
    /**
    * 操作时间
    */
    @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date operateDt;
    /**
    * 逻辑删除标识;0-未删除,1-删除
     */
    @Schema(description = "删除标识,表单不用填写", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Deleted deleted;
    /**
     * 角色所拥有的权限
     */
    @TableField(exist = false)
    public List<BaPrivilege> priviList ;
    private Byte deleted;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoRole.java
New file
@@ -0,0 +1,42 @@
package com.dy.pipIrrGlobal.voBa;
import com.dy.common.po.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-01-10 15:13
 * @LastEditTime 2024-01-10 15:13
 * @Description
 */
@Data
@Schema(title = "角色信息视图对象")
public class VoRole implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "ID")
    private Long id;
    @Schema(title = "角色编号")
    private Long roleId;
    @Schema(title = "角色名称")
    private String roleName;
    @Schema(title = "权限列表")
    private String permissions;
    @Schema(title = "操作人")
    private String operator;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "操作时间")
    private Date operateDt;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java
@@ -4,6 +4,9 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2023/12/20 10:19
@@ -22,12 +25,13 @@
    @Schema(title = "用户姓名")
    private String userName;
    @Schema(title = "角色ID")
    private Long roleId;
    @Schema(title = "角色编号列表")
    private List<Map<String, Object>> roleIds;
    @Schema(title = "角色名称")
    private String roleName;
    @Schema(title = "角色名称列表")
    private List<Map<String, Object>> roleNames;
    @Schema(title = "授权列表")
    private String permissions;
    @Schema(title = "权限列表")
    private List<Map<String, Object>> permissions;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoDivide.java
@@ -28,6 +28,11 @@
    @ColumnWidth(10)
    private Long id;
    @Schema(title = "分水房编号")
    @ExcelProperty("分水房编号")
    @ColumnWidth(15)
    private Long divideId;
    @Schema(title = "分水房名称")
    @ExcelProperty("分水房名称")
    @ColumnWidth(15)
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
@@ -50,7 +50,7 @@
          phone = '#{phone,jdbcType=VARCHAR}' and
        </if>
        <if test="area != null">
          area = #{area,jdbcType=INTEGER} and
          area = ${area} and
        </if>
      </trim>
  </select>
@@ -70,7 +70,7 @@
        phone = '#{phone,jdbcType=VARCHAR}' and
      </if>
      <if test="area != null">
        area = #{area,jdbcType=INTEGER} and
        area = ${area} and
      </if>
    </trim>
    order by id DESC
@@ -169,10 +169,10 @@
        color = #{color,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        color = #{remark,jdbcType=VARCHAR},
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        color = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
        deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRoleMapper.xml
@@ -1,84 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoBa.BaRoleMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <result column="id" jdbcType="BIGINT" property="id" />
    <!--@mbg.generated-->
    <!--@Table ba_role-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.envm.EnumCodeTypeHandler" javaType="com.dy.common.mybatis.envm.Deleted"/>
    <result column="operator" jdbcType="BIGINT" property="operator" />
    <result column="operate_dt" jdbcType="TIMESTAMP" property="operateDt" />
    <result column="deleted" jdbcType="TINYINT" property="deleted" />
  </resultMap>
  <resultMap id="partResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <result column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
  </resultMap>
  <resultMap id="someResultMap" extends="partResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <collection property="priviList" fetchType="eager" column="{roleId=id}" select="com.dy.pipIrrGlobal.daoBa.BaPrivilegeMapper.selectPrivilegeByRoleId" />
  </resultMap>
  <sql id="Base_Column_List">
    id, name, deleted
    <!--@mbg.generated-->
    id, `name`, `operator`, operate_dt, deleted
  </sql>
  <sql id="part_Column_List">
    id, name
  </sql>
  <select id="selectAll" resultMap="BaseResultMap">
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="part_Column_List" />
    <include refid="Base_Column_List" />
    from ba_role
    where deleted!=1
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from ba_role
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <select id="selectByUserId" resultMap="partResultMap">
    select <include refid="part_Column_List" />
    from ba_role r
    inner join ba_user_role ur on r.id = ur.roleId
    where r.deleted != 1
    <if test="userId != null">
      and ur.userId = #{userId,jdbcType=BIGINT}
    </if>
  </select>
  <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long">
    select
    count(*)
    from ba_role where deleted!=1
    <trim prefix="and" suffixOverrides="and">
      <if test="name != null and name != ''">
        name like concat('%', #{name}, '%')
      </if>
    </trim>
  </select>
  <select id="selectSome" parameterType="java.util.Map" resultMap="someResultMap">
    select
    <include refid="part_Column_List" />
    from ba_role where deleted!=1
    <trim prefix="and" suffixOverrides="and">
      <if test="name != null and name != ''">
        name like concat('%', #{name}, '%')
      </if>
    </trim>
    order by id DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRole">
    insert into ba_role (<include refid="Base_Column_List" />)
    values (#{id,jdbcType=BIGINT},
            #{name,jdbcType=VARCHAR},
            #{deleted, typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}
      )
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <!--@mbg.generated-->
    insert into ba_role (id, `name`, `operator`,
      operate_dt, deleted)
    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
      #{operateDt,jdbcType=TIMESTAMP}, #{deleted,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <!--@mbg.generated-->
    insert into ba_role
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
@@ -86,6 +44,12 @@
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="operator != null">
        `operator`,
      </if>
      <if test="operateDt != null">
        operate_dt,
      </if>
      <if test="deleted != null">
        deleted,
@@ -98,41 +62,108 @@
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="operator != null">
        #{operator,jdbcType=BIGINT},
      </if>
      <if test="operateDt != null">
        #{operateDt,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
        #{deleted,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <!--@mbg.generated-->
    update ba_role
    <set>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="operator != null">
        `operator` = #{operator,jdbcType=BIGINT},
      </if>
      <if test="operateDt != null">
        operate_dt = #{operateDt,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT},
        deleted = #{deleted,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRole">
    <!--@mbg.generated-->
    update ba_role
    set `name` = #{name,jdbcType=VARCHAR},
     deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}
      `operator` = #{operator,jdbcType=BIGINT},
      operate_dt = #{operateDt,jdbcType=TIMESTAMP},
      deleted = #{deleted,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据角色名称查询记录数量,添加角色时判断是否重名-->
  <select id="getRecordCountByName" resultType="java.lang.Integer">
    SELECT
        COUNT(*) AS recordCount
    FROM ba_role
    WHERE name = #{roleName}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from ba_role
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <!--根据指定条件获取角色记录数-->
  <select id="getRecordCount" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM ba_role role
    LEFT JOIN ba_role_permissions per ON per.roleId = role.id
    <where>
      AND role.deleted = 0
  <delete id="deleteLogicById" parameterType="java.lang.Long">
    update ba_role set deleted = 1
    where id = #{id,jdbcType=BIGINT}
  </delete>
      <if test = "roleId != null and roleId > 0">
        AND role.id = ${roleId}
      </if>
      <if test = "roleName != null and roleName !=''">
        AND role.name LIKE CONCAT('%',#{roleName},'%')
      </if>
    </where>
  </select>
  <!--根据指定条件获取角色记录-->
  <select id="getRoles" resultType="com.dy.pipIrrGlobal.voBa.VoRole">
    SELECT
        (@i:=@i+1) AS id,
        t.* FROM
        (
          SELECT
            role.id AS roleId,
            role.name AS roleName,
            per.permissions,
            (SELECT `name` FROM ba_user WHERE id =  role.operator) AS operator,
            role.operate_dt AS operateDt
          FROM ba_role role
            LEFT JOIN ba_role_permissions per ON per.roleId = role.id
          <where>
            AND role.deleted = 0
            <if test = "roleId != null and roleId > 0">
              AND role.id = ${roleId}
            </if>
            <if test = "roleName != null and roleName !=''">
              AND role.name LIKE CONCAT('%',#{roleName},'%')
            </if>
          </where>
          ORDER BY role.operate_dt DESC
          <if test="pageCurr != null and pageSize != null">
            LIMIT ${pageCurr}, ${pageSize}
          </if>
      ) t
    , (SELECT @i:=0) AS itable
  </select>
  <!--根据roleId逻辑删除角色对象-->
  <update id="deleteRoleById">
    UPDATE ba_role SET deleted = 1 WHERE id = ${roleId}
  </update>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml
@@ -37,6 +37,7 @@
    values (#{id,jdbcType=BIGINT}, #{roleid,jdbcType=BIGINT}, #{permissions,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
    <!--@mbg.generated-->
    insert into ba_role_permissions
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -223,6 +223,7 @@
    </delete>
    <!--根据用户编号获取用户信息-->
    <!--2024-01-09 废弃-->
    <select id="getUserInfos" resultType="com.dy.pipIrrGlobal.voBa.VoUserInfo">
        SELECT
            user.id AS userId,
@@ -240,4 +241,19 @@
            </if>
        </where>
    </select>
    <!--根据用户编号获取用户信息-->
    <select id="getUserInfoById" resultType="java.util.Map">
        SELECT
            id AS userId,
            name AS userName
        FROM ba_user
        <where>
            AND disabled = 0
            AND deleted = 0
            <if test = "userId != null and userId > 0">
                AND ba_user.id = ${userId}
            </if>
        </where>
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserRoleMapper.xml
@@ -60,4 +60,17 @@
    where userId = #{roleId,jdbcType=BIGINT}
  </delete>
  <!--根据用户编号获取权限列表-->
  <select id="getPermissionsByUserId" resultType="java.util.Map">
    SELECT
      rol.id AS roleId,
      rol.`name` AS roleName,
      per.permissions
    FROM ba_user_role use_rol
           INNER JOIN ba_role rol ON rol.id = use_rol.roleId
           INNER JOIN ba_role_permissions per ON per.roleId = rol.id
    WHERE use_rol.userId = ${userId}
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
@@ -259,6 +259,7 @@
  <select id="getDivides" resultType="com.dy.pipIrrGlobal.voPr.VoDivide">
    SELECT
      (@i:=@i+1) AS id,
      divi.id AS divideId,
      divi.name AS divideName,
      blo.`name` AS blockName,
      divi.header,
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -288,4 +288,25 @@
  <select id="getRecordCountOfIntake" resultType="java.lang.Integer">
    SELECT COUNT(*) AS recordCount FROM pr_intake WHERE deleted = 0 AND id = ${intakeId}
  </select>
  <!--根据村ID获取全部地址-->
  <select id="getAddressByVillageId" parameterType="_long" resultType="java.lang.String">
    select
    CONCAT(dis_province.`name`, dis_city.`name`, dis_county.`name`, dis_town.`name`, dis_village.`name`) AS address
    from ba_district dis_village
    inner join ba_district dis_town    on dis_village.supperId = dis_town.id
    inner join ba_district dis_county    on dis_town.supperId = dis_county.id
    inner join ba_district dis_city    on dis_county.supperId = dis_city.id
    inner join ba_district dis_province    on dis_city.supperId = dis_province.id
    where dis_village.id = #{villageId,jdbcType=BIGINT}
  </select>
  <!--根据区域Id获取区域等级-->
  <select id="getLevelByRegionId" parameterType="_long" resultType="java.lang.Integer">
    select
    region.level
    from ba_district region
    where region.id = #{regionId,jdbcType=BIGINT}
  </select>
</mapper>
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockCtrl.java
@@ -99,7 +99,8 @@
                            schema = @Schema(implementation = BaBlock.class))}
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    //@GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @GetMapping(path = "one")
    @SsoAop()
    public BaseResponse<BaBlock> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
@@ -192,7 +193,8 @@
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    //@GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @GetMapping(path = "delete")
    @SsoAop()
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java
@@ -16,7 +16,12 @@
    /**
     * 角色
     */
    PERMISSION_ERROR(10001, "授权错误");
    PERMISSION_ERROR(10001, "授权错误"),
    ADD_ROLE_FAIL(10002, "角色添加失败"),
    ROLE_NAME_EXIST(10003, "角色名称已存在"),
    NO_ROLES(10004, "没有符合条件的角色记录"),
    PLEASE_INPUT_ROLE_ID(10005, "角色编号不能为空"),
    DELETE_ROLE_FAIL(10006, "删除角色失败");
    private final Integer code;
    private final String message;
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/DtoRole.java
New file
@@ -0,0 +1,48 @@
package com.dy.pipIrrBase.role;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
/**
 * @author ZhuBaoMin
 * @date 2024-01-10 9:16
 * @LastEditTime 2024-01-10 9:16
 * @Description
 */
@Data
@Schema(name = "角色传入对象")
public class DtoRole {
    public static final long serialVersionUID = 1L;
    /**
     * 角色编号
     */
    @Schema(description = "角色编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "角色编号必须为大于0的整数")
    private Long roleid;
    /**
     * 角色名称
     */
    @Schema(description = "角色名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "角色名称不能为空")
    @Length(max = 25, message = "角色名称最多25字")
    private String roleName;
    /**
     * 权限列表
     */
    @Schema(description = "权限列表", requiredMode = Schema.RequiredMode.REQUIRED)
    private String permissions;
    /**
     * 操作人编号
     */
    @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "操作人编号必须为大于0的整数")
    private Long operator;
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/QueryVo.java
@@ -13,8 +13,10 @@
@Builder
@Schema(name = "角色查询条件")
public class QueryVo extends QueryConditionVo {
    @Schema(description = "角色ID")
    public Long roleId;
    @Schema(description = "角色名称")
    public String name;
    public String roleName;
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
@@ -7,9 +7,10 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrBase.result.SystemResultCode;
import com.dy.pipIrrBase.user.QueryVo;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
import com.dy.pipIrrGlobal.voBa.VoRole;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -19,15 +20,12 @@
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
@Slf4j
@Tag(name = "角色管理", description = "角色增删改查等操作")
@@ -37,89 +35,52 @@
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class RoleCtrl {
    private RoleSv sv ;
    //private RoleSv sv ;
    private final RoleSv roleSv;
    @Autowired
    private void setSv(RoleSv sv){
        this.sv = sv ;
    }
    //@Autowired
    //private void setSv(RoleSv sv){
    //    this.sv = sv ;
    //}
    /**
     * 客户端请求得到所有角色数据
     * @return 所有角色数据
     * 根据指定条件(角色编号、角色名称)获取角色列表
     * 当获取一条记录时,传入roleId即可
     * @param vo
     * @return
     */
    @Operation(summary = "获得全部角色", description = "返回全部角色数据")
    @Operation(summary = "获得一页角色记录", description = "返回一页角色数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回全部角色数据(BaseResponse.content:QueryResultVo[{}])",
                    description = "返回一页控制器数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = BaRole.class))}
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "all")
    @GetMapping(path = "/roles")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaRole>>> all(){
    public BaseResponse<QueryResultVo<List<VoRole>>> getRoles(QueryVo vo){
        try {
            QueryResultVo<List<BaRole>> res = this.sv.selectAll() ;
            QueryResultVo<List<VoRole>> res = roleSv.getRoles(vo);
            if(res.itemTotal != null && res.itemTotal > 0) {
            return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(SystemResultCode.NO_ROLES.getMessage());
            }
        } catch (Exception e) {
            log.error("查询角色异常", e);
            log.error("获取开卡记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 客户端请求得到一页角色数据
     * @return 所有角色数据
     * 添加角色及权限列表,添加前判断角色名是否已存在
     * @param po 角色传入对象,包括角色名称、权限列表、操作人编号
     * @param bindingResult
     * @return
     */
    @Operation(summary = "获得一页角色", description = "返回一页角色数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页角色数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = BaRole.class))}
            )
    })
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<QueryResultVo<List<BaRole>>> some(@RequestBody @Valid QueryVo vo){
        try {
            QueryResultVo<List<BaRole>> res = this.sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询角色异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 得到一个角色数据
     * @return 一个角色数据
     */
    @Operation(summary = "一个角色", description = "得到一个角色数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一个角色数据(BaseResponse.content:{})",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = BaRole.class))}
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<BaRole> one(Long id){
        return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
    }
    /**
     * 保存角色
     * @param po 保存角色form表单对象
     * @return 是否成功
     */
    @Operation(summary = "保存角色", description = "提交角色数据(form表单),进行保存")
    @Operation(summary = "添加角色", description = "提交角色数据及权限数据,进行保存")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
@@ -129,134 +90,57 @@
            )
    })
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> save(@RequestBody @Valid BaRole po, BindingResult bindingResult){
    public BaseResponse<Boolean> save(@RequestBody @Valid DtoRole po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        po.id = null ;
        Long count;
        // 获取角色名称级权限列表
        String roleName = Optional.ofNullable(po.getRoleName()).orElse("");
        String permissions = Optional.ofNullable(po.getPermissions()).orElse("");
        Long operator = Optional.ofNullable(po.getOperator()).orElse(0L);
        // 判断角色名称是否重名
        Integer recordCount = Optional.ofNullable(roleSv.getRecordCountByName(roleName)).orElse(0);
        if(recordCount > 0)
            return BaseResponseUtils.buildFail(SystemResultCode.ROLE_NAME_EXIST.getMessage());
        // 添加角色
        BaRole baRole = new BaRole();
        Long roleId = 0L;
        try {
            po.deleted = Deleted.NO ;//默认不删除
            count = this.sv.save(po);
            baRole.setName(roleName);
            baRole.setOperator(operator);
            Date operateTime = new Date();
            baRole.setOperateDt(operateTime);
            baRole.setDeleted(Deleted.NO.getCode());
            roleId = roleSv.addRole(baRole);
        } catch (Exception e) {
            log.error("保存角色异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(count <= 0){
            return BaseResponseUtils.buildFail("数据库存储失败") ;
        }else{
            return BaseResponseUtils.buildSuccess(true) ;
        if(roleId <= 0)
            return BaseResponseUtils.buildFail(SystemResultCode.ADD_ROLE_FAIL.getMessage());
        // 添加权限列表
        BaRolePermissions  baRolePermissions = new BaRolePermissions();
        baRolePermissions.setRoleid(roleId);
        baRolePermissions.setPermissions(permissions);
        Integer rc = Optional.ofNullable(roleSv.addPermissions(baRolePermissions)).orElse(0);
        if(rc <= 0) {
            return BaseResponseUtils.buildFail(SystemResultCode.ADD_ROLE_FAIL.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
    /**
     * 编辑修改角色
     * @param po 保存角色form表单对象
     * @return 是否成功
     * 角色授权,当角色编号为空时,实际为添加角色及权限列表
     * @param po
     * @param bindingResult
     * @return
     */
    @Operation(summary = "编辑修改角色", description = "提交角色数据(form表单),进行修改")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Valid BaRole po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        if(po.id == null){
            return BaseResponseUtils.buildFail("无数据实体ID") ;
        }
        int count;
        try {
            po.deleted = null ;//设置为null,不做更新
            count = this.sv.update(po);
        } catch (Exception e) {
            log.error("保存角色异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(count <= 0){
            return BaseResponseUtils.buildFail("数据库存储失败") ;
        }else{
            return BaseResponseUtils.buildSuccess(true) ;
        }
    }
    /**
     * 设置角色权限
     * @param id 角色ID
     * @return 是否成功
     */
    @Operation(summary = "设置角色权限", description = "提交角色ID,及所选择的权限ID集合(数组)")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @GetMapping(path = "setPrivs", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> setPrivileges(Long id, Long[] privIds){
        Long[] privIds_lg = null ;
        if(privIds != null && privIds.length > 0){
            privIds_lg = new Long[privIds.length] ;
            int index = 0 ;
            for(Long privId : privIds){
                privIds_lg[index++] = privId ;
            }
        }
        try {
            this.sv.setRoles(id, privIds_lg);
        } catch (Exception e) {
            log.error("保存用户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
    /**
     * 删除角色
     * @param id 角色ID
     * @return 是否成功
     */
    @Operation(summary = "删除角色", description = "提交角色ID,进行逻辑删除")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> delete(Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
        }
        int count;
        try {
            count = this.sv.delete(id);
        } catch (Exception e) {
            log.error("保存角色异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(count <= 0){
            return BaseResponseUtils.buildFail("数据库存储失败") ;
        }else{
            return BaseResponseUtils.buildSuccess(true) ;
        }
    }
    @Operation(summary = "授权", description = "授权")
    @ApiResponses(value = {
            @ApiResponse(
@@ -269,7 +153,7 @@
    @PostMapping(path = "addPermissions", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> permission(@RequestBody  @Valid BaRolePermissions po, BindingResult bindingResult){
    public BaseResponse<Boolean> permission(@RequestBody  @Valid DtoRole po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
@@ -284,28 +168,125 @@
         *      2. 添加角色、权限记录
         */
        Long roleid = Optional.ofNullable(po.getRoleid()).orElse(0L);
        Long roleId = Optional.ofNullable(po.getRoleid()).orElse(0L);
        String roleName = Optional.ofNullable(po.getRoleName()).orElse("");
        String permissions = Optional.ofNullable(po.getPermissions()).orElse("");
        Long operator = Optional.ofNullable(po.getOperator()).orElse(0L);
        if(roleid == 0 && roleName.length() == 0) {
        if(roleId == 0 && roleName.length() == 0)
            return BaseResponseUtils.buildFail(SystemResultCode.PERMISSION_ERROR.getMessage());
        }
        // 新建角色且授权
        if(roleid == 0) {
        if(roleId == 0) {
            BaRole baRole = new BaRole();
            baRole.setName(roleName);
            roleid = Optional.ofNullable(roleSv.save(baRole)).orElse(0L);
            po.setRoleid(roleid);
            roleSv.addPermissions(po);
            baRole.setOperator(operator);
            Date operateTime = new Date();
            baRole.setOperateDt(operateTime);
            baRole.setDeleted(Deleted.NO.getCode());
            roleId = Optional.ofNullable(roleSv.addRole(baRole)).orElse(0L);
            BaRolePermissions baRolePermissions = new BaRolePermissions();
            baRolePermissions.setRoleid(roleId);
            baRolePermissions.setPermissions(permissions);
            roleSv.addPermissions(baRolePermissions);
            return BaseResponseUtils.buildSuccess(true) ;
        }
        // 修改角色授权
        roleSv.delPermissionsByRoleId(roleid);
        roleSv.addPermissions(po);
        BaRolePermissions baRolePermissions = new BaRolePermissions();
        baRolePermissions.setRoleid(roleId);
        baRolePermissions.setPermissions(permissions);
        roleSv.delPermissionsByRoleId(roleId);
        roleSv.addPermissions(baRolePermissions);
        return BaseResponseUtils.buildSuccess(true) ;
    }
    /**
     * 修改角色
     * @param po 保存角色form表单对象
     * @return 是否成功
     */
    @Operation(summary = "修改角色", description = "提交角色数据,进行修改")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Valid BaRole po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收角色编号、角色名称、操作人编号
        Long roleId = Optional.ofNullable(po.getId()).orElse(0L);
        String roleName = Optional.ofNullable(po.getName()).orElse("");
        Long operator = Optional.ofNullable(po.getOperator()).orElse(0L);
        // 判断主键是否为空
        if(roleId == 0)
            return BaseResponseUtils.buildFail(SystemResultCode.PLEASE_INPUT_ROLE_ID.getMessage()) ;
        Integer recordCount = 0;
        try {
            po.setName(roleName);
            po.setOperator(operator);
            Date operateTime = new Date();
            po.setOperateDt(operateTime);
            //po.deleted = null ;//设置为null,不做更新
            recordCount = roleSv.updateRole(po);
        } catch (Exception e) {
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(recordCount <= 0)
            return BaseResponseUtils.buildFail("数据库存储失败") ;
        return BaseResponseUtils.buildSuccess(true) ;
    }
    /**
     * 删除角色
     *  逻辑删除角色记录,物理删除角色授权记录
     * @param map
     * @return 是否成功
     */
    @Operation(summary = "删除角色", description = "提交角色ID,进行逻辑删除")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "操作结果:true:成功,false:失败(BaseResponse.content)",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    //@GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @PostMapping(path = "delete", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> delete(@RequestBody Map map){
        Long id = Optional.ofNullable(Long.parseLong(map.get("id").toString())).orElse(0L);
        if(id == 0)
            return BaseResponseUtils.buildException(SystemResultCode.PLEASE_INPUT_ROLE_ID.getMessage());
        try {
            // 逻辑删除角色记录,物理删除角色授权记录
            Integer res_role = Optional.ofNullable(roleSv.deleteRoleById(id)).orElse(0);
            Integer res_per = Optional.ofNullable(roleSv.delPermissionsByRoleId(id)).orElse(0);
            if(res_role == 0 || res_per == 0)
                return BaseResponseUtils.buildFail(SystemResultCode.DELETE_ROLE_FAIL.getMessage());
            return BaseResponseUtils.buildSuccess(true);
        } catch (Exception e) {
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
@@ -1,51 +1,87 @@
package com.dy.pipIrrBase.role;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrBase.user.QueryVo;
import com.dy.pipIrrGlobal.daoBa.BaRoleMapper;
import com.dy.pipIrrGlobal.daoBa.BaRolePermissionsMapper;
import com.dy.pipIrrGlobal.daoBa.BaRolePrivilegeMapper;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
import com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege;
import com.dy.pipIrrGlobal.voBa.VoRole;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2024-01-10 11:00
 * @LastEditTime 2024-01-10 11:00
 * @Description
 */
@Slf4j
@Service
public class RoleSv {
    private BaRoleMapper dao;
    private BaRolePrivilegeMapper rolePrivDao ;
    //private BaRoleMapper baRoleMapper;
    //private BaRolePrivilegeMapper rolePrivDao ;
    @Autowired
    private void setDao(BaRoleMapper dao){
        this.dao = dao;
    }
    //@Autowired
    //private void setDao(BaRoleMapper dao){
    //    this.dao = dao;
    //}
    //@Autowired
    //private void setRolePrivDao(BaRolePrivilegeMapper dao){
    //    this.rolePrivDao = dao;
    //}
    @Autowired
    private void setRolePrivDao(BaRolePrivilegeMapper dao){
        this.rolePrivDao = dao;
    }
    private BaRoleMapper baRoleMapper;
    @Autowired
    private BaRolePermissionsMapper baRolePermissionsMapper;
    /**
     * 根据指定条件(角色编号、角色名称)获取角色列表
     * 当获取一条记录时,传入roleId即可
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoRole>> getRoles(QueryVo queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = baRoleMapper.getRecordCount(params);
        QueryResultVo<List<VoRole>> rsVo = new QueryResultVo<>() ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = baRoleMapper.getRoles(params);
        return rsVo ;
    }
    /**
     * 得到所有角色
     * @return 所有角色集合
     */
    public QueryResultVo<List<BaRole>> selectAll(){
        QueryResultVo<List<BaRole>> rsVo = new QueryResultVo<>() ;
        rsVo.obj = this.dao.selectAll() ;
        return rsVo ;
    }
    //public QueryResultVo<List<BaRole>> selectAll(){
    //    QueryResultVo<List<BaRole>> rsVo = new QueryResultVo<>() ;
    //    rsVo.obj = this.dao.selectAll() ;
    //    return rsVo ;
    //}
    /**
@@ -53,54 +89,65 @@
     * @param id 角色ID
     * @return 角色实体
     */
    public BaRole selectById(Long id){
        return this.dao.selectById(id) ;
    }
    //public BaRole selectById(Long id){
    //    return this.dao.selectById(id) ;
    //}
    /**
     * 得到一个用户
     * @param vo 查询条件值对象
     //* @param vo 查询条件值对象
     * @return 用户实体
     */
    @SuppressWarnings("unchecked")
    public QueryResultVo<List<BaRole>> selectSome(QueryVo vo){
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
        Long itemTotal = this.dao.selectTotal(params) ;
        QueryResultVo<List<BaRole>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = vo.pageSize ;
        rsVo.pageCurr = vo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = this.dao.selectSome(params) ;
        return rsVo ;
    }
    //public QueryResultVo<List<BaRole>> selectSome(QueryVo vo){
    //    Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
    //    Long itemTotal = this.dao.selectTotal(params) ;
    //
    //    QueryResultVo<List<BaRole>> rsVo = new QueryResultVo<>() ;
    //    rsVo.pageSize = vo.pageSize ;
    //    rsVo.pageCurr = vo.pageCurr ;
    //    rsVo.calculateAndSet(itemTotal, params);
    //    rsVo.obj = this.dao.selectSome(params) ;
    //
    //    return rsVo ;
    //}
    /**
     * 保存实体
     * @param po 实体
     * @return 影响记录数量
     * 添加角色
     * @param po 角色实体
     * @return 角色ID
     */
    /**
     * 12月20日 朱宝民修改返回值,添加角色后返回主键
     */
    @Transactional
    public Long save(BaRole po){
        //return this.dao.putin(po) ;
        this.dao.putin(po) ;
    public Long addRole(BaRole po){
        baRoleMapper.insert(po);
        return po.getId();
    }
    /**
     * 保存修改实体
     * @param po 实体
     * @return 影响记录数量
     * 根据角色名称查询记录数量,添加角色前判断是否重名
     * @param roleName 角色名称
     * @return 符合条件记录数
     */
    @Transactional
    public int update(BaRole po){
        return this.dao.updateByPrimaryKeySelective(po) ;
    public Integer getRecordCountByName(String roleName) {
        return baRoleMapper.getRecordCountByName(roleName);
    }
    /**
     * 修改角色
     * @param record
     * @return
     */
    public int updateRole(BaRole record) {
        return baRoleMapper.updateByPrimaryKeySelective(record);
    }
    /**
     * 根据roleId逻辑删除角色对象
     * @param roleId 角色编号
     * @return
     */
    public Integer deleteRoleById(Long roleId) {
        return baRoleMapper.deleteRoleById(roleId);
    }
    /**
@@ -109,35 +156,36 @@
     * @param priviIds 选择的权限id集合
     * @return 插入角色与权限关联记录数量
     */
    public int setRoles(Long roleId, Long[] priviIds){
        this.rolePrivDao.deleteByRoleId(roleId) ;
        int count = 0 ;
        if(priviIds != null && priviIds.length > 0){
            for(Long privId : priviIds){
                count += this.rolePrivDao.insertSelective(new BaRolePrivilege(roleId, privId)) ;
            }
        }
        return count ;
    }
    //public int setRoles(Long roleId, Long[] priviIds){
    //    this.rolePrivDao.deleteByRoleId(roleId) ;
    //    int count = 0 ;
    //    if(priviIds != null && priviIds.length > 0){
    //        for(Long privId : priviIds){
    //            count += this.rolePrivDao.insertSelective(new BaRolePrivilege(roleId, privId)) ;
    //        }
    //    }
    //    return count ;
    //}
    /**
     * 保存修改实体
     * @param id 实体ID
     * @return 影响记录数量
     */
    @Transactional
    public int delete(Long id){
        //int count = this.dao.deleteLogicById(id) ;
        //逻辑删除,所以不实际删除其关联的权限
        //if(count > 0){
        //    this.rolePrivDao.deleteByRoleId(id) ;
    //@Transactional
    //public int delete(Long id){
    //    //int count = this.dao.deleteLogicById(id) ;
    //    //逻辑删除,所以不实际删除其关联的权限
    //    //if(count > 0){
    //    //    this.rolePrivDao.deleteByRoleId(id) ;
    //    //}
    //    //return count ;
    //    return this.dao.deleteLogicById(id) ;
        //}
        //return count ;
        return this.dao.deleteLogicById(id) ;
    }
    /**
     * 添加授权记录
     * @Auth 朱宝民
     * @param po
     * @return
     */
@@ -147,6 +195,7 @@
    /**
     * 依据角色编号删除授权记录
     * @Auth 朱宝民
     * @param roleid
     * @return
     */
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -113,7 +113,8 @@
                            schema = @Schema(implementation = BaUser.class))}
            )
    })
    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    //@GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
    @GetMapping(path = "one")
    @SsoAop()
    public BaseResponse<BaUser> one(String id) {
        return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id)));
@@ -227,7 +228,8 @@
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE)
    //@GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE)
    @GetMapping(path = "changePassword")
    @SsoAop()
    public BaseResponse<Boolean> changePassword(String id, String oldPassword, String newPassword) throws Exception {
        if (id == null) {
@@ -452,7 +454,8 @@
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    //@GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
    @GetMapping(path = "delete")
    @SsoAop()
    public BaseResponse<Boolean> delete(String id) {
        if (id == null) {
@@ -488,9 +491,9 @@
    })
    @GetMapping("/getUserInfos/{userId}")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoUserInfo>>> getUserInfos(@PathVariable("userId") Long userId) {
    public BaseResponse<QueryResultVo<VoUserInfo>> getUserInfos(@PathVariable("userId") Long userId) {
        try {
            List<VoUserInfo> res = this.sv.getUserInfos(userId);
            VoUserInfo res = this.sv.getUserInfos(userId);
            System.out.println("   :" + res);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
@@ -1,6 +1,9 @@
package com.dy.pipIrrBase.user;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoBa.BaUserMapper;
import com.dy.pipIrrGlobal.daoBa.BaUserRoleMapper;
@@ -13,9 +16,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.*;
@Slf4j
@Service
@@ -168,7 +169,40 @@
     * @param userId 用户编号
     * @return 用户信息列表
     */
    public List<VoUserInfo> getUserInfos(Long userId) {
        return dao.getUserInfos(userId);
    public VoUserInfo getUserInfos(Long userId) {
        VoUserInfo voUserInfo = new VoUserInfo();
        String permission = "";
        Map map = Optional.ofNullable(dao.getUserInfoById(userId)).orElse(new HashMap());
        if(map.size() > 0) {
            voUserInfo.setUserId(userId);
            voUserInfo.setUserName(map.get("userName").toString());
        }
        List list_roleIds = new ArrayList();
        List list_roleNames = new ArrayList();
        List list_permissions = new ArrayList();
        List<Map<String, Object>> list = Optional.ofNullable(urDao.getPermissionsByUserId(userId)).orElse(new ArrayList<>());
        if(list.size() > 0) {
            JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));
            for (int i = 0; i < array.size(); i++) {
                JSONObject job = array.getJSONObject(i);
                list_roleIds.add(job.getLong("roleId"));
                list_roleNames.add(job.getString("roleName"));
                String permissions = Optional.ofNullable(job.getString("permissions")).orElse("");
                if(permissions.length() > 0) {
                    permissions = permissions.substring(1, permissions.length() - 1);
                    permissions= permissions.replace(String.valueOf(" "), "");
                    permission = permission + permissions + ",";
                }
            }
            voUserInfo.setRoleIds(list_roleIds);
            voUserInfo.setRoleNames(list_roleNames);
            permission = permission.substring(0, permission.length()-1);
            list_permissions.add(permission);
            voUserInfo.setPermissions(list_permissions);
        }
        return voUserInfo;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideCtrl.java
@@ -68,7 +68,11 @@
    public BaseResponse<QueryResultVo<List<VoDivide>>> getDivides(QueryVo vo){
        try {
            QueryResultVo<List<VoDivide>> res = divideSv.getDivides(vo);
            if(res.itemTotal != null && res.itemTotal > 0) {
            return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(ProjectResultCode.NO_DIVIDES.getMessage());
            }
        } catch (Exception e) {
            log.error("获取开卡记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -94,7 +98,11 @@
    public BaseResponse<PrDivide> getOneDivide(@PathVariable("id") Long id){
        try {
            PrDivide res = divideSv.getOneDivide(id);
            if(res != null) {
            return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(ProjectResultCode.NO_DIVIDES.getMessage());
            }
        } catch (Exception e) {
            log.error("查询农户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -153,7 +161,7 @@
    /**
     * 根据分水房ID逻辑删除分水房
     * @param id
     * @param map
     * @return
     */
    @Operation(summary = "删除一个分水房", description = "删除一个分水房数据")
@@ -166,14 +174,19 @@
            )
    })
    @GetMapping(path = "/delone/{id}")
    //@GetMapping(path = "/delone/{id}")
    @PostMapping(path = "delete", consumes = MediaType.APPLICATION_JSON_VALUE)
    @SsoAop()
    public BaseResponse<Boolean> deleteDivideById(@PathVariable("id") Long id){
    public BaseResponse<Boolean> deleteDivideById(@RequestBody Map map){
        Long id = Optional.ofNullable(Long.parseLong(map.get("id").toString())).orElse(0L);
        if(id == 0)
            return BaseResponseUtils.buildException(ProjectResultCode.DELETE_DIVIDE_FAIL.getMessage());
        try {
            Integer res = Optional.ofNullable(divideSv.deleteDivideById(id)).orElse(0);
            if(res == 0) {
                return BaseResponseUtils.buildFail("分水房删除失败");
            }
            if(res == 0)
                return BaseResponseUtils.buildFail(ProjectResultCode.DELETE_DIVIDE_FAIL.getMessage());
            return BaseResponseUtils.buildSuccess(true);
        } catch (Exception e) {
            log.error("删除分水房异常", e);
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.pojoPr.PrIntake;
import com.dy.pipIrrGlobal.voPr.VoIntake;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrProject.result.ProjectResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -70,7 +71,11 @@
    public BaseResponse<QueryResultVo<List<PrIntake>>> all(){
        try {
            QueryResultVo<List<PrIntake>> res = this.intakeSv.selectAll();
            if(res == null) {
                return BaseResponseUtils.buildFail(ProjectResultCode.NO_INTAKES.getMessage());
            }else {
            return BaseResponseUtils.buildSuccess(res);
            }
        } catch (Exception e) {
            log.error("查询取水口异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -93,7 +98,11 @@
    @GetMapping(path = "one/{id}")
    @SsoAop()
    public BaseResponse<PrIntake> one(@PathVariable("id") Long id){
        if(this.intakeSv.selectById(id) == null) {
            return BaseResponseUtils.buildFail(ProjectResultCode.NO_INTAKES.getMessage());
        }else {
        return BaseResponseUtils.buildSuccess(this.intakeSv.selectById(id));
        }
    }
    @Operation(summary = "获得一页取水口记录", description = "返回一页取水口数据")
@@ -111,7 +120,7 @@
        try {
            QueryResultVo<List<VoIntake>> res = intakeSv.getIntakes(vo);
            if(res == null) {
                return BaseResponseUtils.buildFail("查询失败");
                return BaseResponseUtils.buildFail(ProjectResultCode.NO_INTAKES.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
@@ -142,7 +151,7 @@
        po.setOperateDt(operateTime);
        Integer rec = Optional.ofNullable(intakeSv.addIntake(po)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
            return BaseResponseUtils.buildFail(ProjectResultCode.ADD_INTAKE_FAIL.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
@@ -177,7 +186,7 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(count <= 0){
            return BaseResponseUtils.buildFail("数据库存储失败") ;
            return BaseResponseUtils.buildFail(ProjectResultCode.UPDATE_INTAKE.getMessage()) ;
        }else{
            return BaseResponseUtils.buildSuccess(true) ;
        }
@@ -201,7 +210,7 @@
    @SsoAop()
    public BaseResponse<Boolean> delete(@PathVariable("id") Long id){
        if(id == null){
            return BaseResponseUtils.buildFail("id不能为空") ;
            return BaseResponseUtils.buildFail(ProjectResultCode.PLEASE_INPUT_INTAKE_ID.getMessage()) ;
        }
        int count;
        try {
@@ -211,7 +220,7 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
        if(count <= 0){
            return BaseResponseUtils.buildFail("数据库存储失败") ;
            return BaseResponseUtils.buildFail(ProjectResultCode.DELETE_INTAKE_FAIL.getMessage()) ;
        }else{
            return BaseResponseUtils.buildSuccess(true) ;
        }
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeSv.java
@@ -139,4 +139,22 @@
    public Integer getRecordCountOfIntake(Long intakeId) {
        return prIntakeMapper.getRecordCountOfIntake(intakeId);
    }
    /**
     * 根据村Id获取全部地址
     * @param villageId 村Id
     * @return  address  全部五级地址
     */
    public String getAddressByVillageId(long villageId){
        return prIntakeMapper.getAddressByVillageId(villageId);
    }
    /**
     * 根据区域Id获取区域等级
     * @param regionId 区域Id
     * @return  Level  区域等级
     */
    public int getLevelByRegionId(long regionId){
        return prIntakeMapper.getLevelByRegionId(regionId);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/result/ProjectResultCode.java
@@ -17,10 +17,17 @@
     * 分水房
     */
    DIVIDE_FAIL(10001, "分水房添加失败"),
    DELETE_DIVIDE_FAIL(10001, "分水房删除失败"),
    NO_DIVIDES(10001, "无符合条件的分水房记录"),
    /**
     * 取水口
     */
    ADD_INTAKE_FAIL(20001, "取水口添加失败"),
    NO_INTAKES(20002, "没有符合条件的取水口数据"),
    UPDATE_INTAKE(20003, "修改取水口数据失败"),
    PLEASE_INPUT_INTAKE_ID(20004, "取水口编号不为空"),
    DELETE_INTAKE_FAIL(20005, "取水口删除失败"),
    /**
     * 控制器