Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
3 文件已重命名
60个文件已修改
35个文件已添加
2个文件已删除
| | |
| | | * @return |
| | | */ |
| | | Map getUserInfoById(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 根据指定的条件获取用户记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取用户列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoUserInfo> getUsers(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据用户编号获取角色ID列表 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getRoleIdsByUserId(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * getRoleNamesByUserId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getRoleNamesByUserId(@Param("userId") Long userId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Integer getRecordCountOfController(@Param("controllerId") Long controllerId); |
| | | |
| | | /** |
| | | * 根据控制器编号获取已绑定记录数 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | Integer getBindedCount(@Param("controllerId") Long controllerId); |
| | | |
| | | /** |
| | | * 根据控制器编号删除取水口编号 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | Integer deleteIntakeId(@Param("controllerId") Long controllerId); |
| | | } |
| | |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(PrControllerTramp record); |
| | | |
| | | /** |
| | | * 根据控制器编号获取流浪控制器地址 |
| | | * @param controllerId 流浪控制器编号 |
| | | * @return 记录数量 |
| | | */ |
| | | //String getTrampRtuAddr(@Param("controllerId") Long controllerId); |
| | | |
| | | /** |
| | | * 根据控制器编号获取流浪控制器信息 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | PrControllerTramp getTrampControllerInfo(@Param("controllerId") Long controllerId); |
| | | } |
| | |
| | | * @return Level 区域等级 |
| | | */ |
| | | Integer getLevelByRegionId(long regionId); |
| | | |
| | | /** |
| | | * 获取未绑控制器的取水口列表 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getNoBindingIntakes(); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSe; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeAudits; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-24 18:57 |
| | | * @LastEditTime 2024-01-24 18:57 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeAuditsMapper extends BaseMapper<SeAudits> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(SeAudits record); |
| | | |
| | | int insertSelective(SeAudits record); |
| | | |
| | | SeAudits selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(SeAudits record); |
| | | |
| | | int updateByPrimaryKey(SeAudits record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSe; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-18 19:28 |
| | | * @LastEditTime 2024-01-18 19:28 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeCardOperateMapper extends BaseMapper { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(SeCardOperate record); |
| | | |
| | | int insertSelective(SeCardOperate record); |
| | | |
| | | SeCardOperate selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(SeCardOperate record); |
| | | |
| | | int updateByPrimaryKey(SeCardOperate record); |
| | | |
| | | /** |
| | | * 根据指定条件获取充值记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取充值记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoRecharge> getRecharges(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取交易记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getTransactionRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取交易记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoTransaction> getTransactions(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取购水汇总和购卡汇总,获取交易明细使用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Map getTransactionSums(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取交易统计记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getTransactionStatisticsRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取交易统计记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoTransactionStatistics> getTransactionStatistics(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根基指定条件获取笔数合计、实收金额合计、赠送金额合计 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Map getTransactionStatisticsSums(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取指定日期、指定支付方式实收金额合计 |
| | | * @param tradeDate |
| | | * @param paymentId |
| | | * @return |
| | | */ |
| | | //Float getPaymentSums(Map<?, ?> params); |
| | | Float getPaymentSums(@Param("tradeDate") String tradeDate, @Param("paymentId") Long paymentId); |
| | | |
| | | /** |
| | | * 根据指定条件获取开卡记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getActiveCardRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取开卡记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoActiveCardNew> getActiveCards(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getReissueCardRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoReissueCard> getReissueCards(Map<?, ?> params); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | String getCardStateByCardNum(@Param("cardNum") Long cardNum); |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表记录数,应用程序使用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getCardsCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表,应用程序使用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoCards> getCards(Map<?, ?> params); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | Long getAreaCodeByNum(@Param("clientNum") String clientNum); |
| | | |
| | | /** |
| | | * 根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | Long getAreaCodeById(@Param("clientId") Long clientId); |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID |
| | |
| | | */ |
| | | 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); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSe; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeGeneral; |
| | | import com.dy.pipIrrGlobal.voSe.VoGeneral; |
| | | import com.dy.pipIrrGlobal.voSe.VoTransactionStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-24 18:57 |
| | | * @LastEditTime 2024-01-25 15:55 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeGeneralMapper extends BaseMapper<SeGeneral> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(SeGeneral record); |
| | | |
| | | int insertSelective(SeGeneral record); |
| | | |
| | | SeGeneral selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(SeGeneral record); |
| | | |
| | | int updateByPrimaryKey(SeGeneral record); |
| | | |
| | | /** |
| | | * 获取未生成总账的交易日期列表(当天的交易记录不生成总账) |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getDatesOfNotInGenerals(); |
| | | |
| | | /** |
| | | * 根据交易日期获取总账记录列表(待生成的) |
| | | * @param operateDate |
| | | * @return |
| | | */ |
| | | List<SeGeneral> getGeneralByOperateDate(@Param("operateDate") String operateDate); |
| | | |
| | | /** |
| | | * 根据指定条件获取总账记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取总账记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoGeneral> getGenerals(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 财务对账审核页,收银员+日期分组,排除交易类型分组,记录数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getToAuditRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 财务对账审核页,收银员+日期分组,排除交易类型分组 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoTransactionStatistics> getToAudit(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 获取指定日期、指定收银员、指定支付方式实收金额合计 |
| | | * @param tradeDate |
| | | * @param paymentId |
| | | * @return |
| | | */ |
| | | Float getPaymentSums(@Param("tradeDate") String tradeDate, @Param("cashierId") Long cashierId, @Param("paymentId") Long paymentId); |
| | | |
| | | /** |
| | | * 根基指定日期、指定收银员获取笔数合计、实收金额合计、赠送金额合计 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Map getTransactionStatisticsSums(Map<?, ?> params); |
| | | } |
| | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 分水口实体 |
| | | */ |
| | | @TableName(value="ba_divide", autoResultMap = true) |
| | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description 取水口 |
| | | */ |
| | | |
| | | /** |
| | | * 取水口实体 |
| | | */ |
| | | @TableName(value = "ba_intake", autoResultMap = true) |
| | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 控制器实体,RTU阀控一体机 |
| | | */ |
| | | @TableName(value = "ba_rtu", autoResultMap = true) |
| | |
| | | ASSIGN_UUID(4), //全局唯一的 uuid |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Long id; |
| | | public Long userId; |
| | | |
| | | |
| | | @Schema(description = "所属片区ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | |
| | | @Schema(description = "姓名", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "姓名不能为空") //不能为空也不能为null |
| | | @Length(message = "姓名不大于{max}字,不小于{min}字", min = 2, max = 25) |
| | | public String name; |
| | | public String userName; |
| | | |
| | | /** |
| | | * 手机号,手机号用于登录系统 |
| | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description 取水口 |
| | | */ |
| | | /** |
| | | * 取水口表 |
| | | */ |
| | | |
| | |
| | | */ |
| | | @JSONField(serializeUsing = ObjectWriterImplToString.class) |
| | | @Schema(description = "所在片区ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "所在片区不能为空") |
| | | // @NotNull(message = "所在片区不能为空") |
| | | private Long blockId; |
| | | |
| | | /** |
| | |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注不大于{max}字,不小于{min}字", min = 1, max = 200) |
| | | @Length(message = "备注不大于{max}字", max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Schema(description = "补卡金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "补卡金额不小于{min}", min = 0) |
| | | private Double reissueamount; |
| | | private Float reissueamount; |
| | | |
| | | /** |
| | | * 操作类型;1-开卡,2-补卡 |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-24 18:57 |
| | | * @LastEditTime 2024-01-24 18:57 |
| | | * @Description |
| | | */ |
| | | |
| | | @TableName(value="se_audits", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "总账审核记录实体") |
| | | public class SeAudits implements BaseEntity { |
| | | public static final long serialVersionUID = 202401251043001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 总账ID |
| | | */ |
| | | @Schema(description = "总账ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "总账ID不能为空") |
| | | private Long generalId; |
| | | |
| | | /** |
| | | * 审核状态;1-未审核,2-同意,3-驳回 |
| | | */ |
| | | @Schema(description = "审核状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "审核状态不能为空") |
| | | private Byte auditStatus; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | @Schema(description = "审核意见", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(max = 200, message = "审核意见最多200字") |
| | | private String auditOpinion; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "操作人ID不能为空") |
| | | @Positive(message = "操作人ID必须为大于0的整数") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operateDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-18 19:10 |
| | | * @LastEditTime 2024-01-18 19:10 |
| | | * @Description |
| | | */ |
| | | |
| | | @TableName(value="se_card_operate", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "水卡操作实体") |
| | | public class SeCardOperate implements BaseEntity { |
| | | public static final long serialVersionUID = 202401181914001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 水卡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; |
| | | |
| | | /** |
| | | * 卡片余额;充值、挂失、冲正、解锁 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "卡片余额不小于{min}", min = 0) |
| | | private Float money; |
| | | |
| | | /** |
| | | * 系统余额;冲正时使用 |
| | | */ |
| | | @Schema(description = "系统余额", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "系统余额不小于{min}", min = 0) |
| | | private Float systemBalance; |
| | | |
| | | /** |
| | | * 交易金额;购水金额、退款金额 |
| | | */ |
| | | @Schema(description = "交易金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "交易金额不小于{min}", min = 0) |
| | | private Float tradeAmount; |
| | | |
| | | /** |
| | | * 水价;充值时使用 |
| | | */ |
| | | @Schema(description = "水价", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "水价不小于{min}", min = 0) |
| | | private Float price; |
| | | |
| | | /** |
| | | * 购卡金额 |
| | | */ |
| | | @Schema(description = "购卡金额", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @Length(message = "购卡金额不小于{min}字", min = 0) |
| | | private Integer cardCost; |
| | | |
| | | /** |
| | | * 赠送金额 |
| | | */ |
| | | @Schema(description = "赠送金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "赠送金额不小于{min}", min = 0) |
| | | private Float gift; |
| | | |
| | | /** |
| | | * 非交易金额;补卡金额、补扣金额、剩余金额(解锁) |
| | | */ |
| | | @Schema(description = "非交易金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "非交易金额不小于{min}", min = 0) |
| | | private Float noTradeAmount; |
| | | |
| | | /** |
| | | * 操作类型 |
| | | */ |
| | | @Schema(description = "操作类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "付款方式不大于{max},不小于{min}", min = 1, max = 8) |
| | | private Byte operateType; |
| | | |
| | | /** |
| | | * 付款方式编号 |
| | | */ |
| | | @Schema(description = "付款方式编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "付款方式编号不大于{max},不小于{min}", min = 1, max = 4) |
| | | private Long paymentId; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(message = "备注长度小于{max}字", min = 1, max = 200) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人ID必须为大于0的整数") |
| | | private Long operator; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date operateDt; |
| | | } |
| | |
| | | private Date reversaldt; |
| | | |
| | | /** |
| | | * 补扣时间 |
| | | */ |
| | | @Schema(description = "补扣时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date refunddt; |
| | | |
| | | /** |
| | | * 消费时间 |
| | | */ |
| | | @Schema(description = "消费时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Max; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-24 18:57 |
| | | * @LastEditTime 2024-01-24 18:57 |
| | | * @Description |
| | | */ |
| | | |
| | | @TableName(value="se_general", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "总账实体") |
| | | public class SeGeneral implements BaseEntity { |
| | | public static final long serialVersionUID = 202401241912001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 收银员ID |
| | | */ |
| | | @Schema(description = "收银员ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "收银员ID不能为空") |
| | | private Long cashierId; |
| | | |
| | | /** |
| | | * 收银员姓名 |
| | | */ |
| | | @Schema(description = "收银员姓名", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "收银员姓名不能为空") |
| | | private String cashierName; |
| | | |
| | | /** |
| | | * 实收金额 |
| | | */ |
| | | @Schema(description = "实收金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "实收金额不能为空") |
| | | private Double tradeAmount; |
| | | |
| | | /** |
| | | * 赠送金额 |
| | | */ |
| | | @Schema(description = "赠送金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "赠送金额不能为空") |
| | | private Double gift; |
| | | |
| | | /** |
| | | * 总额 |
| | | */ |
| | | @Schema(description = "总额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "总额不能为空") |
| | | private Double totalAmount; |
| | | |
| | | /** |
| | | * 交易日期 |
| | | */ |
| | | @Schema(description = "交易日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "交易日期不能为空") |
| | | private Date operateDate; |
| | | |
| | | /** |
| | | * 审核状态;1-未审核,2-同意,3-驳回 |
| | | */ |
| | | @Schema(description = "审核状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Max(message = "审核状态最大为3", value = 3) |
| | | @Min(message = "审核状态最小为1",value = 1) |
| | | private Byte auditStatus; |
| | | } |
| | |
| | | @Data |
| | | @Schema(title = "5级行政区划视图对象") |
| | | public class VoAreaCode implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241703001L; |
| | | |
| | | @Schema(title = "省级区划代码") |
| | | private String provinceId; |
| | |
| | | @Data |
| | | @Schema(title = "角色信息视图对象") |
| | | public class VoRole implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241704001L; |
| | | |
| | | @Schema(title = "角色编号") |
| | | private String roleId; |
| | |
| | | @Data |
| | | @Schema(title = "用户信息视图对象") |
| | | public class VoUserInfo implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241704002L; |
| | | |
| | | @Schema(title = "用户ID") |
| | | private String userId; |
| | | |
| | | @Schema(title = "用户姓名") |
| | | private String userName; |
| | | |
| | | @Schema(title = "手机号") |
| | | private String phone; |
| | | |
| | | @Schema(title = "片区ID") |
| | | private String blockId; |
| | | |
| | | @Schema(title = "片区名称") |
| | | private String blockName; |
| | | |
| | | @Schema(title = "状态编号") |
| | | private Integer stateId; |
| | | |
| | | @Schema(title = "状态名称") |
| | | private String stateName; |
| | | |
| | | @Schema(title = "角色编号列表") |
| | | private List<Map<String, Object>> roleIds; |
| | |
| | | private List<Map<String, Object>> roleNames; |
| | | |
| | | @Schema(title = "权限列表") |
| | | //private List<Map<String, Object>> permissions; |
| | | private JSONArray permissions; |
| | | |
| | | } |
| | |
| | | @Data |
| | | @Schema(title = "控制器视图对象") |
| | | public class VoController implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241704003L; |
| | | |
| | | @Schema(title = "ID") |
| | | @ExcelProperty("ID") |
| | |
| | | @Data |
| | | @Schema(title = "分水房视图对象") |
| | | public class VoDivide implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241704004L; |
| | | |
| | | @Schema(title = "ID") |
| | | @ExcelProperty("ID") |
| | |
| | | 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; |
| | |
| | | @Data |
| | | @Schema(title = "流量计视图对象") |
| | | public class VoFlowMeter implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241704005L; |
| | | |
| | | @Schema(title = "ID") |
| | | @ExcelProperty("ID") |
| | |
| | | @Data |
| | | @Schema(title = "管网流量监测站视图对象") |
| | | public class VoFlowMonitoring implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 202401241704006L; |
| | | |
| | | @Schema(title = "ID") |
| | | @ExcelProperty("ID") |
| | |
| | | @Schema(title = "ID") |
| | | @ExcelProperty("ID") |
| | | @ColumnWidth(10) |
| | | private Long id; |
| | | private String id; |
| | | |
| | | @Schema(title = "取水口名称") |
| | | @ExcelProperty("取水口名称") |
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 :WuZeYu |
| | | * @Date :2024/1/23 16:36 |
| | | * @LastEditTime :2024/1/23 16:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "充值记录视图对象") |
| | | public class VoActiveCardNew implements BaseEntity { |
| | | private static final long serialVersionUID = 2024012316370001L; |
| | | |
| | | @Schema(title = "ID") |
| | | private Long id; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "水卡状态") |
| | | private Byte state; |
| | | |
| | | @Schema(title = "水卡状态名称") |
| | | private String stateName; |
| | | |
| | | @Schema(title = "卡片费用") |
| | | private Integer cardCost; |
| | | |
| | | |
| | | @Schema(title = "支付方式") |
| | | private Integer paymentId; |
| | | |
| | | @Schema(title = "操作人") |
| | | private String operator; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Schema(title = "操作时间") |
| | | private Date operateDt; |
| | | } |
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 2024-01-26 18:52 |
| | | * @LastEditTime 2024-01-26 18:52 |
| | | * @Description 应用程序中使用,查询条件为:农户编号、农户姓名、水卡编号 |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "农户卡视图对象") |
| | | public class VoCards implements BaseEntity { |
| | | private static final long serialVersionUID = 202401261853001L; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "电话号码") |
| | | private Float phone; |
| | | |
| | | @Schema(title = "身份证号码") |
| | | private Float idCard; |
| | | |
| | | @Schema(title = "水卡状态") |
| | | private Float cardState; |
| | | |
| | | @Schema(title = "水卡状态名称") |
| | | private String stateName; |
| | | |
| | | @Schema(title = "水卡类型") |
| | | private String cardType; |
| | | |
| | | @Schema(title = "余额") |
| | | private String money; |
| | | } |
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 2024-01-24 17:00 |
| | | * @LastEditTime 2024-01-24 17:00 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "财务对账之总账视图对象") |
| | | public class VoGeneral implements BaseEntity { |
| | | private static final long serialVersionUID = 202401241706001L; |
| | | |
| | | @Schema(title = "总账ID") |
| | | private String generalId; |
| | | |
| | | @Schema(title = "收银员ID") |
| | | private String cashierId; |
| | | |
| | | @Schema(title = "收银员姓名") |
| | | private String cashierName; |
| | | |
| | | @Schema(title = "实收金额") |
| | | private Float tradeAmount; |
| | | |
| | | @Schema(title = "赠送金额") |
| | | private Float gift; |
| | | |
| | | @Schema(title = "总额") |
| | | private Float totalAmount; |
| | | |
| | | @Schema(title = "交易日期") |
| | | private String operateDate; |
| | | |
| | | @Schema(title = "审核状态") |
| | | private String auditStatus; |
| | | |
| | | } |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(title = "ID") |
| | | private Long id; |
| | | private String id; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
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 :WuZeYu |
| | | * @Date :2024/1/26 9:31 |
| | | * @LastEditTime :2024/1/26 9:31 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "补卡记录视图对象") |
| | | public class VoReissueCard implements BaseEntity { |
| | | private static final long serialVersionUID = 2024012609330001L; |
| | | |
| | | @Schema(title = "ID") |
| | | private Long id; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "水卡编号") |
| | | private String cardNum; |
| | | |
| | | @Schema(title = "卡片费用") |
| | | private Integer cardCost; |
| | | |
| | | @Schema(title = "补卡金额") |
| | | private Double reissueAmount; |
| | | |
| | | @Schema(title = "操作人") |
| | | private String operator; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Schema(title = "操作时间") |
| | | private Date operateDt; |
| | | } |
File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoOperate.java |
| | |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "操作记录视图对象") |
| | | public class VoOperate implements BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | @Schema(title = "交易记录视图对象") |
| | | public class VoTransaction implements BaseEntity { |
| | | private static final long serialVersionUID = 202401241705001L; |
| | | |
| | | @Schema(title = "村ID") |
| | | @Schema(title = "订单编号") |
| | | private Long orderNumber; |
| | | |
| | | @Schema(title = "村庄ID") |
| | | private Long villageId; |
| | | |
| | | @Schema(title = "区划名称串") |
| | | @Schema(title = "村庄") |
| | | private String districtTitle; |
| | | |
| | | @Schema(title = "农户编号") |
| | | private String clientNum; |
| | | |
| | | @Schema(title = "农户姓名") |
| | | @Schema(title = "姓名") |
| | | private String name; |
| | | |
| | | @Schema(title = "水卡编号") |
| | |
| | | @Schema(title = "身份证号") |
| | | private String idCard; |
| | | |
| | | @Schema(title = "手机号") |
| | | @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; |
| | | private Date operateTime; |
| | | |
| | | @Schema(title = "余额") |
| | | private Float money; |
| | | |
| | | @Schema(title = "购水金额") |
| | | private Float waterCost; |
| | | |
| | | @Schema(title = "赠送金额") |
| | | private Float gift; |
| | | |
| | | @Schema(title = "购卡金额") |
| | | private Integer cardCost; |
| | | |
| | | @Schema(title = "支付方式") |
| | | private String paymentMethod; |
| | | |
| | | @Schema(title = "操作员") |
| | | private String operatorName; |
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 2024-01-22 18:27 |
| | | * @LastEditTime 2024-01-22 18:27 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Schema(title = "交易记录汇总视图对象") |
| | | public class VoTransactionStatistics implements BaseEntity { |
| | | private static final long serialVersionUID = 202401241705001L; |
| | | |
| | | @Schema(title = "业务类型") |
| | | private String operateType; |
| | | |
| | | @Schema(title = "交易日期") |
| | | private String tradeDate; |
| | | |
| | | @Schema(title = "交易笔数") |
| | | private Integer count; |
| | | |
| | | @Schema(title = "实收金额") |
| | | private Float received; |
| | | |
| | | @Schema(title = "赠送金额") |
| | | private Float gift; |
| | | } |
| | |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaUser"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ba_user--> |
| | | <id property="id" column="id" /> |
| | | <id property="userId" column="id" /> |
| | | <result property="blockId" column="blockId"/> |
| | | <result property="name" column="name"/> |
| | | <result property="userName" column="name"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="password" column="password"/> |
| | | <result property="orgTag" column="orgTag"/> |
| | |
| | | <resultMap id="partResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaUser"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ba_user--> |
| | | <id property="id" column="id" /> |
| | | <result property="name" column="name"/> |
| | | <id property="userId" column="id" /> |
| | | <result property="userName" column="name"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="orgTag" column="orgTag"/> |
| | | <result property="supperAdmin" column="supperAdmin"/> |
| | |
| | | </resultMap> |
| | | |
| | | <resultMap id="loginResultMap" type="com.dy.pipIrrGlobal.pojoBa.BaUser"> |
| | | <id property="id" column="id" /> |
| | | <id property="userId" column="id" /> |
| | | <result property="blockId" column="blockId"/> |
| | | <result property="name" column="name"/> |
| | | <result property="userName" column="name"/> |
| | | <result property="phone" column="phone"/> |
| | | <result property="orgTag" column="orgTag"/> |
| | | <result property="supperAdmin" column="supperAdmin"/> |
| | |
| | | </select> |
| | | <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaUser"> |
| | | insert into ba_user (<include refid="Base_Column_List" />) |
| | | values (#{id,jdbcType=BIGINT}, |
| | | values (#{userId,jdbcType=BIGINT}, |
| | | #{blockId,jdbcType=BIGINT}, |
| | | #{name,jdbcType=VARCHAR}, |
| | | #{userName,jdbcType=VARCHAR}, |
| | | #{phone,jdbcType=VARCHAR}, |
| | | #{password,jdbcType=VARCHAR}, |
| | | #{orgTag,jdbcType=VARCHAR}, |
| | |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaUser"> |
| | | insert into ba_user |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | <if test="userId != null"> |
| | | id, |
| | | </if> |
| | | <if test="blockId != null"> |
| | | blockId, |
| | | </if> |
| | | <if test="name != null"> |
| | | <if test="userName != null"> |
| | | `name`, |
| | | </if> |
| | | <if test="phone != null"> |
| | |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | <if test="userId != null"> |
| | | #{userId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="blockId != null"> |
| | | #{blockId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | <if test="userName != null"> |
| | | #{userName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | #{phone,jdbcType=VARCHAR}, |
| | |
| | | <if test="blockId != null"> |
| | | blockId = #{blockId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null"> |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | <if test="userName != null"> |
| | | `name` = #{userName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | |
| | | deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | where id = #{userId, jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaUser"> |
| | | update ba_user |
| | | set blockId = #{blockId,jdbcType=BIGINT}, |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | `name` = #{userName,jdbcType=VARCHAR}, |
| | | phone = #{phone,jdbcType=VARCHAR}, |
| | | password = #{password,jdbcType=VARCHAR}, |
| | | disabled = #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, |
| | | deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | where id = #{userId,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="changePassword" > |
| | | update ba_user |
| | |
| | | <!--根据用户编号获取用户信息--> |
| | | <select id="getUserInfoById" resultType="java.util.Map"> |
| | | SELECT |
| | | id AS userId, |
| | | name AS userName |
| | | FROM ba_user |
| | | us.id AS userId, |
| | | us.name AS userName, |
| | | us.phone, |
| | | IFNULL(us.blockId, 0) AS blockId, |
| | | IFNULL(blo.name, 0) AS blockName |
| | | FROM ba_user us |
| | | LEFT JOIN ba_block blo ON us.blockId = blo.id |
| | | <where> |
| | | AND disabled = 0 |
| | | AND deleted = 0 |
| | | AND us.disabled = 0 |
| | | AND us.deleted = 0 |
| | | <if test = "userId != null and userId > 0"> |
| | | AND ba_user.id = ${userId} |
| | | AND us.id = ${userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定的条件获取用户记录数--> |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM ba_user user |
| | | INNER JOIN ba_user_role usro ON usro.userId = user.id |
| | | <where> |
| | | AND user.supperAdmin != 1 |
| | | AND user.deleted = 0 |
| | | |
| | | <if test = "name != null and name !=''"> |
| | | AND user.name like CONCAT('%',#{name},'%') |
| | | </if> |
| | | |
| | | <if test = "phone != null and phone !=''"> |
| | | AND user.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | |
| | | <if test = "roleId != null and roleId > 0"> |
| | | AND usro.roleId = ${roleId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取用户列表--> |
| | | <select id="getUsers" resultType="com.dy.pipIrrGlobal.voBa.VoUserInfo"> |
| | | SELECT |
| | | CAST(id AS char) AS userId, |
| | | phone, |
| | | name AS userName, |
| | | disabled AS stateId, |
| | | (CASE |
| | | WHEN disabled = 0 THEN "正常" |
| | | WHEN disabled = 1 THEN "已禁用" |
| | | END) AS stateName, |
| | | CAST(blockId AS char) AS blockId, |
| | | (SELECT name FROM ba_block WHERE id = user.blockId) AS blockName |
| | | FROM ba_user user |
| | | INNER JOIN ba_user_role usro ON usro.userId = user.id |
| | | <where> |
| | | AND user.supperAdmin != 1 |
| | | AND user.deleted = 0 |
| | | |
| | | <if test = "name != null and name !=''"> |
| | | AND user.name like CONCAT('%',#{name},'%') |
| | | </if> |
| | | |
| | | <if test = "phone != null and phone !=''"> |
| | | AND user.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | |
| | | <if test = "roleId != null and roleId > 0"> |
| | | AND usro.roleId = ${roleId} |
| | | </if> |
| | | </where> |
| | | ORDER BY user.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据用户编号获取角色ID列表--> |
| | | <select id="getRoleIdsByUserId" resultType="java.util.HashMap"> |
| | | SELECT |
| | | roleId |
| | | FROM ba_user_role |
| | | WHERE userId = ${userId} |
| | | </select> |
| | | |
| | | <select id="getRoleNamesByUserId" resultType="java.util.HashMap"> |
| | | SELECT |
| | | ro.name AS roleName |
| | | FROM ba_user_role usro |
| | | INNER JOIN ba_role ro ON usro.roleId = ro.id |
| | | WHERE userId = ${userId} |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据控制器编号删除取水口编号--> |
| | | <update id="deleteIntakeId"> |
| | | UPDATE pr_controller SET intakeId = null WHERE id = ${controllerId} |
| | | </update> |
| | | |
| | | <!--根据指定条件获取控制器记录数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | SELECT |
| | |
| | | <select id="getRecordCountOfController" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) AS recordCount FROM pr_controller WHERE deleted = 0 AND id = ${controllerId} |
| | | </select> |
| | | |
| | | <!--根据控制器编号获取已绑定记录数--> |
| | | <select id="getBindedCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) AS recordCount FROM pr_controller WHERE rtuAddr = (SELECT rtuAddr FROM pr_controller_tramp WHERE id = ${controllerId}) AND intakeId IS NOT NULL |
| | | </select> |
| | | </mapper> |
| | |
| | | findDt = #{findDt,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据控制器编号获取流浪控制器地址--> |
| | | <!-- <select id="getTrampRtuAddr" resultType="java.lang.String">--> |
| | | <!-- SELECT rtuAddr FROM pr_controller_tramp WHERE id = ${controllerId}--> |
| | | <!-- </select>--> |
| | | |
| | | <!--根据控制器编号获取流浪控制器信息--> |
| | | <select id="getTrampControllerInfo" resultMap="BaseResultMap"> |
| | | SELECT rtuAddr, protocol, findDt FROM pr_controller_tramp WHERE id = ${controllerId} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <!--根据分水房编号获取所属片区编号--> |
| | | <select id="getBlockIdById" resultType="java.lang.Long"> |
| | | SELECT blockId FROM pr_divide WHERE id = ${divideId}} |
| | | SELECT blockId FROM pr_divide WHERE id = ${divideId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM pr_intake ge |
| | | INNER JOIN ba_divide divi ON ge.divideId = divi.id |
| | | INNER JOIN pr_divide divi ON ge.divideId = divi.id |
| | | INNER JOIN ba_block blo ON divi.blockId = blo.id |
| | | INNER JOIN ba_district country ON ge.countyId = country.id |
| | | INNER JOIN ba_district town ON ge.townId = town.id |
| | | INNER JOIN ba_district village ON ge.villageId = village.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | ge.deleted = 0 |
| | | AND divi.deleted = 0 |
| | |
| | | <if test="blockName != null and blockName != ''"> |
| | | AND blo.name = #{blockName} |
| | | </if> |
| | | |
| | | <if test="isBinded == 0"> |
| | | AND ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == 1"> |
| | | AND ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == null"> |
| | | |
| | | </if> |
| | | <if test="address != null and address != ''"> |
| | | AND CONCAT(country.`name`, town.`name`, village.`name`) LIKE CONCAT('%', #{address}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取取水口记录--> |
| | | <select id="getIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntake"> |
| | | SELECT (@i:=@i+1) AS id, |
| | | SELECT CAST(ge.id AS char) AS id, |
| | | ge.`name` AS intakeName, |
| | | divi.`name` AS divideName, |
| | | blo.`name` AS blockName, |
| | | ge.operateDt As operateDt, |
| | | (CASE |
| | | WHEN ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0) THEN "未绑定" |
| | | WHEN ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0) THEN "已绑定" |
| | | END) AS isBind, |
| | | CONCAT(country.`name`, town.`name`, village.`name`) AS address |
| | | FROM pr_intake ge |
| | | INNER JOIN pr_divide divi ON ge.divideId = divi.id |
| | |
| | | INNER JOIN ba_district country ON ge.countyId = country.id |
| | | INNER JOIN ba_district town ON ge.townId = town.id |
| | | INNER JOIN ba_district village ON ge.villageId = village.id |
| | | , (SELECT @i:=0) AS itable |
| | | <where> |
| | | ge.deleted = 0 |
| | | AND divi.deleted = 0 |
| | |
| | | <if test="intakeName != null and intakeName != ''"> |
| | | AND ge.name LIKE CONCAT('%', #{intakeName}, '%') |
| | | </if> |
| | | |
| | | <if test="divideName != null and divideName != ''"> |
| | | AND divi.name LIKE CONCAT('%', #{divideName}, '%') |
| | | </if> |
| | | |
| | | <if test="blockName != null and blockName != ''"> |
| | | AND blo.name = #{blockName} |
| | | </if> |
| | | |
| | | <if test="isBinded == 0"> |
| | | AND ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == 1"> |
| | | AND ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0) |
| | | </if> |
| | | <if test="isBinded == null"> |
| | | |
| | | </if> |
| | | <if test="address != null and address != ''"> |
| | | AND CONCAT(country.`name`, town.`name`, village.`name`) LIKE CONCAT('%', #{address}, '%') |
| | | </if> |
| | | </where> |
| | | ORDER BY ge.operateDt DESC |
| | |
| | | where region.id = #{regionId,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--获取未绑控制器的取水口列表--> |
| | | <select id="getNoBindingIntakes" resultType="java.util.HashMap"> |
| | | SELECT |
| | | CAST(inta.id AS char)AS intakeId, |
| | | name AS intakeName |
| | | FROM pr_intake inta |
| | | WHERE id NOT IN(SELECT intakeId FROM pr_controller) AND deleted = 0 |
| | | </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.SeAuditsMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeAudits"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_audits--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="general_id" jdbcType="BIGINT" property="generalId" /> |
| | | <result column="audit_status" jdbcType="TINYINT" property="auditStatus" /> |
| | | <result column="audit_opinion" jdbcType="VARCHAR" property="auditOpinion" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_dt" jdbcType="TIMESTAMP" property="operateDt" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, general_id, audit_status, audit_opinion, `operator`, operate_dt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from se_audits |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_audits |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeAudits"> |
| | | <!--@mbg.generated--> |
| | | insert into se_audits (id, general_id, audit_status, |
| | | audit_opinion, `operator`, operate_dt |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{generalId,jdbcType=BIGINT}, #{auditStatus,jdbcType=TINYINT}, |
| | | #{auditOpinion,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operateDt,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeAudits"> |
| | | <!--@mbg.generated--> |
| | | insert into se_audits |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="generalId != null"> |
| | | general_id, |
| | | </if> |
| | | <if test="auditStatus != null"> |
| | | audit_status, |
| | | </if> |
| | | <if test="auditOpinion != null"> |
| | | audit_opinion, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_dt, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="generalId != null"> |
| | | #{generalId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="auditStatus != null"> |
| | | #{auditStatus,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="auditOpinion != null"> |
| | | #{auditOpinion,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeAudits"> |
| | | <!--@mbg.generated--> |
| | | update se_audits |
| | | <set> |
| | | <if test="generalId != null"> |
| | | general_id = #{generalId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="auditStatus != null"> |
| | | audit_status = #{auditStatus,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="auditOpinion != null"> |
| | | audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_dt = #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeAudits"> |
| | | <!--@mbg.generated--> |
| | | update se_audits |
| | | set general_id = #{generalId,jdbcType=BIGINT}, |
| | | audit_status = #{auditStatus,jdbcType=TINYINT}, |
| | | audit_opinion = #{auditOpinion,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operate_dt = #{operateDt,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </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.SeCardOperateMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeCardOperate"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_card_operate--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="card_id" jdbcType="BIGINT" property="cardId" /> |
| | | <result column="client_id" jdbcType="BIGINT" property="clientId" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | <result column="system_balance" jdbcType="FLOAT" property="systemBalance" /> |
| | | <result column="trade_amount" jdbcType="FLOAT" property="tradeAmount" /> |
| | | <result column="price" jdbcType="FLOAT" property="price" /> |
| | | <result column="card_cost" jdbcType="INTEGER" property="cardCost" /> |
| | | <result column="gift" jdbcType="FLOAT" property="gift" /> |
| | | <result column="no_trade_amount" jdbcType="FLOAT" property="noTradeAmount" /> |
| | | <result column="operate_type_id" jdbcType="BIGINT" property="operateType" /> |
| | | <result column="payment_id" jdbcType="BIGINT" property="paymentId" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_dt" jdbcType="TIMESTAMP" property="operateDt" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, card_id, client_id, money, system_balance, trade_amount, price, card_cost, gift, |
| | | no_trade_amount, operate_type_id, payment_id, remarks, `operator`, operate_dt |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from se_card_operate |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_card_operate |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCardOperate"> |
| | | <!--@mbg.generated--> |
| | | insert into se_card_operate (id, card_id, client_id, |
| | | money, system_balance, trade_amount, |
| | | price, card_cost, gift, |
| | | no_trade_amount, operate_type, payment_id, |
| | | remarks, `operator`, operate_dt |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{cardId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, #{systemBalance,jdbcType=FLOAT}, #{tradeAmount,jdbcType=FLOAT}, |
| | | #{price,jdbcType=FLOAT}, #{cardCost,jdbcType=INTEGER}, #{gift,jdbcType=FLOAT}, |
| | | #{noTradeAmount,jdbcType=FLOAT}, #{operateType,jdbcType=BIGINT}, #{paymentId,jdbcType=BIGINT}, |
| | | #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{operateDt,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCardOperate"> |
| | | <!--@mbg.generated--> |
| | | insert into se_card_operate |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="cardId != null"> |
| | | card_id, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | | </if> |
| | | <if test="systemBalance != null"> |
| | | system_balance, |
| | | </if> |
| | | <if test="tradeAmount != null"> |
| | | trade_amount, |
| | | </if> |
| | | <if test="price != null"> |
| | | price, |
| | | </if> |
| | | <if test="cardCost != null"> |
| | | card_cost, |
| | | </if> |
| | | <if test="gift != null"> |
| | | gift, |
| | | </if> |
| | | <if test="noTradeAmount != null"> |
| | | no_trade_amount, |
| | | </if> |
| | | <if test="operateType != null"> |
| | | operate_type_id, |
| | | </if> |
| | | <if test="paymentId != null"> |
| | | payment_id, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_dt, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardId != null"> |
| | | #{cardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="systemBalance != null"> |
| | | #{systemBalance,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="tradeAmount != null"> |
| | | #{tradeAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="price != null"> |
| | | #{price,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="cardCost != null"> |
| | | #{cardCost,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="gift != null"> |
| | | #{gift,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="noTradeAmount != null"> |
| | | #{noTradeAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="operateType != null"> |
| | | #{operateType,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="paymentId != null"> |
| | | #{paymentId,jdbcType=BIGINT}, |
| | | </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> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCardOperate"> |
| | | <!--@mbg.generated--> |
| | | update se_card_operate |
| | | <set> |
| | | <if test="cardId != null"> |
| | | card_id = #{cardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="systemBalance != null"> |
| | | system_balance = #{systemBalance,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="tradeAmount != null"> |
| | | trade_amount = #{tradeAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="price != null"> |
| | | price = #{price,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="cardCost != null"> |
| | | card_cost = #{cardCost,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="gift != null"> |
| | | gift = #{gift,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="noTradeAmount != null"> |
| | | no_trade_amount = #{noTradeAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="operateType != null"> |
| | | operate_type_id = #{operateType,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="paymentId != null"> |
| | | payment_id = #{paymentId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_dt = #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCardOperate"> |
| | | <!--@mbg.generated--> |
| | | update se_card_operate |
| | | set card_id = #{cardId,jdbcType=BIGINT}, |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | money = #{money,jdbcType=FLOAT}, |
| | | system_balance = #{systemBalance,jdbcType=FLOAT}, |
| | | trade_amount = #{tradeAmount,jdbcType=FLOAT}, |
| | | price = #{price,jdbcType=FLOAT}, |
| | | card_cost = #{cardCost,jdbcType=INTEGER}, |
| | | gift = #{gift,jdbcType=FLOAT}, |
| | | no_trade_amount = #{noTradeAmount,jdbcType=FLOAT}, |
| | | operate_type_id = #{operateType,jdbcType=BIGINT}, |
| | | payment_id = #{paymentId,jdbcType=BIGINT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operate_dt = #{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_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 2 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "clientNum != null and clientNum > 0"> |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId > 0"> |
| | | AND ope.payment_id = ${paymentId} |
| | | </if> |
| | | |
| | | <if test = "rechargeTimeStart != null and rechargeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取充值记录--> |
| | | <select id="getRecharges" resultType="com.dy.pipIrrGlobal.voSe.VoRecharge"> |
| | | SELECT |
| | | CAST(ope.id AS char) AS id , |
| | | cli.name AS clientName, |
| | | cli.clientNum, |
| | | card.cardNum, |
| | | ope.trade_amount AS amount, |
| | | (ope.money + ope.trade_amount) AS afterRecharge, |
| | | ope.payment_id, |
| | | ope.price, |
| | | (SELECT `name` FROM ba_user WHERE id = ope.operator) AS operator, |
| | | ope.operate_dt |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 2 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "clientNum != null and clientNum > 0"> |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId > 0"> |
| | | AND ope.payment_id = ${paymentId} |
| | | </if> |
| | | |
| | | <if test = "rechargeTimeStart != null and rechargeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ope.operate_dt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易记录数--> |
| | | <select id="getTransactionRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN ba_user user ON ope.operator = user.id |
| | | INNER JOIN se_payment_method pay ON ope.payment_id = pay.id |
| | | <where> |
| | | AND ope.operate_type IN(1,2,3,4) |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND cli.villageId = ${villageId} |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum >0"> |
| | | AND card.cardNum = ${cardNum} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易记录--> |
| | | <select id="getTransactions" resultType="com.dy.pipIrrGlobal.voSe.VoTransaction"> |
| | | SELECT |
| | | ope.id AS orderNumber, |
| | | cli.villageId, |
| | | cli.districtTitle, |
| | | cli.clientNum, |
| | | cli.`name`, |
| | | card.cardNum, |
| | | cli.idCard, |
| | | cli.phone, |
| | | (CASE operate_type |
| | | WHEN 1 THEN '开卡' |
| | | WHEN 2 THEN '充值' |
| | | WHEN 3 THEN '销卡' |
| | | WHEN 4 THEN '补卡' |
| | | END) AS operateType, |
| | | ope.operate_dt AS operateTime, |
| | | IFNULL(ope.money, 0) AS money, |
| | | IFNULL(ope.trade_amount, 0) AS waterCost, |
| | | IFNULL(ope.gift, 0) AS gift, |
| | | IFNULL(ope.card_cost, 0) AS cardCost, |
| | | pay.`name` paymentMethod, |
| | | user.name AS operatorName |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN ba_user user ON ope.operator = user.id |
| | | INNER JOIN se_payment_method pay ON ope.payment_id = pay.id |
| | | <where> |
| | | AND ope.operate_type IN(1,2,3,4) |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND cli.villageId = ${villageId} |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum >0"> |
| | | AND card.cardNum = ${cardNum} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | |
| | | <if test = "cashierId != null and cashierId > 0"> |
| | | AND user.id = ${cashierId} |
| | | </if> |
| | | </where> |
| | | ORDER BY ope.operate_dt |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取购水汇总和购卡汇总,获取交易明细使用--> |
| | | <select id="getTransactionSums" resultType="java.util.Map"> |
| | | SELECT |
| | | IFNULL(SUM(trade_amount),0) AS waterCost, |
| | | IFNULL(SUM(card_cost),0) AS cardCost |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN ba_user user ON ope.operator = user.id |
| | | INNER JOIN se_payment_method pay ON ope.payment_id = pay.id |
| | | <where> |
| | | AND ope.operate_type IN(1,2,3,4) |
| | | <if test = "villageId != null and villageId > 0"> |
| | | AND cli.villageId = ${villageId} |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum >0"> |
| | | AND card.cardNum = ${cardNum} |
| | | </if> |
| | | |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <!--根据指定条件获取交易统计记录数--> |
| | | <select id="getTransactionStatisticsRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM v_transactionstatistics |
| | | <where> |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeDate BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易统计记录--> |
| | | <select id="getTransactionStatistics" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics"> |
| | | SELECT * FROM v_transactionstatistics |
| | | <where> |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeDate BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY tradeDate |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根基指定条件获取笔数合计、实收金额合计、赠送金额合计--> |
| | | <select id="getTransactionStatisticsSums" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(count) AS totalCount, |
| | | SUM(received) AS totalReceived, |
| | | SUM(gift) AS totalGift |
| | | FROM v_transactionstatistics |
| | | <where> |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeDate BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取指定日期、指定支付方式实收金额合计--> |
| | | <select id="getPaymentSums" resultType="java.lang.Float"> |
| | | SELECT |
| | | SUM(ope.trade_amount) AS tradeAmount |
| | | FROM se_card_operate ope |
| | | <where> |
| | | <if test = "tradeDate != null and tradeDate !=''"> |
| | | AND Date(ope.operate_dt) = #{tradeDate} |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId >0"> |
| | | AND ope.payment_id = ${paymentId} |
| | | </if> |
| | | </where> |
| | | GROUP BY ope.payment_id, Date(ope.operate_dt) |
| | | </select> |
| | | |
| | | <!--根据指定条件获取开卡记录数量--> |
| | | <select id="getActiveCardRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(*) AS recordCount |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 1 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "state != null and state > 0"> |
| | | AND card.state = ${state} |
| | | </if> |
| | | |
| | | <if test = "activeTimeStart != null and activeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{activeTimeStart} AND #{activeTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取开卡记录--> |
| | | <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCardNew"> |
| | | SELECT |
| | | CAST(ope.id AS char) AS id , |
| | | cli.name AS clientName, |
| | | cli.clientNum AS clientNum, |
| | | card.cardNum AS cardNum, |
| | | card.state AS state, |
| | | (CASE |
| | | WHEN card.state = 1 THEN "正常" |
| | | WHEN card.state = 2 THEN "已注销" |
| | | WHEN card.state = 3 THEN "已挂失" |
| | | END) AS stateName, |
| | | ope.card_cost AS cardCost, |
| | | ope.payment_id AS paymentId, |
| | | (SELECT `name` FROM ba_user WHERE id = ope.operator) AS operator, |
| | | ope.operate_dt AS operateDt |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 1 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "state != null and state > 0"> |
| | | AND card.state = ${state} |
| | | </if> |
| | | |
| | | <if test = "activeTimeStart != null and activeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{activeTimeStart} AND #{activeTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ope.operate_dt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取补卡记录数量--> |
| | | <select id="getReissueCardRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(*) AS recordCount |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 4 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "activeTimeStart != null and activeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{reissueCardTimeStart} AND #{reissueCardTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取补卡记录--> |
| | | <select id="getReissueCards" resultType="com.dy.pipIrrGlobal.voSe.VoReissueCard"> |
| | | SELECT |
| | | CAST(ope.id AS char) AS id , |
| | | cli.name AS clientName, |
| | | cli.clientNum AS clientNum, |
| | | card.cardNum AS cardNum, |
| | | ope.card_cost AS cardCost, |
| | | IFNULL(ope.no_trade_amount,0) AS reissueAmount, |
| | | (SELECT `name` FROM ba_user WHERE id = ope.operator) AS operator, |
| | | ope.operate_dt AS operateDt |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | <where> |
| | | AND ope.operate_type = 4 |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "activeTimeStart != null and activeTimeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{reissueCardTimeStart} AND #{reissueCardTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ope.operate_dt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="cancelDt" jdbcType="TIMESTAMP" property="canceldt" /> |
| | | <result column="unlockDt" jdbcType="TIMESTAMP" property="unlockdt" /> |
| | | <result column="reversalDt" jdbcType="TIMESTAMP" property="reversaldt" /> |
| | | <result column="refundDt" jdbcType="TIMESTAMP" property="refunddt" /> |
| | | <result column="consumeDt" jdbcType="TIMESTAMP" property="consumedt" /> |
| | | <result column="lastOper" jdbcType="TINYINT" property="lastoper" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cardAddr, cardNum, clientId, money, `state`, createDt, replaceDt, rechargeDt, |
| | | lossDtDt, cancelDt, unlockDt, reversalDt, consumeDt, lastOper, remarks |
| | | id, cardAddr, cardNum, clientId, money, `state`, createDt, replaceDt, rechargeDt, |
| | | lossDtDt, cancelDt, unlockDt, reversalDt, refundDt, consumeDt, lastOper, remarks |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | insert into se_client_card (id, cardAddr, cardNum, clientId, |
| | | money, `state`, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, |
| | | cancelDt, unlockDt, reversalDt, |
| | | cancelDt, unlockDt, reversalDt, refundDt, |
| | | consumeDt, lastOper, remarks |
| | | ) |
| | | 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} |
| | | #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, |
| | | #{refunddt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR} |
| | | ) |
| | | |
| | | </insert> |
| | |
| | | </if> |
| | | <if test="reversaldt != null"> |
| | | reversalDt, |
| | | </if> |
| | | <if test="refunddt != null"> |
| | | refundDt, |
| | | </if> |
| | | <if test="consumedt != null"> |
| | | consumeDt, |
| | |
| | | </if> |
| | | <if test="reversaldt != null"> |
| | | #{reversaldt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="refunddt != null"> |
| | | #{refunddt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="consumedt != null"> |
| | | #{consumedt,jdbcType=TIMESTAMP}, |
| | |
| | | <if test="reversaldt != null"> |
| | | reversalDt = #{reversaldt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="refunddt != null"> |
| | | refundDt = #{refunddt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="consumedt != null"> |
| | | consumeDt = #{consumedt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | |
| | | cancelDt = #{canceldt,jdbcType=TIMESTAMP}, |
| | | unlockDt = #{unlockdt,jdbcType=TIMESTAMP}, |
| | | reversalDt = #{reversaldt,jdbcType=TIMESTAMP}, |
| | | refundDt = #{refunddt,jdbcType=TIMESTAMP}, |
| | | consumeDt = #{consumedt,jdbcType=TIMESTAMP}, |
| | | lastOper = #{lastoper,jdbcType=TINYINT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | |
| | | |
| | | <!--根据水卡编号获取卡片状态:1-开卡,2-补卡,3-充值,4-挂失,5-注销,6-解锁,7-冲正,8-消费--> |
| | | <select id="getCardStateByCardNum" resultType="java.lang.String"> |
| | | <!-- SELECT--> |
| | | <!-- (CASE--> |
| | | <!-- WHEN lastOper = 1 THEN "开卡"--> |
| | | <!-- WHEN lastOper = 2 THEN "补卡"--> |
| | | <!-- WHEN lastOper = 3 THEN "充值"--> |
| | | <!-- WHEN lastOper = 4 THEN "挂失"--> |
| | | <!-- WHEN lastOper = 5 THEN "注销"--> |
| | | <!-- WHEN lastOper = 6 THEN "解锁"--> |
| | | <!-- WHEN lastOper = 7 THEN "冲正"--> |
| | | <!-- WHEN lastOper = 8 THEN "消费"--> |
| | | <!-- END) AS stateName--> |
| | | <!-- FROM se_client_card--> |
| | | <!-- WHERE cardNum = ${cardNum}--> |
| | | SELECT |
| | | (CASE |
| | | WHEN lastOper = 1 THEN "开卡" |
| | | WHEN lastOper = 2 THEN "补卡" |
| | | WHEN lastOper = 3 THEN "充值" |
| | | WHEN lastOper = 4 THEN "挂失" |
| | | WHEN lastOper = 5 THEN "注销" |
| | | WHEN lastOper = 6 THEN "解锁" |
| | | WHEN lastOper = 7 THEN "冲正" |
| | | WHEN lastOper = 8 THEN "消费" |
| | | (CASE |
| | | WHEN state = 1 THEN '正常' |
| | | WHEN state = 2 THEN '已注销' |
| | | WHEN state = 3 THEN '已挂失' |
| | | END) AS stateName |
| | | FROM se_client_card |
| | | WHERE cardNum = ${cardNum} |
| | | </select> |
| | | |
| | | <!--根据指定条件获取水卡列表记录数,应用程序使用--> |
| | | <select id="getCardsCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | <where> |
| | | <if test = "clientNum != null and clientNum !=''"> |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取水卡列表,应用程序使用--> |
| | | <select id="getCards" resultType="com.dy.pipIrrGlobal.voSe.VoCards"> |
| | | SELECT |
| | | cli.clientNum, |
| | | cli.name AS clientName, |
| | | card.cardNum, |
| | | cli.phone, |
| | | cli.idCard, |
| | | card.state AS cardState, |
| | | (CASE |
| | | WHEN card.state = 1 THEN '正常' |
| | | WHEN card.state = 2 THEN '已注销' |
| | | WHEN card.state = 3 THEN '已挂失' |
| | | End) AS stateName, |
| | | '农户卡' AS cardType, |
| | | card.money |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | <where> |
| | | <if test = "clientNum != null and clientNum !=''"> |
| | | AND cli.clientNum like CONCAT('%',#{clientNum},'%') |
| | | </if> |
| | | |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY card.id |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | SELECT districtNum FROM se_client WHERE clientNum = ${clientNum} |
| | | </select> |
| | | |
| | | <!--根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用--> |
| | | <select id="getAreaCodeById" resultType="java.lang.Long"> |
| | | SELECT districtNum FROM se_client WHERE id = ${clientId} |
| | | </select> |
| | | |
| | | <!--根据农户编号获取农户ID--> |
| | | <select id="getClientIdByNum" resultType="java.lang.Long"> |
| | | SELECT id FROM se_client WHERE clientNum = ${clientNum} |
| | |
| | | <!--获取用水方式列表--> |
| | | <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> |
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.SeGeneralMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeGeneral"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_general--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="cashier_id" jdbcType="BIGINT" property="cashierId" /> |
| | | <result column="cashier_name" jdbcType="VARCHAR" property="cashierName" /> |
| | | <result column="trade_amount" jdbcType="FLOAT" property="tradeAmount" /> |
| | | <result column="gift" jdbcType="FLOAT" property="gift" /> |
| | | <result column="total_amount" jdbcType="FLOAT" property="totalAmount" /> |
| | | <result column="operate_date" jdbcType="TIMESTAMP" property="operateDate" /> |
| | | <result column="audit_status" jdbcType="TINYINT" property="auditStatus" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, cashier_id, cashier_name, trade_amount, gift, total_amount, operate_date, audit_status |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from se_general |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_general |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral"> |
| | | <!--@mbg.generated--> |
| | | insert into se_general (id, cashier_id, cashier_name, |
| | | trade_amount, gift, total_amount, |
| | | operate_date, audit_status) |
| | | values (#{id,jdbcType=BIGINT}, #{cashierId,jdbcType=BIGINT}, #{cashierName,jdbcType=VARCHAR}, |
| | | #{tradeAmount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT}, |
| | | #{operateDate,jdbcType=TIMESTAMP}, #{auditStatus,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral"> |
| | | <!--@mbg.generated--> |
| | | insert into se_general |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="cashierId != null"> |
| | | cashier_id, |
| | | </if> |
| | | <if test="cashierName != null"> |
| | | cashier_name, |
| | | </if> |
| | | <if test="tradeAmount != null"> |
| | | trade_amount, |
| | | </if> |
| | | <if test="gift != null"> |
| | | gift, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount, |
| | | </if> |
| | | <if test="operateDate != null"> |
| | | operate_date, |
| | | </if> |
| | | <if test="auditStatus != null"> |
| | | audit_status, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cashierId != null"> |
| | | #{cashierId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cashierName != null"> |
| | | #{cashierName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="tradeAmount != null"> |
| | | #{tradeAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="gift != null"> |
| | | #{gift,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | #{totalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="operateDate != null"> |
| | | #{operateDate,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="auditStatus != null"> |
| | | #{auditStatus,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral"> |
| | | <!--@mbg.generated--> |
| | | update se_general |
| | | <set> |
| | | <if test="cashierId != null"> |
| | | cashier_id = #{cashierId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cashierName != null"> |
| | | cashier_name = #{cashierName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="tradeAmount != null"> |
| | | trade_amount = #{tradeAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="gift != null"> |
| | | gift = #{gift,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="totalAmount != null"> |
| | | total_amount = #{totalAmount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="operateDate != null"> |
| | | operate_date = #{operateDate,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="auditStatus != null"> |
| | | audit_status = #{auditStatus,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral"> |
| | | <!--@mbg.generated--> |
| | | update se_general |
| | | set cashier_id = #{cashierId,jdbcType=BIGINT}, |
| | | cashier_name = #{cashierName,jdbcType=VARCHAR}, |
| | | trade_amount = #{tradeAmount,jdbcType=FLOAT}, |
| | | gift = #{gift,jdbcType=FLOAT}, |
| | | total_amount = #{totalAmount,jdbcType=FLOAT}, |
| | | operate_date = #{operateDate,jdbcType=TIMESTAMP}, |
| | | audit_status = #{auditStatus,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--获取未生成总账的交易日期列表(当天的交易记录不生成总账)--> |
| | | <select id="getDatesOfNotInGenerals" resultType="java.util.HashMap"> |
| | | SELECT |
| | | DISTINCT Date(ope.operate_dt) AS operateDate |
| | | FROM se_card_operate ope |
| | | WHERE Date(ope.operate_dt) NOT IN(SELECT operate_date FROM se_general) AND Date(ope.operate_dt) != CURDATE() |
| | | </select> |
| | | |
| | | <!--根据交易日期获取总账记录列表(待生成的) --> |
| | | <select id="getGeneralByOperateDate" resultType="com.dy.pipIrrGlobal.pojoSe.SeGeneral"> |
| | | SELECT |
| | | us.id AS cashierId, |
| | | us.`name` AS cashierName, |
| | | IFNULL(SUM(ope.trade_amount),0) AS tradeAmount, |
| | | IFNULL(SUM(ope.gift),0) AS gift, |
| | | IFNULL((SUM(ope.trade_amount) + SUM(ope.gift)),0) AS totalAmount, |
| | | Date(ope.operate_dt) AS operateDate, |
| | | 1 AS auditStatus |
| | | FROM se_card_operate ope |
| | | INNER JOIN ba_user us ON ope.operator = us.id |
| | | WHERE Date(ope.operate_dt) = #{operateDate} |
| | | GROUP BY ope.operator, Date(ope.operate_dt) |
| | | </select> |
| | | |
| | | <!--根据指定条件获取总账记录数--> |
| | | <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM se_general |
| | | <where> |
| | | <if test = "cashierName != null and cashierName !=''"> |
| | | AND cashier_name like CONCAT('%',#{cashierName},'%') |
| | | </if> |
| | | |
| | | <if test = "auditStatus != null and auditStatus > 0"> |
| | | AND audit_status = ${auditStatus} |
| | | </if> |
| | | |
| | | <if test = "operateDateStart != null and operateDateStop != null"> |
| | | AND Date(operate_date) BETWEEN #{operateDateStart} AND #{operateDateStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取总账记录--> |
| | | <select id="getGenerals" resultType="com.dy.pipIrrGlobal.voSe.VoGeneral"> |
| | | SELECT |
| | | CAST(id AS char) AS generalId, |
| | | CAST(cashier_id AS char) AS cashierId, |
| | | cashier_name AS cashierName, |
| | | trade_amount AS tradeAmount, |
| | | gift, |
| | | total_amount AS totalAmount, |
| | | Date(operate_date) AS operateDate, |
| | | (CASE |
| | | WHEN audit_status = 1 THEN "未审核" |
| | | WHEN audit_status = 2 THEN "同意" |
| | | WHEN audit_status = 3 THEN "驳回" |
| | | END) AS auditStatus |
| | | FROM se_general |
| | | <where> |
| | | <if test = "cashierName != null and cashierName !=''"> |
| | | AND cashier_name like CONCAT('%',#{cashierName},'%') |
| | | </if> |
| | | |
| | | <if test = "auditStatus != null and auditStatus > 0"> |
| | | AND audit_status = ${auditStatus} |
| | | </if> |
| | | |
| | | <if test = "operateDateStart != null and operateDateStop != null"> |
| | | AND Date(operate_date) BETWEEN #{operateDateStart} AND #{operateDateStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY Date(operate_date) DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--获取指定日期、指定收银员、指定支付方式实收金额合计--> |
| | | <select id="getPaymentSums" resultType="java.lang.Float"> |
| | | SELECT |
| | | SUM(ope.trade_amount) AS tradeAmount |
| | | FROM se_card_operate ope |
| | | <where> |
| | | <if test = "tradeDate != null and tradeDate !=''"> |
| | | AND Date(ope.operate_dt) = #{tradeDate} |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId >0"> |
| | | AND ope.payment_id = ${paymentId} |
| | | </if> |
| | | |
| | | <if test = "cashierId != null and cashierId >0"> |
| | | AND ope.operator = ${cashierId} |
| | | </if> |
| | | </where> |
| | | GROUP BY ope.payment_id, Date(ope.operate_dt) |
| | | </select> |
| | | |
| | | <!--根基指定日期、指定收银员获取笔数合计、实收金额合计、赠送金额合计--> |
| | | <select id="getTransactionStatisticsSums" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(count) AS totalCount, |
| | | SUM(received) AS totalReceived, |
| | | SUM(gift) AS totalGift |
| | | FROM v_transactionstatistics2 |
| | | <where> |
| | | <if test = "tradeDate != null and tradeDate !=''"> |
| | | AND tradeDate = #{tradeDate} |
| | | </if> |
| | | |
| | | <if test = "cashierId != null and cashierId >0"> |
| | | AND cashierId = ${cashierId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 财务对账审核页,收银员+日期分组,排除交易类型分组,记录数--> |
| | | <select id="getToAuditRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM v_transactionstatistics2 |
| | | <where> |
| | | <if test = "cashierId != null and cashierId > 0"> |
| | | AND cashierId = ${cashierId} |
| | | </if> |
| | | |
| | | <if test = "tradeDate != null"> |
| | | AND tradeDate = #{tradeDate} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--财务对账审核页,收银员+日期分组,排除交易类型分组--> |
| | | <select id="getToAudit" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics"> |
| | | SELECT * FROM v_transactionstatistics2 |
| | | <where> |
| | | <if test = "cashierId != null and cashierId > 0"> |
| | | AND cashierId = ${cashierId} |
| | | </if> |
| | | |
| | | <if test = "tradeDate != null"> |
| | | AND tradeDate = #{tradeDate} |
| | | </if> |
| | | </where> |
| | | ORDER BY tradeDate |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "分水口管理", description = "分水口增删改查等操作") |
| | | @RestController |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DivideSv { |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | |
| | | ROLE_NAME_EXIST(10003, "角色名称已存在"), |
| | | NO_ROLES(10004, "没有符合条件的角色记录"), |
| | | PLEASE_INPUT_ROLE_ID(10005, "角色编号不能为空"), |
| | | DELETE_ROLE_FAIL(10006, "删除角色失败"); |
| | | DELETE_ROLE_FAIL(10006, "删除角色失败"), |
| | | USER_NOT_EXIST(10007, "删除的用户不存在"), |
| | | |
| | | /** |
| | | * 用户 |
| | | */ |
| | | THE_USER_NOT_EXIST(20001, "用户不存在"); |
| | | |
| | | private final Integer code; |
| | | private final String message; |
| | |
| | | */ |
| | | @Schema(description = "角色编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "角色编号必须为大于0的整数") |
| | | private Long roleid; |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * 角色名称 |
| | |
| | | @SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked") |
| | | public class RoleCtrl { |
| | | |
| | | //private RoleSv sv ; |
| | | private final RoleSv roleSv; |
| | | |
| | | //@Autowired |
| | | //private void setSv(RoleSv sv){ |
| | | // this.sv = sv ; |
| | | //} |
| | | |
| | | /** |
| | | * 根据指定条件(角色编号、角色名称)获取角色列表 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 添加角色及权限列表,添加前判断角色名是否已存在 |
| | | * @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 = "save", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid DtoRole po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 获取角色名称级权限列表 |
| | | String roleName = Optional.ofNullable(po.getRoleName()).orElse(""); |
| | | JSONArray permissions = Optional.ofNullable(JSONArray.parseArray(po.getPermissions())).orElse(JSONArray.parseArray("[]")); |
| | | Long operator = Optional.ofNullable(po.getOperator()).orElse(0L); |
| | | |
| | | // 判断角色名称是否重名 |
| | | Integer recordCount = Optional.ofNullable(roleSv.getRecordCountByName(roleName)).orElse(0); |
| | | if(recordCount > 0) |
| | | return BaseResponseUtils.buildFail(SystemResultCode.ROLE_NAME_EXIST.getMessage()); |
| | | |
| | | // 添加角色 |
| | | BaRole baRole = new BaRole(); |
| | | Long roleId = 0L; |
| | | try { |
| | | baRole.setName(roleName); |
| | | baRole.setOperator(operator); |
| | | Date operateTime = new Date(); |
| | | baRole.setOperateDt(operateTime); |
| | | baRole.setDeleted(Deleted.NO.getCode()); |
| | | roleId = roleSv.addRole(baRole); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | |
| | | if(roleId <= 0) |
| | | return BaseResponseUtils.buildFail(SystemResultCode.ADD_ROLE_FAIL.getMessage()); |
| | | |
| | | // 添加权限列表 |
| | | BaRolePermissions baRolePermissions = new BaRolePermissions(); |
| | | baRolePermissions.setRoleid(roleId); |
| | | baRolePermissions.setPermissions(permissions); |
| | | Integer rc = Optional.ofNullable(roleSv.addPermissions(baRolePermissions)).orElse(0); |
| | | if(rc <= 0) { |
| | | return BaseResponseUtils.buildFail(SystemResultCode.ADD_ROLE_FAIL.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 角色授权,当角色编号为空时,实际为添加角色及权限列表 |
| | | * 角色授权 |
| | | * 1. 如果roleid和roleName都空:提示错误信息 |
| | | * 2. 如果roleid为空:新建角色且授权 |
| | | * 1. 添加角色记录 |
| | | * 2. 添加角色、权限关联记录 |
| | | * 3. 如果roleid不为空:修改角色及授权 |
| | | * 1. 删除角色、权限记录 |
| | | * 2. 修改角色信息 |
| | | * 3. 添加角色、权限记录 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 如果roleid和roleName都空:提示错误信息 |
| | | * 如果roleid为空:新建角色且授权 |
| | | * 1. 添加角色记录 |
| | | * 2. 添加角色、权限关联记录 |
| | | * 如果roleid不为空:修改角色授权 |
| | | * 1. 删除角色、权限记录 |
| | | * 2. 添加角色、权限记录 |
| | | */ |
| | | |
| | | Long roleId = Optional.ofNullable(po.getRoleid()).orElse(0L); |
| | | Long roleId = Optional.ofNullable(po.getRoleId()).orElse(0L); |
| | | String roleName = Optional.ofNullable(po.getRoleName()).orElse(""); |
| | | //String permissions = Optional.ofNullable(po.getPermissions()).orElse(""); |
| | | JSONArray permissions = Optional.ofNullable(JSONArray.parseArray(po.getPermissions())).orElse(JSONArray.parseArray("[]")); |
| | | Long operator = Optional.ofNullable(po.getOperator()).orElse(0L); |
| | | |
| | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | // 修改角色信息 |
| | | BaRole baRole = new BaRole(); |
| | | baRole.setId(roleId); |
| | | baRole.setName(roleName); |
| | | baRole.setOperator(operator); |
| | | Date operateTime = new Date(); |
| | | baRole.setOperateDt(operateTime); |
| | | roleSv.updateRole(baRole); |
| | | |
| | | // 修改角色授权 |
| | | BaRolePermissions baRolePermissions = new BaRolePermissions(); |
| | | baRolePermissions.setRoleid(roleId); |
| | | baRolePermissions.setPermissions(permissions); |
| | | roleSv.delPermissionsByRoleId(roleId); |
| | | roleSv.addPermissions(baRolePermissions); |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 修改角色 |
| | | * @param po 保存角色form表单对象 |
| | | * @return 是否成功 |
| | | */ |
| | | @Operation(summary = "修改角色", description = "提交角色数据,进行修改") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid BaRole po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 接收角色编号、角色名称、操作人编号 |
| | | Long roleId = Optional.ofNullable(po.getId()).orElse(0L); |
| | | String roleName = Optional.ofNullable(po.getName()).orElse(""); |
| | | Long operator = Optional.ofNullable(po.getOperator()).orElse(0L); |
| | | |
| | | // 判断主键是否为空 |
| | | if(roleId == 0) |
| | | return BaseResponseUtils.buildFail(SystemResultCode.PLEASE_INPUT_ROLE_ID.getMessage()) ; |
| | | |
| | | Integer recordCount = 0; |
| | | try { |
| | | po.setName(roleName); |
| | | po.setOperator(operator); |
| | | Date operateTime = new Date(); |
| | | po.setOperateDt(operateTime); |
| | | |
| | | //po.deleted = null ;//设置为null,不做更新 |
| | | recordCount = roleSv.updateRole(po); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | |
| | | if(recordCount <= 0) |
| | | return BaseResponseUtils.buildFail("数据库存储失败") ; |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrBase.result.SystemResultCode; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import com.dy.pipIrrGlobal.util.Constant; |
| | | import com.dy.pipIrrGlobal.voBa.VoUserInfo; |
| | |
| | | schema = @Schema(implementation = BaUser.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "some") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Valid QueryVo vo) { |
| | | public BaseResponse<QueryResultVo<List<VoUserInfo>>> some(QueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo); |
| | | QueryResultVo<List<VoUserInfo>> res = this.sv.selectSome(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询用户异常", e); |
| | |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | po.id = null; |
| | | po.userId = null; |
| | | int count; |
| | | try { |
| | | po.supperAdmin = Constant.no.byteValue() ; |
| | |
| | | po.password = MD5.encrypt(defaultPassword); |
| | | } |
| | | count = this.sv.save(po); |
| | | this.sv.setRoles(po.id, po.roleIds); |
| | | this.sv.setRoles(po.userId, po.roleIds); |
| | | } catch (Exception e) { |
| | | log.error("保存用户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | if (po.id == null) { |
| | | if (po.userId == null) { |
| | | return BaseResponseUtils.buildFail("无数据实体ID"); |
| | | } |
| | | int count; |
| | |
| | | po.deleted = null;//设置为null,不做更新 |
| | | po.orgTag = null;//设置为null,不做更新 |
| | | count = this.sv.update(po); |
| | | this.sv.setRoles(po.id, po.roleIds); |
| | | this.sv.setRoles(po.userId, po.roleIds); |
| | | } catch (Exception e) { |
| | | log.error("保存用户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | return BaseResponseUtils.buildFail(SystemResultCode.USER_NOT_EXIST.getMessage()); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | |
| | | public BaseResponse<QueryResultVo<VoUserInfo>> getUserInfos(@PathVariable("userId") Long userId) { |
| | | try { |
| | | VoUserInfo res = this.sv.getUserInfos(userId); |
| | | if(res == null) { |
| | | return BaseResponseUtils.buildException(SystemResultCode.THE_USER_NOT_EXIST.getMessage()); |
| | | } |
| | | System.out.println(" :" + res); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 得到一个用户 |
| | | * |
| | | * @param vo 查询条件值对象 |
| | | * @return 用户实体 |
| | | * 获取用户列表 |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public QueryResultVo<List<BaUser>> selectSome(QueryVo vo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | Long itemTotal = this.dao.selectTotal(params); |
| | | public QueryResultVo<List<VoUserInfo>> selectSome(QueryVo queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | QueryResultVo<List<BaUser>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | Long itemTotal = this.dao.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoUserInfo>> 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 = this.dao.selectSome(params); |
| | | |
| | | return rsVo; |
| | | /** |
| | | * 获取用户列表,取用户ID |
| | | * 根据用户ID获取roleId列表,并添加到返回对象中 |
| | | * 根据用户ID获取roleName列表,并添加到返回对象中 |
| | | */ |
| | | List<VoUserInfo> list_users = Optional.ofNullable(this.dao.getUsers(params)).orElse(new ArrayList<>()); |
| | | if(list_users.size() > 0) { |
| | | for(int i = 0; i < list_users.size(); i++) { |
| | | VoUserInfo voUserInfo = list_users.get(i); |
| | | String userId = voUserInfo.getUserId(); |
| | | |
| | | JSONArray array_roleIds = new JSONArray(); |
| | | List<Map<String, Object>> list_roleIds = Optional.ofNullable(this.dao.getRoleIdsByUserId(Long.parseLong(userId))).orElse(new ArrayList<>()); |
| | | for (int j = 0; j < list_roleIds.size(); j++) { |
| | | Map map_roleId = list_roleIds.get(j); |
| | | if(map_roleId != null) { |
| | | array_roleIds.add(map_roleId.get("roleId").toString()); |
| | | } |
| | | |
| | | } |
| | | List<Map<String, Object>> list_roleId = (List<Map<String, Object>>) JSON.parse(array_roleIds.toJSONString()); |
| | | |
| | | JSONArray array_roleNames = new JSONArray(); |
| | | List<Map<String, Object>> list_roleNames = Optional.ofNullable(this.dao.getRoleNamesByUserId(Long.parseLong(userId))).orElse(new ArrayList<>()); |
| | | for (int j = 0; j < list_roleNames.size(); j++) { |
| | | Map map_roleName = list_roleNames.get(j); |
| | | if(map_roleName != null) { |
| | | array_roleNames.add(map_roleName.get("roleName").toString()); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list_roleName = (List<Map<String, Object>>) JSON.parse(array_roleNames.toJSONString()); |
| | | |
| | | voUserInfo.setRoleIds(list_roleId); |
| | | voUserInfo.setRoleNames(list_roleName); |
| | | } |
| | | } |
| | | rsVo.obj = list_users; |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | |
| | | VoUserInfo voUserInfo = new VoUserInfo(); |
| | | JSONArray array_permission = new JSONArray(); |
| | | Map map = Optional.ofNullable(dao.getUserInfoById(userId)).orElse(new HashMap()); |
| | | if(map.size() > 0) { |
| | | voUserInfo.setUserId(String.valueOf(userId)); |
| | | voUserInfo.setUserName(map.get("userName").toString()); |
| | | if(map.size() == 0) { |
| | | return null; |
| | | } |
| | | voUserInfo.setUserId(String.valueOf(userId)); |
| | | voUserInfo.setUserName(map.get("userName").toString()); |
| | | voUserInfo.setPhone(map.get("phone").toString()); |
| | | voUserInfo.setBlockId(map.get("blockId").toString()); |
| | | voUserInfo.setBlockName(map.get("blockName").toString()); |
| | | |
| | | /** |
| | | * 添加角色编号列表、角色名称列表、权限列表 |
| | |
| | | (password != null && !password.trim().equals("")) && |
| | | supperAdmin != null){ |
| | | BaUser po = new BaUser() ; |
| | | po.name = name ; |
| | | po.userName = name ; |
| | | po.phone = phone ; |
| | | po.password = MD5.encrypt(password) ;//进行加密码 ; |
| | | po.orgTag = orgTag ; |
| | |
| | | @GetMapping("test1") |
| | | public BaseResponse<BaUser> test1(){ |
| | | BaUser po = new BaUser() ; |
| | | po.id = System.currentTimeMillis() ; |
| | | po.name = "张三" ; |
| | | po.userId = System.currentTimeMillis() ; |
| | | po.userName = "张三" ; |
| | | po.phone = "13912345678" ; |
| | | |
| | | return BaseResponseUtils.buildSuccess(po); |
| | |
| | | package com.dy.pipIrrProject.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.support.ExcelTypeEnum; |
| | | import com.dy.common.aop.SsoAop; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取未绑控制器的取水口列表 |
| | | * @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 = "nobinding_intakes") |
| | | @SsoAop() |
| | | public BaseResponse<JSONArray> getNoBindingIntakes(){ |
| | | try { |
| | | JSONArray array = controllerSv.getNoBindingIntakes(); |
| | | if(array.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.NO_BINDING_INTAKE.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(array); |
| | | } catch (Exception e) { |
| | | log.error("查询控制器异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出控制器列表 |
| | | * @param response |
| | | * @param vo |
| | |
| | | package com.dy.pipIrrProject.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.voPr.VoController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | public class ControllerSv { |
| | | @Autowired |
| | | private PrControllerMapper prControllerMapper; |
| | | |
| | | @Autowired |
| | | private PrIntakeMapper prIntakeMapper; |
| | | |
| | | /** |
| | | * 根据指定获取控制器记录 |
| | |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据控制器编号获取未删除的控制器数量 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer getRecordCountOfController(Long controllerId) { |
| | | return prControllerMapper.getRecordCountOfController(controllerId); |
| | | } |
| | | /** |
| | | * 根据控制器编号获取已绑定记录数 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer getBindedCount(Long controllerId) { |
| | | return prControllerMapper.getBindedCount(controllerId); |
| | | } |
| | | |
| | | /** |
| | | * 根据主键删除外键 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer deleteIntakeId(Long controllerId) { |
| | | return prControllerMapper.deleteIntakeId(controllerId); |
| | | } |
| | | |
| | | /** |
| | | * 获取未绑控制器的取水口列表 |
| | | * @return |
| | | */ |
| | | public JSONArray getNoBindingIntakes() { |
| | | List<Map<String, Object>> list = Optional.ofNullable(prIntakeMapper.getNoBindingIntakes()).orElse(new ArrayList<>()); |
| | | JSONArray array= null; |
| | | if(list.size() > 0) { |
| | | array= JSONArray.parseArray(JSON.toJSONString(list)); |
| | | } |
| | | return array; |
| | | } |
| | | } |
| | |
| | | * @return 修改记录条数 |
| | | */ |
| | | public Integer updateByPrimaryKey(PrDivide po) { |
| | | return prDivideMapper.updateByPrimaryKey(po); |
| | | //return prDivideMapper.updateByPrimaryKey(po); |
| | | return prDivideMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author WuZeYu |
| | |
| | | @Slf4j |
| | | @Tag(name = "取水口管理", description = "取水口操作") |
| | | @RestController |
| | | @RequestMapping(path="intake") |
| | | @RequestMapping(path = "intake") |
| | | @RequiredArgsConstructor |
| | | public class IntakeCtrl { |
| | | private final IntakeSv intakeSv; |
| | | |
| | | /** |
| | | * 客户端请求得到所有取水口名字 |
| | | * |
| | | * @return 所有取水口名字 |
| | | */ |
| | | @Operation(summary = "获得全部取水口", description = "返回全部取水口数据") |
| | |
| | | }) |
| | | @GetMapping(path = "all") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<PrIntake>>> all(){ |
| | | public BaseResponse<QueryResultVo<List<PrIntake>>> all() { |
| | | try { |
| | | QueryResultVo<List<PrIntake>> res = this.intakeSv.selectAll(); |
| | | if(res == null) { |
| | | if (res == null) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.NO_INTAKES.getMessage()); |
| | | }else { |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("查询取水口异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到一个取水口数据 |
| | | * |
| | | * @return 一个取水口数据 |
| | | */ |
| | | @Operation(summary = "一个取水口", description = "得到一个取水口数据") |
| | |
| | | }) |
| | | @GetMapping(path = "one/{id}") |
| | | @SsoAop() |
| | | public BaseResponse<PrIntake> one(@PathVariable("id") Long id){ |
| | | if(this.intakeSv.selectById(id) == null) { |
| | | public BaseResponse<PrIntake> one(@PathVariable("id") Long id) { |
| | | if (this.intakeSv.selectById(id) == null) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.NO_INTAKES.getMessage()); |
| | | }else { |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(this.intakeSv.selectById(id)); |
| | | } |
| | | } |
| | |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "getIntakes", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @GetMapping(path = "getIntakes") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getIntakes(@RequestBody @Parameter(description = "查询form表单json数据", required = true) QueryVo vo){ |
| | | public BaseResponse<QueryResultVo<List<VoIntake>>> getIntakes(QueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntake>> res = intakeSv.getIntakes(vo); |
| | | if(res == null) { |
| | | if (res == null) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.NO_INTAKES.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取取水口记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | @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 PrIntake po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> add(@RequestBody @Valid PrIntake po, @Parameter(hidden = true) BindingResult bindingResult) { |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Date operateTime = new Date(); |
| | | po.setOperateDt(operateTime); |
| | | po.setDeleted((byte)0); |
| | | Integer rec = Optional.ofNullable(intakeSv.addIntake(po)).orElse(0); |
| | | if(rec == 0) { |
| | | if (rec == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.ADD_INTAKE_FAIL.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * 编辑修改取水口 |
| | | * |
| | | * @param po 保存取水口form表单对象 |
| | | * @return 是否成功 |
| | | */ |
| | |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid PrIntake po, @Parameter(hidden = true) BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid PrIntake po, @Parameter(hidden = true) BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | int count; |
| | |
| | | count = this.intakeSv.update(po); |
| | | } catch (Exception e) { |
| | | log.error("保存分水口异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if(count <= 0){ |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.UPDATE_INTAKE.getMessage()) ; |
| | | }else{ |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.UPDATE_INTAKE.getMessage()); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除取水口 |
| | | * @param id 取水口ID |
| | | * |
| | | * @param map 取水口ID |
| | | * @return 是否成功 |
| | | */ |
| | | @Operation(summary = "删除分水口", description = "提交取水口ID,进行逻辑删除") |
| | |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "delete/{id}") |
| | | @PostMapping(path = "delete") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> delete(@PathVariable("id") Long id){ |
| | | if(id == null ){ |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.PLEASE_INPUT_INTAKE_ID.getMessage()) ; |
| | | public BaseResponse<Boolean> delete(@RequestBody Map map) { |
| | | if (map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.PLEASE_INPUT_INTAKE_ID.getMessage()); |
| | | } |
| | | int count; |
| | | Long id = Long.parseLong(map.get("id").toString()); |
| | | try { |
| | | count = this.intakeSv.delete(id); |
| | | //取水口ID |
| | | Integer recordCount = Optional.ofNullable(intakeSv.delete(id)).orElse(0); |
| | | if (recordCount == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.DELETE_INTAKE_FAIL.getMessage()); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("保存分水口异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if(count <= 0){ |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.DELETE_INTAKE_FAIL.getMessage()) ; |
| | | }else{ |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 导出取水口列表 |
| | | * |
| | | * @param response |
| | | * @param vo |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 导入取水口列表 |
| | | * |
| | | * @param file |
| | | */ |
| | | @SneakyThrows |
| | |
| | | .head(VoIntake.class) |
| | | .sheet() |
| | | .doReadSync(); |
| | | return BaseResponseUtils.buildSuccess(memberList) ; |
| | | return BaseResponseUtils.buildSuccess(memberList); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.dy.pipIrrProject.intake; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoPr.PrDivideMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntake; |
| | | import com.dy.pipIrrGlobal.voPr.VoIntake; |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | |
| | | public class IntakeSv { |
| | | @Autowired |
| | | private PrIntakeMapper prIntakeMapper; |
| | | @Autowired |
| | | private PrDivideMapper prDivideMapper; |
| | | |
| | | /** |
| | | * 添加取水口 |
| | |
| | | */ |
| | | @Transactional |
| | | Integer addIntake(PrIntake po) { |
| | | if (po.getTownId()==null||po.getTownId()==0) |
| | | { |
| | | Long townId=getSupperByVillageId(po.getVillageId()); |
| | | po.setTownId(townId); |
| | | Long villageId = Optional.ofNullable(po.getVillageId()).orElse(0L); |
| | | |
| | | if (villageId != 0){ |
| | | if (po.getTownId() == null || po.getTownId() == 0) { |
| | | Long townId = getSupperByVillageId(po.getVillageId()); |
| | | po.setTownId(townId); |
| | | } |
| | | if (po.getCountyId() == null || po.getCountyId() == 0) { |
| | | Long countyId = getSupperByVillageId(getSupperByVillageId(po.getVillageId())); |
| | | po.setCountyId(countyId); |
| | | } |
| | | } |
| | | if (po.getCountyId()==null||po.getCountyId()==0) |
| | | { |
| | | Long countyId=getSupperByVillageId(getSupperByVillageId(po.getVillageId())); |
| | | po.setCountyId(countyId); |
| | | if (po.getBlockId() == null || po.getBlockId() == 0) { |
| | | Long blockId = prDivideMapper.getBlockIdById(po.getDivideId()); |
| | | po.setBlockId(blockId); |
| | | } |
| | | return prIntakeMapper.insertSelective(po); |
| | | } |
| | | public Long getSupperByVillageId(long vaId){ |
| | | |
| | | public Long getSupperByVillageId(long vaId) { |
| | | return prIntakeMapper.getSupperByVillageId(vaId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存修改实体 |
| | | * |
| | | * @param po 实体 |
| | | * @return 数量 |
| | | */ |
| | | |
| | | public int update(PrIntake po){ |
| | | if (po.getTownId()==null||po.getTownId()==0) |
| | | { |
| | | Long townId=getSupperByVillageId(po.getVillageId()); |
| | | public int update(PrIntake po) { |
| | | if (po.getTownId() == null || po.getTownId() == 0) { |
| | | Long townId = getSupperByVillageId(po.getVillageId()); |
| | | po.setTownId(townId); |
| | | } |
| | | if (po.getCountyId()==null||po.getCountyId()==0) |
| | | { |
| | | Long countyId=getSupperByVillageId(getSupperByVillageId(po.getVillageId())); |
| | | if (po.getCountyId() == null || po.getCountyId() == 0) { |
| | | Long countyId = getSupperByVillageId(getSupperByVillageId(po.getVillageId())); |
| | | po.setCountyId(countyId); |
| | | } |
| | | return this.prIntakeMapper.updateByPrimaryKeySelective(po) ; |
| | | return this.prIntakeMapper.updateByPrimaryKeySelective(po); |
| | | // return this.prIntakeMapper.updateByPrimaryKey(po); |
| | | } |
| | | |
| | |
| | | * @return 取水口记录列表 |
| | | */ |
| | | public QueryResultVo<List<VoIntake>> getIntakes(QueryVo queryVo) { |
| | | // String isBinded = queryVo.getIsBinded(); |
| | | // |
| | | // if(isBinded == null || isBinded.length() <= 0) { |
| | | // |
| | | // } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | Long itemTotal = prIntakeMapper.getRecordCount(params); |
| | | |
| | |
| | | |
| | | /** |
| | | * 得到所有取水口 |
| | | * |
| | | * @return 所有取水口集合 |
| | | */ |
| | | public QueryResultVo<List<PrIntake>> selectAll() { |
| | | QueryResultVo<List<PrIntake>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.obj = this.prIntakeMapper.selectAll() ; |
| | | return rsVo ; |
| | | QueryResultVo<List<PrIntake>> rsVo = new QueryResultVo<>(); |
| | | rsVo.obj = this.prIntakeMapper.selectAll(); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 得到一个取水口 |
| | | * |
| | | * @param id 取水口ID |
| | | * @return 取水口实体 |
| | | */ |
| | | public PrIntake selectById(Long id) { |
| | | return this.prIntakeMapper.selectByPrimaryKey(id) ; |
| | | return this.prIntakeMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | /** |
| | | * 逻辑删除实体 |
| | | * |
| | | * @param id 实体ID |
| | | * @return 数量 |
| | | */ |
| | | @Transactional |
| | | public int delete(Long id){ |
| | | return this.prIntakeMapper.deleteLogicById(id) ; |
| | | public int delete(Long id) { |
| | | return this.prIntakeMapper.deleteLogicById(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据取水口编号获取未删除的取水口数量 |
| | | * |
| | | * @param intakeId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据村Id获取全部地址 |
| | | * |
| | | * @param villageId 村Id |
| | | * @return address 全部五级地址 |
| | | * @return address 全部五级地址 |
| | | */ |
| | | public String getAddressByVillageId(long villageId){ |
| | | public String getAddressByVillageId(long villageId) { |
| | | return prIntakeMapper.getAddressByVillageId(villageId); |
| | | } |
| | | |
| | | /** |
| | | * 根据区域Id获取区域等级 |
| | | * |
| | | * @param regionId 区域Id |
| | | * @return Level 区域等级 |
| | | * @return Level 区域等级 |
| | | */ |
| | | public int getLevelByRegionId(long regionId){ |
| | | public int getLevelByRegionId(long regionId) { |
| | | return prIntakeMapper.getLevelByRegionId(regionId); |
| | | } |
| | | } |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author wuzeyu |
| | | * @date 2023/12/26 11:12 |
| | | * @LastEditTime 2023/12/26 11:12 |
| | | * @Description 取水口 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | |
| | | public String blockName; |
| | | |
| | | @Schema(description = "是否绑定设备") |
| | | public String isBind; |
| | | //0未绑定 1已绑定 |
| | | public Integer isBinded; |
| | | |
| | | @Schema(description = "地址") |
| | | public String address; |
| | |
| | | public static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 取水口编号 |
| | | * 取水口ID |
| | | */ |
| | | @Schema(description = "取水口ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "取水口ID不能为空") |
| | | private Long intakeId; |
| | | |
| | | /** |
| | | * 控制器编号 |
| | | * 控制器ID |
| | | */ |
| | | @Schema(description = "控制器ID", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "控制器ID不能为空") |
| | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntakeController; |
| | | import com.dy.pipIrrProject.controller.ControllerSv; |
| | | import com.dy.pipIrrProject.intake.IntakeSv; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | private final ControllerSv controllerSv; |
| | | |
| | | /** |
| | | * 添加取水口/控制器捆绑记录 |
| | | * 若取水口或控制器不存在需提示用户 |
| | | * 若取水口已经与控制器绑定需提示用户 |
| | | * 取水口绑定控制器 |
| | | * 1. 接收取水口ID及流浪控制器ID,并验证取水口和控制器是否存在 |
| | | * 2. 判断该控制器是否存在未解绑记录,如果存在提示用户该控制器存在未解绑记录 |
| | | * 3. 组装控制器对象插入控制器表中 |
| | | * 4. 添加绑定记录 |
| | | * 5. 删除流浪控制器(物理删除) |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加绑定记录", description = "添加绑定记录") |
| | | @ApiResponses(value = { |
| | |
| | | @PostMapping(path = "bind", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> bind(@RequestBody @Valid DtoIntakeController po, BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> bind(@RequestBody @Valid DtoIntakeController po, BindingResult bindingResult) throws ParseException { |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | // 根据编号分别获取取水口、控制器未删除记录数 |
| | | Integer recIntke = Optional.ofNullable(intakeSv.getRecordCountOfIntake(po.getIntakeId())).orElse(0); |
| | | Integer recController = Optional.ofNullable(controllerSv.getRecordCountOfController(po.getControllerId())).orElse(0); |
| | | if(recIntke == 0 || recController == 0) { |
| | | // 接收参数 |
| | | Long intakeId = po.getIntakeId(); |
| | | Long controllerId = po.getControllerId(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | |
| | | // 根据编号分别获取取水口记录数、流浪控制器信息,判断取水口及控制器是否存在 |
| | | Integer recIntke = Optional.ofNullable(intakeSv.getRecordCountOfIntake(intakeId)).orElse(0); |
| | | PrControllerTramp prControllerTramp = intakeControllerSv.getTrampControllerInfo(controllerId); |
| | | //Map map_TrampController = Optional.ofNullable(intakeControllerSv.getTrampControllerInfo(controllerId)).orElse(new HashMap()); |
| | | if(recIntke == 0 || prControllerTramp == null) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_OR_CONTROLLER_NO_EXIST.getMessage()); |
| | | } |
| | | |
| | | Integer recordCount = Optional.ofNullable(intakeControllerSv.getBindRecordCount(po.getIntakeId(), po.getControllerId(), (byte)1)).orElse(0); |
| | | if(recordCount > 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_HAS_BINDED_CONTROLLER.getMessage()); |
| | | // 根据控制器编号判断该控制器是否存在未解绑记录 |
| | | Integer recBinded = Optional.ofNullable(controllerSv.getBindedCount(controllerId)).orElse(0); |
| | | if(recBinded > 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.CONTROLLER_BINDED.getMessage()); |
| | | } |
| | | |
| | | PrIntakeController prIntakeController = DtoToPojo.INSTANCT.po2vo(po); |
| | | // 添加控制器记录 |
| | | PrController prController = new PrController(); |
| | | prController.setIntakeId(intakeId); |
| | | prController.setRtuAddr(prControllerTramp.getRtuAddr()); |
| | | prController.setProtocol(prControllerTramp.getProtocol()); |
| | | prController.setFindDt(prControllerTramp.getFindDt()); |
| | | prController.setAddWays((byte)1); |
| | | prController.setOperator(operator); |
| | | Date operateTime = new Date(); |
| | | prController.setOperateDt(operateTime); |
| | | prController.setDeleted((byte)0); |
| | | Integer rec_addController = Optional.ofNullable(controllerSv.addController(prController)).orElse(0); |
| | | if(rec_addController == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage()); |
| | | } |
| | | |
| | | // 添加绑定记录 |
| | | PrIntakeController prIntakeController = DtoToPojo.INSTANCT.po2vo(po); |
| | | prIntakeController.setOperatedt(operateTime); |
| | | prIntakeController.setOperatetype((byte)1); |
| | | |
| | | Integer rec = Optional.ofNullable(intakeControllerSv.addRecord(prIntakeController)).orElse(0); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage()); |
| | | } |
| | | |
| | | // 根据流浪控制器编号删除流浪控制器记录 |
| | | intakeControllerSv.deleteTrampController(controllerId); |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 添加取水口/控制器解绑记录 |
| | | * 1. 判断取水口是否存在 |
| | | * 2. 判断控制器是否存在 |
| | | * 3. 判断取水口、控制器解绑关系是否已存在 |
| | | * 取水口解绑控制器 |
| | | * 1. 接收取水口ID及流浪控制器ID,并验证取水口和控制器是否存在 |
| | | * 2. 添加解绑记录 |
| | | * 3. 删除控制器外键 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @Operation(summary = "添加解绑记录", description = "添加解绑记录") |
| | | @ApiResponses(value = { |
| | |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_OR_CONTROLLER_NO_EXIST.getMessage()); |
| | | } |
| | | |
| | | Integer recordCount = Optional.ofNullable(intakeControllerSv.getBindRecordCount(po.getIntakeId(), po.getControllerId(), (byte)2)).orElse(0); |
| | | if(recordCount > 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_CONTROLLER_HAS_UNBOUND.getMessage()); |
| | | } |
| | | // 判断最后操作记录是否为解绑记录 |
| | | //Integer recordCount = Optional.ofNullable(intakeControllerSv.getBindRecordCount(po.getIntakeId(), po.getControllerId(), (byte)2)).orElse(0); |
| | | //if(recordCount > 0) { |
| | | // return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_CONTROLLER_HAS_UNBOUND.getMessage()); |
| | | //} |
| | | |
| | | // 添加解绑记录 |
| | | PrIntakeController prIntakeController = DtoToPojo.INSTANCT.po2vo(po); |
| | | Date operateTime = new Date(); |
| | | prIntakeController.setOperatedt(operateTime); |
| | | prIntakeController.setOperatetype((byte)2); |
| | | |
| | | Integer rec = Optional.ofNullable(intakeControllerSv.addRecord(prIntakeController)).orElse(0); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage()); |
| | | } |
| | | |
| | | // 删除控制器外键 |
| | | Integer rec_deleteIntakeId = Optional.ofNullable(controllerSv.deleteIntakeId(po.getControllerId())).orElse(0); |
| | | if(rec_deleteIntakeId == 0) { |
| | | return BaseResponseUtils.buildFail(ProjectResultCode.BIND_FAIL.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | |
| | | package com.dy.pipIrrProject.intakeController; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerTrampMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrIntakeControllerMapper; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntakeController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public class IntakeControllerSv { |
| | | @Autowired |
| | | private PrIntakeControllerMapper prIntakeControllerMapper; |
| | | |
| | | @Autowired |
| | | private PrControllerTrampMapper prControllerTrampMapper; |
| | | |
| | | /** |
| | | * 根据取水口编号、控制器编号、操作类别获取记录数量 |
| | |
| | | List<Map<String, Object>> getBindsByControllerId(Long controllerId) { |
| | | return prIntakeControllerMapper.getBindsByControllerId(controllerId); |
| | | } |
| | | |
| | | /** |
| | | * 根据控制器编号获取流浪控制器地址 |
| | | * @param controllerId 流浪控制器编号 |
| | | * @return 流浪控制器地址 |
| | | */ |
| | | //public String getTrampRtuAddr(Long controllerId) { |
| | | // return prControllerTrampMapper.getTrampRtuAddr(controllerId); |
| | | //} |
| | | |
| | | /** |
| | | * 根据控制器编号获取流浪控制器信息 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public PrControllerTramp getTrampControllerInfo(Long controllerId) { |
| | | return prControllerTrampMapper.getTrampControllerInfo(controllerId); |
| | | } |
| | | |
| | | /** |
| | | * 根据流浪控制器编号删除流浪控制器记录 |
| | | * @param controllerId |
| | | * @return |
| | | */ |
| | | public Integer deleteTrampController(Long controllerId) { |
| | | return prControllerTrampMapper.deleteByPrimaryKey(controllerId); |
| | | } |
| | | } |
| | |
| | | UPDATE_INTAKE(20003, "修改取水口数据失败"), |
| | | PLEASE_INPUT_INTAKE_ID(20004, "取水口编号不为空"), |
| | | DELETE_INTAKE_FAIL(20005, "取水口删除失败"), |
| | | NO_BINDING_INTAKE(20006, "没有未绑定的取水口"), |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | INTAKE_NO_RECORDS(40004, "该取水口无绑定记录"), |
| | | CONTROLLER_NO_RECORDS(40005, "该控制器无绑定记录"), |
| | | INTAKE_OR_CONTROLLER_NO_EXIST(40006, "取水口或控制器不存在"), |
| | | CONTROLLER_BINDED(40007, "该控制器尚未解绑"), |
| | | |
| | | /** |
| | | * 流量监测站 |
| | |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.util.Constant; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | |
| | | //String clientNum = ""; |
| | | Long clientId = 0L; |
| | | Integer cardCost = po.getCardCost(); |
| | | Double reissueAmount = po.getReissueAmount(); |
| | | Float reissueAmount = po.getReissueAmount(); |
| | | Long paymentId = po.getPaymentId(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | |
| | | activeCard.setCardcost(cardCost); |
| | | activeCard.setPaymentid(paymentId); |
| | | activeCard.setReissueamount(reissueAmount); |
| | | activeCard.setOperatetype(OperateTypeENUM.REPLACE.getCode()); |
| | | activeCard.setOperatetype(OperateTypeENUM.REISSUE.getCode()); |
| | | activeCard.setRemarks(remarks); |
| | | activeCard.setOperator(operator); |
| | | activeCard.setOperatedt(replaceTime); |
| | |
| | | */ |
| | | @Schema(description = "补卡金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="补卡金额不能小于0") |
| | | private Double reissueAmount; |
| | | private Float reissueAmount; |
| | | |
| | | /** |
| | | * 支付方式编号 |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate; |
| | | |
| | | 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.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.util.Constant; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCardNew; |
| | | import com.dy.pipIrrGlobal.voSe.VoRecharge; |
| | | import com.dy.pipIrrGlobal.voSe.VoReissueCard; |
| | | import com.dy.pipIrrSell.cardOperate.converter.RechargeDtoMapper; |
| | | import com.dy.pipIrrSell.cardOperate.dto.*; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrSell.cardOperate.qo.*; |
| | | import com.dy.pipIrrSell.clientCard.CardStateENUM; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.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.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-18 19:36 |
| | | * @LastEditTime 2024-01-18 19:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Tag(name = "水卡操作管理", description = "水卡各种操作") |
| | | @RestController |
| | | @RequestMapping(path="card") |
| | | @RequiredArgsConstructor |
| | | public class CardOperateCtrl { |
| | | private final CardOperateSv cardOperateSv; |
| | | private final ClientCardSv clientCardSv; |
| | | |
| | | /** |
| | | * 开卡 |
| | | * @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 = "active", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_active(@RequestBody @Valid DtoActiveCard po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 获取5级行政区划串areaCode |
| | | String areaCode = String.valueOf(cardOperateSv.getAreaCodeByNum(po.getClientNum())); |
| | | |
| | | /** |
| | | * 根据行政区划串(areaCode)在水卡表中针对水卡编号(cardNum)进行模糊查询 |
| | | * 如果4位顺序号已经达到最大值,提示用户联系系统管理员 |
| | | * 如果4位顺序号未达到最大值,则加1 |
| | | * cardNum为新的卡号 |
| | | */ |
| | | String cardNum = Optional.ofNullable(cardOperateSv.getCardNumOfMax(areaCode)).orElse(""); |
| | | if(cardNum != null && cardNum.trim().length() > 0) { |
| | | Integer number = Integer.parseInt(cardNum.substring(12)); |
| | | number = number + 1; |
| | | if(number > 9999) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_OVERRUN.getMessage()); |
| | | } |
| | | cardNum = cardNum.substring(0, 12) + String.format("%04d", number); |
| | | } else { |
| | | cardNum = areaCode + "0001"; |
| | | } |
| | | |
| | | /** |
| | | * cardAddr 水卡地址(仅仅写入,无业务) |
| | | * clientNum 农户编号 |
| | | * cardCost 卡片费用 |
| | | * amount 充值金额 |
| | | * reissueAmount 补卡金额,补卡时使用 |
| | | * paymentId 支付方式编号 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * activeTime 开卡时间 |
| | | */ |
| | | String cardAddr = po.getCardAddr(); |
| | | String clientNum = po.getClientNum(); |
| | | Integer cardCost = po.getCardCost(); |
| | | Float amount = po.getAmount(); |
| | | Long paymentId = po.getPaymentId(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date activeTime = new Date(); |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID |
| | | */ |
| | | Long clientId = cardOperateSv.getClientIdByNum(clientNum); |
| | | |
| | | /** |
| | | * 添加农户卡记录 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setCardaddr(cardAddr); |
| | | seClientCard.setCardnum(cardNum); |
| | | seClientCard.setClientid(clientId); |
| | | seClientCard.setMoney(0f); |
| | | seClientCard.setState(CardStateENUM.NORMAL.getCode()); |
| | | seClientCard.setCreatedt(activeTime); |
| | | seClientCard.setLastoper(LastOperateENUM.ACTIVE.getCode()); |
| | | |
| | | Long cardId = Optional.ofNullable(clientCardSv.add(seClientCard)).orElse(0L) ; |
| | | if(cardId == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加开卡记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setCardCost(cardCost); |
| | | seCardOperate.setPaymentId(paymentId); |
| | | seCardOperate.setOperateType(OperateTypeENUM.ACTIVE.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(activeTime); |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_WRITE_ACTIVE_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 如果操作人员开卡时输入了充值金额,则开卡后调用充值功能 |
| | | */ |
| | | po.setCardNum(cardNum); |
| | | if(amount != null && amount > 0) { |
| | | po.setClientId(clientId); |
| | | DtoRecharge dtoRecharge = RechargeDtoMapper.INSTANCT.po2vo(po); |
| | | dtoRecharge.setMoney(0f); |
| | | dtoRecharge.setGift(0f); |
| | | dtoRecharge.setPrice(0f); |
| | | BaseResponse<Boolean> job = cardOperateSv.addRecharge(dtoRecharge); |
| | | if(!job.getCode().equals("0001")) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.ACTIVE_FAIL_RECHARGE_EXCEPTION.getMessage()); |
| | | } |
| | | } |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("projectCode", Constant.projectCode_ym); |
| | | map.put("cardNum", cardNum); |
| | | return BaseResponseUtils.buildSuccess(map) ; |
| | | } |
| | | |
| | | /** |
| | | * 补卡 |
| | | * @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 = "reissue", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_reissue(@RequestBody @Valid DtoReissue po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardAddr 新的水卡地址(仅仅写入,无业务) |
| | | * clientNum 农户编号,开新卡使用,通过老卡号获取 |
| | | * cardNum 水卡编号,传入的是老卡号,返回的是新卡号 |
| | | * moeny 余额,挂失时使用 |
| | | * cardCost 卡片费用 |
| | | * paymentId 支付方式编号 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | */ |
| | | |
| | | String cardAddr = po.getCardAddr(); |
| | | String clientNum = ""; |
| | | String cardNum = po.getCardNum(); |
| | | Float money = po.getMoney(); |
| | | Integer cardCost = po.getCardCost(); |
| | | Long paymentId = po.getPaymentId(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | clientNum = map.get("clientNum").toString(); |
| | | |
| | | /** |
| | | * 添加挂失记录 |
| | | */ |
| | | DtoLoss dtoLoss = new DtoLoss(); |
| | | dtoLoss.setCardNum(cardNum); |
| | | dtoLoss.setMoney(money); |
| | | dtoLoss.setRefund(0f); |
| | | dtoLoss.setRemarks(remarks); |
| | | dtoLoss.setOperator(operator); |
| | | BaseResponse<java.lang.Boolean> baseResponse_addLoss = this.add_loss(dtoLoss, null); |
| | | |
| | | if(!baseResponse_addLoss.getCode().equals("0001")) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加开卡记录 |
| | | */ |
| | | DtoActiveCard dtoActiveCard = new DtoActiveCard(); |
| | | dtoActiveCard.setCardAddr(cardAddr); |
| | | dtoActiveCard.setClientNum(clientNum); |
| | | dtoActiveCard.setCardCost(cardCost); |
| | | dtoActiveCard.setAmount(0f); |
| | | dtoActiveCard.setPaymentId(paymentId); |
| | | dtoActiveCard.setRemarks(remarks); |
| | | dtoActiveCard.setOperator(operator); |
| | | BaseResponse<java.lang.Boolean> baseResponse_addActive = add_active(dtoActiveCard, null); |
| | | |
| | | if(!baseResponse_addActive.getCode().equals("0001")) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage()); |
| | | } |
| | | |
| | | String theContent = String.valueOf(baseResponse_addActive.getContent()); |
| | | cardNum = theContent.substring(theContent.indexOf("=") + 1, theContent.indexOf(",")); |
| | | |
| | | Map map_response = new HashMap(); |
| | | map_response.put("projectCode", Constant.projectCode_ym); |
| | | map_response.put("cardNum", cardNum); |
| | | return BaseResponseUtils.buildSuccess(map_response) ; |
| | | } |
| | | |
| | | /** |
| | | * 充值 |
| | | * @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 = "recharge", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_recharge(@RequestBody @Valid DtoRecharge po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | return cardOperateSv.addRecharge(po); |
| | | } |
| | | |
| | | /** |
| | | * 销卡 |
| | | * @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 = "cancel", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_cancel(@RequestBody @Valid DtoCancel po, BindingResult bindingResult){ |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡编号 |
| | | * refund 退款金额 |
| | | * refundType 退款方式 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * cancelTime 注销时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Float refund = po.getRefund(); |
| | | Byte refundType = po.getRefundType(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date cancelTime = new Date(); |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | 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) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加注销记录 |
| | | * 支付方式为现金 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setTradeAmount(-refund); |
| | | seCardOperate.setPaymentId(1L); |
| | | seCardOperate.setOperateType(OperateTypeENUM.CANCEL.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(cancelTime); |
| | | |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CANCEL_FAIL_WRITE_CANCELL_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 挂失 |
| | | * @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 = "loss", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_loss(@RequestBody @Valid DtoLoss po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡编号 |
| | | * money 余额 |
| | | * refund 退款金额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * lossTime 挂失时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Float money = po.getMoney(); |
| | | Float refund = po.getRefund(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date lossTime = new Date(); |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | 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) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.LOSS_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加挂失记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(money); |
| | | seCardOperate.setTradeAmount(-refund); |
| | | seCardOperate.setOperateType(OperateTypeENUM.LOSS.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(lossTime); |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.LOSS_FAIL_WRITE_LOSS_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 冲正 |
| | | * @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 = "reversal", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_reversal(@RequestBody @Valid DtoReversal po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡编号 |
| | | * cardBalance 卡片余额 |
| | | * systemBalance 系统余额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * reversalTime 冲正时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Float cardBalance = po.getCardBalance(); |
| | | Float systemBalance = po.getSystemBalance(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date reversalTime = new Date(); |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | 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) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加冲正记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(cardBalance); |
| | | seCardOperate.setSystemBalance(systemBalance); |
| | | seCardOperate.setOperateType(OperateTypeENUM.REVERSAL.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(reversalTime); |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.REVERSAL_FAIL_WRITE_REVERSAL_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 补扣 |
| | | * @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 = "refund", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_refund(@RequestBody @Valid DtoRefund po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardNum反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡编号 |
| | | * money 卡片余额 |
| | | * refund 补扣余额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * refundTime 补扣时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Float money = po.getMoney(); |
| | | Float refund = po.getRefund(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date refundTime = new Date(); |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setRefunddt(refundTime); |
| | | seClientCard.setMoney(money + refund); |
| | | seClientCard.setLastoper(LastOperateENUM.REFUND.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加补扣记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(money); |
| | | seCardOperate.setNoTradeAmount(refund); |
| | | seCardOperate.setOperateType(OperateTypeENUM.REFUND.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(refundTime); |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.REFUND_FAIL_WRITE_REFUND_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 解锁 |
| | | * @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 = "unlock", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> add_unlock(@RequestBody @Valid DtoUnlock po, BindingResult bindingResult){ |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * cardId 水卡编号(非传入参数,由cardAddr反查,修改农户卡使用) |
| | | * clientId 农户编号(非传入参数,由cardNum反查) |
| | | * cardNum 水卡地址 |
| | | * money 余额 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * unlockTime 解锁时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Float money = po.getMoney(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date unlockTime = new Date(); |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("已挂失")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 挂失时间 |
| | | * 最后操作类型-4 |
| | | */ |
| | | SeClientCard seClientCard = new SeClientCard(); |
| | | seClientCard.setId(cardId); |
| | | seClientCard.setUnlockdt(unlockTime); |
| | | seClientCard.setMoney(money); |
| | | seClientCard.setState(CardStateENUM.NORMAL.getCode()); |
| | | seClientCard.setLastoper(LastOperateENUM.UNLOCK.getCode()); |
| | | Integer rec_updateClientCard = Optional.ofNullable(clientCardSv.UpdateClientCard(seClientCard)).orElse(0); |
| | | if(rec_updateClientCard == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加解锁记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(money); |
| | | seCardOperate.setOperateType(OperateTypeENUM.UNLOCK.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(unlockTime); |
| | | Long rec = Optional.ofNullable(cardOperateSv.add(seCardOperate)).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.UNLOCK_FAIL_WRITE_UNLOCK_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | /** |
| | | * 获取充值记录 |
| | | * @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 = VoRecharge.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getRecharges") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QoRecharge vo){ |
| | | try { |
| | | QueryResultVo<List<VoRecharge>> res = cardOperateSv.getRecharges(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 = "getTransactions") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getOperates(QoTransaction vo){ |
| | | try { |
| | | Map res = cardOperateSv.getTransactions(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(QoTransactionStatistics vo){ |
| | | try { |
| | | Map res = cardOperateSv.getTransactionStatistics(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 = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getActiveCards") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoActiveCardNew>>> getActiveCards(QoActiveCard vo){ |
| | | try { |
| | | QueryResultVo<List<VoActiveCardNew>> res = cardOperateSv.getActiveCards(vo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.No_ActiveCards.getMessage()); |
| | | } |
| | | 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 = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getReissueCards") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoReissueCard>>> getReissueCards(QoReissueCard vo){ |
| | | try { |
| | | QueryResultVo<List<VoReissueCard>> res = cardOperateSv.getReissueCards(vo); |
| | | if(res.itemTotal == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.No_ReissueCards.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取补卡记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | | import com.dy.pipIrrSell.cardOperate.qo.*; |
| | | import com.dy.pipIrrSell.clientCard.ClientCardSv; |
| | | import com.dy.pipIrrSell.clientCard.LastOperateENUM; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | | 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.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-18 19:36 |
| | | * @LastEditTime 2024-01-18 19:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class CardOperateSv { |
| | | @Autowired |
| | | private SeCardOperateMapper seCardOperateMapper; |
| | | |
| | | @Autowired |
| | | private SeClientCardMapper seClientCardMapper; |
| | | |
| | | @Autowired |
| | | private SeClientMapper seClientMapper; |
| | | |
| | | @Autowired |
| | | private ClientCardSv clientCardSv; |
| | | |
| | | |
| | | /** |
| | | * 添加开卡记录 |
| | | * @param po 水卡操作对象 |
| | | * @return 开卡记录主键 |
| | | */ |
| | | public Long activeCard(SeCardOperate po) { |
| | | seCardOperateMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取5级行政区划代码,开卡使用 |
| | | * @param clientNum 农户编号 |
| | | * @return 5级行政区划代码 |
| | | */ |
| | | public Long getAreaCodeByNum(String clientNum) { |
| | | return seClientMapper.getAreaCodeByNum(clientNum); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | public Long getAreaCodeById(Long clientId) { |
| | | return seClientMapper.getAreaCodeById(clientId); |
| | | } |
| | | /** |
| | | * 根据行政区划串模块查询水卡编号,开卡使用 |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | String getCardNumOfMax(String areaCode) { |
| | | return seClientCardMapper.getCardNumOfMax(areaCode); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID,开卡使用 |
| | | * @param clientNum |
| | | * @return |
| | | */ |
| | | public Long getClientIdByNum(String clientNum) { |
| | | return seClientMapper.getClientIdByNum(clientNum); |
| | | } |
| | | |
| | | /** |
| | | * 添加水卡操作对象,各操作都使用 |
| | | * @param po 水卡操作对象 |
| | | * @return 操作记录主键 |
| | | */ |
| | | public Long add(SeCardOperate po) { |
| | | seCardOperateMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 添加充值记录 |
| | | * 修改农户信息、添加充值记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public BaseResponse<Boolean> addRecharge(DtoRecharge po){ |
| | | /** |
| | | * cardId 水卡编号(依据水卡编号获取) |
| | | * clientId 农户编号(依据水卡编号获取) |
| | | * cardNum 水卡编号 |
| | | * money 卡片余额 |
| | | * amount 充值金额 |
| | | * gift 赠送金额 |
| | | * afterRecharge 充值后余额 |
| | | * paymentId 支付方式编号 |
| | | * price 水价 |
| | | * remarks 备注 |
| | | * operator 操作人编号 |
| | | * rechargeTime 充值时间 |
| | | */ |
| | | Long cardId = 0L; |
| | | Long clientId = 0L; |
| | | String cardNum = po.getCardNum(); |
| | | Float money = po.getMoney(); |
| | | Float amount = po.getAmount(); |
| | | Float gift = po.getGift(); |
| | | Float afterRecharge = money + amount + gift; |
| | | Long paymentId = po.getPaymentId(); |
| | | Float price = po.getPrice(); |
| | | String remarks = po.getRemarks(); |
| | | Long operator = po.getOperator(); |
| | | Date rechargeTime = new Date(); |
| | | |
| | | |
| | | // 验证水卡状态是否支持当前操作 |
| | | String stateName = Optional.ofNullable(clientCardSv.getCardStateByCardNum(Long.parseLong(cardNum))).orElse(""); |
| | | if(stateName.length() == 0 || !stateName.equals("正常")) { |
| | | return BaseResponseUtils.buildFail(stateName + ", " + SellResultCode.THE_CARD_NOT_SUPPORT_THIS_OPERATION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡编号获取水卡表主键及农户编号 |
| | | */ |
| | | Map map = Optional.ofNullable(clientCardSv.getCardIdAndClientNum(cardNum)).orElse(new HashMap()); |
| | | if(map == null || map.size() <= 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.CARD_NUMBER_MISTAKE.getMessage()); |
| | | } |
| | | cardId = Long.parseLong(map.get("cardId").toString()); |
| | | clientId = Long.parseLong(map.get("clientId").toString()); |
| | | |
| | | /** |
| | | * 修改农户卡信息: |
| | | * 补卡时间 |
| | | * 最后操作类型-2 |
| | | */ |
| | | 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); |
| | | if(rec_updateClientCard == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL_WRITE_CLIENT_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加充值记录 |
| | | */ |
| | | SeCardOperate seCardOperate = new SeCardOperate(); |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(money); |
| | | seCardOperate.setTradeAmount(amount); |
| | | seCardOperate.setGift(gift); |
| | | seCardOperate.setOperateType(OperateTypeENUM.RECHARGE.getCode()); |
| | | seCardOperate.setPaymentId(paymentId); |
| | | seCardOperate.setPrice(price); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | | seCardOperate.setOperateDt(rechargeTime); |
| | | |
| | | seCardOperateMapper.insert(seCardOperate); |
| | | Long rec = Optional.ofNullable(seCardOperate.getId()).orElse(0L); |
| | | if(rec == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.REPLACE_FAIL_WRITE_RECHARGE_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取充值记录 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoRecharge>> getRecharges(QoRecharge queryVo) { |
| | | //完善查询充值记录的起止时间 |
| | | String rechargeTimeStart = queryVo.rechargeTimeStart; |
| | | String rechargeTimeStop = queryVo.rechargeTimeStop; |
| | | if(rechargeTimeStart != null) { |
| | | rechargeTimeStart = rechargeTimeStart + " 00:00:00"; |
| | | queryVo.setRechargeTimeStart(rechargeTimeStart); |
| | | } |
| | | if(rechargeTimeStop != null) { |
| | | rechargeTimeStop = rechargeTimeStop + " 23:59:59"; |
| | | queryVo.setRechargeTimeStop(rechargeTimeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = seCardOperateMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoRecharge>> 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 = seCardOperateMapper.getRecharges(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取交易记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public Map getTransactions(QoTransaction 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 waterCost = 0f; |
| | | Float cardCost = 0f; |
| | | Map map_sum = Optional.ofNullable(seCardOperateMapper.getTransactionSums(params)).orElse(new HashMap()); |
| | | if(map_sum.size() > 0) { |
| | | waterCost = Float.parseFloat(map_sum.get("waterCost").toString()); |
| | | cardCost = Float.parseFloat(map_sum.get("cardCost").toString()); |
| | | } |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = seCardOperateMapper.getTransactionRecordCount(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<VoTransaction> lit = seCardOperateMapper.getTransactions(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("waterCost", waterCost); |
| | | map_result.put("cardCost", cardCost); |
| | | map_result.put("records", map_record); |
| | | |
| | | return map_result; |
| | | } |
| | | |
| | | /** |
| | | * 获取交易统计记录 |
| | | * 1.交易统计记录 |
| | | * 2.笔数合计、实收金额合计、赠送金额合计 |
| | | * 3.每一天、各种支付方式实收金额合计 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public Map getTransactionStatistics(QoTransactionStatistics vo) throws ParseException { |
| | | /** |
| | | * 遍历查询日期,取出每天三种支付方式(现金、扫码、转账)实收金额 |
| | | * 每天一个对象 |
| | | * 对象组成JSONArray添加到返回对象中 |
| | | */ |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date startDate = dateFormat.parse(vo.getOperateTimeStart()); |
| | | Date stopDate = dateFormat.parse(vo.getOperateTimeStop()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(startDate); |
| | | |
| | | JSONArray array_paymentSums = new JSONArray(); |
| | | while (calendar.getTime().before(stopDate) || calendar.getTime().equals(stopDate)) { |
| | | String tradeDate = dateFormat.format(calendar.getTime()) ; |
| | | Float receivedCash = Optional.ofNullable(seCardOperateMapper.getPaymentSums(tradeDate ,1L)).orElse(0f); |
| | | Float receivedQRCode = Optional.ofNullable(seCardOperateMapper.getPaymentSums(tradeDate,2L)).orElse(0f); |
| | | Float receivedTransfer = Optional.ofNullable(seCardOperateMapper.getPaymentSums(tradeDate, 3L)).orElse(0f); |
| | | JSONObject job = new JSONObject(); |
| | | job.put("tradeDate", tradeDate); |
| | | job.put("receivedCash", receivedCash); |
| | | job.put("receivedQRCode", receivedQRCode); |
| | | job.put("receivedTransfer", receivedTransfer); |
| | | |
| | | array_paymentSums.add(job); |
| | | calendar.add(Calendar.DAY_OF_MONTH, 1); |
| | | } |
| | | |
| | | |
| | | // 补齐查询时间 |
| | | 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 totalCount = 0; |
| | | Float totalReceived = 0f; |
| | | Float totalGift = 0f; |
| | | Map map_sum = Optional.ofNullable(seCardOperateMapper.getTransactionStatisticsSums(params)).orElse(new HashMap()); |
| | | if(map_sum.size() > 0) { |
| | | totalCount = Integer.parseInt(map_sum.get("totalCount").toString()); |
| | | totalReceived = Float.parseFloat(map_sum.get("totalReceived").toString()); |
| | | totalGift = Float.parseFloat(map_sum.get("totalGift").toString()); |
| | | } |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = seCardOperateMapper.getTransactionStatisticsRecordCount(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<VoTransactionStatistics> list = seCardOperateMapper.getTransactionStatistics(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", list); |
| | | |
| | | Map map_result = new HashMap(); |
| | | map_result.put("totalCount", totalCount); |
| | | map_result.put("totalReceived", totalReceived); |
| | | map_result.put("totalGift", totalGift); |
| | | map_result.put("records", map_record); |
| | | map_result.put("paymentSums", array_paymentSums); |
| | | |
| | | return map_result; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取开卡记录 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoActiveCardNew>> getActiveCards(QoActiveCard queryVo) { |
| | | //完善查询充值记录的起止时间 |
| | | String activeTimeStart = queryVo.activeTimeStart; |
| | | String activeTimeStop = queryVo.activeTimeStop; |
| | | if(activeTimeStart != null) { |
| | | activeTimeStart = activeTimeStart + " 00:00:00"; |
| | | queryVo.setActiveTimeStart(activeTimeStart); |
| | | } |
| | | if(activeTimeStop != null) { |
| | | activeTimeStop = activeTimeStop + " 23:59:59"; |
| | | queryVo.setActiveTimeStop(activeTimeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = seCardOperateMapper.getActiveCardRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoActiveCardNew>> 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 = seCardOperateMapper.getActiveCards(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取补卡记录 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoReissueCard>> getReissueCards(QoReissueCard queryVo) { |
| | | //完善查询充值记录的起止时间 |
| | | String reissueCardTimeStart = queryVo.reissueCardTimeStart; |
| | | String reissueCardTimeStop = queryVo.reissueCardTimeStop; |
| | | if(reissueCardTimeStart != null) { |
| | | reissueCardTimeStart = reissueCardTimeStart + " 00:00:00"; |
| | | queryVo.setReissueCardTimeStart(reissueCardTimeStart); |
| | | } |
| | | if(reissueCardTimeStop != null) { |
| | | reissueCardTimeStop = reissueCardTimeStop + " 23:59:59"; |
| | | queryVo.setReissueCardTimeStop(reissueCardTimeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = seCardOperateMapper.getReissueCardRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoReissueCard>> 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 = seCardOperateMapper.getReissueCards(params); |
| | | return rsVo ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.converter; |
| | | |
| | | import com.dy.pipIrrSell.cardOperate.dto.DtoActiveCard; |
| | | import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.Mapping; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 9:41 |
| | | * @LastEditTime 2024-01-19 9:41 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface RechargeDtoMapper { |
| | | RechargeDtoMapper INSTANCT = Mappers.getMapper(RechargeDtoMapper.class); |
| | | |
| | | @Mapping(target = "cardNum", source = "cardNum") |
| | | @Mapping(target = "amount", source = "amount") |
| | | @Mapping(target = "paymentId", source = "paymentId") |
| | | @Mapping(target = "remarks", source = "remarks") |
| | | @Mapping(target = "operator", source = "operator") |
| | | DtoRecharge po2vo(DtoActiveCard po); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-18 19:44 |
| | | * @LastEditTime 2024-01-18 19:44 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "开卡传入对象") |
| | | public class DtoActiveCard { |
| | | public static final long serialVersionUID = 202401181945001L; |
| | | /** |
| | | * 水卡地址,仅保存,无业务 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡地址不能为空") |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 农户编号,开卡使用 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String clientNum; |
| | | |
| | | /** |
| | | * 农户ID(主键),不是开卡接口传入,由农户编号获得,保存开卡记录和充值记录都需要 |
| | | */ |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 水卡编号,不是开卡接口传入,由农户编号获得,充值需要 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 卡片费用 |
| | | */ |
| | | @Schema(description = "卡片费用", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "卡片费用必须为大于0的整数") |
| | | private Integer cardCost; |
| | | |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="充值金额不能小于0") |
| | | private Float amount; |
| | | |
| | | /** |
| | | * 补卡金额 |
| | | */ |
| | | @Schema(description = "补卡金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="补卡金额不能小于0") |
| | | private Double reissueAmount; |
| | | |
| | | /** |
| | | * 支付方式编号 |
| | | */ |
| | | @Schema(description = "支付方式编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "支付方式编号必须为大于0的整数") |
| | | private Long paymentId; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 10:08 |
| | | * @LastEditTime 2024-01-19 10:08 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "注销传入对象") |
| | | public class DtoCancel { |
| | | public static final long serialVersionUID = 202401191009001L; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | //@Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //private Long clientId; |
| | | |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | @Schema(description = "退款金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="退款金额不能小于0") |
| | | private Float refund; |
| | | |
| | | /** |
| | | * 退款方式;1-现金 |
| | | */ |
| | | @Schema(description = "退款方式", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "退款方式必须为大于0的整数") |
| | | private Byte refundType; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 10:32 |
| | | * @LastEditTime 2024-01-19 10:32 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "挂失传入对象") |
| | | public class DtoLoss { |
| | | public static final long serialVersionUID = 202401191033001L; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 余额 |
| | | */ |
| | | @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="余额不能小于0") |
| | | private Float money; |
| | | |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | @Schema(description = "退款金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="退款金额不能小于0") |
| | | private Float refund; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 9:06 |
| | | * @LastEditTime 2024-01-19 9:06 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "充值传入对象") |
| | | public class DtoRecharge { |
| | | public static final long serialVersionUID = 202401190907001L; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 农户ID,不是充值接口传入,由开卡对象传入,保存充值记录需要 |
| | | */ |
| | | @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="卡片余额不能小于0") |
| | | private Float money; |
| | | |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="充值金额不能小于0") |
| | | private Float amount; |
| | | |
| | | /** |
| | | * 赠送金额 |
| | | */ |
| | | @Schema(description = "赠送金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="赠送金额不能小于0") |
| | | private Float gift; |
| | | |
| | | /** |
| | | * 付款方式编号 |
| | | */ |
| | | @Schema(description = "付款方式编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Long paymentId; |
| | | |
| | | /** |
| | | * 水价 |
| | | */ |
| | | @Schema(description = "水价", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="水价不能小于0") |
| | | private Float price; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 18:35 |
| | | * @LastEditTime 2024-01-19 18:35 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "补扣传入对象") |
| | | public class DtoRefund { |
| | | public static final long serialVersionUID = 202401191836001L; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="卡片余额不能小于0") |
| | | private Float money; |
| | | |
| | | /** |
| | | * 补卡金额 |
| | | */ |
| | | @Schema(description = "补卡金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="补卡金额不能小于0") |
| | | private Float refund; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 20:43 |
| | | * @LastEditTime 2024-01-19 20:43 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "补卡传入对象") |
| | | public class DtoReissue { |
| | | public static final long serialVersionUID = 202401192044001L; |
| | | /** |
| | | * 水卡地址,仅保存,无业务 |
| | | */ |
| | | @Schema(description = "水卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡地址不能为空") |
| | | private String cardAddr; |
| | | |
| | | ///** |
| | | // * 农户编号,开卡使用 |
| | | // */ |
| | | //@Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //private String clientNum; |
| | | |
| | | /** |
| | | * 农户ID(主键),不是开卡接口传入,由农户编号获得,保存开卡记录和充值记录都需要 |
| | | */ |
| | | //@Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //private Long clientId; |
| | | |
| | | /** |
| | | * 水卡编号,不是开卡接口传入,由农户编号获得,充值需要 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 金额 |
| | | */ |
| | | @Schema(description = "金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="金额不能小于0") |
| | | private Float money; |
| | | |
| | | /** |
| | | * 卡片费用 |
| | | */ |
| | | @Schema(description = "卡片费用", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "卡片费用必须为大于0的整数") |
| | | private Integer cardCost; |
| | | |
| | | /** |
| | | * 补卡金额,开卡时充值用 |
| | | */ |
| | | //@Schema(description = "补卡金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //@Min(value = 0, message="补卡金额不能小于0") |
| | | //private Float reissueAmount; |
| | | |
| | | /** |
| | | * 支付方式编号 |
| | | */ |
| | | @Schema(description = "支付方式编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "支付方式编号必须为大于0的整数") |
| | | private Long paymentId; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 13:36 |
| | | * @LastEditTime 2024-01-19 13:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "冲正传入对象") |
| | | public class DtoReversal { |
| | | public static final long serialVersionUID = 202401191337001L; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | //@Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | //private String clientNum; |
| | | |
| | | /** |
| | | * 卡片余额 |
| | | */ |
| | | @Schema(description = "卡片余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="卡片余额不能小于0") |
| | | private Float cardBalance; |
| | | |
| | | /** |
| | | * 系统余额 |
| | | */ |
| | | @Schema(description = "系统余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="系统余额不能小于0") |
| | | private Float systemBalance; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.Min; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-19 20:18 |
| | | * @LastEditTime 2024-01-19 20:18 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "解锁传入对象") |
| | | public class DtoUnlock { |
| | | public static final long serialVersionUID = 202401192019001L; |
| | | |
| | | /** |
| | | * 水卡编号 |
| | | */ |
| | | @Schema(description = "水卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotBlank(message = "水卡编号不能为空") |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String clientNum; |
| | | |
| | | /** |
| | | * 余额 |
| | | */ |
| | | @Schema(description = "余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Min(value = 0, message="余额不能小于0") |
| | | private Float money; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023/12/8 10:56 |
| | | * @LastEditTime 2023/12/8 10:56 |
| | | * @Description 开卡/补卡类型枚举 |
| | | */ |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OperateTypeENUM { |
| | | ACTIVE((byte)1, "开卡"), |
| | | RECHARGE((byte)2, "充值"), |
| | | CANCEL((byte)3, "销卡"), |
| | | REISSUE((byte)4, "补卡"), |
| | | REFUND((byte)5, "补扣"), |
| | | LOSS((byte)6, "挂失"), |
| | | REVERSAL((byte)7, "冲正"), |
| | | UNLOCK((byte)8, "解锁"), |
| | | CONSUME((byte)9, "消费"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/1/23 14:41 |
| | | * @LastEditTime :2024/1/23 14:41 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "IC卡开卡记录查询条件") |
| | | public class QoActiveCard extends QueryConditionVo { |
| | | |
| | | // @Schema(description = "操作类型 1-开卡,2-补卡") |
| | | // private Byte operateType; |
| | | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | //public String cardAddr; |
| | | public String cardNum; |
| | | |
| | | @Schema(description = "卡片状态") |
| | | private Byte state; |
| | | |
| | | //@Schema(description = "开卡时间_开始") |
| | | //public LocalDateTime activeTimeStart; |
| | | // |
| | | //@Schema(description = "开卡时间_结束") |
| | | //public LocalDateTime activeTimeStop; |
| | | |
| | | @Schema(description = "开卡时间_开始") |
| | | public String activeTimeStart; |
| | | |
| | | @Schema(description = "开卡时间_结束") |
| | | public String activeTimeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-20 11:35 |
| | | * @LastEditTime 2024-01-20 11:35 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "IC卡充值记录查询条件") |
| | | public class QoRecharge extends QueryConditionVo { |
| | | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "农户编号") |
| | | private Long clientId; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | public String cardAddr; |
| | | |
| | | @Schema(description = "付款方式") |
| | | public Integer paymentId; |
| | | |
| | | //@Schema(description = "充值时间_开始") |
| | | //public LocalDateTime rechargeTimeStart; |
| | | // |
| | | //@Schema(description = "充值时间_结束") |
| | | //public LocalDateTime rechargeTimeStop; |
| | | |
| | | @Schema(description = "充值时间_开始") |
| | | public String rechargeTimeStart; |
| | | |
| | | @Schema(description = "充值时间_结束") |
| | | public String rechargeTimeStop; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/1/26 9:17 |
| | | * @LastEditTime :2024/1/26 9:17 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "IC卡补卡记录查询条件") |
| | | public class QoReissueCard extends QueryConditionVo { |
| | | |
| | | @Schema(description = "农户姓名") |
| | | public String clientName; |
| | | |
| | | @Schema(description = "IC卡号") |
| | | //public String cardAddr; |
| | | public String cardNum; |
| | | |
| | | @Schema(description = "补卡时间_开始") |
| | | public String reissueCardTimeStart; |
| | | |
| | | @Schema(description = "补卡时间_结束") |
| | | public String reissueCardTimeStop; |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryOperate.java |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | package com.dy.pipIrrSell.cardOperate.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-26 21:00 |
| | | * @LastEditTime 2023-12-26 21:00 |
| | | * @date 2024-01-22 10:57 |
| | | * @LastEditTime 2024-01-22 10:57 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "交易查询条件") |
| | | public class QueryOperate extends QueryConditionVo { |
| | | |
| | | @Schema(name = "交易明细查询条件") |
| | | public class QoTransaction extends QueryConditionVo { |
| | | @Schema(description = "村ID") |
| | | public Long villageId; |
| | | |
| | | @Schema(description = "支付方式编号") |
| | | public Long paymentId; |
| | | @Schema(description = "水卡编号") |
| | | public Long cardNum; |
| | | |
| | | @Schema(description = "交易查询起始时间") |
| | | public String operateTimeStart; |
| | | |
| | | @Schema(description = "交易查询截止时间") |
| | | public String operateTimeStop; |
| | | |
| | | @Schema(description = "收银员ID") |
| | | public Long cashierId; |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/QueryStatistic.java |
| | |
| | | package com.dy.pipIrrSell.client; |
| | | package com.dy.pipIrrSell.cardOperate.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2023-12-27 15:33 |
| | | * @LastEditTime 2023-12-27 15:33 |
| | | * @date 2024-01-22 18:32 |
| | | * @LastEditTime 2024-01-22 18:32 |
| | | * @Description |
| | | */ |
| | | |
| | |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "交易汇总查询条件") |
| | | public class QueryStatistic extends QueryConditionVo { |
| | | @Schema(description = "村ID") |
| | | public Long villageId; |
| | | |
| | | //@Schema(description = "支付方式编号") |
| | | //public Long paymentId; |
| | | |
| | | public class QoTransactionStatistics extends QueryConditionVo { |
| | | @Schema(description = "交易查询起始时间") |
| | | public String operateTimeStart; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取交易记录 |
| | | * @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 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 生成10为农户编号 |
| | | * 生成10位农户编号 |
| | | * 1. 到农户表中查询6位区划串开头的最大的农户编号 |
| | | * 2. 是否取到记录 |
| | | * 2.1 取到 |
| | |
| | | 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards; |
| | | import com.dy.pipIrrSell.clientCard.qo.QoCards; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | 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 = "getcards") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoCards>>> getcards(QoCards vo){ |
| | | try { |
| | | QueryResultVo<List<VoCards>> res = clientCardSv.getCards(vo); |
| | | if(res.itemTotal != null && res.itemTotal > 0) { |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | }else { |
| | | return BaseResponseUtils.buildFail(SellResultCode.THE_CARD_NOT_EXIST.getMessage()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("查询农户异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrSell.clientCard; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import com.dy.pipIrrGlobal.voSe.VoCards; |
| | | import com.dy.pipIrrSell.clientCard.qo.QoCards; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | String stateName = Optional.ofNullable(seClientCardMapper.getCardStateByCardNum(cardNum)).orElse(""); |
| | | return stateName; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取水卡列表,应用程序使用 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoCards>> getCards(QoCards queryVo){ |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ; |
| | | Long itemTotal = seClientCardMapper.getCardsCount(params); |
| | | |
| | | QueryResultVo<List<VoCards>> 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 = seClientCardMapper.getCards(params); |
| | | |
| | | return rsVo ; |
| | | } |
| | | } |
| | |
| | | @AllArgsConstructor |
| | | public enum LastOperateENUM { |
| | | ACTIVE((byte)1, "开卡"), |
| | | REPLACE((byte)2, "补卡"), |
| | | RECHARGE((byte)3, "充值"), |
| | | LOSS((byte)4, "挂失"), |
| | | CANCEL((byte)5, "注销"), |
| | | UNLOCK((byte)6, "解锁"), |
| | | RECHARGE((byte)2, "充值"), |
| | | CANCEL((byte)3, "注销"), |
| | | REPLACE((byte)4, "补卡"), |
| | | REFUND((byte)5, "补扣"), |
| | | LOSS((byte)6, "挂失"), |
| | | REVERSAL((byte)7, "冲正"), |
| | | CONSUME((byte)8, "消费"); |
| | | UNLOCK((byte)8, "解锁"), |
| | | CONSUME((byte)9, "消费"); |
| | | |
| | | private final Byte code; |
| | | private final String message; |
New file |
| | |
| | | package com.dy.pipIrrSell.clientCard.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-26 19:11 |
| | | * @LastEditTime 2024-01-26 19:11 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "水卡记录查询条件") |
| | | public class QoCards extends QueryConditionVo { |
| | | |
| | | @Schema(description = "农户编号") |
| | | public Long clientNum; |
| | | |
| | | @Schema(description = "农户姓名") |
| | | private String clientName; |
| | | |
| | | @Schema(description = "水卡编号") |
| | | public Long cardNum; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.general; |
| | | |
| | | 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.SeAudits; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeGeneral; |
| | | import com.dy.pipIrrGlobal.voSe.VoGeneral; |
| | | import com.dy.pipIrrSell.general.dto.DtoGeneral; |
| | | import com.dy.pipIrrSell.general.qo.QoGeneral; |
| | | import com.dy.pipIrrSell.general.qo.QoToAudit; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | | 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 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 2024-01-24 19:01 |
| | | * @LastEditTime 2024-01-24 19:01 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Tag(name = "总账管理", description = "总账管理") |
| | | @RestController |
| | | @RequestMapping(path="general") |
| | | @RequiredArgsConstructor |
| | | public class GeneralCtrl { |
| | | private final GeneralSv generalSv; |
| | | |
| | | /** |
| | | * 根据指定条件获取总账记录 |
| | | * 查询前先生成未生成的总账记录 |
| | | * @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_generals") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoGeneral>>> getOperates(QoGeneral vo){ |
| | | try { |
| | | add_general(); |
| | | QueryResultVo<List<VoGeneral>> res = generalSv.getGenerals(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询交易记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成总账 |
| | | * 获取未生成总账的交易日期列表(当天的交易记录不生成总账) |
| | | * 将指定日期的交易记录汇总到总账表 |
| | | * @return |
| | | */ |
| | | public void add_general(){ |
| | | // 获取未生成总账的交易日期列表(当天的交易记录不生成总账) |
| | | List<Map<String, Object>> list_operateDate = Optional.ofNullable(generalSv.getDatesOfNotInGenerals()).orElse(new ArrayList<>()); |
| | | if(list_operateDate.size() > 0) { |
| | | for(int i = 0; i < list_operateDate.size(); i++) { |
| | | String operateDate = list_operateDate.get(i).get("operateDate").toString(); |
| | | // 根据交易日期获取总账记录列表(待生成的) |
| | | List<SeGeneral> list_general = Optional.ofNullable(generalSv.getGeneralByOperateDate(operateDate)).orElse(new ArrayList<>()); |
| | | if(list_general.size() > 0) { |
| | | for(int j = 0; j < list_general.size(); j++) { |
| | | SeGeneral general = list_general.get(j); |
| | | generalSv.addGeneral(general); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 审核总账 |
| | | * 1. 修改总账审核状态 |
| | | * 2. 添加总账审核记录 |
| | | * @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 = "audit", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> audit(@RequestBody @Valid DtoGeneral po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | Long generalId = po.getGeneralId(); |
| | | Byte auditStatus = po.getAuditStatus(); |
| | | String auditOpinion = po.getAuditOpinion(); |
| | | Long operator = po.getOperator(); |
| | | Date auditTime = new Date(); |
| | | |
| | | if(generalId == null) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.GENERAL_ID_CANNOT_BE_NULL.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 判断总账是否存在 |
| | | */ |
| | | if(generalSv.getGeneralById(generalId) == null) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.GENERAL_NOT_EXIST.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 修改总账审核状态 |
| | | */ |
| | | SeGeneral seGeneral = new SeGeneral(); |
| | | seGeneral.setId(generalId); |
| | | seGeneral.setAuditStatus(auditStatus); |
| | | Integer rec_updateGeneral = Optional.ofNullable(generalSv.updateGeneral(seGeneral)).orElse(0); |
| | | if(rec_updateGeneral == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.GENERAL_AUDIT_FAIL.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 添加总账审核记录 |
| | | */ |
| | | SeAudits seAudits = new SeAudits(); |
| | | seAudits.setGeneralId(generalId); |
| | | seAudits.setAuditStatus(auditStatus); |
| | | seAudits.setAuditOpinion(auditOpinion); |
| | | seAudits.setOperator(operator); |
| | | seAudits.setOperateDt(auditTime); |
| | | Integer rec_addAucits = Optional.ofNullable(generalSv.addAudits(seAudits)).orElse(0); |
| | | if(rec_addAucits == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.AUDITS_ADD_FAIL.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess() ; |
| | | } |
| | | |
| | | @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 = "getToAudit") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getToAudit(QoToAudit vo){ |
| | | try { |
| | | Map res = generalSv.getToAudit(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询交易汇总记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.general; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSe.SeAuditsMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeGeneralMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeAudits; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeGeneral; |
| | | import com.dy.pipIrrGlobal.voSe.VoGeneral; |
| | | import com.dy.pipIrrGlobal.voSe.VoTransactionStatistics; |
| | | import com.dy.pipIrrSell.general.qo.QoGeneral; |
| | | import com.dy.pipIrrSell.general.qo.QoToAudit; |
| | | 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.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-24 19:02 |
| | | * @LastEditTime 2024-01-24 19:02 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class GeneralSv { |
| | | @Autowired |
| | | private SeGeneralMapper seGeneralMapper; |
| | | |
| | | @Autowired |
| | | private SeAuditsMapper seAuditsMapper; |
| | | |
| | | @Autowired |
| | | private SeCardOperateMapper seCardOperateMapper; |
| | | |
| | | /** |
| | | * 获取未生成总账的交易日期列表(当天的交易记录不生成总账) |
| | | * @return |
| | | */ |
| | | public List<Map<String, Object>> getDatesOfNotInGenerals() { |
| | | return seGeneralMapper.getDatesOfNotInGenerals(); |
| | | } |
| | | |
| | | /** |
| | | * 添加总账 |
| | | * @param po 总账对象 |
| | | * @return |
| | | */ |
| | | public Integer addGeneral(SeGeneral po) { |
| | | return seGeneralMapper.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据交易日期获取总账记录列表(待生成的) |
| | | * @param operateDate 交易日期 |
| | | * @return 取总账记录列表 |
| | | */ |
| | | public List<SeGeneral> getGeneralByOperateDate(String operateDate) { |
| | | return seGeneralMapper.getGeneralByOperateDate(operateDate); |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取总账记录 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoGeneral>> getGenerals(QoGeneral queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = seGeneralMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoGeneral>> 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 = seGeneralMapper.getGenerals(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 修改总账审核意见 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer updateGeneral(SeGeneral po) { |
| | | return seGeneralMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据编号查询总账 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public SeGeneral getGeneralById(Long id) { |
| | | return seGeneralMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | /** |
| | | * t添加总账审核记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Integer addAudits(SeAudits po) { |
| | | return seAuditsMapper.insert(po); |
| | | } |
| | | |
| | | /** |
| | | * 财务对账审核页,收银员+日期分组,排除交易类型分组 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public Map getToAudit(QoToAudit vo) { |
| | | /** |
| | | * 取出指定日期三种支付方式(现金、扫码、转账)实收金额 |
| | | */ |
| | | JSONArray array_paymentSums = new JSONArray(); |
| | | String tradeDate = vo.getTradeDate(); |
| | | Long cashierId = vo.cashierId; |
| | | |
| | | Float receivedCash = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId, 1L)).orElse(0f); |
| | | Float receivedQRCode = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId,2L)).orElse(0f); |
| | | Float receivedTransfer = Optional.ofNullable(seGeneralMapper.getPaymentSums(tradeDate, cashierId, 3L)).orElse(0f); |
| | | JSONObject job = new JSONObject(); |
| | | job.put("tradeDate", tradeDate); |
| | | job.put("receivedCash", receivedCash); |
| | | job.put("receivedQRCode", receivedQRCode); |
| | | job.put("receivedTransfer", receivedTransfer); |
| | | array_paymentSums.add(job); |
| | | |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ; |
| | | |
| | | //获取笔数合计、实收金额合计、赠送金额合计 |
| | | Integer totalCount = 0; |
| | | Float totalReceived = 0f; |
| | | Float totalGift = 0f; |
| | | Map map_sum = Optional.ofNullable(seGeneralMapper.getTransactionStatisticsSums(params)).orElse(new HashMap()); |
| | | if(map_sum.size() > 0) { |
| | | totalCount = Integer.parseInt(map_sum.get("totalCount").toString()); |
| | | totalReceived = Float.parseFloat(map_sum.get("totalReceived").toString()); |
| | | totalGift = Float.parseFloat(map_sum.get("totalGift").toString()); |
| | | } |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = seGeneralMapper.getToAuditRecordCount(params); |
| | | |
| | | List<VoTransactionStatistics> list = seGeneralMapper.getToAudit(params); |
| | | Map map_record = new HashMap(); |
| | | map_record.put("itemTotal", itemTotal); |
| | | map_record.put("pageCurr", vo.pageCurr); |
| | | map_record.put("list", list); |
| | | |
| | | Map map_result = new HashMap(); |
| | | map_result.put("totalCount", totalCount); |
| | | map_result.put("totalReceived", totalReceived); |
| | | map_result.put("totalGift", totalGift); |
| | | map_result.put("records", map_record); |
| | | map_result.put("paymentSums", array_paymentSums); |
| | | |
| | | return map_result; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.general.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.Positive; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-25 10:19 |
| | | * @LastEditTime 2024-01-25 10:19 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "总账审核传入对象") |
| | | public class DtoGeneral { |
| | | public static final long serialVersionUID = 202401251020001L; |
| | | |
| | | /** |
| | | * 总账ID |
| | | */ |
| | | @Schema(description = "总账ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "总账ID不能为空") |
| | | @Positive(message = "总账编号必须为大于0的整数") |
| | | private Long generalId; |
| | | |
| | | /** |
| | | * 审核状态 |
| | | */ |
| | | @Schema(description = "审核状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "审核状态不能为空") |
| | | private Byte auditStatus; |
| | | |
| | | /** |
| | | * 审核意见 |
| | | */ |
| | | @Schema(description = "审核意见", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @Length(max = 200, message = "审核意见最多200字") |
| | | private String auditOpinion; |
| | | |
| | | /** |
| | | * 操作人编号 |
| | | */ |
| | | @Schema(description = "操作人编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @NotNull(message = "操作人编号不能为空") |
| | | @Positive(message = "操作人编号必须为大于0的整数") |
| | | private Long operator; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.general.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-24 20:25 |
| | | * @LastEditTime 2024-01-24 20:25 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "总账查询条件") |
| | | public class QoGeneral extends QueryConditionVo { |
| | | @Schema(description = "收银员姓名") |
| | | public String cashierName; |
| | | |
| | | @Schema(description = "交易查询起始日期") |
| | | public String operateDateStart; |
| | | |
| | | @Schema(description = "交易查询截止日期") |
| | | public String operateDateStop; |
| | | |
| | | @Schema(description = "审核状态") |
| | | private Byte auditStatus; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrSell.general.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-01-25 20:13 |
| | | * @LastEditTime 2024-01-25 20:13 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "待审核交易汇总查询条件") |
| | | public class QoToAudit extends QueryConditionVo { |
| | | @Schema(description = "交易时间") |
| | | public String tradeDate; |
| | | |
| | | @Schema(description = "收银员ID") |
| | | public Long cashierId; |
| | | } |
| | |
| | | CARD_NUMBER_ERROR(10006, "卡号错误,该卡不存在"), |
| | | REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR(10007, "补卡失败-农户卡修改异常"), |
| | | REPLACE_FAIL_WRITE_RECHARGE_ERROR(10008, "补卡失败-补卡记录写入异常"), |
| | | No_ActiveCards(10009, "没有符合条件的开卡数据"), |
| | | No_ReissueCards(10010, "没有符合条件的补卡数据"), |
| | | |
| | | THE_CARD_NOT_EXIST(10011, "没有符合条件的水卡"), |
| | | THE_CARD_NOT_SUPPORT_THIS_OPERATION(10012, "水卡状态不支持当前操作"), |
| | | |
| | | /** |
| | | * 充值 |
| | |
| | | * 冲正 |
| | | */ |
| | | REVERSAL_FAIL_WRITE_CLIENT_CARD_ERROR(60001, "冲正失败-农户卡修改异常"), |
| | | REVERSAL_FAIL_WRITE_REVERSAL_ERROR(60002, "冲正失败-冲正记录写入异常"); |
| | | REVERSAL_FAIL_WRITE_REVERSAL_ERROR(60002, "冲正失败-冲正记录写入异常"), |
| | | |
| | | /** |
| | | * 补扣 |
| | | */ |
| | | REFUND_FAIL_WRITE_REFUND_ERROR(70001, "补扣失败-补扣记录写入异常"), |
| | | |
| | | /** |
| | | * 总账 |
| | | */ |
| | | GENERAL_ID_CANNOT_BE_NULL(80001, "总账编号不能为空"), |
| | | GENERAL_NOT_EXIST(80001, "总账不存在"), |
| | | GENERAL_AUDIT_FAIL(80001, "总账审核失败"), |
| | | AUDITS_ADD_FAIL(80001, "总账审核记录添加失败"); |
| | | |
| | | private final Integer code; |
| | | private final String message; |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import com.dy.pipIrrGlobal.util.DistrictLevel; |
| | | import com.dy.pipIrrGlobal.util.Org; |
| | | import com.mysql.cj.util.StringUtils; |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.cache.CacheManager; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.UUID; |
| | | |
| | | //import org.springframework.cache.CacheManager; |
| | | |
| | | /** |
| | | * 注解Tag 在API中显示: Tag 注解, 给整个接口起了个名字与描述" |
| | |
| | | @GetMapping(path = "loginUserId") |
| | | public Long loginUserId(String token){ |
| | | BaUser userPo = this.sv.getByUuid(token) ; |
| | | return userPo == null ? null : userPo.id ; |
| | | return userPo == null ? null : userPo.userId ; |
| | | } |
| | | /** |
| | | * 此方法供子模块系统调用,所以不公开在API接口中 |
| | |
| | | BaUser userPo = this.sv.getByUuid(token) ; |
| | | CurUserVo vo = new CurUserVo(); |
| | | if(userPo != null){ |
| | | vo.id = userPo.id ; |
| | | vo.name = userPo.name ; |
| | | vo.id = userPo.userId ; |
| | | vo.name = userPo.userName; |
| | | } |
| | | return vo ; |
| | | } |
| | |
| | | @Cacheable(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid", sync=true) |
| | | public BaUser loginWithMapperXml(String uuid, String phone, String password){ |
| | | BaUser baUser = this.baUserMapper.login(phone, password) ; |
| | | if(baUser != null && baUser.id != null){ |
| | | baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.id) ; |
| | | if(baUser != null && baUser.userId != null){ |
| | | baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.userId) ; |
| | | } |
| | | return baUser; |
| | | } |
| | |
| | | .eq("phone", phone) |
| | | .eq("password", password); |
| | | BaUser baUser = this.baUserMapper.selectOne(qw) ; |
| | | if(baUser != null && baUser.id != null){ |
| | | baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.id) ; |
| | | if(baUser != null && baUser.userId != null){ |
| | | baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.userId) ; |
| | | } |
| | | return baUser; |
| | | } |
| | |
| | | * @param po |
| | | * @return |
| | | */ |
| | | @Mapping(target = "id", source = "id") |
| | | @Mapping(target = "name", source = "name") |
| | | @Mapping(target = "id", source = "userId") |
| | | @Mapping(target = "name", source = "userName") |
| | | @Mapping(target = "phone", source = "phone") |
| | | @Mapping(target = "token", ignore=true) |
| | | UserVo po2vo(BaUser po); |