2023-12-20 朱宝民 IC卡15个接口重构,角色授权,获取用户信息
New file |
| | |
| | | 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); |
| | | } |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | * @return update count |
| | | */ |
| | | int deleteLogicById(Long id); |
| | | |
| | | /** |
| | | * 根据用户编号获取用户信息 |
| | | * @param userId 用户编号 |
| | | * @return 用户信息列表 |
| | | */ |
| | | List<VoUserInfo> getUserInfos(@Param("userId") Long userId); |
| | | } |
| | |
| | | |
| | | /** |
| | | * @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 { |
| | |
| | | |
| | | /** |
| | | * @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 { |
| | |
| | | |
| | | /** |
| | | * @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 { |
| | |
| | | |
| | | /** |
| | | * @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 { |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 退款金额 |
| | |
| | | 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; |
| | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/9 8:55 |
| | | * @LastEditTime 2023/12/9 8:55 |
| | | * @LastEditTime 2023/12/19 15:14 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 余额 |
| | |
| | | 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; |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | 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; |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 剩余金额 |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | |
| | | private String clientName; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private Long clientId; |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "水卡地址") |
| | | private String cardAddr; |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "退回金额") |
| | | private Float refund; |
| | |
| | | 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) |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
New file |
| | |
| | | <?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> |
| | |
| | | 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> |
| | |
| | | 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} |
| | |
| | | <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},'%') |
| | |
| | | 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, |
| | |
| | | <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},'%') |
| | |
| | | <!--@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" /> |
| | |
| | | </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--> |
| | |
| | | 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">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- 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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | 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"> |
| | |
| | | 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> |
| | |
| | | <!--@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" /> |
| | |
| | | </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--> |
| | |
| | | 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">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- 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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | 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"> |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | <!--@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" /> |
| | |
| | | </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--> |
| | |
| | | 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">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- 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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | <!--根据指定的条件获取冲正记录数--> |
| | | <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> |
| | |
| | | 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> |
| | |
| | | <!--@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" /> |
| | |
| | | </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--> |
| | |
| | | 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">--> |
| | | <!-- <!–@mbg.generated–>--> |
| | | <!-- 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, |
| | |
| | | </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}, |
| | |
| | | <!--@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}, |
| | |
| | | <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}, |
| | |
| | | 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"> |
| | |
| | | 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> |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | |
| | | 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){ |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | |
| | | @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) ; |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | this.rolePrivDao = dao; |
| | | } |
| | | |
| | | @Autowired |
| | | private BaRolePermissionsMapper baRolePermissionsMapper; |
| | | |
| | | /** |
| | | * 得到所有角色 |
| | |
| | | * @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(); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | private void setSv(UserSv sv) { |
| | | this.sv = sv; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 客户端请求得到默认密码 |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | return val; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据用户编号获取用户信息 |
| | | * @param userId 用户编号 |
| | | * @return 用户信息列表 |
| | | */ |
| | | public List<VoUserInfo> getUserInfos(Long userId) { |
| | | return dao.getUserInfos(userId); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | public class ActiveCardCtrl { |
| | | private final ActiveCardSv activeCardSv; |
| | | private final ClientCardSv clientCardSv; |
| | | |
| | | private final RechargeCtrl rechargeCtrl; |
| | | |
| | | @Operation(summary = "获得一页开卡记录", description = "返回一页开卡数据") |
| | |
| | | */ |
| | | 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(); |
| | |
| | | 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 { |
| | |
| | | |
| | | |
| | | /** |
| | | * cardId 水卡编号(插入记录后生成) |
| | | * cardAddr 水卡地址(仅仅写入,无业务) |
| | | * clientNum 农户编号 |
| | | * cardCost 卡片费用 |
| | |
| | | * 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(); |
| | |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setCardaddr(cardAddr); |
| | | //seClientCard.setClientid(clientId); |
| | | seClientCard.setCardnum(cardNum); |
| | | seClientCard.setClientnum(clientNum); |
| | | seClientCard.setMoney(0.0); |
| | |
| | | |
| | | 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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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()); |
| | |
| | | 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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | //String clientNum = po.getClientNum(); |
| | | String clientNum = ""; |
| | | Integer cardCost = po.getCardCost(); |
| | | Double reissueAmount = po.getReissueAmount(); |
| | |
| | | */ |
| | | 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(); |
| | |
| | | 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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | |
| | | 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) ; |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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(); |
| | |
| | | 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(); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | 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); |
| | |
| | | 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) ; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 退款金额 |
| | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | public String cardAddr; |
| | | @Schema(description = "水卡编号") |
| | | public String cardNum; |
| | | |
| | | |
| | | @Schema(description = "注销时间_开始") |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 余额 |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | @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 备注 |
| | |
| | | * 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(); |
| | |
| | | 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(); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | 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); |
| | |
| | | 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) ; |
| | |
| | | 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; |
| | |
| | | * 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(); |
| | |
| | | */ |
| | | 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(); |
| | |
| | | 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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 添加充值记录 |
| | | */ |
| | | SeRecharge seRecharge = new SeRecharge(); |
| | | //seRecharge.setCardid(cardId); |
| | | //seRecharge.setClientid(clientId); |
| | | seRecharge.setCardnum(cardNum); |
| | | seRecharge.setClientnum(clientNum); |
| | | seRecharge.setMoney(money); |
| | |
| | | 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); |
| | |
| | | |
| | | 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) ; |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | public String cardAddr; |
| | | @Schema(description = "水卡编号") |
| | | public String cardNum; |
| | | |
| | | |
| | | @Schema(description = "冲正时间_开始") |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | @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 备注 |
| | |
| | | * 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(); |
| | |
| | | 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(); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | 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); |
| | |
| | | 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) ; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 余额 |
| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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(); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | 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) ; |