Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoBa; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaPrivilege; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BaPrivilegeMapper extends BaseMapper<BaPrivilege> { |
| | | |
| | | /** |
| | | * 查询全部 |
| | | * @return List<BaPrivilege> |
| | | */ |
| | | List<BaPrivilege> selectAll() ; |
| | | |
| | | /** |
| | | * 查询某个用户所隶属所有角色的所有权限 |
| | | * @param userId 用户ID |
| | | * @return List<Integer> |
| | | */ |
| | | List<Integer> selectPrivilegeByUserId(@Param("userId") Long userId) ; |
| | | |
| | | /** |
| | | * 查询某个角色所隶属于该角色的所有权限 |
| | | * @param roleId 用户ID |
| | | * @return List<Integer> |
| | | */ |
| | | List<Integer> selectPrivilegeByRoleId(@Param("roleId") Long roleId) ; |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int putin(BaPrivilege record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(BaPrivilege record); |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoBa; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface BaRolePrivilegeMapper extends BaseMapper<BaRolePrivilege> { |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int putin(BaRolePrivilege record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(BaRolePrivilege record); |
| | | |
| | | /** |
| | | * delete by primary key |
| | | * @param roleId primaryKey |
| | | * @param privilegeId primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(@Param("roleId") Long roleId, @Param("privilegeId") Long privilegeId); |
| | | |
| | | /** |
| | | * delete by roleId |
| | | * @param roleId 角色ID |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByRoleId(@Param("roleId") Long roleId); |
| | | |
| | | /** |
| | | * delete by roleId |
| | | * @param privilegeId 权限ID |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrivilegeId(@Param("privilegeId") Long privilegeId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | |
| | | import com.dy.pipIrrGlobal.voSe.VoCards; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards2; |
| | | import com.dy.pipIrrGlobal.voWe.VoCards3; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return 符合条件记录数,最多一条 |
| | | */ |
| | | Integer isLostAndUnreplaced(@Param("cardNum") Long cardNum); |
| | | |
| | | /** |
| | | * 根据农户姓名和手机号获取水卡列表记录数,应用程序使用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getCardsByClientNameAndPhoneCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据农户姓名和手机号获取水卡列表,应用程序使用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoCards2> getCardsByClientNameAndPhone(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 根据农户ID查询正常状态的水卡列表,小程序使用 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | List<VoCards3> getCardsByClientID(String clientId); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoBa; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * 权限实体 |
| | | */ |
| | | @TableName(value="ba_privilege", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "权限实体") |
| | | public class BaPrivilege implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202310211551001L; |
| | | |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | /** |
| | | * 权限编号 |
| | | */ |
| | | public Integer num; |
| | | /** |
| | | * 权限名称 |
| | | */ |
| | | public String name; |
| | | /** |
| | | * 权限类别 |
| | | */ |
| | | public String type; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoBa; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import lombok.*; |
| | | /** |
| | | * 角色与权限关系实体 |
| | | */ |
| | | @TableName(value="ba_role_privilege", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class BaRolePrivilege implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202311062027001L; |
| | | |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableField(value = "roleId") |
| | | public Long roleId; |
| | | |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableField(value = "privilegeId") |
| | | public Long privilegeId; |
| | | |
| | | } |
| | |
| | | public List<?> roleList ; |
| | | |
| | | /** |
| | | * 用户所拥有的权限,针对登录应用 |
| | | */ |
| | | @Schema(hidden = true) |
| | | @TableField(exist = false) |
| | | @JSONField(serialize = false) |
| | | public List<Integer> privileges; |
| | | |
| | | |
| | | /** |
| | | * 所属片区名称 |
| | | */ |
| | | @Schema(description = "所属片区名称,用于显示,表单不用填写", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/26 17:14 |
| | | * @LastEditTime :2024/6/26 17:14 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "农户卡视图对象") |
| | | public class VoCards2 { |
| | | private static final long serialVersionUID = 202406261715001L; |
| | | |
| | | @Schema(title = "水卡ID") |
| | | private String clientCardId; |
| | | |
| | | @Schema(title = "农户ID") |
| | | private String clientId; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "电话号码") |
| | | private String phone; |
| | | |
| | | @Schema(title = "身份证号码") |
| | | private String idCard; |
| | | |
| | | @Schema(title = "水卡状态") |
| | | private Integer cardState; |
| | | |
| | | @Schema(title = "水卡状态名称") |
| | | private String stateName; |
| | | |
| | | @Schema(title = "水卡类型") |
| | | private String cardType; |
| | | |
| | | @Schema(title = "余额") |
| | | private String money; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voWe; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/26 17:14 |
| | | * @LastEditTime :2024/6/26 17:14 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "农户卡视图对象") |
| | | public class VoCards3 { |
| | | private static final long serialVersionUID = 202406261715001L; |
| | | |
| | | @Schema(title = "水卡ID") |
| | | private String clientCardId; |
| | | |
| | | @Schema(title = "农户ID") |
| | | private String clientId; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "电话号码") |
| | | private String phone; |
| | | |
| | | @Schema(title = "身份证号码") |
| | | private String idCard; |
| | | |
| | | @Schema(title = "水卡状态") |
| | | private Integer cardState; |
| | | |
| | | @Schema(title = "水卡状态名称") |
| | | private String stateName; |
| | | |
| | | @Schema(title = "水卡类型") |
| | | private String cardType; |
| | | |
| | | @Schema(title = "余额") |
| | | private String money; |
| | | } |
| | |
| | | |
| | | pipIrr: |
| | | global: |
| | | dev: false #是否开发阶段,true或false |
| | | dev: true #是否开发阶段,true或false |
| | | dsName: ym #开发阶段,设置临时的数据库名称 |
| | | mw: |
| | | webPort: 8070 |
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.BaPrivilegeMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaPrivilege"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ba_privilege--> |
| | | <result column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="num" jdbcType="INTEGER" property="num" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="type" jdbcType="VARCHAR" property="type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, num, name, type |
| | | </sql> |
| | | |
| | | <select id="selectAll" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ba_privilege |
| | | </select> |
| | | |
| | | <select id="selectPrivilegeByUserId" resultType="Integer"> |
| | | select p.num |
| | | from ba_privilege p |
| | | inner join ba_role_privilege rp on p.id = rp.privilegeId |
| | | inner join ba_user_role ur on rp.roleId = ur.roleId |
| | | inner join ba_role r on ur.roleId = r.id |
| | | where r.deleted != 1 |
| | | <if test="userId != null"> |
| | | and ur.userId = #{userId, jdbcType=BIGINT} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectPrivilegeByRoleId" resultType="Integer"> |
| | | select p.num |
| | | from ba_privilege p |
| | | inner join ba_role_privilege rp on p.id = rp.privilegeId |
| | | <if test="roleId != null"> |
| | | where rp.roleId = #{roleId, jdbcType=BIGINT} |
| | | </if> |
| | | </select> |
| | | |
| | | <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaPrivilege"> |
| | | <!--@mbg.generated--> |
| | | insert into ba_privilege (<include refid="Base_Column_List" />) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{num,jdbcType=INTEGER}, |
| | | #{name,jdbcType=VARCHAR}, |
| | | #{type, jdbcType=VARCHAR} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaPrivilege"> |
| | | <!--@mbg.generated--> |
| | | insert into ba_privilege |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="num != null"> |
| | | id, |
| | | </if> |
| | | <if test="name != null"> |
| | | name, |
| | | </if> |
| | | <if test="type != null"> |
| | | type, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="num != null"> |
| | | #{name,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null"> |
| | | #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | </mapper> |
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.BaRolePrivilegeMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ba_role_privilege--> |
| | | <id column="roleId" jdbcType="BIGINT" property="roleId" /> |
| | | <id column="privilegeId" jdbcType="BIGINT" property="privilegeId" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | roleId, privilegeId |
| | | </sql> |
| | | |
| | | <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege"> |
| | | <!--@mbg.generated--> |
| | | insert into ba_role_privilege (roleId, privilegeId) |
| | | values (#{roleId,jdbcType=BIGINT}, #{privilegeId,jdbcType=BIGINT}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege"> |
| | | <!--@mbg.generated--> |
| | | insert into ba_role_privilege |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="roleId != null"> |
| | | roleId, |
| | | </if> |
| | | <if test="privilegeId != null"> |
| | | privilegeId, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="roleId != null"> |
| | | #{roleId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="privilegeId != null"> |
| | | #{privilegeId,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="map"> |
| | | <!--@mbg.generated--> |
| | | delete from ba_role_privilege |
| | | where roleId = #{roleId,jdbcType=BIGINT} |
| | | and privilegeId = #{privilegeId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <delete id="deleteByRoleId" parameterType="long"> |
| | | delete from ba_role_privilege |
| | | where roleId = #{roleId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <delete id="deleteByPrivilegeId" parameterType="long"> |
| | | delete from ba_role_privilege |
| | | where privilegeId = #{privilegeId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据农户姓名和手机号获取水卡列表记录数,应用程序使用--> |
| | | <select id="getCardsByClientNameAndPhoneCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | <where> |
| | | card.state = 1 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "phone != null and phone !=''"> |
| | | AND cli.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据农户姓名和手机号获取水卡列表,应用程序使用--> |
| | | <select id="getCardsByClientNameAndPhone" resultType="com.dy.pipIrrGlobal.voSe.VoCards2"> |
| | | SELECT |
| | | card.id AS clientCardId, |
| | | cli.id AS clientId, |
| | | cli.clientNum, |
| | | cli.name AS clientName, |
| | | card.cardNum, |
| | | cli.phone, |
| | | cli.idCard, |
| | | card.state AS cardState, |
| | | (CASE |
| | | WHEN card.state = 1 THEN '正常' |
| | | WHEN card.state = 2 THEN '已注销' |
| | | WHEN card.state = 3 THEN '已挂失' |
| | | End) AS stateName, |
| | | '农户卡' AS cardType, |
| | | FORMAT(card.money, 2) AS money |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | <where> |
| | | card.state = 1 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "phone != null and phone !=''"> |
| | | AND cli.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY card.id |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--根据农户ID查询正常状态的水卡列表,小程序使用--> |
| | | <select id="getCardsByClientID" resultType="com.dy.pipIrrGlobal.voWe.VoCards3"> |
| | | SELECT |
| | | card.id AS clientCardId, |
| | | cli.id AS clientId, |
| | | cli.clientNum, |
| | | cli.name AS clientName, |
| | | card.cardNum, |
| | | cli.phone, |
| | | cli.idCard, |
| | | card.state AS cardState, |
| | | (CASE |
| | | WHEN card.state = 1 THEN '正常' |
| | | WHEN card.state = 2 THEN '已注销' |
| | | WHEN card.state = 3 THEN '已挂失' |
| | | End) AS stateName, |
| | | '农户卡' AS cardType, |
| | | FORMAT(card.money, 2) AS money |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | where |
| | | card.state = 1 |
| | | AND cli.id like CONCAT('%',#{clientId},'%') |
| | | |
| | | |
| | | ORDER BY card.id |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.dy.pipIrrBase.block; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.mybatis.envm.Deleted; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | po.id = null ; |
| | | po.deleted = Deleted.NO; |
| | | int count; |
| | | try { |
| | | count = this.sv.save(po); |
| | |
| | | public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QoRecharge vo){ |
| | | try { |
| | | QueryResultVo<List<VoRecharge>> res = cardOperateSv.getRecharges(vo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.No_RECHARGES.getMessage()); |
| | | } |
| | | //if(res.itemTotal == 0) { |
| | | // return BaseResponseUtils.buildFail(SellResultCode.No_RECHARGES.getMessage()); |
| | | //} |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取充值记录异常", e); |
| | |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards2; |
| | | import com.dy.pipIrrSell.clientCard.qo.QoCards; |
| | | import com.dy.pipIrrSell.clientCard.qo.QoCards2; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据农户姓名、电话查询正常状态的水卡列表 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "getCardsByClientNameAndPhone") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCards2>>> getCardsByClientNameAndPhone(QoCards2 vo){ |
| | | try { |
| | | QueryResultVo<List<VoCards2>> res = clientCardSv.getCardsByClientNameAndPhone(vo); |
| | | if(res.itemTotal != null && res.itemTotal > 0) { |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | }else { |
| | | return BaseResponseUtils.buildFail(SellResultCode.THE_CARD_NOT_EXIST.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("查询水卡异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards2; |
| | | import com.dy.pipIrrSell.clientCard.qo.QoCards; |
| | | import com.dy.pipIrrSell.clientCard.qo.QoCards2; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据农户姓名、电话查询正常状态的水卡列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoCards2>> getCardsByClientNameAndPhone(QoCards2 queryVo){ |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ; |
| | | Long itemTotal = seClientCardMapper.getCardsByClientNameAndPhoneCount(params); |
| | | |
| | | QueryResultVo<List<VoCards2>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seClientCardMapper.getCardsByClientNameAndPhone(params); |
| | | |
| | | return rsVo ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.clientCard.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "水卡记录查询条件") |
| | | public class QoCards2 extends QueryConditionVo { |
| | | |
| | | @Schema(description = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(description = "手机号") |
| | | private String phone; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.client; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.voWe.VoCards3; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/26 15:58 |
| | | * @LastEditTime :2024/6/26 15:58 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Tag(name = "农户水卡操作", description = "农户水卡操作") |
| | | @RestController |
| | | @RequestMapping(path="clientCard") |
| | | public class ClientCardCtrl { |
| | | @Autowired |
| | | private ClientCardSv clientCardSv; |
| | | |
| | | /** |
| | | * 根据农户ID查询正常状态的水卡列表 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "getCardsByClientID") |
| | | @SsoAop() |
| | | public BaseResponse<List<VoCards3>> getCardsByClientID(String clientId){ |
| | | try { |
| | | List<VoCards3> res = clientCardSv.getCardsByClientID(clientId); |
| | | |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("查询水卡异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.client; |
| | | |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.voWe.VoCards3; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/6/26 16:05 |
| | | * @LastEditTime :2024/6/26 16:05 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ClientCardSv { |
| | | |
| | | @Autowired |
| | | private SeClientCardMapper seClientCardMapper; |
| | | /** |
| | | * 根据农户ID查询正常状态的水卡列表 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | public List<VoCards3> getCardsByClientID(String clientId){ |
| | | |
| | | return seClientCardMapper.getCardsByClientID(clientId); |
| | | } |
| | | } |