Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
62个文件已修改
1个文件已删除
17个文件已添加
| | |
| | | <artifactId>httpclient</artifactId> |
| | | <version>4.5.14</version> |
| | | </dependency> |
| | | <!-- apache poi --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>3.14</version> |
| | | </dependency> |
| | | |
| | | <!-- quartz --> |
| | | <dependency> |
| | | <groupId>org.quartz-scheduler</groupId> |
| | |
| | | <groupId>com.dy</groupId> |
| | | <artifactId>pipIrr-common</artifactId> |
| | | <version>1.0.0</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>spring-boot-starter-log4j2</artifactId> |
| | | <groupId>org.springframework.boot</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | <!--EasyExcel相关依赖--> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.1.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaDistrict; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface BaDistrictMapper extends BaseMapper<BaDistrict> { |
| | |
| | | */ |
| | | int deleteLogicById(Long id); |
| | | |
| | | /** |
| | | * 根据村编号获取5级区划信息 |
| | | * @param villageId 村编号(主键) |
| | | * @return 5级行政区划信息 |
| | | */ |
| | | Map getDistrictsByVillageId(@Param("villageId") Long villageId); |
| | | |
| | | /** |
| | | * 根据级别获取行政区划列表 |
| | | * @param level 行政区划层级 |
| | | * @return 行政区划列表 |
| | | */ |
| | | List<Map<String, Object>> getDistrictgsByLevel(@Param("level") Integer level); |
| | | |
| | | /** |
| | | * 根据父ID获取行政区划列表 |
| | | * @param supperId 行政区划父级ID |
| | | * @return 行政区划列表 |
| | | */ |
| | | List<Map<String, Object>> getDistrictsBySupperId(@Param("supperId") Long supperId); |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.daoPr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrDivide; |
| | | import com.dy.pipIrrGlobal.voPr.VoDivide; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @LastEditTime 2023/12/21 9:16 |
| | | * @Description |
| | | */ |
| | | public interface PrDivideMapper { |
| | | @Mapper |
| | | public interface PrDivideMapper extends BaseMapper<PrDivide> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PrDivide record); |
| | |
| | | * @return |
| | | */ |
| | | List<VoDivide> getDivides(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据分水房ID逻辑删除分水房 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Integer deleteDivideById(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 根据分水房编号获取所属片区编号 |
| | | * @param divideId |
| | | * @return |
| | | */ |
| | | Long getBlockIdById(@Param("divideId") Long divideId); |
| | | } |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/18 16:58 |
| | | * @LastEditTime 2023/12/18 16:58 |
| | | * @date 2023/12/22 16:26 |
| | | * @LastEditTime 2023/12/22 16:26 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/20 14:48 |
| | | * @LastEditTime 2023/12/20 14:48 |
| | | * @date 2023-12-25 14:32 |
| | | * @LastEditTime 2023-12-25 14:32 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/18 16:26 |
| | | * @LastEditTime 2023/12/18 16:26 |
| | | * @date 2023/12/22 16:04 |
| | | * @LastEditTime 2023/12/22 16:04 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Map getCardIdAndClientNum(@Param("cardNum") String cardNum); |
| | | |
| | | /** |
| | | * 根据农户主键获取水卡列表 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | List<VoCardInfo> getCardInfoByClientId(@Param("clientId") Long clientId); |
| | | |
| | | /** |
| | | * 根据水卡编号获取操作记录列表 |
| | | * @param cardNum 水卡编号 |
| | | * @return 水卡操作记录列表 |
| | | */ |
| | | List<Map<String, Object>> getOperateRecordsByCardNum(@Param("cardNum") Long cardNum); |
| | | |
| | | /** |
| | | * 根据水卡编号获取余额 |
| | | * @param cardNum 水卡编号 |
| | | * @return 余额 |
| | | */ |
| | | Float getMoneyByCardNum(@Param("cardNum") Long cardNum); |
| | | |
| | | /** |
| | | * 根据水卡编号获取充值总额 |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | | Float sumRechargeByCardNum(@Param("cardNum") Long cardNum); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSe; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoOperate; |
| | | import com.dy.pipIrrGlobal.voSe.VoStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-26 10:32 |
| | | * @LastEditTime 2023-12-26 10:32 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeClientMapper extends BaseMapper<SeClient> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(SeClient record); |
| | | |
| | | int insertSelective(SeClient record); |
| | | |
| | | SeClient selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(SeClient record); |
| | | |
| | | int updateByPrimaryKey(SeClient record); |
| | | |
| | | /** |
| | | * 根据6位区划串模糊查询农户编号 |
| | | * @param district8 |
| | | * @return |
| | | */ |
| | | String getClientNumOfMax(@Param("district8") String district8); |
| | | |
| | | /** |
| | | * 根据农户编号获取5级行政区划代码 |
| | | * @param clientNum 农户编号 |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | Long getAreaCodeByNum(@Param("clientNum") String clientNum); |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID |
| | | * @param clientNum |
| | | * @return |
| | | */ |
| | | Long getClientIdByNum(@Param("clientNum") String clientNum); |
| | | |
| | | /** |
| | | * 根据指定条件获取农户记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取农户数据 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoClient> getClients(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据农户ID逻辑删除农户 |
| | | * @param id 农户ID |
| | | * @return 逻辑删除记录数 |
| | | */ |
| | | Integer deleteClientById(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 根据主键获取村ID |
| | | * @param id 农户ID |
| | | * @return 村主键 |
| | | */ |
| | | Long getVillageIdById(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 获取虚拟卡号最大值 |
| | | * @return |
| | | */ |
| | | Long getMa1xVirtualId(); |
| | | |
| | | /** |
| | | * 获取用水方式列表 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getWaterTypes(); |
| | | |
| | | /** |
| | | * 根据指定条件获取购水汇总和购卡汇总 |
| | | * @param params 统计条件 |
| | | * @return 购水金额、购卡金额 |
| | | */ |
| | | Map getSums(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取操作记录数 |
| | | * @param params 查询条件 |
| | | * @return 符合条件的记录数 |
| | | */ |
| | | Long getOperateRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取操作记录 |
| | | * @param params 查询条件 |
| | | * @return 符合条件的交易记录 |
| | | */ |
| | | List<VoOperate> getOperates(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取交易笔数汇总和交易金额汇总 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Map getStatisticSums(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取汇总记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getStatisticRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取统计记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoStatistics> getStatistics(Map<?, ?> params); |
| | | } |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/19 15:08 |
| | | * @LastEditTime 2023/12/19 15:08 |
| | | * @date 2023-12-25 13:52 |
| | | * @LastEditTime 2023-12-25 13:52 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/19 10:35 |
| | | * @LastEditTime 2023/12/19 10:35 |
| | | * @date 2023/12/23 8:47 |
| | | * @LastEditTime 2023/12/23 8:47 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/19 10:18 |
| | | * @LastEditTime 2023/12/19 10:18 |
| | | * @date 2023/12/23 8:47 |
| | | * @LastEditTime 2023/12/23 8:47 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | |
| | | int updateByPrimaryKey(SeRecharge record); |
| | | |
| | | /** |
| | | * 根据指定的条件获取充值记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | |
| | | List<VoRecharge> getRecharges(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据水卡编号删除充值记录 |
| | | * @param cardNum |
| | | * 根据水卡ID删除充值记录 |
| | | * @param cardId |
| | | * @return |
| | | */ |
| | | //Integer deleteByCardId(@Param("cardId") Long cardId); |
| | | Integer deleteByCardNum(@Param("cardNum") String cardNum); |
| | | //Integer deleteByCardNum(@Param("cardNum") String cardNum); |
| | | Integer deleteByCardId(@Param("cardId") Long cardId); |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/20 16:52 |
| | | * @LastEditTime 2023/12/20 16:52 |
| | | * @date 2023-12-25 15:13 |
| | | * @LastEditTime 2023-12-25 15:13 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeReversalMapper extends BaseMapper<SeReversal> { |
| | | int deleteByPrimaryKey(Long id); |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/20 16:05 |
| | | * @LastEditTime 2023/12/20 16:05 |
| | | * @date 2023-12-25 14:51 |
| | | * @LastEditTime 2023-12-25 14:51 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeUnlockMapper extends BaseMapper<SeUnlock> { |
| | | int deleteByPrimaryKey(Long id); |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Max; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import jakarta.validation.constraints.*; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | //@Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "水卡编号不能为空") |
| | | //private String cardnum; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | //@Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "农户编号不能为空") |
| | | //private String clientnum; |
| | | |
| | | /** |
| | | * 水卡ID;水卡主键 |
| | | */ |
| | | @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "水卡ID不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户ID;农户主键 |
| | | */ |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "农户ID不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 卡片费用 |
| | |
| | | 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.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | @NotNull(message = "水卡编号不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @NotNull(message = "农户编号不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 退款金额 |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/21 19:08 |
| | | * @LastEditTime 2023/12/21 19:08 |
| | | * @Description |
| | | */ |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.*; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 农户表 |
| | | */ |
| | | |
| | | @TableName(value="se_client", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "农户实体") |
| | | public class SeClient implements BaseEntity { |
| | | public static final long serialVersionUID = 202311141539001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 县ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在县ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在县不能为空") |
| | | private Long countyid; |
| | | |
| | | /** |
| | | * 镇ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在镇ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在镇不能为空") //不能为空也不能为null |
| | | private Long townid; |
| | | |
| | | /** |
| | | * 村ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在村ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在村不能为空") //不能为空也不能为null |
| | | private Long villageid; |
| | | |
| | | /** |
| | | * 片区ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在片区ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在片区不能为空") //不能为空也不能为null |
| | | private Long blockid; |
| | | |
| | | /** |
| | | * 分水房ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "所在分水房ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在分水房不能为空") //不能为空也不能为null |
| | | private Long divideid; |
| | | |
| | | /** |
| | | * 农户姓名 |
| | | */ |
| | | @Schema(description = "农户姓名", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotBlank(message = "农户姓名不能为空") //不能为空也不能为null |
| | | @Length(message = "农户姓名不大于{max}字,不小于{min}字", min = 1, max = 25) |
| | | private String name; |
| | | |
| | | /** |
| | | * 虚拟卡号;10位,从1000000000开始 |
| | | */ |
| | | @Schema(description = "虚拟卡号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "虚拟卡号不能为空") |
| | | private Long virtualid; |
| | | |
| | | /** |
| | | * 农户编号;6位区划 + 4为顺序号 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | //@NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | |
| | | /** |
| | | * 区划编码串;省区划+市区划+县区划+镇区划+村区划 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @Schema(description = "区划编码串", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | //@NotNull(message = "区划编码串不能为空") |
| | | private Long districtnum; |
| | | |
| | | /** |
| | | * 区划名称串;县名+镇名+村名,用于归属地 |
| | | */ |
| | | @Schema(description = "区划名称串", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | //@NotBlank(message = "区划名称串") |
| | | private String districttitle; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @Schema(description = "农户手机号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "农户手机号不能为空") //不能为空也不能为null |
| | | @Length(message = "农户手机号必须{max}位数据", min = 11, max = 11) |
| | | private String phone; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @Schema(description = "农户身份证号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotBlank(message = "农户身份证号不能为空") //不能为空也不能为null |
| | | @Length(message = "农户身份证号必须{max}位数据", min = 18, max = 18) |
| | | private String idcard; |
| | | |
| | | /** |
| | | * 种植面积 |
| | | */ |
| | | @Schema(description = "农户种植面积", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Double area; |
| | | |
| | | /** |
| | | * 用水类型ID |
| | | */ |
| | | @Schema(description = "用水类型ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long typeid; |
| | | |
| | | /** |
| | | * 街道及门牌号 |
| | | */ |
| | | @Schema(description = "街道+门牌号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "地址不大于{max}字,不小于{min}字", min = 1, max = 50) |
| | | private String address; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注不大于{max}字,不小于{min}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "操作人编号不能为空") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operatedt; |
| | | |
| | | /** |
| | | * 禁止标志;0-未禁,1-已禁 |
| | | */ |
| | | @Schema(description = "是否禁用", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Max(message = "是否禁用只能0或1", value = 1) |
| | | @Min(message = "是否禁用只能0或1",value = 0) |
| | | @TableField(updateStrategy = FieldStrategy.NEVER) |
| | | private Byte disabled; |
| | | |
| | | /** |
| | | * 逻辑删除标识;0-未删除,1-删除 |
| | | */ |
| | | @Schema(description = "删除标识,form表单中不存在,只在查询显示中有效", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @TableField(updateStrategy = FieldStrategy.NEVER) |
| | | private Byte deleted; |
| | | |
| | | } |
| | |
| | | private String cardnum; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户ID不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 余额 |
| | | */ |
| | | @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Double money; |
| | | private Float money; |
| | | |
| | | /** |
| | | * 卡片状态;1-正常,2-已注销,3-已挂失 |
| | |
| | | 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.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/9 8:55 |
| | | * @LastEditTime 2023/12/19 15:14 |
| | | * @date 2023-12-25 13:52 |
| | | * @LastEditTime 2023-12-25 13:52 |
| | | * @Description |
| | | */ |
| | | |
| | | /** |
| | | * 水卡挂失表 |
| | | */ |
| | | |
| | | @TableName(value="se_loss", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "挂失实体") |
| | | |
| | | public class SeLoss implements BaseEntity { |
| | | public static final long serialVersionUID = 20231191728001L; |
| | | /** |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | @NotNull(message = "水卡编号不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @NotNull(message = "农户编号不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 余额 |
| | |
| | | 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.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | * 水卡ID |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "水卡ID不能为空") |
| | | //private String cardnum; |
| | | @NotNull(message = "水卡ID不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "农户ID不能为空") |
| | | //private String clientnum; |
| | | @NotNull(message = "农户ID不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | 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.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | * 水卡ID |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | @Schema(description = "水卡ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "水卡ID不能为空") |
| | | //private String cardnum; |
| | | @NotNull(message = "水卡ID不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@NotBlank(message = "农户ID不能为空") |
| | | //private String clientnum; |
| | | @NotNull(message = "农户ID不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | 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.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | @NotNull(message = "水卡编号不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @NotNull(message = "农户编号不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | 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.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardnum; |
| | | @NotNull(message = "水卡编号不能为空") |
| | | private Long cardid; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "农户编号不能为空") |
| | | private String clientnum; |
| | | @NotNull(message = "农户编号不能为空") |
| | | private Long clientid; |
| | | |
| | | /** |
| | | * 剩余金额 |
New file |
| | |
| | | package com.dy.pipIrrGlobal.util; |
| | | |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.io.resource.ClassPathResource; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONUtil; |
| | | import java.nio.charset.Charset; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/21 11:03 |
| | | * @LastEditTime 2023/12/21 11:03 |
| | | * @Description |
| | | */ |
| | | public class LocalJsonUtil { |
| | | /** |
| | | * 从指定路径获取JSON并转换为List |
| | | * @param path json文件路径 |
| | | * @param elementType List元素类型 |
| | | */ |
| | | public static <T> List<T> getListFromJson(String path, Class<T> elementType) { |
| | | ClassPathResource resource = new ClassPathResource(path); |
| | | String jsonStr = IoUtil.read(resource.getStream(), Charset.forName("UTF-8")); |
| | | JSONArray jsonArray = new JSONArray(jsonStr); |
| | | return JSONUtil.toList(jsonArray, elementType); |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "ID") |
| | | @ExcelProperty("ID") |
| | | @ColumnWidth(10) |
| | | private Long id; |
| | | |
| | | @Schema(title = "分水房名称") |
| | | @ExcelProperty("分水房名称") |
| | | @ColumnWidth(15) |
| | | private String divideName; |
| | | |
| | | @Schema(title = "所属片区") |
| | | @ExcelProperty("所属片区") |
| | | @ColumnWidth(15) |
| | | private String blockName; |
| | | |
| | | @Schema(title = "负责人") |
| | | @ExcelProperty("负责人") |
| | | @ColumnWidth(10) |
| | | private String header; |
| | | |
| | | @Schema(title = "联系电话") |
| | | @ExcelProperty("联系电话") |
| | | @ColumnWidth(15) |
| | | private String phone; |
| | | |
| | | @Schema(title = "归属地") |
| | | @ExcelProperty("归属地") |
| | | @ColumnWidth(25) |
| | | private String address; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Schema(title = "操作时间") |
| | | @ExcelIgnore |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-27 19:22 |
| | | * @LastEditTime 2023-12-27 19:22 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "IC卡视图对象") |
| | | public class VoCardInfo implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private Long cardNum; |
| | | |
| | | @Schema(title = "卡片类型") |
| | | private String cardType; |
| | | |
| | | @Schema(title = "余额") |
| | | private Float money; |
| | | |
| | | @Schema(title = "水卡状态") |
| | | private String state; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/22 11:43 |
| | | * @LastEditTime 2023/12/22 11:43 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "农户视图对象") |
| | | public class VoClient implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "ID") |
| | | private Long id; |
| | | |
| | | @Schema(title = "县ID") |
| | | private String countyId; |
| | | @Schema(title = "县名称") |
| | | private String countryName; |
| | | |
| | | @Schema(title = "镇ID") |
| | | private String townId; |
| | | @Schema(title = "镇名称") |
| | | private String townName; |
| | | |
| | | @Schema(title = "村ID") |
| | | private String villageId; |
| | | @Schema(title = "村名称") |
| | | private String villageName; |
| | | |
| | | @Schema(title = "片区ID") |
| | | private String blockId; |
| | | @Schema(title = "片区名称") |
| | | private String bolckName; |
| | | |
| | | @Schema(title = "分水房ID") |
| | | private String divideId; |
| | | @Schema(title = "分水房名称") |
| | | private String divideName; |
| | | |
| | | @Schema(title = "用户类型ID") |
| | | private String waterTypeId; |
| | | @Schema(title = "用户类型名称") |
| | | private String waterTypeName; |
| | | |
| | | @Schema(title = "农户ID") |
| | | private String clientId; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String name; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "手机号") |
| | | private String phone; |
| | | |
| | | @Schema(title = "身份证号") |
| | | private String idcard; |
| | | |
| | | @Schema(title = "种植面积") |
| | | private Double area; |
| | | |
| | | @Schema(title = "卡片数量") |
| | | private Integer cardCount; |
| | | |
| | | @Schema(title = "地址") |
| | | private String address; |
| | | |
| | | @Schema(title = "备注") |
| | | private String remarks; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Schema(title = "注册时间") |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-26 20:44 |
| | | * @LastEditTime 2023-12-26 20:44 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "操作记录视图对象") |
| | | public class VoOperate implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "村ID") |
| | | private Long villageId; |
| | | |
| | | @Schema(title = "区划名称串") |
| | | private String districtTitle; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String name; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private Long cardNum; |
| | | |
| | | @Schema(title = "身份证号") |
| | | private String idCard; |
| | | |
| | | @Schema(title = "手机号") |
| | | private String phone; |
| | | |
| | | @Schema(title = "充值金额") |
| | | private Float money; |
| | | |
| | | @Schema(title = "购卡金额") |
| | | private Integer cardCost; |
| | | |
| | | @Schema(title = "支付方式编号") |
| | | private Long paymentId; |
| | | |
| | | @Schema(title = "支付方式名称") |
| | | private String paymentMethod; |
| | | |
| | | @Schema(title = "业务类型") |
| | | private String operateType; |
| | | |
| | | @Schema(title = "交易时间") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date operateDt; |
| | | |
| | | @Schema(title = "操作员") |
| | | private String operatorName; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSe; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-27 15:01 |
| | | * @LastEditTime 2023-12-27 15:01 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "交易汇总视图对象") |
| | | public class VoStatistics implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "村庄ID") |
| | | private Long villageId; |
| | | |
| | | @Schema(title = "村庄") |
| | | private String districtTitle; |
| | | |
| | | @Schema(title = "业务类型") |
| | | private String operateType; |
| | | |
| | | @Schema(title = "交易日期") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date operateDt; |
| | | |
| | | @Schema(title = "交易笔数") |
| | | private Integer count; |
| | | |
| | | @Schema(title = "交易金额") |
| | | private Float money; |
| | | } |
| | |
| | | project: |
| | | webPort: 8085 |
| | | actutorPort: 9085 |
| | | idSuffix: 7 |
| | | idSuffix: 7 |
| | | |
| | | projectCode: |
| | | ym: 100 |
| | | pj: 101 |
| | |
| | | update ba_district set deleted = 1 |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!--根据村编号获取5级区划信息--> |
| | | <select id="getDistrictsByVillageId" resultType="java.util.Map"> |
| | | SELECT |
| | | pro.id AS provinceId, |
| | | pro.num AS provinceNum, |
| | | pro.name AS provinceName, |
| | | cit.id AS cityId, |
| | | cit.num AS cityNum, |
| | | cit.name AS cityName, |
| | | con.id AS countryId, |
| | | con.num AS countyNum, |
| | | con.name AS countryName, |
| | | tow.id AS townId, |
| | | tow.num AS townNum, |
| | | tow.name AS townName, |
| | | vil.id AS villageId, |
| | | vil.num AS villageNum, |
| | | vil.name AS villageName |
| | | FROM ba_district vil |
| | | INNER JOIN ba_district tow ON vil.supperId = tow.id |
| | | INNER JOIN ba_district con ON tow.supperId = con.id |
| | | INNER JOIN ba_district cit ON con.supperId = cit.id |
| | | INNER JOIN ba_district pro ON cit.supperId = pro.id |
| | | WHERE vil.id = ${villageId} |
| | | </select> |
| | | |
| | | <!--根据级别获取行政区划列表--> |
| | | <select id="getDistrictgsByLevel" resultType="java.util.Map"> |
| | | SELECT |
| | | CAST(id AS char) AS id, |
| | | name |
| | | FROM ba_district WHERE `level` = ${level} |
| | | </select> |
| | | |
| | | <!--根据父ID获取行政区划列表--> |
| | | <select id="getDistrictsBySupperId" resultType="java.util.Map"> |
| | | SELECT |
| | | CAST(id AS char) AS id, |
| | | name |
| | | FROM ba_district WHERE supperId = ${supperId} |
| | | </select> |
| | | </mapper> |
| | |
| | | lat = #{lat,jdbcType=DOUBLE}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP}, |
| | | deleted = #{deleted,jdbcType=TINYINT} |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP} |
| | | <!-- ,--> |
| | | <!-- deleted = #{deleted,jdbcType=TINYINT}--> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | |
| | | INNER JOIN ba_district village ON divi.villageid = village.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | AND divi. deleted = 0 |
| | | <if test = "divideName != null and divideName !=''"> |
| | | AND divi.name LIKE CONCAT('%',#{divideName},'%') |
| | | </if> |
| | |
| | | INNER JOIN ba_district village ON divi.villageid = village.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | AND divi. deleted = 0 |
| | | <if test = "divideName != null and divideName !=''"> |
| | | AND divi.name LIKE CONCAT('%',#{divideName},'%') |
| | | </if> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据分水房ID逻辑删除分水房--> |
| | | <update id="deleteDivideById" parameterType="java.lang.Long"> |
| | | update pr_divide set deleted = 1 |
| | | <where> |
| | | <if test = "id != null and id > 0"> |
| | | AND id = ${id} |
| | | </if> |
| | | </where> |
| | | </update> |
| | | |
| | | <!--根据分水房编号获取所属片区编号--> |
| | | <select id="getBlockIdById" resultType="java.lang.Long"> |
| | | SELECT blockId FROM pr_divide WHERE id = ${divideId}} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_active_card--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <result column="cardCost" jdbcType="INTEGER" property="cardcost" /> |
| | | <result column="paymentId" jdbcType="BIGINT" property="paymentid" /> |
| | | <result column="reissueAmount" jdbcType="DOUBLE" property="reissueamount" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardNum, clientNum, cardCost, paymentId, reissueAmount, operateType, remarks, |
| | | `operator`, operateDt |
| | | id, cardId, clientId, cardCost, paymentId, reissueAmount, operateType, 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.SeActiveCard"> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_active_card (id, cardNum, clientNum, cardCost, paymentId, reissueAmount, operateType, remarks, `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | #{cardcost,jdbcType=INTEGER}, |
| | | #{paymentid,jdbcType=BIGINT}, |
| | | #{reissueamount,jdbcType=DOUBLE}, |
| | | #{operatetype,jdbcType=TINYINT}, |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, |
| | | #{operatedt,jdbcType=TIMESTAMP}) |
| | | insert into se_active_card (id, cardId, clientId, cardCost, |
| | | paymentId, reissueAmount, operateType, |
| | | remarks, `operator`, operateDt |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{cardcost,jdbcType=INTEGER}, |
| | | #{paymentid,jdbcType=BIGINT}, #{reissueamount,jdbcType=DOUBLE}, #{operatetype,jdbcType=TINYINT}, |
| | | #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_active_card |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="cardcost != null"> |
| | | cardCost, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardcost != null"> |
| | | #{cardcost,jdbcType=INTEGER}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_active_card |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardcost != null"> |
| | | cardCost = #{cardcost,jdbcType=INTEGER}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeActiveCard"> |
| | | <!--@mbg.generated--> |
| | | update se_active_card |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | cardCost = #{cardcost,jdbcType=INTEGER}, |
| | | paymentId = #{paymentid,jdbcType=BIGINT}, |
| | | reissueAmount = #{reissueamount,jdbcType=DOUBLE}, |
| | |
| | | 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 se_client cli ON act.clientId = cli.id |
| | | INNER JOIN se_client_card card ON act.cardId = card.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "operateType != null and operateType > 0"> |
| | | AND act.operateType = ${operateType} |
| | |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.num AS clientNum, |
| | | cli.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, |
| | |
| | | (SELECT `name` FROM ba_user WHERE id = act.operator) AS operator, |
| | | act.operateDt |
| | | 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 |
| | | INNER JOIN se_client cli ON act.clientId = cli.id |
| | | INNER JOIN se_client_card card ON act.cardId = card.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "operateType != null and operateType > 0"> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_cancel--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <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, cardNum, clientNum, refund, refundType, remarks, `operator`, operateDt |
| | | id, cardId, clientId, refund, refundType, remarks, `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel"> |
| | | <!--@mbg.generated--> |
| | | insert into se_cancel (id, cardNum, clientNum, refund, |
| | | insert into se_cancel (id, cardId, clientId, refund, |
| | | refundType, remarks, `operator`, |
| | | operateDt) |
| | | values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{refund,jdbcType=FLOAT}, |
| | | 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> |
| | |
| | | <!--@mbg.generated--> |
| | | insert into se_cancel |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="refund != null"> |
| | | refund, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="refund != null"> |
| | | #{refund,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_cancel |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="refund != null"> |
| | | refund = #{refund,jdbcType=FLOAT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCancel"> |
| | | <!--@mbg.generated--> |
| | | update se_cancel |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | 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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON can.clientNum = cli.num |
| | | , (SELECT @i:=0) AS itable |
| | | INNER JOIN se_client_card card ON can.cardId = card.id |
| | | INNER JOIN se_client cli ON can.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.num AS clientNum, |
| | | cli.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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON can.clientNum = cli.num |
| | | INNER JOIN se_client_card card ON can.cardId = card.id |
| | | INNER JOIN se_client cli ON can.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | |
| | | <!--@Table se_client_card--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardAddr" jdbcType="VARCHAR" property="cardaddr" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardNum" jdbcType="BIGINT" property="cardnum" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | <result column="state" jdbcType="TINYINT" property="state" /> |
| | | <result column="createDt" jdbcType="TIMESTAMP" property="createdt" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardAddr, cardNum, clientNum, money, `state`, createDt, replaceDt, rechargeDt, |
| | | id, cardAddr, cardNum, clientId, money, `state`, createDt, replaceDt, rechargeDt, |
| | | lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | |
| | | <!--根据水卡编号获取水卡表主键及农户编号--> |
| | | <select id="getCardIdAndClientNum" resultType="java.util.Map"> |
| | | SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum} |
| | | <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> |
| | | SELECT |
| | | card.id AS cardId, |
| | | cli.clientNum, |
| | | cli.id AS clientId |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | |
| | | <!--根据行政区划串模块查询水卡编号--> |
| | | <!--根据行政区划串模糊查询水卡编号--> |
| | | <select id="getCardNumOfMax" resultType="java.lang.String"> |
| | | SELECT cardNum |
| | | FROM se_client_card |
| | |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--添加水卡记录--> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true"> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card (id, cardAddr, cardNum, clientNum, |
| | | money, `state`, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, |
| | | cancelDt, unlockDt, reversalDt, |
| | | insert into se_client_card (id, cardAddr, cardNum, clientId, |
| | | money, `state`, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, |
| | | cancelDt, unlockDt, reversalDt, |
| | | consumeDt, lastOper, remarks |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, |
| | | #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP}, |
| | | #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, |
| | | #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, |
| | | values (#{id,jdbcType=BIGINT}, #{cardaddr,jdbcType=VARCHAR}, #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{createdt,jdbcType=TIMESTAMP}, |
| | | #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, |
| | | #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, |
| | | #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR} |
| | | ) |
| | | </insert> |
| | | |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card |
| | |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | #{cardaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | #{cardnum,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | |
| | | cardAddr = #{cardaddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | cardNum = #{cardnum,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_client_card |
| | | set cardAddr = #{cardaddr,jdbcType=VARCHAR}, |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | cardNum = #{cardnum,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | money = #{money,jdbcType=FLOAT}, |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | createDt = #{createdt,jdbcType=TIMESTAMP}, |
| | |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据农户主键获取水卡列表--> |
| | | <select id="getCardInfoByClientId" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo"> |
| | | SELECT |
| | | cardNum, |
| | | '用户卡' AS cardType, |
| | | money, |
| | | (CASE |
| | | WHEN state = 1 THEN "正常" |
| | | WHEN state = 2 THEN "已注销" |
| | | ELSE "已挂失" |
| | | END) AS state |
| | | FROM se_client_card |
| | | WHERE clientId = ${clientId} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取操作记录列表--> |
| | | <select id="getOperateRecordsByCardNum" resultType="java.util.HashMap"> |
| | | SELECT * FROM v_operate WHERE cardNum = ${cardNum} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取余额--> |
| | | <select id="getMoneyByCardNum" resultType="java.lang.Float"> |
| | | SELECT money FROM se_client_card WHERE cardNum = ${cardNum} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取充值总额--> |
| | | <select id="sumRechargeByCardNum" resultType="java.lang.Float"> |
| | | SELECT |
| | | SUM(his.amount) AS amount |
| | | FROM se_recharge_history his |
| | | INNER JOIN se_client_card card ON his.cardId = card.id |
| | | WHERE card.cardNum = ${cardNum} |
| | | </select> |
| | | </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.daoSe.SeClientMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeClient"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_client--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="countyId" jdbcType="BIGINT" property="countyid" /> |
| | | <result column="townId" jdbcType="BIGINT" property="townid" /> |
| | | <result column="villageId" jdbcType="BIGINT" property="villageid" /> |
| | | <result column="blockId" jdbcType="BIGINT" property="blockid" /> |
| | | <result column="divideId" jdbcType="BIGINT" property="divideid" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="virtualId" jdbcType="BIGINT" property="virtualid" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="districtNum" jdbcType="BIGINT" property="districtnum" /> |
| | | <result column="districtTitle" jdbcType="VARCHAR" property="districttitle" /> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone" /> |
| | | <result column="idCard" jdbcType="VARCHAR" property="idcard" /> |
| | | <result column="area" jdbcType="DOUBLE" property="area" /> |
| | | <result column="typeId" jdbcType="BIGINT" property="typeid" /> |
| | | <result column="address" jdbcType="VARCHAR" property="address" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operateDt" jdbcType="TIMESTAMP" property="operatedt" /> |
| | | <result column="disabled" jdbcType="TINYINT" property="disabled" /> |
| | | <result column="deleted" jdbcType="TINYINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, countyId, townId, villageId, blockId, divideId, `name`, virtualId, clientNum, |
| | | districtNum, districtTitle, phone, idCard, area, typeId, address, remarks, `operator`, |
| | | operateDt, disabled, deleted |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from se_client |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_client |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client (id, countyId, townId, |
| | | villageId, blockId, divideId, |
| | | `name`, virtualId, clientNum, |
| | | districtNum, districtTitle, phone, |
| | | idCard, area, typeId, |
| | | address, remarks, `operator`, |
| | | operateDt, disabled, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{countyid,jdbcType=BIGINT}, #{townid,jdbcType=BIGINT}, |
| | | #{villageid,jdbcType=BIGINT}, #{blockid,jdbcType=BIGINT}, #{divideid,jdbcType=BIGINT}, |
| | | #{name,jdbcType=VARCHAR}, #{virtualid,jdbcType=BIGINT}, #{clientnum,jdbcType=VARCHAR}, |
| | | #{districtnum,jdbcType=BIGINT}, #{districttitle,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, |
| | | #{idcard,jdbcType=VARCHAR}, #{area,jdbcType=DOUBLE}, #{typeid,jdbcType=BIGINT}, |
| | | #{address,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, |
| | | #{operatedt,jdbcType=TIMESTAMP}, #{disabled,jdbcType=TINYINT}, #{deleted,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="countyid != null"> |
| | | countyId, |
| | | </if> |
| | | <if test="townid != null"> |
| | | townId, |
| | | </if> |
| | | <if test="villageid != null"> |
| | | villageId, |
| | | </if> |
| | | <if test="blockid != null"> |
| | | blockId, |
| | | </if> |
| | | <if test="divideid != null"> |
| | | divideId, |
| | | </if> |
| | | <if test="name != null"> |
| | | `name`, |
| | | </if> |
| | | <if test="virtualid != null"> |
| | | virtualId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | </if> |
| | | <if test="districtnum != null"> |
| | | districtNum, |
| | | </if> |
| | | <if test="districttitle != null"> |
| | | districtTitle, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone, |
| | | </if> |
| | | <if test="idcard != null"> |
| | | idCard, |
| | | </if> |
| | | <if test="area != null"> |
| | | area, |
| | | </if> |
| | | <if test="typeid != null"> |
| | | typeId, |
| | | </if> |
| | | <if test="address != null"> |
| | | address, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operatedt != null"> |
| | | operateDt, |
| | | </if> |
| | | <if test="disabled != null"> |
| | | disabled, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="countyid != null"> |
| | | #{countyid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="townid != null"> |
| | | #{townid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="villageid != null"> |
| | | #{villageid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="blockid != null"> |
| | | #{blockid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="divideid != null"> |
| | | #{divideid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="virtualid != null"> |
| | | #{virtualid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="districtnum != null"> |
| | | #{districtnum,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="districttitle != null"> |
| | | #{districttitle,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="idcard != null"> |
| | | #{idcard,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="area != null"> |
| | | #{area,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="typeid != null"> |
| | | #{typeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="address != null"> |
| | | #{address,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operatedt != null"> |
| | | #{operatedt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | | #{disabled,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> |
| | | <!--@mbg.generated--> |
| | | update se_client |
| | | <set> |
| | | <if test="countyid != null"> |
| | | countyId = #{countyid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="townid != null"> |
| | | townId = #{townid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="villageid != null"> |
| | | villageId = #{villageid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="blockid != null"> |
| | | blockId = #{blockid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="divideid != null"> |
| | | divideId = #{divideid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="virtualid != null"> |
| | | virtualId = #{virtualid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="districtnum != null"> |
| | | districtNum = #{districtnum,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="districttitle != null"> |
| | | districtTitle = #{districttitle,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="idcard != null"> |
| | | idCard = #{idcard,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="area != null"> |
| | | area = #{area,jdbcType=DOUBLE}, |
| | | </if> |
| | | <if test="typeid != null"> |
| | | typeId = #{typeid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="address != null"> |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operatedt != null"> |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | | disabled = #{disabled,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClient"> |
| | | <!--@mbg.generated--> |
| | | update se_client |
| | | set countyId = #{countyid,jdbcType=BIGINT}, |
| | | townId = #{townid,jdbcType=BIGINT}, |
| | | villageId = #{villageid,jdbcType=BIGINT}, |
| | | blockId = #{blockid,jdbcType=BIGINT}, |
| | | divideId = #{divideid,jdbcType=BIGINT}, |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | <!-- virtualId = #{virtualid,jdbcType=BIGINT},--> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | districtNum = #{districtnum,jdbcType=BIGINT}, |
| | | districtTitle = #{districttitle,jdbcType=VARCHAR}, |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | idCard = #{idcard,jdbcType=VARCHAR}, |
| | | area = #{area,jdbcType=DOUBLE}, |
| | | typeId = #{typeid,jdbcType=BIGINT}, |
| | | address = #{address,jdbcType=VARCHAR}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP}, |
| | | <!-- disabled = #{disabled,jdbcType=TINYINT},--> |
| | | <!-- deleted = #{deleted,jdbcType=TINYINT}--> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据6位区划串模糊查询农户编号--> |
| | | <select id="getClientNumOfMax" resultType="java.lang.String"> |
| | | SELECT clientNum |
| | | FROM se_client |
| | | WHERE clientNum LIKE CONCAT('%',#{district8},'%') |
| | | ORDER BY clientNum desc |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--根据指定条件获取农户记录数--> |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_client cli |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | AND cli.disabled = 0 |
| | | AND cli.deleted = 0 |
| | | <if test = "name != null and name !=''"> |
| | | AND cli.name like CONCAT('%',#{name},'%') |
| | | </if> |
| | | |
| | | <if test = "clientNum != null and clientNum !=''"> |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "phone != null and phone !=''"> |
| | | AND cli.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | |
| | | <if test = "address != null and address !=''"> |
| | | AND cli.address like CONCAT('%',#{address},'%') |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!--根据指定条件获取农户数据--> |
| | | <select id="getClients" resultType="com.dy.pipIrrGlobal.voSe.VoClient"> |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | CAST(cli.countyId AS char) AS countyId, |
| | | dis_con.name AS countryName, |
| | | CAST(cli.townId AS char) AS townId, |
| | | dis_town.name AS townName, |
| | | CAST(cli.villageId AS char) AS villageId, |
| | | dis_village.name AS villageName, |
| | | CAST(cli.blockId AS char) AS blockId, |
| | | blo.name AS bolckName, |
| | | CAST(cli.divideId AS char) AS divideId, |
| | | divi.name AS divideName, |
| | | CAST(cli.typeId AS char) AS waterTypeId, |
| | | wat.typeName AS waterTypeName, |
| | | CAST(cli.id AS char) AS clientId, |
| | | cli.name, |
| | | cli.clientNum, |
| | | cli.phone, |
| | | cli.idCard, |
| | | cli.area, |
| | | (SELECT COUNT(*) FROM se_client_card WHERE clientId = cli.id) AS cardCount, |
| | | cli.address, |
| | | cli.remarks, |
| | | cli.operateDt |
| | | FROM se_client cli |
| | | LEFT JOIN ba_district dis_con ON cli.countyId = dis_con.id |
| | | LEFT JOIN ba_district dis_town ON cli.townId = dis_town.id |
| | | LEFT JOIN ba_district dis_village ON cli.villageId = dis_village.id |
| | | LEFT JOIN ba_block blo ON cli.blockId = blo.id |
| | | LEFT JOIN pr_divide divi ON cli.divideId = divi.id |
| | | LEFT JOIN se_water_type wat ON cli.typeId = wat.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | AND cli.disabled = 0 |
| | | AND cli.deleted = 0 |
| | | <if test = "name != null and name !=''"> |
| | | AND cli.name like CONCAT('%',#{name},'%') |
| | | </if> |
| | | |
| | | <if test = "clientNum != null and clientNum !=''"> |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "phone != null and phone !=''"> |
| | | AND cli.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | |
| | | <if test = "address != null and address !=''"> |
| | | AND cli.address like CONCAT('%',#{address},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.operateDt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据农户编号获取5级行政区划代码--> |
| | | <select id="getAreaCodeByNum" resultType="java.lang.Long"> |
| | | SELECT districtNum FROM se_client WHERE clientNum = ${clientNum} |
| | | </select> |
| | | |
| | | <!--根据农户编号获取农户ID--> |
| | | <select id="getClientIdByNum" resultType="java.lang.Long"> |
| | | SELECT id FROM se_client WHERE clientNum = ${clientNum} |
| | | </select> |
| | | |
| | | <!--根据农户ID逻辑删除农户--> |
| | | <update id="deleteClientById" parameterType="java.lang.Long"> |
| | | update se_client set deleted = 1 |
| | | <where> |
| | | <if test = "id != null and id > 0"> |
| | | AND id = ${id} |
| | | </if> |
| | | </where> |
| | | </update> |
| | | |
| | | <!--根据主键获取村ID--> |
| | | <select id="getVillageIdById" parameterType="java.lang.Long" resultType="java.lang.Long"> |
| | | SELECT villageId FROM se_client WHERE id = ${id} |
| | | </select> |
| | | |
| | | <!--获取虚拟卡号最大值--> |
| | | <select id="getMa1xVirtualId" resultType="java.lang.Long"> |
| | | SELECT virtualId FROM se_client ORDER BY id DESC LIMIT 0,1 |
| | | </select> |
| | | |
| | | <!--获取用水方式列表--> |
| | | <select id="getWaterTypes" resultType="java.util.Map"> |
| | | SELECT id, typeName from se_water_type |
| | | </select> |
| | | |
| | | <!-- 下列内容为交易明细查询 --> |
| | | <!--根据指定条件获取购水汇总和购卡汇总--> |
| | | <select id="getSums" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(money) AS money, |
| | | SUM(cardCost) AS cardCost |
| | | FROM v_operate |
| | | <where> |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = ${villageId} |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId >0"> |
| | | AND paymentId = ${paymentId} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易记录数--> |
| | | <select id="getOperateRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM v_operate |
| | | <where> |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = ${villageId} |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId >0"> |
| | | AND paymentId = ${paymentId} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易记录--> |
| | | <select id="getOperates" resultType="com.dy.pipIrrGlobal.voSe.VoOperate"> |
| | | SELECT |
| | | villageId, |
| | | districtTitle, |
| | | clientNum, |
| | | `name`, |
| | | cardNum, |
| | | idCard, |
| | | phone, |
| | | money, |
| | | cardCost, |
| | | paymentId, |
| | | paymentMethod, |
| | | operateType, |
| | | operateDt, |
| | | operatorName |
| | | FROM v_operate |
| | | <where> |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = ${villageId} |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId >0"> |
| | | AND paymentId = ${paymentId} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY operateDt |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 下列内容为交易统计查询 --> |
| | | <!--根据指定条件获取交易笔数汇总和交易金额汇总--> |
| | | <select id="getStatisticSums" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(count) AS count, |
| | | SUM(money) AS money |
| | | FROM |
| | | ( |
| | | SELECT |
| | | villageId, |
| | | districtTitle, |
| | | operateType, |
| | | operateDt, |
| | | count(*) AS count, |
| | | (sum(money) + sum(cardCost)) AS money |
| | | FROM v_operate |
| | | <where> |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = ${villageId} |
| | | </if> |
| | | |
| | | <!-- <if test = "paymentId != null and paymentId >0">--> |
| | | <!-- AND paymentId = ${paymentId}--> |
| | | <!-- </if>--> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | GROUP BY villageId, districtTitle, operateType, operateDt |
| | | ) temp |
| | | </select> |
| | | |
| | | <!--根据指定条件获取汇总记录数--> |
| | | <select id="getStatisticRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM |
| | | ( |
| | | SELECT |
| | | villageId, |
| | | districtTitle, |
| | | operateType, |
| | | operateDt, |
| | | count(*) AS count, |
| | | (sum(money) + sum(cardCost)) AS money |
| | | FROM v_operate |
| | | <where> |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = ${villageId} |
| | | </if> |
| | | |
| | | <!-- <if test = "paymentId != null and paymentId >0">--> |
| | | <!-- AND paymentId = ${paymentId}--> |
| | | <!-- </if>--> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | GROUP BY villageId, districtTitle, operateType, operateDt |
| | | ) temp |
| | | </select> |
| | | |
| | | <!--根据指定条件获取统计记录--> |
| | | <select id="getStatistics" resultType="com.dy.pipIrrGlobal.voSe.VoStatistics"> |
| | | SELECT |
| | | villageId, |
| | | districtTitle, |
| | | operateType, |
| | | operateDt, |
| | | count(*) AS count, |
| | | (sum(money) + sum(cardCost)) AS money |
| | | FROM v_operate |
| | | <where> |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND villageId = ${villageId} |
| | | </if> |
| | | |
| | | <!-- <if test = "paymentId != null and paymentId >0">--> |
| | | <!-- AND paymentId = ${paymentId}--> |
| | | <!-- </if>--> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND operateDt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | GROUP BY villageId, districtTitle, operateType, operateDt |
| | | ORDER BY operateDt |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_loss--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <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, cardNum, clientNum, money, refund, remarks, `operator`, operateDt |
| | | id, cardId, clientId, money, refund, remarks, `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss"> |
| | | <!--@mbg.generated--> |
| | | insert into se_loss (id, cardNum, clientNum, money, |
| | | insert into se_loss (id, cardId, clientId, money, |
| | | refund, remarks, `operator`, |
| | | operateDt) |
| | | values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT}, |
| | | 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> |
| | |
| | | <!--@mbg.generated--> |
| | | insert into se_loss |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_loss |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeLoss"> |
| | | <!--@mbg.generated--> |
| | | update se_loss |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | 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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON loss.clientNum = cli.num |
| | | INNER JOIN se_client_card card ON loss.cardId = card.id |
| | | INNER JOIN se_client cli ON loss.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.num AS clientNum, |
| | | cli.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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON loss.clientNum = cli.num |
| | | INNER JOIN se_client_card card ON loss.cardId = card.id |
| | | INNER JOIN se_client cli ON loss.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_recharge_history--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | <result column="gift" jdbcType="FLOAT" property="gift" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardNum, clientNum, money, amount, gift, afterRecharge, paymentId, price, remarks, |
| | | id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, |
| | | `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge_history (id, cardNum, clientNum, money, |
| | | insert into se_recharge_history (id, cardId, clientId, money, |
| | | amount, gift, afterRecharge, |
| | | paymentId, price, remarks, |
| | | `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT}, |
| | | values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, |
| | | #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) |
| | |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_recharge_history |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRechargeHistory"> |
| | | <!--@mbg.generated--> |
| | | update se_recharge_history |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | money = #{money,jdbcType=FLOAT}, |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | gift = #{gift,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_recharge--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | <result column="gift" jdbcType="FLOAT" property="gift" /> |
| | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardNum, clientNum, money, amount, gift, afterRecharge, paymentId, price, remarks, |
| | | id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, |
| | | `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true">--> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge (id, cardNum, clientNum, money, |
| | | insert into se_recharge (id, cardId, clientId, money, |
| | | amount, gift, afterRecharge, |
| | | paymentId, price, remarks, |
| | | `operator`, operateDt) |
| | | values (#{id,jdbcType=BIGINT} ,#{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT}, |
| | | values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, |
| | | #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, |
| | | #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true"> |
| | | <!--@mbg.generated--> |
| | | insert into se_recharge |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_recharge |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge"> |
| | | <!--@mbg.generated--> |
| | | update se_recharge |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | money = #{money,jdbcType=FLOAT}, |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | gift = #{gift,jdbcType=FLOAT}, |
| | |
| | | </update> |
| | | |
| | | <!--根据水卡编号删除充值记录--> |
| | | <delete id="deleteByCardNum" parameterType="java.lang.String"> |
| | | DELETE FROM se_recharge WHERE cardNum = #{cardNum} |
| | | <!-- <delete id="deleteByCardNum" parameterType="java.lang.String">--> |
| | | <!-- DELETE FROM se_recharge WHERE cardNum = #{cardNum}--> |
| | | <!-- </delete>--> |
| | | |
| | | <!--根据水卡ID删除充值记录--> |
| | | <delete id="deleteByCardId" parameterType="java.lang.Long"> |
| | | DELETE FROM se_recharge WHERE cardId = #{cardId} |
| | | </delete> |
| | | |
| | | <!--根据指定的条件获取充值记录--> |
| | |
| | | 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.cardId = card.id |
| | | INNER JOIN se_client cli ON rec.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "clientNum != null and clientNum > 0"> |
| | | AND rec.clientNum like CONCAT('%',#{clientNum},'%') |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.name AS clientName, |
| | | cli.num AS clientNum, |
| | | cli.clientNum, |
| | | card.cardNum, |
| | | rec.amount, |
| | | rec.afterRecharge, |
| | |
| | | (SELECT `name` FROM ba_user WHERE id = rec.operator) AS operator, |
| | | rec.operateDt |
| | | 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 |
| | | INNER JOIN se_client_card card ON rec.cardId = card.id |
| | | INNER JOIN se_client cli ON rec.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | |
| | | </if> |
| | | |
| | | <if test = "clientNum != null and clientNum > 0"> |
| | | AND rec.clientNum like CONCAT('%',#{clientNum},'%') |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_reversal--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <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, cardNum, clientNum, cardBalance, systemBalance, remarks, `operator`, operateDt |
| | | id, cardId, clientId, cardBalance, systemBalance, remarks, `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal"> |
| | | <!--@mbg.generated--> |
| | | insert into se_reversal (id, cardNum, clientNum, cardBalance, |
| | | insert into se_reversal (id, cardId, clientId, cardBalance, |
| | | systemBalance, remarks, `operator`, |
| | | operateDt) |
| | | values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{cardbalance,jdbcType=FLOAT}, |
| | | 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> |
| | |
| | | <!--@mbg.generated--> |
| | | insert into se_reversal |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="cardbalance != null"> |
| | | cardBalance, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardbalance != null"> |
| | | #{cardbalance,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_reversal |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardbalance != null"> |
| | | cardBalance = #{cardbalance,jdbcType=FLOAT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeReversal"> |
| | | <!--@mbg.generated--> |
| | | update se_reversal |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | cardBalance = #{cardbalance,jdbcType=FLOAT}, |
| | | systemBalance = #{systembalance,jdbcType=FLOAT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | |
| | | operateDt = #{operatedt,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据指定的条件获取冲正记录数--> |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | 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 |
| | | INNER JOIN se_client_card card ON rev.cardId = card.id |
| | | INNER JOIN se_client cli ON rev.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | |
| | | <!--根据指定的条件获取冲正记录--> |
| | | <select id="getReversals" resultType="com.dy.pipIrrGlobal.voSe.VoReversal"> |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.num AS clientNum, |
| | | card.cardNum, |
| | | rev.cardBalance, |
| | | (SELECT `name` FROM ba_user WHERE id = rev.operator) AS operator, |
| | | rev.operateDt |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON rev.clientNum = cli.num |
| | | , (SELECT @i:=0) AS itable |
| | | INNER JOIN se_client_card card ON rev.cardId = card.id |
| | | INNER JOIN se_client cli ON rev.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_unlock--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cardNum" jdbcType="VARCHAR" property="cardnum" /> |
| | | <result column="clientNum" jdbcType="VARCHAR" property="clientnum" /> |
| | | <result column="cardId" jdbcType="BIGINT" property="cardid" /> |
| | | <result column="clientId" jdbcType="BIGINT" property="clientid" /> |
| | | <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, cardNum, clientNum, money, remarks, `operator`, operateDt |
| | | id, cardId, clientId, money, remarks, `operator`, operateDt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock"> |
| | | <!--@mbg.generated--> |
| | | insert into se_unlock (id, cardNum, clientNum, money, |
| | | insert into se_unlock (id, cardId, clientId, money, |
| | | remarks, `operator`, operateDt |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{cardnum,jdbcType=VARCHAR}, #{clientnum,jdbcType=VARCHAR}, #{money,jdbcType=FLOAT}, |
| | | values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | |
| | | <!--@mbg.generated--> |
| | | insert into se_unlock |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | cardNum, |
| | | <if test="cardid != null"> |
| | | cardId, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum, |
| | | <if test="clientid != null"> |
| | | clientId, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="cardnum != null"> |
| | | #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | |
| | | <!--@mbg.generated--> |
| | | update se_unlock |
| | | <set> |
| | | <if test="cardnum != null"> |
| | | cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | <if test="cardid != null"> |
| | | cardId = #{cardid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientnum != null"> |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | <if test="clientid != null"> |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeUnlock"> |
| | | <!--@mbg.generated--> |
| | | update se_unlock |
| | | set cardNum = #{cardnum,jdbcType=VARCHAR}, |
| | | clientNum = #{clientnum,jdbcType=VARCHAR}, |
| | | set cardId = #{cardid,jdbcType=BIGINT}, |
| | | clientId = #{clientid,jdbcType=BIGINT}, |
| | | 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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON unl.clientNum = cli.num |
| | | , (SELECT @i:=0) AS itable |
| | | INNER JOIN se_client_card card ON unl.cardId = card.id |
| | | INNER JOIN se_client cli ON unl.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | |
| | | SELECT |
| | | (@i:=@i+1) AS id, |
| | | cli.`name` AS clientName, |
| | | cli.num AS clientNum, |
| | | cli.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.cardNum = card.cardNum |
| | | INNER JOIN ba_client cli ON unl.clientNum = cli.num |
| | | , (SELECT @i:=0) AS itable |
| | | INNER JOIN se_client_card card ON unl.cardId = card.id |
| | | INNER JOIN se_client cli ON unl.clientId = cli.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | |
| | | 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; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaDistrict; |
| | | import com.dy.pipIrrGlobal.util.DistrictLevel; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | 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 = "行政区划增删改查等操作") |
| | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据级别获取行政区划列表 |
| | | * @param id |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/level/{id}") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<Map<String, Object>>>> getDistrictgsByLevel(@PathVariable("id") Integer id){ |
| | | if(id == null || id <= 0){ |
| | | return BaseResponseUtils.buildFail("id不能为空") ; |
| | | } |
| | | |
| | | List<Map<String, Object>> map_Districts = Optional.ofNullable(sv.getDistrictgsByLevel(id)).orElse(new ArrayList<>()); |
| | | if(map_Districts == null || map_Districts.size() == 0) { |
| | | return BaseResponseUtils.buildFail("您输入的层级有误") ; |
| | | } |
| | | return BaseResponseUtils.buildSuccess(map_Districts); |
| | | } |
| | | |
| | | /** |
| | | * 根据父ID获取行政区划列表 |
| | | * @param supperId |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/supperid/{supperId}") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<Map<String, Object>>>> getDistrictsBySupperId(@PathVariable("supperId") Long supperId){ |
| | | if(supperId == null || supperId <= 0){ |
| | | return BaseResponseUtils.buildFail("父ID不能为空") ; |
| | | } |
| | | |
| | | List<Map<String, Object>> map_Districts = Optional.ofNullable(sv.getDistrictsBySupperId(supperId)).orElse(new ArrayList<>()); |
| | | if(map_Districts == null || map_Districts.size() == 0) { |
| | | return BaseResponseUtils.buildFail("您输入的父级ID有误") ; |
| | | } |
| | | return BaseResponseUtils.buildSuccess(map_Districts); |
| | | } |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据级别获取行政区划列表 |
| | | * @param level |
| | | * @return |
| | | */ |
| | | public List<Map<String, Object>> getDistrictgsByLevel(Integer level) { |
| | | return dao.getDistrictgsByLevel(level); |
| | | } |
| | | |
| | | /** |
| | | * 根据父ID获取行政区划列表 |
| | | * @param supperId |
| | | * @return |
| | | */ |
| | | public List<Map<String, Object>> getDistrictsBySupperId(Long supperId) { |
| | | return dao.getDistrictsBySupperId(supperId); |
| | | } |
| | | } |
| | |
| | | }) |
| | | @GetMapping("info/{id}/") |
| | | //http://127.0.0.1:8000/demo/demo/info/123234234/?name=张三 |
| | | @SsoAop(power="123456", ifAllPower = {"123", "456"}) |
| | | @SsoAop() |
| | | public BaseResponse<String> info(@PathVariable String id, @RequestParam String name) throws GlException{ |
| | | if(name == null || name.trim().equals("")){ |
| | | return BaseResponseUtils.buildFail(ResultCodeMsg.RsMsg.ERROR_PARAM); |
| | |
| | | <name>pipIrr-web-project</name> |
| | | <description>web项目配置系统</description> |
| | | |
| | | |
| | | <build> |
| | | <plugins> |
| | | <!-- 生成不包含依赖jar的可执行jar包 |
| | |
| | | @EnableAspectJAutoProxy |
| | | @EnableMultiDataSource |
| | | @ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.pipIrrProject"}) |
| | | @MapperScan({"com.dy.pipIrrGlobal.daoPr"}) |
| | | @MapperScan({"com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoBa"}) |
| | | public class PipIrrProjectApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | package com.dy.pipIrrProject.divide; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.support.ExcelTypeEnum; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrDivide; |
| | | import com.dy.pipIrrGlobal.voPr.VoDivide; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | public class DivideCtrl { |
| | | private final DivideSv divideSv; |
| | | |
| | | /** |
| | | * 分页获取分水房记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页分水房记录", description = "返回一页分水房数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getDivides", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getDivides") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoDivide>>> getDivides(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoDivide>>> getDivides(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoDivide>> res = divideSv.getDivides(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据分水房主键获取分水房对象 |
| | | * @param id |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getone/{id}") |
| | | @SsoAop() |
| | | public BaseResponse<PrDivide> getOneDivide(@PathVariable("id") Long id){ |
| | | try { |
| | | PrDivide res = divideSv.getOneDivide(id); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询农户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加分水房记录 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加分水房记录", description = "添加分水房记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | |
| | | }) |
| | | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop()//@SsoAop(power = "-1") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid PrDivide 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()); |
| | | } |
| | | // 接收村编号(主键) |
| | | Long villageId = po.getVillageid(); |
| | | |
| | | /** |
| | | * 获取5级行政区划信息 |
| | | */ |
| | | Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); |
| | | if(map_districts.size() <= 0) { |
| | | return BaseResponseUtils.buildFail("区划信息有误"); |
| | | } |
| | | |
| | | Long countryId = Long.parseLong(map_districts.get("countryId").toString()); |
| | | Long townId = Long.parseLong(map_districts.get("townId").toString()); |
| | | po.setCountyid(countryId); |
| | | po.setTownid(townId); |
| | | |
| | | Date operateTime = new Date(); |
| | | po.setOperatedt(operateTime); |
| | | po.setDeleted((byte)0); |
| | | Integer rec = Optional.ofNullable(divideSv.addDivide(po)).orElse(0); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.DIVIDE_FAIL.getMessage()); |
| | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 根据分水房ID逻辑删除分水房 |
| | | * @param id |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | |
| | | @GetMapping(path = "/delone/{id}") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteDivideById(@PathVariable("id") Long id){ |
| | | try { |
| | | Integer res = Optional.ofNullable(divideSv.deleteDivideById(id)).orElse(0); |
| | | if(res == 0) { |
| | | return BaseResponseUtils.buildFail("分水房删除失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } catch (Exception e) { |
| | | log.error("删除分水房异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改分水房 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "修改分水房记录", description = "修改分水房记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid PrDivide po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 接收村编号(主键) |
| | | Long villageId = po.getVillageid(); |
| | | |
| | | /** |
| | | * 获取5级行政区划信息 |
| | | */ |
| | | Map map_districts = Optional.ofNullable(divideSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); |
| | | if(map_districts.size() <= 0) { |
| | | return BaseResponseUtils.buildFail("区划信息有误"); |
| | | } |
| | | |
| | | Long countryId = Long.parseLong(map_districts.get("countryId").toString()); |
| | | Long townId = Long.parseLong(map_districts.get("townId").toString()); |
| | | |
| | | po.setCountyid(countryId); |
| | | po.setTownid(townId); |
| | | |
| | | Date operateTime = new Date(); |
| | | po.setOperatedt(operateTime); |
| | | |
| | | Integer rec = Optional.ofNullable(divideSv.updateByPrimaryKey(po)).orElse(0); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail("分水房修改失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 导出分水房列表 |
| | | * @param response |
| | | * @param vo |
| | | */ |
| | | @SneakyThrows(IOException.class) |
| | | @RequestMapping(value = "/exportDivides", method = RequestMethod.GET) |
| | | public void exportDivides(HttpServletResponse response, QueryVo vo) { |
| | | setExcelRespProp(response, "分水房列表"); |
| | | //List<VoDivide> memberList = LocalJsonUtil.getListFromJson("json/members.json", VoDivide.class); |
| | | List<VoDivide> memberList = divideSv.exportDivides(vo); |
| | | |
| | | EasyExcel.write(response.getOutputStream()) |
| | | .head(VoDivide.class) |
| | | .excelType(ExcelTypeEnum.XLSX) |
| | | .sheet("分水房列表") |
| | | .doWrite(memberList); |
| | | } |
| | | |
| | | @SneakyThrows |
| | | @RequestMapping(value = "/importDivides", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public BaseResponse<Boolean> importDivides(@RequestPart("file") MultipartFile file) { |
| | | List<VoDivide> memberList = EasyExcel.read(file.getInputStream()) |
| | | .head(VoDivide.class) |
| | | .sheet() |
| | | .doReadSync(); |
| | | return BaseResponseUtils.buildSuccess(memberList) ; |
| | | } |
| | | |
| | | /** |
| | | * 设置excel下载响应头属性 |
| | | */ |
| | | private void setExcelRespProp(HttpServletResponse response, String rawFileName) throws UnsupportedEncodingException { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode(rawFileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrProject.divide; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrDivideMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrDivide; |
| | | import com.dy.pipIrrGlobal.voPr.VoDivide; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | public class DivideSv { |
| | | @Autowired |
| | | private PrDivideMapper prDivideMapper; |
| | | |
| | | @Autowired |
| | | private BaDistrictMapper baDistrictMapper; |
| | | |
| | | /** |
| | | * 添加分水房 |
| | |
| | | public QueryResultVo<List<VoDivide>> getDivides(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | // 计算符合条件的记录数 |
| | | Long itemTotal = prDivideMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoDivide>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = prDivideMapper.getDivides(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件导出分水房列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public List<VoDivide> exportDivides(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | List<VoDivide> rsVo = new ArrayList<>(); |
| | | rsVo = prDivideMapper.getDivides(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据分水房主键获取分水房对象 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public PrDivide getOneDivide(Long id) { |
| | | return prDivideMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据主键逻辑删除一个分水房 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteDivideById(Long id) { |
| | | return prDivideMapper.deleteDivideById(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据村编号获取5级区划信息 |
| | | * @param villageId 村编号(主键) |
| | | * @return 5级行政区划信息 |
| | | */ |
| | | public Map getDistrictsByVillageId(Long villageId) { |
| | | return baDistrictMapper.getDistrictsByVillageId(villageId); |
| | | } |
| | | |
| | | /** |
| | | * 修改分水房对象 |
| | | * @param po 农户对象 |
| | | * @return 修改记录条数 |
| | | */ |
| | | public Integer updateByPrimaryKey(PrDivide po) { |
| | | return prDivideMapper.updateByPrimaryKey(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据分水房编号获取所属片区编号 |
| | | * @param divideId 分水房ID |
| | | * @return 所属片区ID |
| | | */ |
| | | public Long getBlockIdById(Long divideId) { |
| | | return prDivideMapper.getBlockIdById(divideId); |
| | | } |
| | | } |
| | |
| | | @Schema(description = "农户姓名") |
| | | public String divideName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | @Schema(description = "片区名称") |
| | | public String blockName; |
| | | } |
| | |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeActiveCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voBa.VoAreaCode; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | |
| | | private final ClientCardSv clientCardSv; |
| | | private final RechargeCtrl rechargeCtrl; |
| | | |
| | | @Value("${projectCode.ym}") |
| | | private Integer projectCode; |
| | | |
| | | /** |
| | | * 获取开卡记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得一页开卡记录", description = "返回一页开卡数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getActiveCards", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@GetMapping(path = "/getActiveCards", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getActiveCards") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoActiveCard>> res = activeCardSv.getActiveCards(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 开卡操作 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "开卡", description = "新开农户卡") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | |
| | | * townId 镇级区划代码 |
| | | * villageId 村级区划代码 |
| | | */ |
| | | VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum()); |
| | | if(voAreaCode == null) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.AREA_CODE_MISTAKE.getMessage()); |
| | | } |
| | | String provinceId = voAreaCode.getProvinceId(); |
| | | String cityId = voAreaCode.getCityId(); |
| | | String countryId = voAreaCode.getCountryId(); |
| | | String townId = voAreaCode.getTownId(); |
| | | String villageId = voAreaCode.getVillageId(); |
| | | String areaCode = provinceId + cityId + countryId + townId + villageId; |
| | | //VoAreaCode voAreaCode = activeCardSv.getAreaCodeByNum(po.getClientNum()); |
| | | //if(voAreaCode == null) { |
| | | // return BaseResponseUtils.buildFail(SellResultCode.AREA_CODE_MISTAKE.getMessage()); |
| | | //} |
| | | //String provinceId = voAreaCode.getProvinceId(); |
| | | //String cityId = voAreaCode.getCityId(); |
| | | //String countryId = voAreaCode.getCountryId(); |
| | | //String townId = voAreaCode.getTownId(); |
| | | //String villageId = voAreaCode.getVillageId(); |
| | | //String areaCode = provinceId + cityId + countryId + townId + villageId; |
| | | |
| | | String areaCode = String.valueOf(activeCardSv.getAreaCodeByNum(po.getClientNum())); |
| | | |
| | | /** |
| | | * 根据行政区划串(areaCode)在水卡表中针对水卡编号(cardNum)进行模糊查询 |
| | |
| | | */ |
| | | String cardAddr = po.getCardAddr(); |
| | | String clientNum = po.getClientNum(); |
| | | //Long clientId = po.getClientId(); |
| | | |
| | | Integer cardCost = po.getCardCost(); |
| | | Float amount = po.getAmount(); |
| | | Long paymentId = po.getPaymentId(); |
| | |
| | | Date createTime = new Date(); |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID |
| | | */ |
| | | Long clientId = activeCardSv.getClientIdByNum(clientNum); |
| | | |
| | | /** |
| | | * 添加农户卡记录 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setCardaddr(cardAddr); |
| | | seClientCard.setCardnum(cardNum); |
| | | seClientCard.setClientnum(clientNum); |
| | | seClientCard.setMoney(0.0); |
| | | //seClientCard.setClientnum(clientNum); |
| | | seClientCard.setClientid(clientId); |
| | | seClientCard.setMoney(0f); |
| | | seClientCard.setState(CardStateENUM.NORMAL.getCode()); |
| | | seClientCard.setCreatedt(createTime); |
| | | seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode()); |
| | |
| | | * 添加开卡记录 |
| | | */ |
| | | SeActiveCard activeCard = new SeActiveCard(); |
| | | activeCard.setCardnum(cardNum); |
| | | activeCard.setClientnum(clientNum); |
| | | //activeCard.setCardnum(cardNum); |
| | | //activeCard.setClientnum(clientNum); |
| | | |
| | | activeCard.setCardid(cardId); |
| | | activeCard.setClientid(clientId); |
| | | activeCard.setCardcost(cardCost); |
| | | activeCard.setPaymentid(paymentId); |
| | | activeCard.setOperatetype(OperateTypeENUM.ACTIVE.getCode()); |
| | |
| | | */ |
| | | po.setCardNum(cardNum); |
| | | if(amount != null && amount > 0) { |
| | | po.setClientId(clientId); |
| | | DtoRecharge dtoRecharge = RechargeDtoMapper.INSTANCT.po2vo(po); |
| | | dtoRecharge.setMoney(0f); |
| | | dtoRecharge.setGift(0f); |
| | |
| | | } |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(cardNum) ; |
| | | Map map = new HashMap(); |
| | | map.put("projectCode", projectCode); |
| | | map.put("cardNum", cardNum); |
| | | return BaseResponseUtils.buildSuccess(map) ; |
| | | } |
| | | |
| | | @Operation(summary = "补卡", description = "补卡") |
| | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查,更新水卡表用) |
| | | * cardNum 水卡编号 |
| | | * clientNum 农户编号(非传入参数,由cardNum反查,添加补卡使用) |
| | | //* clientNum 农户编号(非传入参数,由cardNum反查,添加补卡使用) |
| | | * clientId 农户ID(非传入参数,由cardNum反查,添加补卡使用) |
| | | * cardCost 卡片费用 |
| | | * reissueAmount 补卡金额,补卡时使用 |
| | | * paymentId 支付方式编号 |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | String clientNum = ""; |
| | | //String clientNum = ""; |
| | | Long clientId = 0L; |
| | | Integer cardCost = po.getCardCost(); |
| | | Double reissueAmount = po.getReissueAmount(); |
| | | Long paymentId = po.getPaymentId(); |
| | |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_ERROR.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | //clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | * 添加补卡记录 |
| | | */ |
| | | SeActiveCard activeCard = new SeActiveCard(); |
| | | activeCard.setCardnum(cardNum); |
| | | activeCard.setClientnum(clientNum); |
| | | //activeCard.setCardnum(cardNum); |
| | | //activeCard.setClientnum(clientNum); |
| | | activeCard.setCardid(cardId); |
| | | activeCard.setClientid(clientId); |
| | | activeCard.setCardcost(cardCost); |
| | | activeCard.setPaymentid(paymentId); |
| | | activeCard.setReissueamount(reissueAmount); |
| | |
| | | package com.dy.pipIrrSell.activeCard; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoBa.BaClientMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeActiveCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeActiveCard; |
| | | import com.dy.pipIrrGlobal.voBa.VoAreaCode; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private SeClientCardMapper seClientCardMapper; |
| | | |
| | | //@Autowired |
| | | //private BaClientMapper baClientMapper; |
| | | |
| | | @Autowired |
| | | private BaClientMapper baClientMapper; |
| | | private SeClientMapper seClientMapper; |
| | | |
| | | public QueryResultVo<List<VoActiveCard>> getActiveCards(QueryVo queryVo) { |
| | | //完善查询开卡记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime activeTimeStart = queryVo.activeTimeStart; |
| | | LocalDateTime activeTimeStop = queryVo.activeTimeStop; |
| | | String activeTimeStart = queryVo.activeTimeStart; |
| | | String activeTimeStop = queryVo.activeTimeStop; |
| | | if(activeTimeStart != null) { |
| | | activeTimeStart = LocalDateTime.parse(df.format(activeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | activeTimeStart = activeTimeStart + " 00:00:00"; |
| | | queryVo.setActiveTimeStart(activeTimeStart); |
| | | } |
| | | |
| | | if(activeTimeStop != null) { |
| | | activeTimeStop = LocalDateTime.parse(df.format(activeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | activeTimeStop = activeTimeStop + " 23:59:59"; |
| | | queryVo.setActiveTimeStop(activeTimeStop); |
| | | } |
| | | |
| | |
| | | Long itemTotal = seActiveCardMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoActiveCard>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seActiveCardMapper.getActiveCards(params); |
| | | return rsVo ; |
| | |
| | | * @param clientNum 农户编号 |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | public VoAreaCode getAreaCodeByNum(String clientNum) { |
| | | return baClientMapper.getAreaCodeByNum(clientNum); |
| | | public Long getAreaCodeByNum(String clientNum) { |
| | | return seClientMapper.getAreaCodeByNum(clientNum); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID |
| | | * @param clientNum |
| | | * @return |
| | | */ |
| | | public Long getClientIdByNum(String clientNum) { |
| | | return seClientMapper.getClientIdByNum(clientNum); |
| | | } |
| | | |
| | | /** |
| | |
| | | public static final long serialVersionUID = 20231191728001L; |
| | | |
| | | /** |
| | | * 水卡地址 |
| | | * 水卡地址,仅保存,无业务 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡地址不能为空") |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | * 开卡时使用 |
| | | * 农户编号,开卡使用 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String clientNum; |
| | | |
| | | /** |
| | | * 农户ID(主键) |
| | | * 废弃,改用clientNum |
| | | * 农户ID(主键),不是开卡接口传入,由农户编号获得,保存开卡记录和充值记录都需要 |
| | | */ |
| | | //@Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@Positive(message = "农户ID必须为大于0的整数") |
| | | //private Long clientId; |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/5 20:00 |
| | |
| | | @Schema(description = "卡片状态") |
| | | private Byte state; |
| | | |
| | | //@Schema(description = "开卡时间_开始") |
| | | //public LocalDateTime activeTimeStart; |
| | | // |
| | | //@Schema(description = "开卡时间_结束") |
| | | //public LocalDateTime activeTimeStop; |
| | | |
| | | @Schema(description = "开卡时间_开始") |
| | | public LocalDateTime activeTimeStart; |
| | | public String activeTimeStart; |
| | | |
| | | @Schema(description = "开卡时间_结束") |
| | | public LocalDateTime activeTimeStop; |
| | | public String activeTimeStop; |
| | | } |
| | |
| | | public interface RechargeDtoMapper { |
| | | RechargeDtoMapper INSTANCT = Mappers.getMapper(RechargeDtoMapper.class); |
| | | |
| | | //@Mapping(target = "cardAddr", source = "cardAddr") |
| | | //@Mapping(target = "clientId", source = "clientId") |
| | | //@Mapping(target = "cardId", source = "cardId") |
| | | @Mapping(target = "clientId", source = "clientId") |
| | | |
| | | @Mapping(target = "cardNum", source = "cardNum") |
| | | @Mapping(target = "clientNum", source = "clientNum") |
| | | @Mapping(target = "amount", source = "amount") |
| | | @Mapping(target = "paymentId", source = "paymentId") |
| | | @Mapping(target = "remarks", source = "remarks") |
| | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCancel; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCancel; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | |
| | | schema = @Schema(implementation = VoCancel.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getCancels", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getCancels") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCancel>>> getCancels(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoCancel>>> getCancels(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoCancel>> res = cancelSv.getCancels(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardAddr反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡编号 |
| | | * clientNum 农户编号(非传入参数,由cardNum反查,添加注销使用) |
| | | * refund 退款金额 |
| | | * refundType 退款方式 |
| | | * remarks 备注 |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | String clientNum = ""; |
| | | Long clientId = 0L; |
| | | Float refund = po.getRefund(); |
| | | Byte refundType = po.getRefundType(); |
| | | String remarks = po.getRemarks(); |
| | |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 注销时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setCanceldt(cancelTime); |
| | | seClientCard.setMoney(0f); |
| | | seClientCard.setState(CardStateENUM.CANCELLED.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.CANCEL.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 添加挂失记录 |
| | | * 添加注销记录 |
| | | */ |
| | | SeCancel seCancel = new SeCancel(); |
| | | seCancel.setCardnum(cardNum); |
| | | seCancel.setClientnum(clientNum); |
| | | //seCancel.setCardnum(cardNum); |
| | | //seCancel.setClientnum(clientNum); |
| | | seCancel.setCardid(cardId); |
| | | seCancel.setClientid(clientId); |
| | | seCancel.setRefund(refund); |
| | | seCancel.setRefundtype(refundType); |
| | | seCancel.setRemarks(remarks); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | public QueryResultVo<List<VoCancel>> getCancels(QueryVo queryVo) { |
| | | //完善查询注销记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime cancelTimeStart = queryVo.cancelTimeStart; |
| | | LocalDateTime cancelTimeStop = queryVo.cancelTimeStop; |
| | | String cancelTimeStart = queryVo.cancelTimeStart; |
| | | String cancelTimeStop = queryVo.cancelTimeStop; |
| | | if(cancelTimeStart != null) { |
| | | cancelTimeStart = LocalDateTime.parse(df.format(cancelTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | cancelTimeStart = cancelTimeStart + " 00:00:00"; |
| | | queryVo.setCancelTimeStart(cancelTimeStart); |
| | | } |
| | | |
| | | if(cancelTimeStop != null) { |
| | | cancelTimeStop = LocalDateTime.parse(df.format(cancelTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | cancelTimeStop = cancelTimeStop + " 23:59:59"; |
| | | queryVo.setCancelTimeStop(cancelTimeStop); |
| | | } |
| | | |
| | |
| | | Long itemTotal = seCancelMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoCancel>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seCancelMapper.getCancels(params); |
| | | return rsVo ; |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 14:18 |
| | |
| | | |
| | | |
| | | @Schema(description = "注销时间_开始") |
| | | public LocalDateTime cancelTimeStart; |
| | | public String cancelTimeStart; |
| | | |
| | | @Schema(description = "注销时间_结束") |
| | | public LocalDateTime cancelTimeStop; |
| | | public String cancelTimeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoClient; |
| | | 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.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | 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.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/21 19:17 |
| | | * @LastEditTime 2023/12/21 19:17 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Tag(name = "农户管理", description = "农户操作") |
| | | @RestController |
| | | @RequestMapping(path="client") |
| | | @RequiredArgsConstructor |
| | | public class ClientCtrl { |
| | | private final ClientSv clientSv; |
| | | |
| | | /** |
| | | * 获取农户列表 |
| | | * @param vo |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "get") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClient>>> get(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoClient>> res = clientSv.getClients(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询农户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取交易记录 |
| | | * @param vo |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "getOperates") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getOperates(QueryOperate vo){ |
| | | try { |
| | | Map res = clientSv.getOperates(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询交易记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取交易汇总记录 |
| | | * @param vo |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "getStatistics") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getStatistics(QueryStatistic vo){ |
| | | try { |
| | | Map res = clientSv.getStatistics(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询交易汇总记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据主键获取一个农户对象 |
| | | * @param id |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getone/{id}") |
| | | @SsoAop() |
| | | public BaseResponse<VoClient> getOneClient(@PathVariable("id") Long id){ |
| | | try { |
| | | VoClient res = clientSv.getOneClient(id); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询农户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加一个农户对象 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加农户记录", description = "添加农户记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 接收村编号(主键) |
| | | Long villageId = po.getVillageid(); |
| | | |
| | | /** |
| | | * 获取5级行政区划信息 |
| | | */ |
| | | Map map_districts = Optional.ofNullable(clientSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); |
| | | if(map_districts.size() <= 0) { |
| | | return BaseResponseUtils.buildFail("区划信息有误"); |
| | | } |
| | | |
| | | String provinceNum = map_districts.get("provinceNum").toString(); |
| | | String cityNum = map_districts.get("cityNum").toString(); |
| | | Long countryId = Long.parseLong(map_districts.get("countryId").toString()); |
| | | String countyNum = map_districts.get("countyNum").toString(); |
| | | String countryName = map_districts.get("countryName").toString(); |
| | | Long townId = Long.parseLong(map_districts.get("townId").toString()); |
| | | String townNum = map_districts.get("townNum").toString(); |
| | | String townName = map_districts.get("townName").toString(); |
| | | String villageNum = map_districts.get("villageNum").toString(); |
| | | String villageName = map_districts.get("villageName").toString(); |
| | | |
| | | // 生成8位行政区划编码,生成农户编号用 |
| | | String district8 = countyNum + townNum + villageNum; |
| | | // 生成农户编号 |
| | | String clientNum = generateClientNum(district8); |
| | | // 生成12位5级行政区划编码串及名称串 |
| | | Long districtNum = Long.parseLong(provinceNum + cityNum + district8); |
| | | String districtTitle = countryName + townName + villageName; |
| | | |
| | | // 生成虚拟卡号 |
| | | Long virtualId = Optional.ofNullable(clientSv.getMa1xVirtualId()).orElse(0L); |
| | | if(virtualId == 0) { |
| | | virtualId = 1000000000L; |
| | | }else { |
| | | virtualId = virtualId + 1; |
| | | if(virtualId > 10000000000L) { |
| | | return BaseResponseUtils.buildFail("虚拟卡号超限"); |
| | | } |
| | | } |
| | | |
| | | SeClient seClient = DtoClientToSeClient.INSTANCT.po2vo(po); |
| | | seClient.setCountyid(countryId); |
| | | seClient.setTownid(townId); |
| | | seClient.setVirtualid(virtualId); |
| | | seClient.setClientnum(clientNum); |
| | | seClient.setDistrictnum(districtNum); |
| | | seClient.setDistricttitle(districtTitle); |
| | | Date operateTime = new Date(); |
| | | seClient.setOperatedt(operateTime); |
| | | |
| | | seClient.setDisabled((byte)0); |
| | | seClient.setDeleted((byte)0); |
| | | Integer rec = Optional.ofNullable(clientSv.addClient(seClient)).orElse(0); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail("添加农户失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 生成10为农户编号 |
| | | * 1. 到农户表中查询6位区划串开头的最大的农户编号 |
| | | * 2. 是否取到记录 |
| | | * 2.1 取到 |
| | | * 2.1.1 取出后4位顺序号并转成整形 |
| | | * 2.1.2. 整形格式的顺序号加1并判断是否大于9999 |
| | | * 2.1.2.1 如果大于则提示用户编号已满 |
| | | * 2.1.2.2 如果不大 6位区划加上格式化后的顺序号 |
| | | * 2.2 未取到 6位区划加上0001 |
| | | * 3. 返回农户编号 |
| | | */ |
| | | private String generateClientNum(String district8) { |
| | | String clientNum = Optional.ofNullable(clientSv.getClientNumOfMax(district8)).orElse(""); |
| | | if(clientNum != null && clientNum.trim().length() > 0) { |
| | | Integer number = Integer.parseInt(clientNum.substring(8)); |
| | | number = number + 1; |
| | | if(number > 9999) { |
| | | return "农户编号超限"; |
| | | } |
| | | clientNum = clientNum.substring(0, 8) + String.format("%04d", number); |
| | | } else { |
| | | clientNum = district8 + "0001"; |
| | | } |
| | | return clientNum; |
| | | } |
| | | |
| | | /** |
| | | * 修改农户对象(虚拟卡号、禁止标志、逻辑删除标识不参与修改) |
| | | * @param po 农户对象 |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "修改农户记录", description = "修改农户记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 接收村编号(主键) |
| | | Long villageId = po.getVillageid(); |
| | | |
| | | /** |
| | | * 获取5级行政区划信息 |
| | | */ |
| | | Map map_districts = Optional.ofNullable(clientSv.getDistrictsByVillageId(villageId)).orElse(new HashMap()); |
| | | if(map_districts.size() <= 0) { |
| | | return BaseResponseUtils.buildFail("区划信息有误"); |
| | | } |
| | | |
| | | String provinceNum = map_districts.get("provinceNum").toString(); |
| | | String cityNum = map_districts.get("cityNum").toString(); |
| | | Long countryId = Long.parseLong(map_districts.get("countryId").toString()); |
| | | String countyNum = map_districts.get("countyNum").toString(); |
| | | String countryName = map_districts.get("countryName").toString(); |
| | | Long townId = Long.parseLong(map_districts.get("townId").toString()); |
| | | String townNum = map_districts.get("townNum").toString(); |
| | | String townName = map_districts.get("townName").toString(); |
| | | String villageNum = map_districts.get("villageNum").toString(); |
| | | String villageName = map_districts.get("villageName").toString(); |
| | | |
| | | // 生成8位行政区划编码,生成农户编号用 |
| | | String district8 = countyNum + townNum + villageNum; |
| | | // 生成农户编号 |
| | | String clientNum = generateClientNum(district8); |
| | | // 生成12位5级行政区划编码串及名称串 |
| | | Long districtNum = Long.parseLong(provinceNum + cityNum + district8); |
| | | String districtTitle = countryName + townName + villageName; |
| | | |
| | | SeClient seClient = DtoClientToSeClient.INSTANCT.po2vo(po); |
| | | seClient.setCountyid(countryId); |
| | | seClient.setTownid(townId); |
| | | seClient.setClientnum(clientNum); |
| | | seClient.setDistrictnum(districtNum); |
| | | seClient.setDistricttitle(districtTitle); |
| | | Date operateTime = new Date(); |
| | | seClient.setOperatedt(operateTime); |
| | | |
| | | Integer rec = Optional.ofNullable(clientSv.updateByPrimaryKey(seClient)).orElse(0); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail("农户修改失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 根据农户ID逻辑删除农户 |
| | | * @param id |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | |
| | | @GetMapping(path = "/delone/{id}") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteClientById(@PathVariable("id") Long id){ |
| | | try { |
| | | Integer res = Optional.ofNullable(clientSv.deleteClientById(id)).orElse(0); |
| | | if(res == 0) { |
| | | return BaseResponseUtils.buildFail("农户删除失败"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } catch (Exception e) { |
| | | log.error("查询农户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取用水方式列表 |
| | | * @param |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/watertypes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<Map<String, Object>>>> getWaterTypes(){ |
| | | List<Map<String, Object>> map_WaterTypes = Optional.ofNullable(clientSv.getWaterTypes()).orElse(new ArrayList<>()); |
| | | if(map_WaterTypes == null || map_WaterTypes.size() == 0) { |
| | | return BaseResponseUtils.buildFail("没有用水方式") ; |
| | | } |
| | | return BaseResponseUtils.buildSuccess(map_WaterTypes); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoOperate; |
| | | import com.dy.pipIrrGlobal.voSe.VoStatistics; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/21 19:17 |
| | | * @LastEditTime 2023/12/21 19:17 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class ClientSv { |
| | | @Autowired |
| | | private SeClientMapper seClientMapper; |
| | | |
| | | @Autowired |
| | | private BaDistrictMapper baDistrictMapper; |
| | | |
| | | /** |
| | | * 根据指定条件获取农户数据 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoClient>> getClients(QueryVo queryVo){ |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ; |
| | | Long itemTotal = seClientMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seClientMapper.getClients(params); |
| | | |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取交易记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public Map getOperates(QueryOperate vo){ |
| | | // 补齐查询时间 |
| | | String operateTimeStart = vo.operateTimeStart; |
| | | String operateTimeStop = vo.operateTimeStop; |
| | | if(operateTimeStart != null) { |
| | | operateTimeStart = operateTimeStart + " 00:00:00"; |
| | | vo.setOperateTimeStart(operateTimeStart); |
| | | } |
| | | if(operateTimeStop != null) { |
| | | operateTimeStop = operateTimeStop + " 23:59:59"; |
| | | vo.setOperateTimeStop(operateTimeStop); |
| | | } |
| | | |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ; |
| | | |
| | | // 获取汇总的购水金额、购卡金额 |
| | | Float money = 0f; |
| | | Float cardCost = 0f; |
| | | Map map_sum = Optional.ofNullable(seClientMapper.getSums(params)).orElse(new HashMap()); |
| | | if(map_sum.size() > 0) { |
| | | money = Float.parseFloat(map_sum.get("money").toString()); |
| | | cardCost = Float.parseFloat(map_sum.get("cardCost").toString()); |
| | | } |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = seClientMapper.getOperateRecordCount(params); |
| | | |
| | | Integer pageSize = vo.getPageSize(); |
| | | // 计算总页数 |
| | | Integer pageTotal ; |
| | | pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize); |
| | | |
| | | // 根据当前页码及每页数量计算偏移量 |
| | | Integer pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | params.put("pageCurr", pageCurr); |
| | | |
| | | List<VoOperate> lit = seClientMapper.getOperates(params); |
| | | Map map_record = new HashMap(); |
| | | map_record.put("itemTotal", itemTotal); |
| | | map_record.put("pageCurr", vo.pageCurr); |
| | | map_record.put("pageSize", pageSize); |
| | | map_record.put("pageTotal", pageTotal); |
| | | map_record.put("list", lit); |
| | | |
| | | Map map_result = new HashMap(); |
| | | map_result.put("money", money); |
| | | map_result.put("cardCost", cardCost); |
| | | map_result.put("records", map_record); |
| | | |
| | | return map_result; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取统计记录 |
| | | * @param vo 交易汇总查询条件 |
| | | * @return 交易汇总记录 |
| | | */ |
| | | public Map getStatistics(QueryStatistic vo){ |
| | | // 补齐查询时间 |
| | | String operateTimeStart = vo.operateTimeStart; |
| | | String operateTimeStop = vo.operateTimeStop; |
| | | if(operateTimeStart != null) { |
| | | operateTimeStart = operateTimeStart + " 00:00:00"; |
| | | vo.setOperateTimeStart(operateTimeStart); |
| | | } |
| | | if(operateTimeStop != null) { |
| | | operateTimeStop = operateTimeStop + " 23:59:59"; |
| | | vo.setOperateTimeStop(operateTimeStop); |
| | | } |
| | | |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ; |
| | | |
| | | // 获取汇总的交易笔数、交易金额 |
| | | Integer count = 0; |
| | | Float money = 0f; |
| | | Map map_sum = Optional.ofNullable(seClientMapper.getStatisticSums(params)).orElse(new HashMap()); |
| | | if(map_sum.size() > 0) { |
| | | count = Integer.parseInt(map_sum.get("count").toString()); |
| | | money = Float.parseFloat(map_sum.get("money").toString()); |
| | | } |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = seClientMapper.getStatisticRecordCount(params); |
| | | |
| | | Integer pageSize = vo.getPageSize(); |
| | | // 计算总页数 |
| | | Integer pageTotal ; |
| | | pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize); |
| | | |
| | | // 根据当前页码及每页数量计算偏移量 |
| | | Integer pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | params.put("pageCurr", pageCurr); |
| | | |
| | | List<VoStatistics> lit = seClientMapper.getStatistics(params); |
| | | Map map_record = new HashMap(); |
| | | map_record.put("itemTotal", itemTotal); |
| | | map_record.put("pageCurr", vo.pageCurr); |
| | | map_record.put("pageSize", pageSize); |
| | | map_record.put("pageTotal", pageTotal); |
| | | map_record.put("list", lit); |
| | | |
| | | Map map_result = new HashMap(); |
| | | map_result.put("count", count); |
| | | map_result.put("money", money); |
| | | map_result.put("records", map_record); |
| | | |
| | | return map_result; |
| | | } |
| | | |
| | | /** |
| | | * 根据主键获取农户对象 |
| | | * @param id 农户主键 |
| | | * @return 农户对象 |
| | | */ |
| | | public VoClient getOneClient(Long id) { |
| | | SeClient seClient = seClientMapper.selectByPrimaryKey(id); |
| | | VoClient voClient = SeClientToVoClient.INSTANCT.po2vo(seClient); |
| | | return voClient; |
| | | } |
| | | /** |
| | | * 增开农户 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer addClient(SeClient po) { |
| | | return seClientMapper.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据6位区划串模糊查询农户编号 |
| | | * @param district6 |
| | | * @return |
| | | */ |
| | | public String getClientNumOfMax(String district6) { |
| | | return seClientMapper.getClientNumOfMax(district6); |
| | | } |
| | | |
| | | /** |
| | | * 根据村编号获取5级区划信息 |
| | | * @param villageId 村编号(主键) |
| | | * @return 5级行政区划信息 |
| | | */ |
| | | public Map getDistrictsByVillageId(Long villageId) { |
| | | return baDistrictMapper.getDistrictsByVillageId(villageId); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户ID逻辑删除农户 |
| | | */ |
| | | public Integer deleteClientById(Long id) { |
| | | return seClientMapper.deleteClientById(id); |
| | | } |
| | | |
| | | /** |
| | | * 修改农户对象 |
| | | * @param po 农户对象 |
| | | * @return 修改记录条数 |
| | | */ |
| | | public Integer updateByPrimaryKey(SeClient po) { |
| | | return seClientMapper.updateByPrimaryKey(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据主键获取村ID |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Long getVillageIdById(Long id) { |
| | | return seClientMapper.getVillageIdById(id); |
| | | } |
| | | |
| | | /** |
| | | * 获取虚拟卡号最大值 |
| | | * @return |
| | | */ |
| | | public Long getMa1xVirtualId() { |
| | | return seClientMapper.getMa1xVirtualId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取用水方式列表 |
| | | * @return |
| | | */ |
| | | public List<Map<String, Object>> getWaterTypes() { |
| | | return seClientMapper.getWaterTypes(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.*; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/22 8:41 |
| | | * @LastEditTime 2023/12/22 8:41 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "创建农户传入对象") |
| | | public class DtoClient { |
| | | public static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 村ID |
| | | */ |
| | | @Schema(description = "所在村ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在村不能为空") |
| | | private Long villageid; |
| | | |
| | | /** |
| | | * 片区ID |
| | | */ |
| | | @Schema(description = "所在片区ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在片区不能为空") |
| | | private Long blockid; |
| | | |
| | | /** |
| | | * 分水房ID |
| | | */ |
| | | @Schema(description = "所在分水房ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在分水房不能为空") |
| | | private Long divideid; |
| | | |
| | | /** |
| | | * 农户姓名 |
| | | */ |
| | | @Schema(description = "农户姓名", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotBlank(message = "农户姓名不能为空") //不能为空也不能为null |
| | | @Length(message = "农户姓名不大于{max}字,不小于{min}字", min = 1, max = 25) |
| | | private String name; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @Schema(description = "农户手机号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "农户手机号不能为空") //不能为空也不能为null |
| | | @Length(message = "农户手机号必须{max}位数据", min = 11, max = 11) |
| | | private String phone; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @Schema(description = "农户身份证号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotBlank(message = "农户身份证号不能为空") //不能为空也不能为null |
| | | @Length(message = "农户身份证号必须{max}位数据", min = 18, max = 18) |
| | | private String idcard; |
| | | |
| | | /** |
| | | * 种植面积 |
| | | */ |
| | | @Schema(description = "农户种植面积", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Double area; |
| | | |
| | | /** |
| | | * 用水方式 |
| | | */ |
| | | @Schema(description = "用水方式", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long typeid; |
| | | |
| | | /** |
| | | * 街道及门牌号 |
| | | */ |
| | | @Schema(description = "街道+门牌号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "地址不大于{max}字,不小于{min}字", min = 1, max = 50) |
| | | private String address; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注不大于{max}字,不小于{min}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "操作人编号不能为空") |
| | | private Long operator; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.Mapping; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/22 9:23 |
| | | * @LastEditTime 2023/12/22 9:23 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface DtoClientToSeClient { |
| | | DtoClientToSeClient INSTANCT = Mappers.getMapper(DtoClientToSeClient.class); |
| | | |
| | | @Mapping(target = "villageid", source = "villageid") |
| | | @Mapping(target = "blockid", source = "blockid") |
| | | @Mapping(target = "divideid", source = "divideid") |
| | | @Mapping(target = "name", source = "name") |
| | | @Mapping(target = "phone", source = "phone") |
| | | @Mapping(target = "idcard", source = "idcard") |
| | | @Mapping(target = "area", source = "area") |
| | | @Mapping(target = "typeid", source = "typeid") |
| | | @Mapping(target = "address", source = "address") |
| | | @Mapping(target = "remarks", source = "remarks") |
| | | @Mapping(target = "operator", source = "operator") |
| | | @Mapping(target = "disabled", ignore=true) |
| | | @Mapping(target = "deleted", ignore=true) |
| | | SeClient po2vo(DtoClient po); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-26 21:00 |
| | | * @LastEditTime 2023-12-26 21:00 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "交易查询条件") |
| | | public class QueryOperate extends QueryConditionVo { |
| | | |
| | | @Schema(description = "村ID") |
| | | public Long villageId; |
| | | |
| | | @Schema(description = "支付方式编号") |
| | | public Long paymentId; |
| | | |
| | | @Schema(description = "交易查询起始时间") |
| | | public String operateTimeStart; |
| | | |
| | | @Schema(description = "交易查询截止时间") |
| | | public String operateTimeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-27 15:33 |
| | | * @LastEditTime 2023-12-27 15:33 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "交易汇总查询条件") |
| | | public class QueryStatistic extends QueryConditionVo { |
| | | @Schema(description = "村ID") |
| | | public Long villageId; |
| | | |
| | | //@Schema(description = "支付方式编号") |
| | | //public Long paymentId; |
| | | |
| | | @Schema(description = "交易查询起始时间") |
| | | public String operateTimeStart; |
| | | |
| | | @Schema(description = "交易查询截止时间") |
| | | public String operateTimeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/21 19:18 |
| | | * @LastEditTime 2023/12/21 19:18 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "农户查询条件") |
| | | public class QueryVo extends QueryConditionVo { |
| | | |
| | | //@Schema(description = "县ID") |
| | | //public Long countyId ; |
| | | // |
| | | //@Schema(description = "镇ID") |
| | | //public Long townId ; |
| | | // |
| | | //@Schema(description = "村ID") |
| | | //public Long villageId ; |
| | | // |
| | | //@Schema(description = "片区ID") |
| | | //public Long blockId ; |
| | | |
| | | @Schema(description = "农户姓名") |
| | | public String name; |
| | | |
| | | @Schema(description = "农户编号") |
| | | public String clientNum; |
| | | |
| | | @Schema(description = "农户电话") |
| | | public String phone; |
| | | |
| | | @Schema(description = "地址") |
| | | public String address; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoClient; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.Mapping; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-25 15:54 |
| | | * @LastEditTime 2023-12-25 15:54 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeClientToVoClient { |
| | | SeClientToVoClient INSTANCT = Mappers.getMapper(SeClientToVoClient.class); |
| | | |
| | | @Mapping(target = "name", source = "name") |
| | | @Mapping(target = "clientNum", source = "clientnum") |
| | | @Mapping(target = "phone", source = "phone") |
| | | @Mapping(target = "idCard", source = "idcard") |
| | | //@Mapping(target = "cardCount", source = "cardCount") |
| | | @Mapping(target = "address", source = "address") |
| | | @Mapping(target = "operateDt", source = "operatedt") |
| | | VoClient po2vo(SeClient po); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.clientCard; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-27 19:36 |
| | | * @LastEditTime 2023-12-27 19:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Tag(name = "农户水卡", description = "农户水卡") |
| | | @RestController |
| | | @RequestMapping(path="clientcard") |
| | | @RequiredArgsConstructor |
| | | public class ClientCardCtrl { |
| | | private final ClientCardSv clientCardSv; |
| | | |
| | | /** |
| | | * 获取指定用户名下全部水卡 |
| | | * @param clientId |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "clientcard/{clientId}") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCardInfo>>> get(@PathVariable("clientId") Long clientId){ |
| | | try { |
| | | List<VoCardInfo> list = clientCardSv.getCardInfoByClientId(clientId); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } catch (Exception e) { |
| | | log.error("查询农户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据水卡编号获取操作记录及余额 |
| | | * @param cardNum 水卡编号 |
| | | * @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 = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getoperaterecords") |
| | | @SsoAop() |
| | | public BaseResponse<List<Map<String, Object>>> getOperateRecordsAndMoney(@RequestParam("cardNum") Long cardNum){ |
| | | try { |
| | | Map map = clientCardSv.getOperateRecordsAndMoney(cardNum); |
| | | return BaseResponseUtils.buildSuccess(map); |
| | | } catch (Exception e) { |
| | | log.error("查询操作记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | public Integer UpdateClientCard(SeClientCard po) { |
| | | return seClientCardMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户主键获取水卡列表 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | public List<VoCardInfo> getCardInfoByClientId(Long clientId){ |
| | | List<VoCardInfo> list = Optional.ofNullable(seClientCardMapper.getCardInfoByClientId(clientId)).orElse(new ArrayList<>()); |
| | | if(list.size() > 0) { |
| | | return list; |
| | | }else { |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据水卡编号获取操作记录及余额 |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | | public Map getOperateRecordsAndMoney(Long cardNum) { |
| | | List<Map<String, Object>> list = Optional.ofNullable(seClientCardMapper.getOperateRecordsByCardNum(cardNum)).orElse(new ArrayList<>()); |
| | | Float mondy = Optional.ofNullable(seClientCardMapper.getMoneyByCardNum(cardNum)).orElse(0f); |
| | | Float amount = Optional.ofNullable(seClientCardMapper.sumRechargeByCardNum(cardNum)).orElse(0f); |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("mondy", mondy); |
| | | map.put("amount", amount); |
| | | map.put("list", list); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeLoss; |
| | | import com.dy.pipIrrGlobal.voSe.VoLoss; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | |
| | | schema = @Schema(implementation = VoLoss.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getLosses", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getLosses") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoLoss>>> getLosses(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoLoss>>> getLosses(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoLoss>> res = lossSv.getLosses(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡编号 |
| | | * clientNum 农户编号(非传入参数,由cardNum反查,添加挂失使用) |
| | | * money 余额 |
| | | * refund 退款金额 |
| | | * remarks 备注 |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | String clientNum = ""; |
| | | Long clientId = 0L; |
| | | Float money = po.getMoney(); |
| | | Float refund = po.getRefund(); |
| | | String remarks = po.getRemarks(); |
| | |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setMoney(money); |
| | | seClientCard.setLossdtdt(lossTime); |
| | | seClientCard.setState(CardStateENUM.LOSS.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.LOSS.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | |
| | | * 添加挂失记录 |
| | | */ |
| | | SeLoss seLoss = new SeLoss(); |
| | | seLoss.setCardnum(cardNum); |
| | | seLoss.setClientnum(clientNum); |
| | | //seLoss.setCardnum(cardNum); |
| | | //seLoss.setClientnum(clientNum); |
| | | seLoss.setCardid(cardId); |
| | | seLoss.setClientid(clientId); |
| | | seLoss.setMoney(money); |
| | | seLoss.setRefund(refund); |
| | | seLoss.setRemarks(remarks); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | //完善查询挂失记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime lossTimeStart = queryVo.lossTimeStart; |
| | | LocalDateTime lossTimeStop = queryVo.lossTimeStop; |
| | | //LocalDateTime lossTimeStart = queryVo.lossTimeStart; |
| | | //LocalDateTime lossTimeStop = queryVo.lossTimeStop; |
| | | //if(lossTimeStart != null) { |
| | | // lossTimeStart = LocalDateTime.parse(df.format(lossTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | // queryVo.setLossTimeStart(lossTimeStart); |
| | | //} |
| | | // |
| | | //if(lossTimeStop != null) { |
| | | // lossTimeStop = LocalDateTime.parse(df.format(lossTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | // queryVo.setLossTimeStop(lossTimeStop); |
| | | //} |
| | | |
| | | String lossTimeStart = queryVo.lossTimeStart; |
| | | String lossTimeStop = queryVo.lossTimeStop; |
| | | if(lossTimeStart != null) { |
| | | lossTimeStart = LocalDateTime.parse(df.format(lossTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | lossTimeStart = lossTimeStart + " 00:00:00"; |
| | | queryVo.setLossTimeStart(lossTimeStart); |
| | | } |
| | | |
| | | if(lossTimeStop != null) { |
| | | lossTimeStop = LocalDateTime.parse(df.format(lossTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | lossTimeStop = lossTimeStop + " 23:59:59"; |
| | | queryVo.setLossTimeStop(lossTimeStop); |
| | | } |
| | | |
| | |
| | | Long itemTotal = seLossMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoLoss>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seLossMapper.getLosses(params); |
| | | return rsVo ; |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 9:43 |
| | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | public String cardAddr; |
| | | @Schema(description = "水卡ID") |
| | | //public String cardAddr; |
| | | public Long cardNum; |
| | | |
| | | @Schema(description = "挂失时间_开始") |
| | | public LocalDateTime lossTimeStart; |
| | | public String lossTimeStart; |
| | | |
| | | @Schema(description = "挂失时间_结束") |
| | | public LocalDateTime lossTimeStop; |
| | | public String lossTimeStop; |
| | | } |
| | |
| | | public static final long serialVersionUID = 20231191728001L; |
| | | |
| | | /** |
| | | * 水卡地址 |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | //private String cardAddr; |
| | | private String cardNum; |
| | | //private Long cardId; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | * 农户ID,不是充值接口传入,由开卡对象传入,保存充值记录需要 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //private Long clientId; |
| | | private String clientNum; |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //private String clientNum; |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/4 17:20 |
| | |
| | | @Schema(description = "付款方式") |
| | | public Integer paymentId; |
| | | |
| | | //@Schema(description = "充值时间_开始") |
| | | //public LocalDateTime rechargeTimeStart; |
| | | // |
| | | //@Schema(description = "充值时间_结束") |
| | | //public LocalDateTime rechargeTimeStop; |
| | | |
| | | @Schema(description = "充值时间_开始") |
| | | //public DateTime rechargeTimeStart; |
| | | public LocalDateTime rechargeTimeStart; |
| | | public String rechargeTimeStart; |
| | | |
| | | @Schema(description = "充值时间_结束") |
| | | //public DateTime rechargeTimeStop; |
| | | public LocalDateTime rechargeTimeStop; |
| | | public String rechargeTimeStop; |
| | | } |
| | |
| | | schema = @Schema(implementation = VoRecharge.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getRecharges", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@GetMapping(path = "/getRecharges", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getRecharges") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoRecharge>>> get(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoRecharge>> res = rechargeSv.getRecharges(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | String clientNum = ""; |
| | | //Long clientId = po.getClientId(); |
| | | Long clientId = 0L; |
| | | Float money = po.getMoney(); |
| | | Float amount = po.getAmount(); |
| | | Float gift = po.getGift(); |
| | |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setMoney(afterRecharge); |
| | | seClientCard.setRechargedt(rechargeTime); |
| | | seClientCard.setLastoper(LastOperateENUM.RECHARGE.getCode ()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | |
| | | /** |
| | | * 删除充值表该卡的充值记录 |
| | | */ |
| | | Integer rec_deleteRecharge = Optional.ofNullable(rechargeSv.deleteByCardNum(cardNum)).orElse(0); |
| | | Integer rec_deleteRecharge = Optional.ofNullable(rechargeSv.deleteByCardId(cardId)).orElse(0); |
| | | /** |
| | | * 添加充值记录 |
| | | */ |
| | | SeRecharge seRecharge = new SeRecharge(); |
| | | seRecharge.setCardnum(cardNum); |
| | | seRecharge.setClientnum(clientNum); |
| | | //seRecharge.setCardnum(cardNum); |
| | | //seRecharge.setClientnum(clientNum); |
| | | |
| | | seRecharge.setCardid(cardId); |
| | | seRecharge.setClientid(clientId); |
| | | seRecharge.setMoney(money); |
| | | seRecharge.setAmount(amount); |
| | | seRecharge.setGift(gift); |
| | |
| | | * 添加补卡历史记录 |
| | | */ |
| | | SeRechargeHistory seRechargeHistory = new SeRechargeHistory(); |
| | | seRechargeHistory.setCardnum(cardNum); |
| | | seRechargeHistory.setClientnum(clientNum); |
| | | //seRechargeHistory.setCardnum(cardNum); |
| | | //seRechargeHistory.setClientnum(clientNum); |
| | | seRechargeHistory.setCardid(cardId); |
| | | seRechargeHistory.setClientid(clientId); |
| | | seRechargeHistory.setMoney(money); |
| | | seRechargeHistory.setAmount(amount); |
| | | seRechargeHistory.setGift(gift); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | public QueryResultVo<List<VoRecharge>> getRecharges(QueryVo queryVo) { |
| | | //完善查询充值记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime rechargeTimeStart = queryVo.rechargeTimeStart; |
| | | LocalDateTime rechargeTimeStop = queryVo.rechargeTimeStop; |
| | | String rechargeTimeStart = queryVo.rechargeTimeStart; |
| | | String rechargeTimeStop = queryVo.rechargeTimeStop; |
| | | if(rechargeTimeStart != null) { |
| | | rechargeTimeStart = LocalDateTime.parse(df.format(rechargeTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | rechargeTimeStart = rechargeTimeStart + " 00:00:00"; |
| | | queryVo.setRechargeTimeStart(rechargeTimeStart); |
| | | } |
| | | |
| | | if(rechargeTimeStop != null) { |
| | | rechargeTimeStop = LocalDateTime.parse(df.format(rechargeTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | rechargeTimeStop = rechargeTimeStop + " 23:59:59"; |
| | | queryVo.setRechargeTimeStop(rechargeTimeStop); |
| | | } |
| | | |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = seRechargeMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoRecharge>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seRechargeMapper.getRecharges(params); |
| | | return rsVo ; |
| | |
| | | |
| | | /** |
| | | * 根据水卡编号删除充值记录 |
| | | * @param cardNum |
| | | * @param cardId |
| | | * @return |
| | | */ |
| | | //public Integer deleteByCardId(Long cardId) { |
| | | // return seRechargeMapper.deleteByCardId(cardId); |
| | | //} |
| | | public Integer deleteByCardNum(String cardNum) { |
| | | return seRechargeMapper.deleteByCardNum(cardNum); |
| | | public Integer deleteByCardId(Long cardId) { |
| | | return seRechargeMapper.deleteByCardId(cardId); |
| | | } |
| | | //public Integer deleteByCardNum(String cardNum) { |
| | | // return seRechargeMapper.deleteByCardNum(cardNum); |
| | | //} |
| | | |
| | | /** |
| | | * 添加充值历史表 |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 15:57 |
| | |
| | | |
| | | |
| | | @Schema(description = "冲正时间_开始") |
| | | public LocalDateTime reversalTimeStart; |
| | | public String reversalTimeStart; |
| | | |
| | | @Schema(description = "冲正时间_结束") |
| | | public LocalDateTime reversalTimeStop; |
| | | public String reversalTimeStop; |
| | | } |
| | |
| | | schema = @Schema(implementation = VoReversal.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getReversals", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getReversals") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoReversal>>> getReversals(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoReversal>>> getReversals(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoReversal>> res = reversalSv.getReversals(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardAddr反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡地址 |
| | | * clientNum 农户编号(非传入参数,由cardNum反查,添加冲正使用) |
| | | * cardBalance 卡片余额 |
| | | * systemBalance 系统余额 |
| | | * remarks 备注 |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | String clientNum = ""; |
| | | Long clientId = 0L; |
| | | Float cardBalance = po.getCardBalance(); |
| | | Float systemBalance = po.getSystemBalance(); |
| | | String remarks = po.getRemarks(); |
| | |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setReversaldt(reversalTime); |
| | | seClientCard.setMoney(cardBalance); |
| | | seClientCard.setLastoper(LastOperateENUM.REVERSAL.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | |
| | | * 添加冲正记录 |
| | | */ |
| | | SeReversal reversal = new SeReversal(); |
| | | reversal.setCardnum(cardNum); |
| | | reversal.setClientnum(clientNum); |
| | | //reversal.setCardnum(cardNum); |
| | | //reversal.setClientnum(clientNum); |
| | | reversal.setCardid(cardId); |
| | | reversal.setClientid(clientId); |
| | | reversal.setCardbalance(cardBalance); |
| | | reversal.setSystembalance(systemBalance); |
| | | reversal.setRemarks(remarks); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | //完善查询注销记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime reversalTimeStart = queryVo.reversalTimeStart; |
| | | LocalDateTime reversalTimeStop = queryVo.reversalTimeStop; |
| | | String reversalTimeStart = queryVo.reversalTimeStart; |
| | | String reversalTimeStop = queryVo.reversalTimeStop; |
| | | if(reversalTimeStart != null) { |
| | | reversalTimeStart = LocalDateTime.parse(df.format(reversalTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | reversalTimeStart = reversalTimeStart + " 00:00:00"; |
| | | queryVo.setReversalTimeStart (reversalTimeStart); |
| | | } |
| | | |
| | | if(reversalTimeStop != null) { |
| | | reversalTimeStop = LocalDateTime.parse(df.format(reversalTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | reversalTimeStop = reversalTimeStop + " 23:59:59"; |
| | | queryVo.setReversalTimeStop(reversalTimeStop); |
| | | } |
| | | |
| | |
| | | Long itemTotal = seReversalMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoReversal>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seReversalMapper.getReversals(params); |
| | | return rsVo ; |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/6 15:00 |
| | |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | public String cardAddr; |
| | | public Long cardNum; |
| | | |
| | | |
| | | @Schema(description = "解锁时间_开始") |
| | | public LocalDateTime unlocklTimeStart; |
| | | public String unlocklTimeStart; |
| | | |
| | | @Schema(description = "解锁时间_结束") |
| | | public LocalDateTime unlockTimeStop; |
| | | public String unlockTimeStop; |
| | | } |
| | |
| | | schema = @Schema(implementation = VoUnlock.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getUnlocks", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "/getUnlocks") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoUnlock>>> getUnlocks(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoUnlock>>> getUnlocks(QueryVo vo){ |
| | | try { |
| | | QueryResultVo<List<VoUnlock>> res = unlockSv.getUnlocks(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardAddr反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡地址 |
| | | * clientNum 农户编号(非传入参数,由cardNum反查,添加解锁使用) |
| | | * money 余额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | |
| | | */ |
| | | Long cardId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | String clientNum = ""; |
| | | Long clientId = 0L; |
| | | Float money = po.getMoney(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientNum = map.get("clientNum").toString(); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setUnlockdt(unlockTime); |
| | | seClientCard.setMoney(money); |
| | | seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | |
| | | * 添加解锁记录 |
| | | */ |
| | | SeUnlock seUnlock = new SeUnlock(); |
| | | seUnlock.setCardnum(cardNum); |
| | | seUnlock.setClientnum(clientNum); |
| | | //seUnlock.setCardnum(cardNum); |
| | | //seUnlock.setClientnum(clientNum); |
| | | seUnlock.setCardid(cardId); |
| | | seUnlock.setClientid(clientId); |
| | | seUnlock.setMoney(money); |
| | | seUnlock.setRemarks(remarks); |
| | | seUnlock.setOperator(operator); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | //完善查询注销记录的起止时间 |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | LocalDateTime unlocklTimeStart = queryVo.unlocklTimeStart; |
| | | LocalDateTime unlockTimeStop = queryVo.unlockTimeStop; |
| | | String unlocklTimeStart = queryVo.unlocklTimeStart; |
| | | String unlockTimeStop = queryVo.unlockTimeStop; |
| | | if(unlocklTimeStart != null) { |
| | | unlocklTimeStart = LocalDateTime.parse(df.format(unlocklTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | unlocklTimeStart = unlocklTimeStart + " 00:00:00"; |
| | | queryVo.setUnlocklTimeStart(unlocklTimeStart); |
| | | } |
| | | |
| | | if(unlockTimeStop != null) { |
| | | unlockTimeStop = LocalDateTime.parse(df.format(unlockTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | unlockTimeStop = unlockTimeStop + " 23:59:59"; |
| | | queryVo.setUnlockTimeStop(unlockTimeStop); |
| | | } |
| | | |
| | |
| | | Long itemTotal = seUnlockMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoUnlock>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr ; |
| | | Integer pageCurr = 0; |
| | | Integer pageSize = 10000; |
| | | rsVo.pageCurr = 1; |
| | | rsVo.pageSize = 10000; |
| | | if(queryVo.pageSize != null && queryVo.pageCurr != null) { |
| | | rsVo.pageSize = queryVo.pageSize ; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | pageSize = queryVo.pageSize ; |
| | | pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString()); |
| | | } |
| | | params.put("pageCurr", pageCurr); |
| | | params.put("pageSize", pageSize); |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = seUnlockMapper.getUnlocks(params); |
| | | return rsVo ; |