Administrator
2023-12-20 23f8f5155749bbe0d2494c52d8adc3e6476b9cac
2023-12-20 朱宝民 IC卡15个接口重构,角色授权,获取用户信息
6个文件已添加
38个文件已修改
1171 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePermissionsMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | 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/daoSe/SeCancelMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePermissions.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaRolePermissionsMapper.java
New file
@@ -0,0 +1,30 @@
package com.dy.pipIrrGlobal.daoBa;
import com.dy.pipIrrGlobal.pojoBa.BaRolePermissions;
import org.apache.ibatis.annotations.Param;
/**
 * @author ZhuBaoMin
 * @date 2023/12/19 16:48
 * @LastEditTime 2023/12/19 16:48
 * @Description
 */
public interface BaRolePermissionsMapper {
    int deleteByPrimaryKey(Long id);
    int insert(BaRolePermissions record);
    int insertSelective(BaRolePermissions record);
    BaRolePermissions selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(BaRolePermissions record);
    int updateByPrimaryKey(BaRolePermissions record);
    /**
     * 依据角色编号删除角色授权
     * @return
     */
    int delPermissionsByRoleId(@Param("roleId") Long roleId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -85,4 +86,11 @@
     * @return update count
     */
    int deleteLogicById(Long id);
    /**
     * 根据用户编号获取用户信息
     * @param userId 用户编号
     * @return 用户信息列表
     */
    List<VoUserInfo> getUserInfos(@Param("userId") Long userId);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCancelMapper.java
@@ -8,8 +8,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/9 10:14
 * @LastEditTime 2023/12/9 10:14
 * @date 2023/12/20 14:48
 * @LastEditTime 2023/12/20 14:48
 * @Description
 */
public interface SeCancelMapper {
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeLossMapper.java
@@ -8,8 +8,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/9 8:55
 * @LastEditTime 2023/12/9 8:55
 * @date 2023/12/19 15:08
 * @LastEditTime 2023/12/19 15:08
 * @Description
 */
public interface SeLossMapper {
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeReversalMapper.java
@@ -8,8 +8,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 9:17
 * @LastEditTime 2023/12/11 9:17
 * @date 2023/12/20 16:52
 * @LastEditTime 2023/12/20 16:52
 * @Description
 */
public interface SeReversalMapper {
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeUnlockMapper.java
@@ -8,8 +8,8 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 9:11
 * @LastEditTime 2023/12/11 9:11
 * @date 2023/12/20 16:05
 * @LastEditTime 2023/12/20 16:05
 * @Description
 */
public interface SeUnlockMapper {
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRolePermissions.java
New file
@@ -0,0 +1,64 @@
package com.dy.pipIrrGlobal.pojoBa;
/**
 * @author ZhuBaoMin
 * @date 2023/12/19 16:48
 * @LastEditTime 2023/12/19 16:48
 * @Description
 */
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.Size;
import lombok.*;
/**
 * 角色权限关联表
 */
@TableName(value="ba_role_permissions", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "角色权限实体")
public class BaRolePermissions implements BaseEntity {
    public static final long serialVersionUID = 1L;
    /**
    * 主键
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long id;
    /**
    * 角色编号
    */
    @Schema(description = "角色编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "角色编号必须为大于0的整数")
    private Long roleid;
    /**
     * 角色名称
     */
    @Schema(description = "角色名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 20)
    private String roleName;
    /**
    * 权限列表
    */
    @Schema(description = "权限列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "权限列表不能为空")
    private String permissions;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCancel.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -46,15 +47,15 @@
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "水卡编号必须为大于0的整数")
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 退款金额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeLoss.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -16,7 +17,7 @@
/**
 * @author ZhuBaoMin
 * @date 2023/12/9 8:55
 * @LastEditTime 2023/12/9 8:55
 * @LastEditTime 2023/12/19 15:14
 * @Description
 */
@@ -46,15 +47,15 @@
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "水卡编号不小于{min}", min = 1)
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 余额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeReversal.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -47,15 +48,15 @@
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "水卡编号必须为大于0的整数")
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 卡片余额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeUnlock.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
@@ -47,15 +48,15 @@
     * 水卡编号
     */
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "水卡编号必须为大于0的整数")
    private Long cardid;
    @NotBlank(message = "水卡编号不能为空")
    private String cardnum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
    @NotBlank(message = "农户编号不能为空")
    private String clientnum;
    /**
     * 剩余金额
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voBa/VoUserInfo.java
New file
@@ -0,0 +1,33 @@
package com.dy.pipIrrGlobal.voBa;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2023/12/20 10:19
 * @LastEditTime 2023/12/20 10:19
 * @Description 用户信息视图对象
 */
@Data
@Schema(title = "用户信息视图对象")
public class VoUserInfo implements BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(title = "用户ID")
    private Long userId;
    @Schema(title = "用户姓名")
    private String userName;
    @Schema(title = "角色ID")
    private Long roleId;
    @Schema(title = "角色名称")
    private String roleName;
    @Schema(title = "授权列表")
    private String permissions;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoActiveCard.java
@@ -27,10 +27,10 @@
    private String clientName;
    @Schema(title = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(title = "水卡地址")
    private String cardAddr;
    @Schema(title = "水卡编号")
    private String cardNum;
    @Schema(title = "水卡状态")
    private Byte state;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoCancel.java
@@ -27,10 +27,10 @@
    private String clientName;
    @Schema(title = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(title = "水卡地址")
    private String cardAddr;
    private String cardNum;
    @Schema(title = "退回金额")
    private Float refund;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoLoss.java
@@ -29,10 +29,10 @@
    private String clientName;
    @Schema(title = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(title = "水卡地址")
    private String cardAddr;
    @Schema(title = "水卡编号")
    private String cardNum;
    @Schema(title = "卡片余额")
    @JsonSerialize(using = Double2Serializer.class)
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java
@@ -27,10 +27,10 @@
    private String clientName;
    @Schema(title = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(title = "水卡地址")
    private String cardAddr;
    @Schema(title = "水卡编号")
    private String cardNum;
    @Schema(title = "充值金额")
    private Float amount;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReversal.java
@@ -26,10 +26,10 @@
    private String clientName;
    @Schema(title = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(title = "水卡地址")
    private String cardAddr;
    @Schema(title = "水卡编号")
    private String cardNum;
    @Schema(title = "剩余金额")
    private Float cardBalance;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoUnlock.java
@@ -27,10 +27,10 @@
    private String clientName;
    @Schema(title = "农户编号")
    private Long clientId;
    private String clientNum;
    @Schema(title = "水卡地址")
    private String cardAddr;
    @Schema(title = "水卡编号")
    private String cardNum;
    @Schema(title = "剩余金额")
    private Float money;
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml
New file
@@ -0,0 +1,86 @@
<?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.BaRolePermissionsMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
    <!--@mbg.generated-->
    <!--@Table ba_role_permissions-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="roleId" jdbcType="BIGINT" property="roleid" />
    <result column="permissions" jdbcType="VARCHAR" property="permissions" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, roleId, permissions
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from ba_role_permissions
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from ba_role_permissions
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <!--依据角色编号删除角色授权-->
  <delete id="delPermissionsByRoleId" parameterType="java.lang.Long">
    delete from ba_role_permissions where roleId = ${roleId}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
    <!--@mbg.generated-->
    insert into ba_role_permissions (id, roleId, permissions
      )
    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
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="roleid != null">
        roleId,
      </if>
      <if test="permissions != null">
        permissions,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="roleid != null">
        #{roleid,jdbcType=BIGINT},
      </if>
      <if test="permissions != null">
        #{permissions,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
    <!--@mbg.generated-->
    update ba_role_permissions
    <set>
      <if test="roleid != null">
        roleId = #{roleid,jdbcType=BIGINT},
      </if>
      <if test="permissions != null">
        permissions = #{permissions,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePermissions">
    <!--@mbg.generated-->
    update ba_role_permissions
    set roleId = #{roleid,jdbcType=BIGINT},
      permissions = #{permissions,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -221,4 +221,23 @@
        update ba_user set deleted = 1
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <!--根据用户编号获取用户信息-->
    <select id="getUserInfos" resultType="com.dy.pipIrrGlobal.voBa.VoUserInfo">
        SELECT
            user.id AS userId,
            user.`name` AS userName,
            rol.id AS roleId,
            rol.`name` AS roleName,
            per.permissions
        FROM ba_user user
            INNER JOIN ba_user_role use_rol ON user.id = use_rol.userId
            INNER JOIN ba_role rol ON rol.id = use_rol.roleId
            INNER JOIN ba_role_permissions per ON per.roleId = rol.id
        <where>
            <if test = "userId != null and userId > 0">
                AND user.id = ${userId}
            </if>
        </where>
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml
@@ -164,9 +164,9 @@
    SELECT
        COUNT(*) AS recordCount
    FROM se_active_card act
        INNER JOIN ba_client cli ON act.clientNum = cli.num
        INNER JOIN se_client_card card ON act.cardNum = card.cardNum
        , (SELECT @i:=0) AS itable
      INNER JOIN ba_client cli ON act.clientNum = cli.num
      INNER JOIN se_client_card card ON act.cardNum = card.cardNum
      , (SELECT @i:=0) AS itable
    <where>
      <if test = "operateType != null and operateType > 0">
        AND act.operateType = ${operateType}
@@ -175,10 +175,6 @@
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <!--      <if test = "cardAddr != null and cardAddr !=''">-->
      <!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
      <!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
@@ -199,13 +195,13 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.`name` AS clientName,
        cli.id AS clientId,
        card.cardAddr,
        cli.num AS clientNum,
        card.cardNum,
        card.state,
        (CASE
        WHEN card.state = 1 THEN "正常"
        WHEN card.state = 2 THEN "已注销"
        ELSE "已挂失"
          WHEN card.state = 1 THEN "正常"
          WHEN card.state = 2 THEN "已注销"
          ELSE "已挂失"
        END) AS stateName,
        act.reissueAmount,
        act.cardCost,
@@ -224,10 +220,6 @@
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
<!--      <if test = "cardAddr != null and cardAddr !=''">-->
<!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
<!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_cancel-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="refund" jdbcType="FLOAT" property="refund" />
    <result column="refundType" jdbcType="TINYINT" property="refundtype" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
@@ -15,7 +15,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, refund, refundType, remarks, `operator`, operateDt
    id, cardNum, clientNum, refund, refundType, remarks, `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -30,39 +30,25 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel">
    <!--@mbg.generated-->
    insert into se_cancel (id, cardId, clientId, refund, refundType, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{refund,jdbcType=FLOAT},
            #{refundtype,jdbcType=TINYINT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    insert into se_cancel (id, cardNum, clientNum, refund,
      refundType, remarks, `operator`,
      operateDt)
    values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{refund,jdbcType=FLOAT},
      #{refundtype,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
      #{operatedt,jdbcType=TIMESTAMP})
  </insert>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_cancel (cardId, clientId, refund, -->
<!--      refundType, remarks, `operator`, -->
<!--      operateDt)-->
<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{refund,jdbcType=FLOAT}, -->
<!--      #{refundtype,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
<!--      #{operatedt,jdbcType=TIMESTAMP})-->
<!--  </insert>-->
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_cancel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="refund != null">
        refund,
@@ -81,11 +67,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="refund != null">
        #{refund,jdbcType=FLOAT},
@@ -108,11 +94,11 @@
    <!--@mbg.generated-->
    update se_cancel
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="refund != null">
        refund = #{refund,jdbcType=FLOAT},
@@ -135,8 +121,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel">
    <!--@mbg.generated-->
    update se_cancel
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      refund = #{refund,jdbcType=FLOAT},
      refundType = #{refundtype,jdbcType=TINYINT},
      remarks = #{remarks,jdbcType=VARCHAR},
@@ -150,16 +136,16 @@
    SELECT
        COUNT(*) AS recordCount
    FROM se_cancel can
    INNER JOIN se_client_card card ON can.cardId = card.id
    INNER JOIN ba_client cli ON can.clientId = cli.id
    , (SELECT @i:=0) AS itable
        INNER JOIN se_client_card card ON can.cardNum = card.cardNum
        INNER JOIN ba_client cli ON can.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "cancelTimeStart != null and cancelTimeStop != null">
@@ -173,33 +159,33 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.`name` AS clientName,
        cli.id AS clientId,
        card.cardAddr,
        cli.num AS clientNum,
        card.cardNum,
        can.refund,
        (CASE
        WHEN can.refundType = 1 THEN "现金"
            WHEN can.refundType = 1 THEN "现金"
        END) AS refundTypeName,
        can.refundType,
        (SELECT `name` FROM ba_user WHERE id =  can.operator) AS operator,
        can.operateDt
    FROM se_cancel can
    INNER JOIN se_client_card card ON can.cardId = card.id
    INNER JOIN ba_client cli ON can.clientId = cli.id
    , (SELECT @i:=0) AS itable
        INNER JOIN se_client_card card ON can.cardNum = card.cardNum
        INNER JOIN ba_client cli ON can.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "cancelTimeStart != null and cancelTimeStop != null">
        AND can.operateDt BETWEEN #{cancelTimeStart} AND #{cancelTimeStop}
      </if>
    </where>
    ORDER BY can.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_loss-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="refund" jdbcType="FLOAT" property="refund" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
@@ -15,7 +15,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, money, refund, remarks, `operator`, operateDt
    id, cardNum, clientNum, money, refund, remarks, `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -30,38 +30,25 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss">
    <!--@mbg.generated-->
    insert into se_loss (id, cardId, clientId, money, refund, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{money,jdbcType=FLOAT},
            #{refund,jdbcType=FLOAT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    insert into se_loss (id, cardNum, clientNum, money,
      refund, remarks, `operator`,
      operateDt)
    values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
      #{refund,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
      #{operatedt,jdbcType=TIMESTAMP})
  </insert>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_loss (cardId, clientId, money, -->
<!--      refund, remarks, `operator`, -->
<!--      operateDt)-->
<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, -->
<!--      #{refund,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
<!--      #{operatedt,jdbcType=TIMESTAMP})-->
<!--  </insert>-->
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_loss
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="money != null">
        money,
@@ -80,11 +67,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -107,11 +94,11 @@
    <!--@mbg.generated-->
    update se_loss
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -134,8 +121,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss">
    <!--@mbg.generated-->
    update se_loss
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      money = #{money,jdbcType=FLOAT},
      refund = #{refund,jdbcType=FLOAT},
      remarks = #{remarks,jdbcType=VARCHAR},
@@ -149,16 +136,16 @@
    SELECT
        COUNT(*) AS recordCount
    FROM se_loss loss
    INNER JOIN se_client_card card ON loss.cardId = card.id
    INNER JOIN ba_client cli ON loss.clientId = cli.id
    INNER JOIN se_client_card card ON loss.cardNum = card.cardNum
    INNER JOIN ba_client cli ON loss.clientNum = cli.num
    , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "lossTimeStart != null and lossTimeStop != null">
@@ -172,29 +159,29 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.`name` AS clientName,
        cli.id AS clientId,
        card.cardAddr,
        cli.num AS clientNum,
        card.cardNum,
        loss.money,
        (SELECT `name` FROM ba_user WHERE id =  loss.operator) AS operator,
        loss.operateDt
    FROM se_loss loss
        INNER JOIN se_client_card card ON loss.cardId = card.id
        INNER JOIN ba_client cli ON loss.clientId = cli.id
        INNER JOIN se_client_card card ON loss.cardNum = card.cardNum
        INNER JOIN ba_client cli ON loss.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "lossTimeStart != null and lossTimeStop != null">
        AND loss.operateDt BETWEEN #{lossTimeStart} AND #{lossTimeStop}
      </if>
    </where>
    ORDER BY loss.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml
@@ -190,24 +190,18 @@
    select
        COUNT(*) AS recordCount
    FROM se_recharge_history rec
    INNER JOIN se_client_card card ON rec.cardNum = card.cardNum
    INNER JOIN ba_client cli ON rec.clientNum = cli.num
    , (SELECT @i:=0) AS itable
        INNER JOIN se_client_card card ON rec.cardNum = card.cardNum
        INNER JOIN ba_client cli ON rec.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <!--      <if test = "clientId != null and clientId > 0">-->
      <!--        AND rec.clientId like CONCAT('%',#{clientId},'%')-->
      <!--      </if>-->
      <if test = "clientNum != null and clientNum > 0">
        AND rec.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
      <!--      <if test = "cardAddr != null and cardAddr !=''">-->
      <!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
      <!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
@@ -244,16 +238,10 @@
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
<!--      <if test = "clientId != null and clientId > 0">-->
<!--        AND rec.clientId like CONCAT('%',#{clientId},'%')-->
<!--      </if>-->
      <if test = "clientNum != null and clientNum > 0">
        AND rec.clientNum like CONCAT('%',#{clientNum},'%')
      </if>
<!--      <if test = "cardAddr != null and cardAddr !=''">-->
<!--        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')-->
<!--      </if>-->
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_reversal-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="cardBalance" jdbcType="FLOAT" property="cardbalance" />
    <result column="systemBalance" jdbcType="FLOAT" property="systembalance" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
@@ -15,7 +15,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt
    id, cardNum, clientNum, cardBalance, systemBalance, remarks, `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -30,38 +30,25 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
    <!--@mbg.generated-->
    insert into se_reversal (id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{cardbalance,jdbcType=FLOAT},
            #{systembalance,jdbcType=FLOAT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    insert into se_reversal (id, cardNum, clientNum, cardBalance,
      systemBalance, remarks, `operator`,
      operateDt)
    values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{cardbalance,jdbcType=FLOAT},
      #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
      #{operatedt,jdbcType=TIMESTAMP})
  </insert>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_reversal (cardId, clientId, cardBalance, -->
<!--      systemBalance, remarks, `operator`, -->
<!--      operateDt)-->
<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardbalance,jdbcType=FLOAT}, -->
<!--      #{systembalance,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, -->
<!--      #{operatedt,jdbcType=TIMESTAMP})-->
<!--  </insert>-->
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_reversal
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="cardbalance != null">
        cardBalance,
@@ -80,11 +67,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="cardbalance != null">
        #{cardbalance,jdbcType=FLOAT},
@@ -107,11 +94,11 @@
    <!--@mbg.generated-->
    update se_reversal
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="cardbalance != null">
        cardBalance = #{cardbalance,jdbcType=FLOAT},
@@ -134,8 +121,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal">
    <!--@mbg.generated-->
    update se_reversal
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      cardBalance = #{cardbalance,jdbcType=FLOAT},
      systemBalance = #{systembalance,jdbcType=FLOAT},
      remarks = #{remarks,jdbcType=VARCHAR},
@@ -147,22 +134,22 @@
  <!--根据指定的条件获取冲正记录数-->
  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
    COUNT(*) AS recordCount
    FROM se_client_card card
    INNER JOIN se_reversal rev ON rev.cardId = card.id
    INNER JOIN ba_client cli ON     card.clientId = cli.id
    , (SELECT @i:=0) AS itable
        COUNT(*) AS recordCount
    FROM se_reversal rev
        INNER JOIN se_client_card card ON rev.cardNum = card.cardNum
        INNER JOIN ba_client cli ON rev.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "reversallTimeStart != null and reversalTimeStop != null">
        AND card.unlockDt BETWEEN #{reversallTimeStart} AND #{reversalTimeStop}
      <if test = "reversalTimeStart != null and reversalTimeStop != null">
        AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop}
      </if>
    </where>
  </select>
@@ -172,29 +159,29 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.`name` AS clientName,
        cli.id AS clientId,
        card.cardAddr,
        cli.num AS clientNum,
        card.cardNum,
        rev.cardBalance,
        (SELECT `name` FROM ba_user WHERE id =  rev.operator) AS operator,
        rev.operateDt
    FROM se_reversal rev
        INNER JOIN se_client_card card ON rev.cardId = card.id
        INNER JOIN ba_client cli ON rev.clientId = cli.id
        INNER JOIN se_client_card card ON rev.cardNum = card.cardNum
        INNER JOIN ba_client cli ON rev.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "reversalTimeStart != null and reversalTimeStop != null">
        AND rev.operateDt BETWEEN #{reversalTimeStart} AND #{reversalTimeStop}
      </if>
    </where>
    ORDER BY rev.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml
@@ -5,8 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table se_unlock-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cardId" jdbcType="BIGINT" property="cardid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="cardNum" jdbcType="VARCHAR" property="cardnum" />
    <result column="clientNum" jdbcType="VARCHAR" property="clientnum" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="operator" jdbcType="BIGINT" property="operator" />
@@ -14,7 +14,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, cardId, clientId, money, remarks, `operator`, operateDt
    id, cardNum, clientNum, money, remarks, `operator`, operateDt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -29,36 +29,25 @@
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock">
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock">
    <!--@mbg.generated-->
    insert into se_unlock (id, cardId, clientId, money, remarks, `operator`, operateDt)
    values (#{id,jdbcType=BIGINT},
            #{cardid,jdbcType=BIGINT},
            #{clientid,jdbcType=BIGINT},
            #{money,jdbcType=FLOAT},
            #{remarks,jdbcType=VARCHAR},
            #{operator,jdbcType=BIGINT},
            #{operatedt,jdbcType=TIMESTAMP})
    insert into se_unlock (id, cardNum, clientNum, money,
      remarks, `operator`, operateDt
      )
    values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT},
      #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}
      )
  </insert>
<!--  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true">-->
<!--    &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!--    insert into se_unlock (cardId, clientId, money, -->
<!--      remarks, `operator`, operateDt-->
<!--      )-->
<!--    values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, -->
<!--      #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}-->
<!--      )-->
<!--  </insert>-->
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into se_unlock
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardId,
      <if test="cardnum != null">
        cardNum,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientnum != null">
        clientNum,
      </if>
      <if test="money != null">
        money,
@@ -74,11 +63,11 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -98,11 +87,11 @@
    <!--@mbg.generated-->
    update se_unlock
    <set>
      <if test="cardid != null">
        cardId = #{cardid,jdbcType=BIGINT},
      <if test="cardnum != null">
        cardNum = #{cardnum,jdbcType=VARCHAR},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientnum != null">
        clientNum = #{clientnum,jdbcType=VARCHAR},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -122,8 +111,8 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock">
    <!--@mbg.generated-->
    update se_unlock
    set cardId = #{cardid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set cardNum = #{cardnum,jdbcType=VARCHAR},
      clientNum = #{clientnum,jdbcType=VARCHAR},
      money = #{money,jdbcType=FLOAT},
      remarks = #{remarks,jdbcType=VARCHAR},
      `operator` = #{operator,jdbcType=BIGINT},
@@ -136,16 +125,16 @@
    SELECT
        COUNT(*) AS recordCount
    FROM se_unlock unl
    INNER JOIN se_client_card card ON unl.cardId = card.id
    INNER JOIN ba_client cli ON unl.clientId = cli.id
    , (SELECT @i:=0) AS itable
        INNER JOIN se_client_card card ON unl.cardNum = card.cardNum
        INNER JOIN ba_client cli ON unl.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "unlocklTimeStart != null and unlockTimeStop != null">
@@ -159,29 +148,29 @@
    SELECT
        (@i:=@i+1) AS id,
        cli.`name` AS clientName,
        cli.id AS clientId,
        card.cardAddr,
        cli.num AS clientNum,
        card.cardNum,
        unl.money,
        (SELECT `name` FROM ba_user WHERE id =  unl.operator) AS operator,
        unl.operateDt
    FROM se_unlock unl
      INNER JOIN se_client_card card ON unl.cardId = card.id
      INNER JOIN ba_client cli ON unl.clientId = cli.id
      , (SELECT @i:=0) AS itable
        INNER JOIN se_client_card card ON unl.cardNum = card.cardNum
        INNER JOIN ba_client cli ON unl.clientNum = cli.num
        , (SELECT @i:=0) AS itable
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "cardAddr != null and cardAddr !=''">
        AND card.cardAddr like CONCAT('%',#{cardAddr},'%')
      <if test = "cardNum != null and cardNum !=''">
        AND card.cardNum like CONCAT('%',#{cardNum},'%')
      </if>
      <if test = "unlocklTimeStart != null and unlockTimeStop != null">
        AND unl.operateDt BETWEEN #{unlocklTimeStart} AND #{unlockTimeStop}
      </if>
    </where>
    ORDER BY unl.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/result/SystemResultCode.java
New file
@@ -0,0 +1,23 @@
package com.dy.pipIrrBase.result;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @author ZhuBaoMin
 * @date 2023/12/20 13:46
 * @LastEditTime 2023/12/20 13:46
 * @Description
 */
@Getter
@AllArgsConstructor
public enum SystemResultCode {
    /**
     * 角色
     */
    PERMISSION_ERROR(10001, "授权错误");
    private final Integer code;
    private final String message;
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleCtrl.java
@@ -6,8 +6,10 @@
import com.dy.common.webUtil.BaseResponseUtils;
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 io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -16,23 +18,26 @@
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
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.*;
@Slf4j
@Tag(name = "角色管理", description = "角色增删改查等操作")
@RestController
@RequestMapping(path="role")
@RequiredArgsConstructor
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class RoleCtrl {
    private RoleSv sv ;
    private final RoleSv roleSv;
    @Autowired
    private void setSv(RoleSv sv){
@@ -129,7 +134,7 @@
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        po.id = null ;
        int count;
        Long count;
        try {
            po.deleted = Deleted.NO ;//默认不删除
            count = this.sv.save(po);
@@ -252,4 +257,55 @@
        }
    }
    @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 = "addPermissions", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    public BaseResponse<Boolean> permission(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid BaRolePermissions po, @Parameter(hidden = true) BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        /**
         * 如果roleid和roleName都空:提示错误信息
         * 如果roleid为空:新建角色且授权
         *      1. 添加角色记录
         *      2. 添加角色、权限关联记录
         * 如果roleid不为空:修改角色授权
         *      1. 删除角色、权限记录
         *      2. 添加角色、权限记录
         */
        Long roleid = Optional.ofNullable(po.getRoleid()).orElse(0L);
        String roleName = Optional.ofNullable(po.getRoleName()).orElse("");
        String permissions = Optional.ofNullable(po.getPermissions()).orElse("");
        if(roleid == 0 && roleName.length() == 0) {
            return BaseResponseUtils.buildFail(SystemResultCode.PERMISSION_ERROR.getMessage());
        }
        // 新建角色且授权
        if(roleid == 0) {
            BaRole baRole = new BaRole();
            baRole.setName(roleName);
            roleid = Optional.ofNullable(roleSv.save(baRole)).orElse(0L);
            po.setRoleid(roleid);
            roleSv.addPermissions(po);
            return BaseResponseUtils.buildSuccess(true) ;
        }
        // 修改角色授权
        roleSv.delPermissionsByRoleId(roleid);
        roleSv.addPermissions(po);
        return BaseResponseUtils.buildSuccess(true) ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
@@ -3,8 +3,10 @@
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 lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -32,6 +34,8 @@
        this.rolePrivDao = dao;
    }
    @Autowired
    private BaRolePermissionsMapper baRolePermissionsMapper;
    /**
     * 得到所有角色
@@ -78,9 +82,15 @@
     * @param po 实体
     * @return 影响记录数量
     */
    /**
     * 12月20日 朱宝民修改返回值,添加角色后返回主键
     */
    @Transactional
    public int save(BaRole po){
        return this.dao.putin(po) ;
    public Long save(BaRole po){
        //return this.dao.putin(po) ;
        this.dao.putin(po) ;
        return po.getId();
    }
    /**
@@ -126,5 +136,22 @@
        return this.dao.deleteLogicById(id) ;
    }
    /**
     * 添加授权记录
     * @param po
     * @return
     */
    public Integer addPermissions(BaRolePermissions po) {
        return baRolePermissionsMapper.insert(po);
    }
    /**
     * 依据角色编号删除授权记录
     * @param roleid
     * @return
     */
    public Integer delPermissionsByRoleId(Long roleid) {
        return baRolePermissionsMapper.delPermissionsByRoleId(roleid);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -11,6 +11,7 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
import com.dy.pipIrrGlobal.util.Constant;
import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import com.mysql.cj.util.StringUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -49,7 +50,6 @@
    private void setSv(UserSv sv) {
        this.sv = sv;
    }
    /**
     * 客户端请求得到默认密码
@@ -474,4 +474,31 @@
            return BaseResponseUtils.buildSuccess(true);
        }
    }
    /**
     * 根据用户编号获取用户信息
     * @param userId 用户编号
     * @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 = BaUser.class))}
            )
    })
    @GetMapping("/getUserInfos/{userId}")
    @SsoAop("-1")
    public BaseResponse<QueryResultVo<List<VoUserInfo>>> getUserInfos(@PathVariable("userId") Long userId) {
        try {
            List<VoUserInfo> res = this.sv.getUserInfos(userId);
            System.out.println("   :" + res);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询用户信息异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
@@ -6,6 +6,7 @@
import com.dy.pipIrrGlobal.daoBa.BaUserRoleMapper;
import com.dy.pipIrrGlobal.pojoBa.BaUser;
import com.dy.pipIrrGlobal.pojoBa.BaUserRole;
import com.dy.pipIrrGlobal.voBa.VoUserInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -162,5 +163,12 @@
        return val;
    }
    /**
     * 根据用户编号获取用户信息
     * @param userId 用户编号
     * @return 用户信息列表
     */
    public List<VoUserInfo> getUserInfos(Long userId) {
        return dao.getUserInfos(userId);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardCtrl.java
@@ -14,6 +14,7 @@
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.recharge.DtoRecharge;
import com.dy.pipIrrSell.recharge.RechargeCtrl;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -46,7 +47,6 @@
public class ActiveCardCtrl {
    private final ActiveCardSv activeCardSv;
    private final ClientCardSv clientCardSv;
    private final RechargeCtrl rechargeCtrl;
    @Operation(summary = "获得一页开卡记录", description = "返回一页开卡数据")
@@ -97,7 +97,7 @@
         */
        VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum());
        if(voAreaCode == null) {
            return BaseResponseUtils.buildFail("该农户行政区划异常,请联系系统管理员");
            return BaseResponseUtils.buildFail(SellResultCode.AREA_CODE_MISTAKE.getMessage());
        }
        String provinceId = voAreaCode.getProvinceId();
        String cityId = voAreaCode.getCityId();
@@ -117,7 +117,7 @@
            Integer number = Integer.parseInt(cardNum.substring(12));
            number = number + 1;
            if(number > 9999) {
                return BaseResponseUtils.buildFail("水卡编号已满,请联系系统管理员");
                return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_OVERRUN.getMessage());
            }
            cardNum = cardNum.substring(0, 12) + String.format("%04d", number);
        } else {
@@ -126,7 +126,6 @@
        /**
         * cardId           水卡编号(插入记录后生成)
         * cardAddr         水卡地址(仅仅写入,无业务)
         * clientNum        农户编号
         * cardCost         卡片费用
@@ -137,9 +136,7 @@
         * operator         操作人编号
         * activeTime       开卡时间
         */
        //Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        //Long clientId = po.getClientId();
        String clientNum = po.getClientNum();
        Integer cardCost = po.getCardCost();
        Float amount = po.getAmount();
@@ -153,7 +150,6 @@
         */
        SeClientCard seClientCard = new SeClientCard();
        seClientCard.setCardaddr(cardAddr);
        //seClientCard.setClientid(clientId);
        seClientCard.setCardnum(cardNum);
        seClientCard.setClientnum(clientNum);
        seClientCard.setMoney(0.0);
@@ -163,7 +159,7 @@
        Long cardId = Optional.ofNullable(clientCardSv.add(seClientCard)).orElse(0L) ;
        if(cardId == 0) {
            return BaseResponseUtils.buildFail("开卡失败-农户卡写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
@@ -172,8 +168,6 @@
        SeActiveCard activeCard = new SeActiveCard();
        activeCard.setCardnum(cardNum);
        activeCard.setClientnum(clientNum);
        //activeCard.setCardid(cardId);
        //activeCard.setClientid(clientId);
        activeCard.setCardcost(cardCost);
        activeCard.setPaymentid(paymentId);
        activeCard.setOperatetype(OperateTypeENUM.ACTIVE.getCode());
@@ -182,7 +176,7 @@
        activeCard.setOperatedt(createTime);
        Long rec = Optional.ofNullable(activeCardSv.add(activeCard)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("开卡失败-开卡记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR.getMessage());
        }
        /**
@@ -196,7 +190,7 @@
            dtoRecharge.setPrice(0f);
            BaseResponse<Boolean> job = rechargeCtrl.addRecharge(dtoRecharge);
            if(!job.getCode().equals("0001")) {
                return BaseResponseUtils.buildFail("开卡成功,但充值失败");
                return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_RECHARGE_EXCEPTION.getMessage());
            }
        }
@@ -233,7 +227,6 @@
         */
        Long cardId = 0L;
        String cardNum = po.getCardNum();
        //String clientNum = po.getClientNum();
        String clientNum = "";
        Integer cardCost = po.getCardCost();
        Double reissueAmount = po.getReissueAmount();
@@ -247,7 +240,7 @@
         */
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_ERROR.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
@@ -263,7 +256,7 @@
        seClientCard.setLastoper(LastOperateENUM.REPLACE.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
            return BaseResponseUtils.buildFail("补卡失败-农户卡修改异常");
            return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
@@ -272,8 +265,6 @@
        SeActiveCard activeCard = new SeActiveCard();
        activeCard.setCardnum(cardNum);
        activeCard.setClientnum(clientNum);
        //activeCard.setCardid(cardId);
        //activeCard.setClientid(clientId);
        activeCard.setCardcost(cardCost);
        activeCard.setPaymentid(paymentId);
        activeCard.setReissueamount(reissueAmount);
@@ -283,7 +274,7 @@
        activeCard.setOperatedt(replaceTime);
        Long rec = Optional.ofNullable(activeCardSv.add(activeCard)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("补卡失败-补卡记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoCancel;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -26,10 +27,7 @@
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -87,18 +85,18 @@
        }
        /**
         * cardId           水卡编号(非传入参数,由cardAddr反查)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardId           水卡编号(非传入参数,由cardAddr反查,修改农户卡使用)
         * cardNum          水卡编号
         * clientNum        农户编号(非传入参数,由cardNum反查,添加注销使用)
         * refund           退款金额
         * refundType       退款方式
         * remarks          备注
         * operator         操作人编号
         * cancelTime         挂失时间
         * cancelTime       挂失时间
         */
        Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        String clientNum = "";
        Float refund = po.getRefund();
        Byte refundType = po.getRefundType();
        String remarks = po.getRemarks();
@@ -106,12 +104,14 @@
        Date cancelTime = new Date();
        /**
         * 依据水卡地址获取水卡编号(主键)
         * 依据水卡编号获取水卡表主键及农户编号
         */
        cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
        if(cardId == 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        /**
         * 修改农户卡信息:
@@ -124,15 +124,15 @@
        seClientCard.setLastoper(LastOperateENUM.CANCEL.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
            return BaseResponseUtils.buildFail("注销失败-农户卡注销异常");
            return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
         * 添加挂失记录
         */
        SeCancel seCancel = new SeCancel();
        seCancel.setCardid(cardId);
        seCancel.setClientid(clientId);
        seCancel.setCardnum(cardNum);
        seCancel.setClientnum(clientNum);
        seCancel.setRefund(refund);
        seCancel.setRefundtype(refundType);
        seCancel.setRemarks(remarks);
@@ -140,7 +140,7 @@
        seCancel.setOperatedt(cancelTime);
        Long rec = Optional.ofNullable(cancelSv.add(seCancel)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("注销失败-注销记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CANCELL_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/DtoCancel.java
@@ -23,17 +23,17 @@
    public static final long serialVersionUID = 1L;
    /**
     * 水卡地址
     * 水卡编号
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    private String cardAddr;
    private String cardNum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long clientId;
    //@Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //private Long clientId;
    /**
     * 退款金额
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/QueryVo.java
@@ -24,8 +24,8 @@
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "IC卡号")
    public String cardAddr;
    @Schema(description = "水卡编号")
    public String cardNum;
    @Schema(description = "注销时间_开始")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/DtoLoss.java
@@ -23,17 +23,17 @@
    public static final long serialVersionUID = 1L;
    /**
     * 水卡地址
     * 水卡编号
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    private String cardAddr;
    private String cardNum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long clientId;
    //@Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //private Long clientId;
    /**
     * 余额
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoLoss;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -25,11 +26,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -81,15 +78,14 @@
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoLoss po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        /**
         * cardId           水卡编号(非传入参数,由cardAddr反查)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardId           水卡编号(非传入参数,由cardNum反查)
         * cardNum          水卡编号
         * clientNum        农户编号(非传入参数,由cardNum反查,添加挂失使用)
         * money            余额
         * refund           退款金额
         * remarks          备注
@@ -97,8 +93,8 @@
         * lossTime         挂失时间
         */
        Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        String clientNum = "";
        Float money = po.getMoney();
        Float refund = po.getRefund();
        String remarks = po.getRemarks();
@@ -106,12 +102,14 @@
        Date lossTime = new Date();
        /**
         * 依据水卡地址获取水卡编号(主键)
         * 依据水卡编号获取水卡表主键及农户编号
         */
        cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
        if(cardId == 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        /**
         * 修改农户卡信息:
@@ -124,15 +122,15 @@
        seClientCard.setLastoper(LastOperateENUM.LOSS.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
            return BaseResponseUtils.buildFail("挂失失败-农户卡挂失异常");
            return BaseResponseUtils.buildFail(SellResultCode.LOSS_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
         * 添加挂失记录
         */
        SeLoss seLoss = new SeLoss();
        seLoss.setCardid(cardId);
        seLoss.setClientid(clientId);
        seLoss.setCardnum(cardNum);
        seLoss.setClientnum(clientNum);
        seLoss.setMoney(money);
        seLoss.setRefund(refund);
        seLoss.setRemarks(remarks);
@@ -140,7 +138,7 @@
        seLoss.setOperatedt(lossTime);
        Long rec = Optional.ofNullable(lossSv.add(seLoss)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("挂失失败-挂失记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.LOSS_FAIL_WRITE_LOSS_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeCtrl.java
@@ -11,6 +11,7 @@
import com.dy.pipIrrGlobal.voSe.VoRecharge;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -98,10 +99,7 @@
         * rechargeTime     充值时间
         */
        Long cardId = 0L;
        //String cardAddr = po.getCardAddr();
        //Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        //String clientNum = po.getClientNum();
        String clientNum = "";
        Float money = po.getMoney();
        Float amount = po.getAmount();
@@ -118,7 +116,7 @@
         */
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
@@ -134,7 +132,7 @@
        seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
            return BaseResponseUtils.buildFail("充值失败-农户卡修改异常");
            return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
@@ -145,8 +143,6 @@
         * 添加充值记录
         */
        SeRecharge seRecharge = new SeRecharge();
        //seRecharge.setCardid(cardId);
        //seRecharge.setClientid(clientId);
        seRecharge.setCardnum(cardNum);
        seRecharge.setClientnum(clientNum);
        seRecharge.setMoney(money);
@@ -160,15 +156,13 @@
        seRecharge.setOperatedt(rechargeTime);
        Long rec = Optional.ofNullable(rechargeSv.add(seRecharge)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("充值失败-充值记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage());
        }
        /**
         * 添加补卡历史记录
         */
        SeRechargeHistory seRechargeHistory = new SeRechargeHistory();
        //seRechargeHistory.setCardid(cardId);
        //seRechargeHistory.setClientid(clientId);
        seRechargeHistory.setCardnum(cardNum);
        seRechargeHistory.setClientnum(clientNum);
        seRechargeHistory.setMoney(money);
@@ -183,7 +177,7 @@
        Long rec_history = Optional.ofNullable(rechargeSv.addHistory(seRechargeHistory)).orElse(0L);
        if(rec_history == 0) {
            return BaseResponseUtils.buildFail("充值失败-充值历史记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_RECHARGE_HISTORY_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java
New file
@@ -0,0 +1,62 @@
package com.dy.pipIrrSell.result;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @author ZhuBaoMin
 * @date 2023/12/20 13:53
 * @LastEditTime 2023/12/20 13:53
 * @Description
 */
@Getter
@AllArgsConstructor
public enum SellResultCode {
    /**
     * 开卡/补卡
     */
    AREA_CODE_MISTAKE(10001, "该农户行政区划异常"),
    CARD_NUMBER_OVERRUN(10002, "水卡编号已满"),
    ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR(10003, "开卡失败-农户卡写入异常"),
    ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR(10004, "开卡失败-开卡记录写入异常"),
    ACTIVE_FAIL_RECHARGE_EXCEPTION(10005, "开卡失败-充值异常"),
    CARD_NUMBER_ERROR(10006, "卡号错误,该卡不存在"),
    REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR(10007, "补卡失败-农户卡修改异常"),
    REPLACE_FAIL_WRITE_RECHARGE_ERROR(10008, "补卡失败-补卡记录写入异常"),
    /**
     * 充值
     */
    CARD_NUMBER_MISTAKE(20001, "卡号错误,该卡不存在"),
    RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR(20002, "充值失败-农户卡修改异常"),
    RECHARGE_FAIL_WRITE_RECHARGE_ERROR(20003, "充值失败-充值记录写入异常"),
    RECHARGE_FAIL_WRITE_RECHARGE_HISTORY_ERROR(20004, "充值失败-充值历史记录写入异常"),
    /**
     * 挂失
     */
    LOSS_FAIL_WRITE_CLIENT_CARD_ERROR(30001, "挂失失败-农户卡修改异常"),
    LOSS_FAIL_WRITE_LOSS_ERROR(30002, "挂失失败-挂失记录写入异常"),
    /**
     * 注销
     */
    CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR(40001, "注销失败-农户卡修改异常"),
    CANCEL_FAIL_WRITE_CANCELL_ERROR(40002, "注销失败-注销记录写入异常"),
    /**
     * 解锁
     */
    UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR(50001, "解锁失败-农户卡修改异常"),
    UNLOCK_FAIL_WRITE_UNLOCK_ERROR(50002, "解锁失败-解锁记录写入异常"),
    /**
     * 冲正
     */
    REVERSAL_FAIL_WRITE_CLIENT_CARD_ERROR(60001, "冲正失败-农户卡修改异常"),
    REVERSAL_FAIL_WRITE_REVERSAL_ERROR(60002, "冲正失败-冲正记录写入异常");
    private final Integer code;
    private final String message;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/DtoReversal.java
@@ -23,17 +23,17 @@
    public static final long serialVersionUID = 1L;
    /**
     * 水卡地址
     * 水卡编号
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    private String cardAddr;
    private String cardNum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long clientId;
    private String clientNum;
    /**
     * 卡片余额
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/QueryVo.java
@@ -24,8 +24,8 @@
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "IC卡号")
    public String cardAddr;
    @Schema(description = "水卡编号")
    public String cardNum;
    @Schema(description = "冲正时间_开始")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoReversal;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -25,11 +26,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -81,15 +78,14 @@
    @Transactional(rollbackFor = Exception.class)
    @SsoAop("-1")//@SsoAop(power = "-1")
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoReversal po, @Parameter(hidden = true) BindingResult bindingResult){
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        /**
         * cardId           水卡编号(非传入参数,由cardAddr反查)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardId           水卡编号(非传入参数,由cardAddr反查,修改农户卡使用)
         * cardNum          水卡地址
         * clientNum        农户编号(非传入参数,由cardNum反查,添加冲正使用)
         * cardBalance      卡片余额
         * systemBalance    系统余额
         * remarks          备注
@@ -97,8 +93,8 @@
         * reversalTime     冲正
         */
        Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        String clientNum = "";
        Float cardBalance = po.getCardBalance();
        Float systemBalance = po.getSystemBalance();
        String remarks = po.getRemarks();
@@ -106,12 +102,14 @@
        Date reversalTime = new Date();
        /**
         * 依据水卡地址获取水卡编号(主键)
         * 依据水卡编号获取水卡表主键及农户编号
         */
        cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
        if(cardId == 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        /**
         * 修改农户卡信息:
@@ -124,15 +122,15 @@
        seClientCard.setLastoper(LastOperateENUM.REVERSAL.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
            return BaseResponseUtils.buildFail("冲正失败-农户卡冲正异常");
            return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
         * 添加解锁记录
         * 添加冲正记录
         */
        SeReversal reversal = new SeReversal();
        reversal.setCardid(cardId);
        reversal.setClientid(clientId);
        reversal.setCardnum(cardNum);
        reversal.setClientnum(clientNum);
        reversal.setCardbalance(cardBalance);
        reversal.setSystembalance(systemBalance);
        reversal.setRemarks(remarks);
@@ -140,7 +138,7 @@
        reversal.setOperatedt(reversalTime);
        Long rec = Optional.ofNullable(reversalSv.add(reversal)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("解锁失败-解锁记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.REVERSAL_FAIL_WRITE_REVERSAL_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/DtoUnlock.java
@@ -23,17 +23,17 @@
    public static final long serialVersionUID = 1L;
    /**
     * 水卡地址
     * 水卡编号
     */
    @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank
    private String cardAddr;
    @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotBlank(message = "水卡编号不能为空")
    private String cardNum;
    /**
     * 农户编号
     */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long clientId;
    private String clientNum;
    /**
     * 余额
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockCtrl.java
@@ -10,6 +10,7 @@
import com.dy.pipIrrGlobal.voSe.VoUnlock;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
@@ -26,10 +27,7 @@
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -87,29 +85,31 @@
        }
        /**
         * cardId           水卡编号(非传入参数,由cardAddr反查)
         * cardAddr         水卡地址
         * clientId         农户编号
         * cardId           水卡编号(非传入参数,由cardAddr反查,修改农户卡使用)
         * cardNum          水卡地址
         * clientNum        农户编号(非传入参数,由cardNum反查,添加解锁使用)
         * money            余额
         * remarks          备注
         * operator         操作人编号
         * unlockTime       解锁时间
         */
        Long cardId = 0L;
        String cardAddr = po.getCardAddr();
        Long clientId = po.getClientId();
        String cardNum = po.getCardNum();
        String clientNum = "";
        Float money = po.getMoney();
        String remarks = po.getRemarks();
        Long operator = po.getOperator();
        Date unlockTime = new Date();
        /**
         * 依据水卡地址获取水卡编号(主键)
         * 依据水卡编号获取水卡表主键及农户编号
         */
        cardId = Optional.ofNullable(clientCardSv.getCardIdByAddr(cardAddr)).orElse(0L);
        if(cardId == 0) {
            return BaseResponseUtils.buildFail("卡号错误,该卡不存在");
        Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap());
        if(map == null || map.size() <= 0) {
            return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage());
        }
        cardId = Long.parseLong(map.get("cardId").toString());
        clientNum = map.get("clientNum").toString();
        /**
         * 修改农户卡信息:
@@ -122,22 +122,22 @@
        seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode());
        Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0);
        if(rec_updateClientCard == 0) {
            return BaseResponseUtils.buildFail("解锁失败-农户卡解锁异常");
            return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage());
        }
        /**
         * 添加解锁记录
         */
        SeUnlock seUnlock = new SeUnlock();
        seUnlock.setCardid(cardId);
        seUnlock.setClientid(clientId);
        seUnlock.setCardnum(cardNum);
        seUnlock.setClientnum(clientNum);
        seUnlock.setMoney(money);
        seUnlock.setRemarks(remarks);
        seUnlock.setOperator(operator);
        seUnlock.setOperatedt(unlockTime);
        Long rec = Optional.ofNullable(unlockSv.add(seUnlock)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("解锁失败-解锁记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_UNLOCK_ERROR.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;