liurunyu
2024-02-22 d919e26796ec5a6f78fc0b665840207f185f1274
Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
56个文件已修改
35个文件已添加
5个文件已删除
5565 ■■■■ 已修改文件
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCardOperateMapper.java 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeConsumeMapper.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeGeneralMapper.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRefundMapper.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletMapper.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeHistoryMapper.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeMapper.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCardOperate.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeConsume.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeGeneral.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRefund.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWallet.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRecharge.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRechargeHistory.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/AmountToChinese.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoOperate.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReceipt.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTransactionStatistics.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWallet.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWalletConsume.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWalletRecharge.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWalletRefund.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowmeterMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml 410 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeConsumeMapper.xml 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml 246 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletMapper.xml 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeHistoryMapper.xml 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeMapper.xml 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideSv.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringSv.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowmeterSv.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoCancel.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoCommonOperate.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoReceipt.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoTransaction.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/GeneralCtrl.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/GeneralSv.java 168 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/qo/QoSummary.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/qo/QoToAudit.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossSv.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockSv.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWallet.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWalletRecharge.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java 441 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java 225 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/enums/LastOperateENUM.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/enums/RefundStatusENUM.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QoWalletRecharge.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QueryVo.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/.gitignore 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/.mvn/wrapper/maven-wrapper.jar 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/.mvn/wrapper/maven-wrapper.properties 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/mvnw 308 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/mvnw.cmd 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/pom.xml 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/PipIrrWebChatApplication.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/config/WebFilterConfiguration.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/config/WebListenerConfiguration.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/result/WebChatResultCode.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/resources/application.yml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/resources/log4j2.yml 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/test/java/com/dy/pipirrWebChat/PipIrrWebWebchatApplicationTests.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/webUtil/QueryResultVo.java
@@ -64,7 +64,12 @@
            this.pageSize = 1 ;
        }
        if(this.pageSize == null || this.pageSize <= 0){
            this.pageSize = 1 ;//供下面作为除数
            /**
             * 朱宝民 2024-01-30 修改
             * 未传入分页参数时,取全部记录
             */
            //this.pageSize = 1 ;//供下面作为除数
            this.pageSize = 10000 ;//供下面作为除数
        }
        pageTotal = (int)Math.ceil((itemTotal==null?0.0D:itemTotal.doubleValue())/pageSize);
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCardOperateMapper.java
@@ -4,20 +4,19 @@
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
 * @date 2024-02-02 16:00
 * @LastEditTime 2024-02-02 16:00
 * @Description
 */
@Mapper
public interface SeCardOperateMapper extends BaseMapper {
public interface SeCardOperateMapper extends BaseMapper<SeCardOperate> {
    int deleteByPrimaryKey(Long id);
    int insert(SeCardOperate record);
@@ -57,44 +56,8 @@
     * @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);
    /*List<VoTransaction> getTransactions(Map<?, ?> params);*/
    List<VoTradeDetails> getTransactions(Map<?, ?> params);
    /**
     * 根据指定条件获取开卡记录数
@@ -108,7 +71,7 @@
     * @param params
     * @return
     */
    List<VoActiveCardNew> getActiveCards(Map<?, ?> params);
    List<VoActiveCard> getActiveCards(Map<?, ?> params);
    /**
@@ -124,4 +87,42 @@
     * @return
     */
    List<VoReissueCard> getReissueCards(Map<?, ?> params);
    /**
     * 根据指定条件获取通用操作记录数量
     * 注销、挂失、冲正、解锁通用
     * @param params
     * @return
     */
    Long getCommonOperationRecordCount(Map<?, ?> params);
    /**
     * 根据指定条件获取通用操作记录
     * 注销、挂失、冲正、解锁通用
     * @param params
     * @return
     */
    List<VoOperate> getCommonOperations(Map<?, ?> params);
    /**
     * 根据指定条件获取收据列表数
     * @param params
     * @return
     */
    Long getReceiptsRecordCount(Map<?, ?> params);
    /***
     * 根据指定条件获取收据列表
     * @param params
     * @return
     */
    List<VoReceipt> getReceipts(Map<?, ?> params);
    /**
     * 根据指定条件获取收据收费金额合计
     * @param params
     * @return
     */
    Double getTotalAmount(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeConsumeMapper.java
New file
@@ -0,0 +1,53 @@
package com.dy.pipIrrGlobal.daoSe;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeConsume;
import com.dy.pipIrrGlobal.voSe.VoWalletConsume;
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-30 15:44
 * @LastEditTime 2024-01-30 15:44
 * @Description 电子钱包消费Mapper接口
 */
@Mapper
public interface SeConsumeMapper extends BaseMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeConsume record);
    int insertSelective(SeConsume record);
    SeConsume selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SeConsume record);
    int updateByPrimaryKey(SeConsume record);
    /**
     * 根据农户ID获取消费汇总记录
     * @param clientId
     * @return
     */
    Map getWalletConsumeSum(@Param("clientId") Long clientId);
    /**
     * 根据农户ID获取电子钱包消费记录数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /***
     * 根据农户ID获取电子钱包消费记录
     * @param params
     * @return
     */
    List<VoWalletConsume> getWalletConsumes(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeGeneralMapper.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeGeneral;
import com.dy.pipIrrGlobal.voSe.VoGeneral;
import com.dy.pipIrrGlobal.voSe.VoTradeDetails;
import com.dy.pipIrrGlobal.voSe.VoTransactionStatistics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -63,14 +64,14 @@
     * @param params
     * @return
     */
    Long getToAuditRecordCount(Map<?, ?> params);
    //Long getToAuditRecordCount(Map<?, ?> params);
    /**
     * 财务对账审核页,收银员+日期分组,排除交易类型分组
     * 开卡系统交易统计,收银员+日期+类型分组
     * @param params
     * @return
     */
    List<VoTransactionStatistics> getToAudit(Map<?, ?> params);
    List<VoTransactionStatistics> getSummaries(Map<?, ?> params);
    /**
     * 获取指定日期、指定收银员、指定支付方式实收金额合计
@@ -81,9 +82,16 @@
    Float getPaymentSums(@Param("tradeDate") String tradeDate, @Param("cashierId") Long cashierId, @Param("paymentId") Long paymentId);
    /**
     * 根基指定日期、指定收银员获取笔数合计、实收金额合计、赠送金额合计
     * 根据收银员ID及日期获取财务对账_交易明细记录数
     * @param params
     * @return
     */
    Map getTransactionStatisticsSums(Map<?, ?> params);
    Long getTradeDetailsRecordCount(Map<?, ?> params);
    /**
     * 根据收银员ID及日期获取财务对账_交易明细记录
     * @param params
     * @return
     */
    List<VoTradeDetails> getTradeDetails(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeRefundMapper.java
New file
@@ -0,0 +1,60 @@
package com.dy.pipIrrGlobal.daoSe;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeRefund;
import com.dy.pipIrrGlobal.voSe.VoWalletRefund;
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-30 15:45
 * @LastEditTime 2024-01-30 15:45
 * @Description 电子钱包退款Mapper接口
 */
@Mapper
public interface SeRefundMapper  extends BaseMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeRefund record);
    int insertSelective(SeRefund record);
    SeRefund selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SeRefund record);
    int updateByPrimaryKey(SeRefund record);
    /**
     * 根据钱包ID获取待审核的退款申请对象
     * @param walletId
     * @return
     */
    SeRefund getRefundByWallerId(@Param("walletId") Long walletId);
    /**
     * 根据指定条件获取电子钱包退款记录数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /***
     * 根据指定条件获取电子钱包退款记录
     * @param params
     * @return
     */
    List<VoWalletRefund> getWalletRefunds(Map<?, ?> params);
    /**
     * 获取指定日期微信退款(只计算已退的)总额,财务对账审核页使用
     * @param tradeDate
     * @return
     */
    Double getRefundSum(@Param("tradeDate") String tradeDate);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletMapper.java
@@ -2,17 +2,22 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeWallet;
import com.dy.pipIrrGlobal.voSe.VoWallet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 16:29
 * @LastEditTime 2023/12/11 16:29
 * @Description
 * @date 2024-01-30 15:41
 * @LastEditTime 2024-01-30 15:41
 * @Description 电子钱包Mapper接口
 */
@Mapper
public interface SeWalletMapper extends BaseMapper<SeWallet> {
public interface SeWalletMapper extends BaseMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeWallet record);
@@ -24,4 +29,25 @@
    int updateByPrimaryKeySelective(SeWallet record);
    int updateByPrimaryKey(SeWallet record);
    /**
     * 根据农户ID获取电子钱包对象
     * @param clientId
     * @return
     */
    SeWallet getWalletByClientId(@Param("clientId") Long clientId);
    /**
     * 根据农户姓名获取电子钱包账户记录数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /***
     * 根据农户姓名获取电子钱包账户记录
     * @param params
     * @return
     */
    List<VoWallet> getWallets(Map<?, ?> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeHistoryMapper.java
File was deleted
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeWalletRechargeMapper.java
@@ -2,17 +2,22 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge;
import com.dy.pipIrrGlobal.voSe.VoWalletRecharge;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 9:06
 * @LastEditTime 2023/12/12 9:06
 * @Description
 * @date 2024-01-30 15:44
 * @LastEditTime 2024-01-30 15:44
 * @Description 电子钱包充值Mapper接口
 */
@Mapper
public interface SeWalletRechargeMapper extends BaseMapper<SeWalletRecharge> {
public interface SeWalletRechargeMapper extends BaseMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SeWalletRecharge record);
@@ -24,4 +29,25 @@
    int updateByPrimaryKeySelective(SeWalletRecharge record);
    int updateByPrimaryKey(SeWalletRecharge record);
    /**
     * 根据指定条件获取电子钱包充值记录数
     * @param params
     * @return
     */
    Long getRecordCount(Map<?, ?> params);
    /***
     * 根据指定条件获取电子钱包充值记录
     * @param params
     * @return
     */
    List<VoWalletRecharge> getWalletRecharges(Map<?, ?> params);
    /**
     * 获取指定日期微信收款总额,财务对账审核页使用
     * @param tradeDate
     * @return
     */
    Double getRechargeSum(@Param("tradeDate") String tradeDate);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeCardOperate.java
@@ -17,7 +17,7 @@
/**
 * @author ZhuBaoMin
 * @date 2024-01-18 19:10
 * @LastEditTime 2024-01-18 19:10
 * @LastEditTime 2024-02-02 16:00
 * @Description
 */
@@ -96,6 +96,13 @@
    private Float gift;
    /**
     * 返还金额;补扣操作时返还的金额
     */
    @Schema(description = "返还金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "返还金额不小于{min}", min = 0)
    private Float refundAmount;
    /**
     * 非交易金额;补卡金额、补扣金额、剩余金额(解锁)
     */
    @Schema(description = "非交易金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeConsume.java
New file
@@ -0,0 +1,97 @@
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.Min;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-01-30 15:44
 * @LastEditTime 2024-01-30 15:44
 * @Description 电子钱包消费实体
 */
@TableName(value="se_consume", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "电子钱包消费实体")
public class SeConsume implements BaseEntity {
    public static final long serialVersionUID = 202401301552003L;
    /**
    * 主键
    */
    @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 walletId;
    /**
    * 农户ID
    */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户ID不能为空")
    private Long clientId;
    /**
    * 钱包余额
    */
    @Schema(description = "钱包余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "钱包余额不能小于0")
    private Double money;
    /**
    * 消费金额
    */
    @Schema(description = "消费金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "消费金额不能小于0")
    @NotNull(message = "消费金额不能为空")
    private Double consumption;
    /**
    * 消费后余额
    */
    @Schema(description = "消费后余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "消费后余额不能小于0")
    private Double afterConsume;
    /**
    * 用水时长
    */
    @Schema(description = "用水时长", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "用水时长不能小于0")
    private Double duration;
    /**
    * 开阀时间
    */
    @Schema(description = "开阀时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "开阀时间不能为空")
    private Date vot;
    /**
    * 关阀时间
    */
    @Schema(description = "关阀时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "关阀时间不能为空")
    private Date vct;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeGeneral.java
@@ -69,11 +69,11 @@
    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 Double refundAmount;
    /**
     * 交易日期
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeRefund.java
New file
@@ -0,0 +1,112 @@
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.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-01-30 15:45
 * @LastEditTime 2024-01-30 15:45
 * @Description 电子钱包退款实体
 */
@TableName(value="se_refund", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "电子钱包退款实体")
public class SeRefund implements BaseEntity {
    public static final long serialVersionUID = 202401301552004L;
    /**
    * 主键
    */
    @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)
    private Long walletId;
    /**
    * 农户ID
    */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户ID不能为空")
    private Long clientId;
    /**
    * 钱包余额
    */
    @Schema(description = "钱包余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "钱包余额不能小于0")
    private Double money;
    /**
    * 退款金额
    */
    @Schema(description = "退款金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "消退款金额不能小于0")
    //@NotNull(message = "退款金额不能为空")
    private Double refundAmount;
    /**
    * 退款后余额
    */
    @Schema(description = "退款后余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "退款后余额不能小于0")
    private Double afterRefund;
    /**
    * 申请时间
    */
    @Schema(description = "申请时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date applicationTime;
    /**
    * 退款状态;1-未退款,2-已退款
    */
    @Schema(description = "退款状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 1, message = "退款状态不能小于1")
    @Max(value = 2, message = "退款状态不能大于2")
    private Byte refundStatus;
    /**
    * 审核人
    */
    @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "操作人ID必须为大于0的整数")
    private Long auditor;
    /**
    * 审核时间
    */
    @Schema(description = "审核时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date auditTime;
    /**
    * 审核备注
    */
    @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "备注长度小于{max}字", min = 0, max = 200)
    private String remarks;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWallet.java
@@ -7,21 +7,18 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023/12/11 16:29
 * @LastEditTime 2023/12/11 16:29
 * @Description
 */
/**
 * 电子钱包表
 * @date 2024-01-30 15:41
 * @LastEditTime 2024-01-30 15:41
 * @Description 电子钱包账户实体
 */
@TableName(value="se_wallet", autoResultMap = true)
@@ -30,36 +27,50 @@
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "电子钱包表实体")
@Schema(name = "电子钱包账户实体")
public class SeWallet implements BaseEntity {
    public static final long serialVersionUID = 202401151519005L;
    public static final long serialVersionUID = 202401301552001L;
    /**
    * 主键
    */
     * 主键
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Positive(message = "主键必须为大于0的整数")
    private Long id;
    /**
    * 用水户编号
    */
    @Schema(description = "农户编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Length(message = "农户编号不小于{min}", min = 1)
    private Long clientid;
     * 农户ID
     */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户ID不能为空")
    private Long clientId;
    /**
    * 钱包余额
    */
    @Schema(description = "钱包余额", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(message = "钱包余额不小于{min}", min = 0)
    private Float money;
     * 钱包余额
     */
    @Schema(description = "钱包余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "钱包余额不能小于0")
    private Double money;
    /**
    * 创建时间
    */
     * 最后操作;1-开户,2-充值,3-消费,4-申请退款,5-退款审核
     */
    @Schema(description = "操作类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 1, message = "最后操作不能小于1")
    @Max(value = 5, message = "最后操作不能大于5")
    private Byte lastOperate;
    /**
     * 最后操作时间
     */
    @Schema(description = "最后操作时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date lastOperateTime;
    /**
     * 创建时间
     */
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date createdt;
    private Date createTime;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRecharge.java
@@ -1,55 +1,82 @@
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.Min;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2023/12/12 9:06
 * @LastEditTime 2023/12/12 9:06
 * @Description
 * @date 2024-01-30 15:44
 * @LastEditTime 2024-01-30 15:44
 * @Description 电子钱包充值实体
 */
/**
    * 电子钱包充值表
    */
public class SeWalletRecharge {
@TableName(value="se_wallet_recharge", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "电子钱包充值实体")
public class SeWalletRecharge implements BaseEntity {
    public static final long serialVersionUID = 202401301552002L;
    /**
    * 主键
    */
     * 主键
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    @Schema(description = "实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long id;
    /**
    * 钱包编号
    */
    private Long walletid;
     * 钱包ID
     */
    @Schema(description = "钱包ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@NotNull(message = "钱包ID不能为空")
    private Long walletId;
    /**
    * 农户编号
    */
    private Long clientid;
     * 农户ID
     */
    @Schema(description = "农户ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "农户ID不能为空")
    private Long clientId;
    /**
    * 钱包余额
    */
     * 钱包余额
     */
    @Schema(description = "钱包余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "钱包余额不能小于0")
    private Double money;
    /**
    * 充值金额
    */
     * 充值金额
     */
    @Schema(description = "充值金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "钱包余额不能小于0")
    @NotNull(message = "充值金额不能为空")
    private Double amount;
    /**
    * 充值后余额
    */
    private Double afterrecharge;
     * 充值后余额
     */
    @Schema(description = "充值后余额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @Min(value = 0, message = "钱包余额不能小于0")
    private Double afterRecharge;
    /**
    * 充值时间
    */
    private Date rechargedt;
    /**
    * 备注信息
    */
    private String remarks;
     * 充值时间
     */
    @Schema(description = "充值时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Date rechargeTime;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoSe/SeWalletRechargeHistory.java
File was deleted
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/AmountToChinese.java
New file
@@ -0,0 +1,57 @@
package com.dy.pipIrrGlobal.util;
import java.math.BigDecimal;
/**
 * @author ZhuBaoMin
 * @date 2024-02-01 9:58
 * @LastEditTime 2024-02-01 9:58
 * @Description 金额数字转中文大写
 */
public class AmountToChinese {
    private static final String[] CN_UPPER_NUMBER = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" };
    private static final String[] CN_UPPER_MONETRAY_UNIT = { "分", "角", "元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟" };
    private static final String CN_FULL = "整";
    private static final String CN_NEGATIVE = "负";
    private static final int MONEY_PRECISION = 2;
    private static final String CN_ZEOR_FULL = "零元" + CN_FULL;
    public static String toChinese(BigDecimal amount) {
        StringBuilder result = new StringBuilder();
        amount = amount.setScale(MONEY_PRECISION, BigDecimal.ROUND_HALF_UP);
        long number = amount.movePointRight(MONEY_PRECISION).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
        boolean zero = true;
        int unitIndex = 0;
        if (number == 0) {
            return CN_ZEOR_FULL;
        }
        if (number < 0) {
            number = -number;
            result.append(CN_NEGATIVE);
        }
        long scale = 10;
        while (true) {
            if (number == 0) {
                break;
            }
            long numIndex = number % scale;
            if (zero && numIndex == 0) {
                zero = false;
            }
            if (numIndex != 0) {
                result.insert(0, CN_UPPER_MONETRAY_UNIT[unitIndex])
                        .insert(0, CN_UPPER_NUMBER[(int) numIndex]);
                zero = false;
            }
            else if (!zero) {
                result.insert(0, CN_UPPER_NUMBER[(int) numIndex]);
            }
            number = number / scale;
            unitIndex++;
        }
        if (zero) {
            result.append(CN_FULL);
        }
        return result.toString();
    }
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java
@@ -31,8 +31,8 @@
    @Schema(title = "赠送金额")
    private Float gift;
    @Schema(title = "总额")
    private Float totalAmount;
    @Schema(title = "返还金额")
    private Float refundAmount;
    @Schema(title = "交易日期")
    private String operateDate;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoOperate.java
New file
@@ -0,0 +1,55 @@
package com.dy.pipIrrGlobal.voSe;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-02-05 11:23
 * @LastEditTime 2024-02-05 11:23
 * @Description
 */
@Data
@Schema(title = "通用操作记录视图对象")
public class VoOperate {
    private static final long serialVersionUID = 202402051126001L;
    @Schema(title = "农户姓名")
    private String clientName;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "水卡编号")
    private String cardNum;
    @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;
    //注销查询2个返回值
    @Schema(title = "退回金额")
    private Float refund;
    @Schema(title = "退款方式名称")
    private String refundTypeName;
    //挂失1个返回值
    @Schema(title = "卡片余额及冲正后余额")
    private Double money;
    //冲正2个返回值,冲正后余额与挂失共用
    @Schema(title = "冲正前余额")
    private Double systemBalance;
    //解锁1个返回值,与挂失共用
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoReceipt.java
New file
@@ -0,0 +1,76 @@
package com.dy.pipIrrGlobal.voSe;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-02-01 10:36
 * @LastEditTime 2024-02-01 10:36
 * @Description 收据视图对象
 */
@Data
@Schema(title = "收据视图对象")
public class VoReceipt {
    private static final long serialVersionUID = 202402011037001L;
    @Schema(title = "收银员ID")
    private String cashierId;
    @Schema(title = "订单号")
    private String orderNumber;
    @Schema(title = "镇名称")
    private String townName;
    @Schema(title = "村名称")
    private String villageName;
    @Schema(title = "农户姓名")
    private String name;
    @Schema(title = "电话")
    private String phone;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "水卡编号")
    private String cardNum;
    @Schema(title = "业务类型")
    private String operateType;
    @Schema(title = "购水金额")
    private Double waterCost;
    @Schema(title = "购卡金额")
    private Double cardCost;
    @Schema(title = "收费金额")
    private Double amount;
    @Schema(title = "水卡余额")
    private Double money;
    @Schema(title = "支付方式")
    private String paymentName;
    @Schema(title = "操作人")
    private String operatorName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "操作时间")
    private Date operateTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "当前时间")
    private Date currentTime;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoRecharge.java
@@ -35,11 +35,14 @@
    @Schema(title = "充值金额")
    private Float amount;
    @Schema(title = "返回金额")
    private Float refundAmount;
    @Schema(title = "充值后金额")
    private Float afterRecharge;
    @Schema(title = "支付方式")
    private Integer paymentId;
    private String paymentName;
    @Schema(title = "水价")
    private Float price;
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java
New file
@@ -0,0 +1,66 @@
package com.dy.pipIrrGlobal.voSe;
import com.dy.common.po.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-02-01 20:38
 * @LastEditTime 2024-02-01 20:38
 * @Description
 */
@Data
@Schema(title = "财务对账,交易明细视图对象")
public class VoTradeDetails implements BaseEntity {
    private static final long serialVersionUID = 202402012040001L;
    @Schema(title = "收银员ID")
    private String cashierId;
    @Schema(title = "区划名称串")
    private String districtTitle;
    @Schema(title = "村庄ID")
    private String villageId;
    @Schema(title = "农户姓名")
    private String clientName;
    @Schema(title = "联系电话")
    private String phone;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "业务类型")
    private String operateType;
    @Schema(title = "交易金额")
    private Double tradeAmount;
    @Schema(title = "购水金额")
    private Double waterCost;
    @Schema(title = "购卡金额")
    private Double cardCost;
    @Schema(title = "赠送金额")
    private Double gift;
    @Schema(title = "返回金额")
    private Double refundAmount;
    @Schema(title = "付款方式")
    private String paymentName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "交易时间")
    private Date tradeTime;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTransactionStatistics.java
@@ -30,4 +30,10 @@
    @Schema(title = "赠送金额")
    private Float gift;
    @Schema(title = "返还金额")
    private Float refundAmount;
    @Schema(title = "收银员ID")
    private String cashierId;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWallet.java
New file
@@ -0,0 +1,33 @@
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-31 16:15
 * @LastEditTime 2024-01-31 16:15
 * @Description
 */
@Data
@Schema(title = "电子钱包账户视图对象")
public class VoWallet implements BaseEntity {
    private static final long serialVersionUID = 202401311618001L;
    @Schema(title = "农户ID")
    private String clientId;
    @Schema(title = "农户姓名")
    private String name;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "手机号")
    private String phone;
    @Schema(title = "电子钱包余额")
    private Double money;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWalletConsume.java
New file
@@ -0,0 +1,37 @@
package com.dy.pipIrrGlobal.voSe;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-01-31 18:23
 * @LastEditTime 2024-01-31 18:23
 * @Description
 */
@Data
@Schema(title = "电子钱包消费视图对象")
public class VoWalletConsume {
    private static final long serialVersionUID = 202401311824001L;
    @Schema(title = "消费金额")
    private Double consumption;
    @Schema(title = "用水时长")
    private Double duration;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "开阀时间")
    private Date vot;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "关阀时间")
    private Date vct;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWalletRecharge.java
New file
@@ -0,0 +1,41 @@
package com.dy.pipIrrGlobal.voSe;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-01-31 16:43
 * @LastEditTime 2024-01-31 16:43
 * @Description
 */
@Data
@Schema(title = "电子钱包充值视图对象")
public class VoWalletRecharge {
    private static final long serialVersionUID = 202401311644001L;
    @Schema(title = "农户姓名")
    private String name;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "手机号")
    private String phone;
    @Schema(title = "充值金额")
    private Double amount;
    @Schema(title = "电子钱包余额")
    private Double afterRecharge;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "充值时间")
    private Date rechargeTime;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoWalletRefund.java
New file
@@ -0,0 +1,52 @@
package com.dy.pipIrrGlobal.voSe;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @author ZhuBaoMin
 * @date 2024-01-31 18:29
 * @LastEditTime 2024-01-31 18:29
 * @Description
 */
@Data
@Schema(title = "电子钱包退款视图对象")
public class VoWalletRefund {
    private static final long serialVersionUID = 202401311830001L;
    @Schema(title = "农户姓名")
    private String name;
    @Schema(title = "农户编号")
    private String clientNum;
    @Schema(title = "手机号")
    private String phone;
    @Schema(title = "申请退款金额")
    private Double refundAmount;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "申请时间")
    private Date applicationTime;
    @Schema(title = "退款状态代码")
    private Byte refundStatus;
    @Schema(title = "退款状态名称")
    private String refundStatusName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(title = "审核时间")
    private Date auditTime;
    @Schema(title = "审核备注")
    private String remarks;
}
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
@@ -112,6 +112,10 @@
        webPort: 8085
        actutorPort: 9085
        idSuffix: 7
    webchat:
        webPort: 8086
        actutorPort: 9086
        idSuffix: 8
#项目编号
#projectCode:
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaRolePermissionsMapper.xml
@@ -129,8 +129,10 @@
      </if>
    </where>
    ORDER BY role.operate_dt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -317,9 +317,11 @@
            </if>
        </where>
        ORDER BY user.id DESC
        <if test="pageCurr != null and pageSize != null">
            LIMIT ${pageCurr}, ${pageSize}
        </if>
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
    <!--根据用户编号获取角色ID列表-->
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrControllerMapper.xml
@@ -215,9 +215,11 @@
      </if>
    </where>
    ORDER BY con.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据控制器地址获取控制器列表-->
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
@@ -283,9 +283,11 @@
      </if>
    </where>
    ORDER BY divi.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据分水房ID逻辑删除分水房-->
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowMonitoringMapper.xml
@@ -248,9 +248,10 @@
            </if>
        </where>
        ORDER BY pmofl.operateDt DESC
        <if test="pageCurr != null and pageSize != null">
            LIMIT ${pageCurr}, ${pageSize}
        </if>
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrFlowmeterMapper.xml
@@ -207,8 +207,10 @@
      </if>
    </where>
    ORDER BY pfm.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeActiveCardMapper.xml
@@ -231,8 +231,10 @@
      </if>
    </where>
    ORDER BY act.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCancelMapper.xml
@@ -186,8 +186,10 @@
      </if>
    </where>
    ORDER BY can.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml
@@ -13,8 +13,9 @@
    <result column="price" jdbcType="FLOAT" property="price" />
    <result column="card_cost" jdbcType="INTEGER" property="cardCost" />
    <result column="gift" jdbcType="FLOAT" property="gift" />
    <result column="refund_amount" jdbcType="FLOAT" property="refundAmount" />
    <result column="no_trade_amount" jdbcType="FLOAT" property="noTradeAmount" />
    <result column="operate_type_id" jdbcType="BIGINT" property="operateType" />
    <result column="operate_type" jdbcType="TINYINT" property="operateType" />
    <result column="payment_id" jdbcType="BIGINT" property="paymentId" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="operator" jdbcType="BIGINT" property="operator" />
@@ -23,7 +24,7 @@
  <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
    refund_amount, no_trade_amount, operate_type, payment_id, remarks, `operator`, operate_dt
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -42,15 +43,15 @@
    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
      )
      refund_amount, 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}
      )
      #{refundAmount,jdbcType=FLOAT}, #{noTradeAmount,jdbcType=FLOAT}, #{operateType,jdbcType=TINYINT},
      #{paymentId,jdbcType=BIGINT}, #{remarks,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
      #{operateDt,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeCardOperate">
    <!--@mbg.generated-->
@@ -83,11 +84,14 @@
      <if test="gift != null">
        gift,
      </if>
      <if test="refundAmount != null">
        refund_amount,
      </if>
      <if test="noTradeAmount != null">
        no_trade_amount,
      </if>
      <if test="operateType != null">
        operate_type_id,
        operate_type,
      </if>
      <if test="paymentId != null">
        payment_id,
@@ -130,11 +134,14 @@
      <if test="gift != null">
        #{gift,jdbcType=FLOAT},
      </if>
      <if test="refundAmount != null">
        #{refundAmount,jdbcType=FLOAT},
      </if>
      <if test="noTradeAmount != null">
        #{noTradeAmount,jdbcType=FLOAT},
      </if>
      <if test="operateType != null">
        #{operateType,jdbcType=BIGINT},
        #{operateType,jdbcType=TINYINT},
      </if>
      <if test="paymentId != null">
        #{paymentId,jdbcType=BIGINT},
@@ -178,11 +185,14 @@
      <if test="gift != null">
        gift = #{gift,jdbcType=FLOAT},
      </if>
      <if test="refundAmount != null">
        refund_amount = #{refundAmount,jdbcType=FLOAT},
      </if>
      <if test="noTradeAmount != null">
        no_trade_amount = #{noTradeAmount,jdbcType=FLOAT},
      </if>
      <if test="operateType != null">
        operate_type_id = #{operateType,jdbcType=BIGINT},
        operate_type = #{operateType,jdbcType=TINYINT},
      </if>
      <if test="paymentId != null">
        payment_id = #{paymentId,jdbcType=BIGINT},
@@ -210,8 +220,9 @@
      price = #{price,jdbcType=FLOAT},
      card_cost = #{cardCost,jdbcType=INTEGER},
      gift = #{gift,jdbcType=FLOAT},
      refund_amount = #{refundAmount,jdbcType=FLOAT},
      no_trade_amount = #{noTradeAmount,jdbcType=FLOAT},
      operate_type_id = #{operateType,jdbcType=BIGINT},
      operate_type = #{operateType,jdbcType=TINYINT},
      payment_id = #{paymentId,jdbcType=BIGINT},
      remarks = #{remarks,jdbcType=VARCHAR},
      `operator` = #{operator,jdbcType=BIGINT},
@@ -226,8 +237,10 @@
    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
        INNER JOIN ba_user us ON ope.operator = us.id
        Left JOIN se_payment_method pay ON ope.payment_id = pay.id
    <where>
      AND ope.operate_type = 2
      AND ope.operate_type in(2, 5)
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
@@ -253,21 +266,25 @@
  <!--根据指定条件获取充值记录-->
  <select id="getRecharges" resultType="com.dy.pipIrrGlobal.voSe.VoRecharge">
    SELECT
        CAST(ope.id AS char) AS id ,
        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,
        CAST(card.cardNum AS char) AS cardNum,
        IFNULL(ope.trade_amount, 0) AS amount,
        IFNULL(ope.refund_amount, 0) AS refundAmount,
        (IFNULL(ope.money, 0) + IFNULL(ope.trade_amount, 0)) AS afterRecharge,
        --     ope.payment_id AS paymentId,
        pay.name AS paymentName,
        ope.price,
        (SELECT `name` FROM ba_user WHERE id =  ope.operator) AS operator,
        us.name 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_card card ON ope.card_id = card.id
        INNER JOIN se_client cli ON ope.client_id = cli.id
        INNER JOIN ba_user us ON ope.operator = us.id
        Left JOIN se_payment_method pay ON ope.payment_id = pay.id
    <where>
      AND ope.operate_type = 2
      AND ope.operate_type in(2, 5)
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
@@ -289,171 +306,57 @@
      </if>
    </where>
    ORDER BY ope.operate_dt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </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
    FROM v_trade_details
    <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}
        AND villageId = ${villageId}
      </if>
      <if test = "operateTimeStart != null and operateTimeStop != null">
        AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
        AND tradeTime BETWEEN #{operateTimeStart} AND #{operateTimeStop}
      </if>
      <if test = "cashierId != null and cashierId > 0">
        AND cashierId = ${cashierId}
      </if>
      <if test = "tradeTime != null">
        AND tradeTime = #{tradeTime}
      </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
  <select id="getTransactions" resultType="com.dy.pipIrrGlobal.voSe.VoTradeDetails">
    SELECT * FROM v_trade_details
    <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}
        AND villageId = ${villageId}
      </if>
      <if test = "operateTimeStart != null and operateTimeStop != null">
        AND ope.operate_dt BETWEEN #{operateTimeStart} AND #{operateTimeStop}
        AND tradeTime BETWEEN #{operateTimeStart} AND #{operateTimeStop}
      </if>
      <if test = "cashierId != null and cashierId > 0">
        AND user.id = ${cashierId}
        AND cashierId = ${cashierId}
      </if>
    </where>
    ORDER BY ope.operate_dt
    ORDER BY tradeTime
    <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>
  <!--根据指定条件获取开卡记录数量-->
@@ -484,7 +387,7 @@
  </select>
  <!--根据指定条件获取开卡记录-->
  <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCardNew">
  <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCard">
    SELECT
    CAST(ope.id AS char) AS id ,
    cli.name AS clientName,
@@ -522,9 +425,11 @@
      </if>
    </where>
    ORDER BY ope.operate_dt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据指定条件获取补卡记录数量-->
@@ -579,8 +484,185 @@
      </if>
    </where>
    ORDER BY ope.operate_dt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据指定条件获取通用操作记录数量-->
  <select id="getCommonOperationRecordCount" 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 us ON ope.operator = us.id
    <where>
      <if test = "operateType != null and operateType > 0">
        AND ope.operate_type = ${operateType}
      </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>
      <if test = "timeStart != null and timeStop != null">
        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取通用操作记录-->
  <select id="getCommonOperations" resultType="com.dy.pipIrrGlobal.voSe.VoOperate">
    SELECT
        cli.name AS clientName,
        cli.clientNum,
        CAST(card.cardNum AS char) AS cardNum,
        us.name AS operator,
        ope.operate_dt AS operateDt,
        IFNULL(ope.trade_amount,0) AS refund,
        (CASE
            WHEN ope.payment_id = 1 THEN "现金"
        END) AS refundTypeName,
        card.money,
        IFNULL(ope.system_balance,0) AS systemBalance
    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 us ON ope.operator = us.id
    <where>
      <if test = "operateType != null and operateType > 0">
        AND ope.operate_type = ${operateType}
      </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>
      <if test = "timeStart != null and timeStop != null">
        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY ope.operate_dt DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据指定条件获取收据列表数-->
  <select id="getReceiptsRecordCount" 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 se_payment_method pay ON ope.payment_id = pay.id
    INNER JOIN ba_user us ON ope.operator = us.id
    INNER JOIN ba_district vil ON cli.villageId = vil.id
    INNER JOIN ba_district tow ON cli.townId = tow.id
    <where>
      AND ope.operate_type IN(1,2)
      <if test = "operateId != null and operateId > 0">
        AND ope.id = ${operateId}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取收据列表-->
  <select id="getReceipts" resultType="com.dy.pipIrrGlobal.voSe.VoReceipt">
    SELECT
    CAST(ope.id AS char) AS orderNumber,
    tow.name AS townName,
    vil.name AS villageName,
    cli.`name`,
    cli.phone,
    CAST(cli.clientNum AS char) AS clientNum,
    CAST(card.cardNum AS char) AS cardNum,
    (CASE
    WHEN ope.operate_type = 1 THEN '开卡'
    WHEN ope.operate_type = 2 THEN '充值'
    END) AS operateType,
    IFNULL(ope.trade_amount,0) AS waterCost,
    IFNULL(ope.card_cost,0) AS cardCost,
    (IFNULL(ope.trade_amount,0) + IFNULL(ope.card_cost,0)) AS amount,
    card.money,
    pay.`name` AS paymentName,
    us.`name` AS operatorName,
    ope.operate_dt AS operateTime,
    NOW() AS currentTime
    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 se_payment_method pay ON ope.payment_id = pay.id
    INNER JOIN ba_user us ON ope.operator = us.id
    INNER JOIN ba_district vil ON cli.villageId = vil.id
    INNER JOIN ba_district tow ON cli.townId = tow.id
    <where>
      AND ope.operate_type IN(1,2)
      <if test = "operateId != null and operateId > 0">
        AND ope.id = ${operateId}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY ope.operate_dt DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据指定条件获取收据收费金额合计-->
  <select id="getTotalAmount" parameterType="java.util.Map" resultType="java.lang.Double">
    SELECT
    SUM(IFNULL(ope.trade_amount,0) + IFNULL(ope.card_cost,0)) AS totalAmount
    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 se_payment_method pay ON ope.payment_id = pay.id
    INNER JOIN ba_user us ON ope.operator = us.id
    INNER JOIN ba_district vil ON cli.villageId = vil.id
    INNER JOIN ba_district tow ON cli.townId = tow.id
    <where>
      AND ope.operate_type IN(1,2)
      <if test = "operateId != null and operateId > 0">
        AND ope.id = ${operateId}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientCardMapper.xml
@@ -381,8 +381,10 @@
      </if>
    </where>
    ORDER BY card.id
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeClientMapper.xml
@@ -384,9 +384,11 @@
      </if>
    </where>
    ORDER BY cli.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--根据农户编号获取5级行政区划代码-->
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeConsumeMapper.xml
New file
@@ -0,0 +1,200 @@
<?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.SeConsumeMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeConsume">
    <!--@mbg.generated-->
    <!--@Table se_consume-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="wallet_id" jdbcType="BIGINT" property="walletId" />
    <result column="client_id" jdbcType="BIGINT" property="clientId" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="consumption" jdbcType="FLOAT" property="consumption" />
    <result column="after_consume" jdbcType="FLOAT" property="afterConsume" />
    <result column="duration" jdbcType="FLOAT" property="duration" />
    <result column="vot" jdbcType="TIMESTAMP" property="vot" />
    <result column="vct" jdbcType="TIMESTAMP" property="vct" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, wallet_id, client_id, money, consumption, after_consume, duration, vot, vct
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from se_consume
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_consume
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeConsume">
    <!--@mbg.generated-->
    insert into se_consume (id, wallet_id, client_id,
      money, consumption, after_consume,
      duration, vot, vct
      )
    values (#{id,jdbcType=BIGINT}, #{walletId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT},
      #{money,jdbcType=FLOAT}, #{consumption,jdbcType=FLOAT}, #{afterConsume,jdbcType=FLOAT},
      #{duration,jdbcType=FLOAT}, #{vot,jdbcType=TIMESTAMP}, #{vct,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeConsume">
    <!--@mbg.generated-->
    insert into se_consume
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="walletId != null">
        wallet_id,
      </if>
      <if test="clientId != null">
        client_id,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="consumption != null">
        consumption,
      </if>
      <if test="afterConsume != null">
        after_consume,
      </if>
      <if test="duration != null">
        duration,
      </if>
      <if test="vot != null">
        vot,
      </if>
      <if test="vct != null">
        vct,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="walletId != null">
        #{walletId,jdbcType=BIGINT},
      </if>
      <if test="clientId != null">
        #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="consumption != null">
        #{consumption,jdbcType=FLOAT},
      </if>
      <if test="afterConsume != null">
        #{afterConsume,jdbcType=FLOAT},
      </if>
      <if test="duration != null">
        #{duration,jdbcType=FLOAT},
      </if>
      <if test="vot != null">
        #{vot,jdbcType=TIMESTAMP},
      </if>
      <if test="vct != null">
        #{vct,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeConsume">
    <!--@mbg.generated-->
    update se_consume
    <set>
      <if test="walletId != null">
        wallet_id = #{walletId,jdbcType=BIGINT},
      </if>
      <if test="clientId != null">
        client_id = #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="consumption != null">
        consumption = #{consumption,jdbcType=FLOAT},
      </if>
      <if test="afterConsume != null">
        after_consume = #{afterConsume,jdbcType=FLOAT},
      </if>
      <if test="duration != null">
        duration = #{duration,jdbcType=FLOAT},
      </if>
      <if test="vot != null">
        vot = #{vot,jdbcType=TIMESTAMP},
      </if>
      <if test="vct != null">
        vct = #{vct,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeConsume">
    <!--@mbg.generated-->
    update se_consume
    set wallet_id = #{walletId,jdbcType=BIGINT},
      client_id = #{clientId,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      consumption = #{consumption,jdbcType=FLOAT},
      after_consume = #{afterConsume,jdbcType=FLOAT},
      duration = #{duration,jdbcType=FLOAT},
      vot = #{vot,jdbcType=TIMESTAMP},
      vct = #{vct,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据农户ID获取消费汇总记录-->
  <select id="getWalletConsumeSum" resultType="java.util.Map">
    SELECT
      cli.name AS clientName,
      cli.clientNum,
      wal.money,
      (SELECT SUM(consumption) FROM se_consume WHERE client_id = cli.id) AS totalConsume
    FROM se_client cli
           INNER JOIN se_wallet wal ON wal.client_id = cli.id
    <where>
      <if test = "clientId != null and clientId > 0">
        AND cli.id = ${clientId}
      </if>
    </where>
  </select>
  <!--根据农户ID获取电子钱包消费记录数-->
  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM se_consume
    <where>
      <if test = "clientId != null and clientId > 0">
        AND client_id = ${clientId}
      </if>
    </where>
  </select>
  <!--根据农户ID获取电子钱包消费记录-->
  <select id="getWalletConsumes" resultType="com.dy.pipIrrGlobal.voSe.VoWalletConsume">
    SELECT
        consumption,
        duration,
        vot,
        vct
    FROM se_consume
    <where>
      <if test = "clientId != null and clientId > 0">
        AND client_id = ${clientId}
      </if>
    </where>
    ORDER BY vct DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
@@ -9,13 +9,13 @@
    <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="refund_amount" jdbcType="FLOAT" property="refundAmount" />
    <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
    id, cashier_id, cashier_name, trade_amount, gift, refund_amount, operate_date, audit_status
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -32,10 +32,10 @@
  <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,
      trade_amount, gift, refund_amount,
      operate_date, audit_status)
    values (#{id,jdbcType=BIGINT}, #{cashierId,jdbcType=BIGINT}, #{cashierName,jdbcType=VARCHAR}, 
      #{tradeAmount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT},
      #{tradeAmount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{refundAmount,jdbcType=FLOAT},
      #{operateDate,jdbcType=TIMESTAMP}, #{auditStatus,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
@@ -57,8 +57,8 @@
      <if test="gift != null">
        gift,
      </if>
      <if test="totalAmount != null">
        total_amount,
      <if test="refundAmount != null">
        refund_amount,
      </if>
      <if test="operateDate != null">
        operate_date,
@@ -83,8 +83,8 @@
      <if test="gift != null">
        #{gift,jdbcType=FLOAT},
      </if>
      <if test="totalAmount != null">
        #{totalAmount,jdbcType=FLOAT},
      <if test="refundAmount != null">
        #{refundAmount,jdbcType=FLOAT},
      </if>
      <if test="operateDate != null">
        #{operateDate,jdbcType=TIMESTAMP},
@@ -110,8 +110,8 @@
      <if test="gift != null">
        gift = #{gift,jdbcType=FLOAT},
      </if>
      <if test="totalAmount != null">
        total_amount = #{totalAmount,jdbcType=FLOAT},
      <if test="refundAmount != null">
        refund_amount = #{refundAmount,jdbcType=FLOAT},
      </if>
      <if test="operateDate != null">
        operate_date = #{operateDate,jdbcType=TIMESTAMP},
@@ -129,7 +129,7 @@
      cashier_name = #{cashierName,jdbcType=VARCHAR},
      trade_amount = #{tradeAmount,jdbcType=FLOAT},
      gift = #{gift,jdbcType=FLOAT},
      total_amount = #{totalAmount,jdbcType=FLOAT},
      refund_amount = #{refundAmount,jdbcType=FLOAT},
      operate_date = #{operateDate,jdbcType=TIMESTAMP},
      audit_status = #{auditStatus,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
@@ -148,15 +148,43 @@
    SELECT
        us.id AS cashierId,
        us.`name` AS cashierName,
        IFNULL(SUM(ope.trade_amount),0) AS tradeAmount,
        (IFNULL(SUM(ope.trade_amount),0) + IFNULL(SUM(ope.card_cost),0)) AS tradeAmount,
        IFNULL(SUM(ope.gift),0) AS gift,
        IFNULL((SUM(ope.trade_amount) + SUM(ope.gift)),0) AS totalAmount,
        IFNULL(SUM(ope.refund_amount),0) AS refundAmount,
        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)
    UNION ALL
    SELECT
        1000000 AS cashierId,
        '微信' AS cashierName,
        IFNULL(SUM(amount), 0) AS tradeAmount,
        0 AS gift,
        0 AS refundAmount,
        Date(recharge_time) AS operateDate,
        1 AS auditStatus
    FROM se_wallet_recharge
    WHERE Date(recharge_time) = #{operateDate}
    GROUP BY Date(recharge_time)
    UNION ALL
    SELECT
        1000000 AS cashierId,
        '微信' AS cashierName,
        IFNULL(-SUM(refund_amount), 0) AS tradeAmount,
        0 AS gift,
        0 AS refundAmount,
        Date(audit_time) AS operateDate,
        1 AS auditStatus
    FROM se_refund
    WHERE Date(audit_time) = #{operateDate}
    GROUP BY Date(audit_time)
  </select>
  <!--根据指定条件获取总账记录数-->
@@ -187,7 +215,7 @@
        cashier_name AS cashierName,
        trade_amount AS tradeAmount,
        gift,
        total_amount AS totalAmount,
        refund_amount AS refundAmount,
        Date(operate_date) AS operateDate,
        (CASE
          WHEN audit_status = 1 THEN "未审核"
@@ -209,9 +237,11 @@
      </if>
    </where>
    ORDER BY Date(operate_date) DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--获取指定日期、指定收银员、指定支付方式实收金额合计-->
@@ -235,55 +265,70 @@
    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
<!--  <select id="getToAuditRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">-->
<!--    SELECT-->
<!--    COUNT(*) AS recordCount-->
<!--    FROM v_trade_summary-->
<!--    <where>-->
<!--      <if test = "cashierId != null and cashierId > 0">-->
<!--        AND cashierId = ${cashierId}-->
<!--      </if>-->
<!--      <if test = "tradeDate != null">-->
<!--        AND tradeDate = #{tradeDate}-->
<!--      </if>-->
<!--    </where>-->
<!--  </select>-->
  <!--开卡系统交易统计,收银员+日期+类型分组-->
  <select id="getSummaries" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics">
    SELECT * FROM v_trade_summary
    <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 test = "timeStart != null and timeStop != null">
        AND Date(tradeDate) BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY tradeDate
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
  </select>
  <!--  根据收银员ID及日期获取财务对账_交易明细记录数-->
  <select id="getTradeDetailsRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM v_trade_details
    <where>
      <if test = "cashierId != null and cashierId > 0">
        AND cashierId = ${cashierId}
      </if>
      <if test = "tradeDate != null">
        AND Date(tradeTime) = #{tradeDate}
      </if>
    </where>
  </select>
  <!--根据收银员ID及日期获取财务对账_交易明细记录-->
  <select id="getTradeDetails" resultType="com.dy.pipIrrGlobal.voSe.VoTradeDetails">
    SELECT * FROM v_trade_details
    <where>
      <if test = "cashierId != null and cashierId > 0">
        AND cashierId = ${cashierId}
      </if>
      <if test = "tradeDate != null">
        AND Date(tradeTime) = #{tradeDate}
      </if>
    </where>
    ORDER BY tradeTime
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeLossMapper.xml
@@ -182,8 +182,10 @@
      </if>
    </where>
    ORDER BY loss.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml
@@ -258,8 +258,10 @@
      </if>
    </where>
    ORDER BY rec.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRefundMapper.xml
New file
@@ -0,0 +1,246 @@
<?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.SeRefundMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeRefund">
    <!--@mbg.generated-->
    <!--@Table se_refund-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="wallet_id" jdbcType="BIGINT" property="walletId" />
    <result column="client_id" jdbcType="BIGINT" property="clientId" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="refund_amount" jdbcType="FLOAT" property="refundAmount" />
    <result column="after_refund" jdbcType="FLOAT" property="afterRefund" />
    <result column="application_time" jdbcType="TIMESTAMP" property="applicationTime" />
    <result column="refund_status" jdbcType="TINYINT" property="refundStatus" />
    <result column="auditor" jdbcType="BIGINT" property="auditor" />
    <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, wallet_id, client_id, money, refund_amount, after_refund, application_time, refund_status,
    auditor, audit_time, remarks
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from se_refund
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_refund
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRefund">
    <!--@mbg.generated-->
    insert into se_refund (id, wallet_id, client_id,
      money, refund_amount, after_refund,
      application_time, refund_status, auditor,
      audit_time, remarks)
    values (#{id,jdbcType=BIGINT}, #{walletId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT},
      #{money,jdbcType=FLOAT}, #{refundAmount,jdbcType=FLOAT}, #{afterRefund,jdbcType=FLOAT},
      #{applicationTime,jdbcType=TIMESTAMP}, #{refundStatus,jdbcType=TINYINT}, #{auditor,jdbcType=BIGINT},
      #{auditTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRefund">
    <!--@mbg.generated-->
    insert into se_refund
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="walletId != null">
        wallet_id,
      </if>
      <if test="clientId != null">
        client_id,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="refundAmount != null">
        refund_amount,
      </if>
      <if test="afterRefund != null">
        after_refund,
      </if>
      <if test="applicationTime != null">
        application_time,
      </if>
      <if test="refundStatus != null">
        refund_status,
      </if>
      <if test="auditor != null">
        auditor,
      </if>
      <if test="auditTime != null">
        audit_time,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="walletId != null">
        #{walletId,jdbcType=BIGINT},
      </if>
      <if test="clientId != null">
        #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="refundAmount != null">
        #{refundAmount,jdbcType=FLOAT},
      </if>
      <if test="afterRefund != null">
        #{afterRefund,jdbcType=FLOAT},
      </if>
      <if test="applicationTime != null">
        #{applicationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="refundStatus != null">
        #{refundStatus,jdbcType=TINYINT},
      </if>
      <if test="auditor != null">
        #{auditor,jdbcType=BIGINT},
      </if>
      <if test="auditTime != null">
        #{auditTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRefund">
    <!--@mbg.generated-->
    update se_refund
    <set>
      <if test="walletId != null">
        wallet_id = #{walletId,jdbcType=BIGINT},
      </if>
      <if test="clientId != null">
        client_id = #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="refundAmount != null">
        refund_amount = #{refundAmount,jdbcType=FLOAT},
      </if>
      <if test="afterRefund != null">
        after_refund = #{afterRefund,jdbcType=FLOAT},
      </if>
      <if test="applicationTime != null">
        application_time = #{applicationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="refundStatus != null">
        refund_status = #{refundStatus,jdbcType=TINYINT},
      </if>
      <if test="auditor != null">
        auditor = #{auditor,jdbcType=BIGINT},
      </if>
      <if test="auditTime != null">
        audit_time = #{auditTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRefund">
    <!--@mbg.generated-->
    update se_refund
    set wallet_id = #{walletId,jdbcType=BIGINT},
      client_id = #{clientId,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      refund_amount = #{refundAmount,jdbcType=FLOAT},
      after_refund = #{afterRefund,jdbcType=FLOAT},
      application_time = #{applicationTime,jdbcType=TIMESTAMP},
      refund_status = #{refundStatus,jdbcType=TINYINT},
      auditor = #{auditor,jdbcType=BIGINT},
      audit_time = #{auditTime,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据钱包ID获取待审核的退款申请对象-->
  <select id="getRefundByWallerId" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
        <include refid="Base_Column_List" />
    from se_refund
    where refund_status = 1 AND wallet_id = ${walletId}
  </select>
  <!--根据指定条件获取电子钱包退款记录数-->
  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM se_refund ref
        INNER JOIN se_client cli ON ref.client_id = cli.id
    <where>
      <if test = "refundStatus != null and refundStatus > 0">
        AND ref.refund_status = ${refundStatus}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
    </where>
  </select>
  <!--根据指定条件获取电子钱包退款记录-->
  <select id="getWalletRefunds" resultType="com.dy.pipIrrGlobal.voSe.VoWalletRefund">
    SELECT
        cli.`name`,
        cli.clientNum,
        cli.phone,
        ref.refund_amount AS refundAmount,
        ref.application_time AS applicationTime,
        ref.refund_status AS refundStatus,
        (CASE
            WHEN ref.refund_status = 1 THEN '未退款'
            WHEN ref.refund_status = 2 THEN '已退款'
        End) AS refundStatusName,
        ref.audit_time AS auditTime,
        ref.remarks
    FROM se_refund ref
        INNER JOIN se_client cli ON ref.client_id = cli.id
    <where>
      <if test = "refundStatus != null and refundStatus > 0">
        AND ref.refund_status = ${refundStatus}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
    </where>
    ORDER BY ref.application_time DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--获取指定日期微信退款(只计算已退的)总额,财务对账审核页使用-->
  <select id="getRefundSum" resultType="java.lang.Double">
    SELECT
        SUM(refund_amount) AS tradeAmount
    FROM se_refund
    <where>
      AND refund_status = 2
      <if test = "tradeDate != null and tradeDate !=''">
        AND Date(audit_time) = #{tradeDate}
      </if>
    </where>
    GROUP BY Date(audit_time)
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeReversalMapper.xml
@@ -181,8 +181,10 @@
      </if>
    </where>
    ORDER BY rev.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeUnlockMapper.xml
@@ -171,8 +171,10 @@
      </if>
    </where>
    ORDER BY unl.operateDt DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${pageCurr}, ${pageSize}
    </if>
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletMapper.xml
@@ -5,13 +5,15 @@
    <!--@mbg.generated-->
    <!--@Table se_wallet-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="client_id" jdbcType="BIGINT" property="clientId" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="createDt" jdbcType="TIMESTAMP" property="createdt" />
    <result column="last_operate" jdbcType="TINYINT" property="lastOperate" />
    <result column="last_operate_time" jdbcType="TIMESTAMP" property="lastOperateTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, clientId, money, createDt
    id, client_id, money, last_operate, last_operate_time, create_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -27,9 +29,12 @@
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    insert into se_wallet (id, clientId, money, createDt)
    values (#{id,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT},
      #{createdt,jdbcType=TIMESTAMP})
    insert into se_wallet (id, client_id, money,
      last_operate, last_operate_time, create_time
      )
    values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{money,jdbcType=FLOAT},
      #{lastOperate,jdbcType=TINYINT}, #{lastOperateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
@@ -38,28 +43,40 @@
      <if test="id != null">
        id,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientId != null">
        client_id,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="createdt != null">
        createDt,
      <if test="lastOperate != null">
        last_operate,
      </if>
      <if test="lastOperateTime != null">
        last_operate_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientId != null">
        #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="createdt != null">
        #{createdt,jdbcType=TIMESTAMP},
      <if test="lastOperate != null">
        #{lastOperate,jdbcType=TINYINT},
      </if>
      <if test="lastOperateTime != null">
        #{lastOperateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
@@ -67,14 +84,20 @@
    <!--@mbg.generated-->
    update se_wallet
    <set>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientId != null">
        client_id = #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="createdt != null">
        createDt = #{createdt,jdbcType=TIMESTAMP},
      <if test="lastOperate != null">
        last_operate = #{lastOperate,jdbcType=TINYINT},
      </if>
      <if test="lastOperateTime != null">
        last_operate_time = #{lastOperateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
@@ -82,9 +105,56 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWallet">
    <!--@mbg.generated-->
    update se_wallet
    set clientId = #{clientid,jdbcType=BIGINT},
    set client_id = #{clientId,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      createDt = #{createdt,jdbcType=TIMESTAMP}
      last_operate = #{lastOperate,jdbcType=TINYINT},
      last_operate_time = #{lastOperateTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据农户ID获取电子钱包对象-->
  <select id="getWalletByClientId" resultMap="BaseResultMap">
    SELECT
        <include refid="Base_Column_List" />
    FROM se_wallet
    WHERE client_id = ${clientId}
    LIMIT 0,1
  </select>
  <!--根据农户姓名获取电子钱包账户记录数-->
  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
    SELECT
        COUNT(*) AS recordCount
    FROM se_wallet wal
    INNER JOIN se_client cli ON wal.client_id = cli.id
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
    </where>
  </select>
  <!--根据农户姓名获取电子钱包账户记录-->
  <select id="getWallets" resultType="com.dy.pipIrrGlobal.voSe.VoWallet">
    SELECT
        CAST(cli.id AS char) AS clientId,
        cli.`name`,
        cli.clientNum,
        cli.phone,
        wal.money
    FROM se_wallet wal
        INNER JOIN se_client cli ON wal.client_id = cli.id
    <where>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
    </where>
    ORDER BY wal.last_operate_time DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeHistoryMapper.xml
File was deleted
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeWalletRechargeMapper.xml
@@ -5,17 +5,16 @@
    <!--@mbg.generated-->
    <!--@Table se_wallet_recharge-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="walletId" jdbcType="BIGINT" property="walletid" />
    <result column="clientId" jdbcType="BIGINT" property="clientid" />
    <result column="wallet_id" jdbcType="BIGINT" property="walletId" />
    <result column="client_id" jdbcType="BIGINT" property="clientId" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="amount" jdbcType="FLOAT" property="amount" />
    <result column="afterRecharge" jdbcType="FLOAT" property="afterrecharge" />
    <result column="rechargeDt" jdbcType="TIMESTAMP" property="rechargedt" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="after_recharge" jdbcType="FLOAT" property="afterRecharge" />
    <result column="recharge_time" jdbcType="TIMESTAMP" property="rechargeTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, walletId, clientId, money, amount, afterRecharge, rechargeDt, remarks
    id, wallet_id, client_id, money, amount, after_recharge, recharge_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -31,12 +30,12 @@
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    insert into se_wallet_recharge (id, walletId, clientId,
      money, amount, afterRecharge,
      rechargeDt, remarks)
    values (#{id,jdbcType=BIGINT}, #{walletid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT},
      #{money,jdbcType=FLOAT}, #{amount,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT},
      #{rechargedt,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR})
    insert into se_wallet_recharge (id, wallet_id, client_id,
      money, amount, after_recharge,
      recharge_time)
    values (#{id,jdbcType=BIGINT}, #{walletId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT},
      #{money,jdbcType=FLOAT}, #{amount,jdbcType=FLOAT}, #{afterRecharge,jdbcType=FLOAT},
      #{rechargeTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
@@ -45,11 +44,11 @@
      <if test="id != null">
        id,
      </if>
      <if test="walletid != null">
        walletId,
      <if test="walletId != null">
        wallet_id,
      </if>
      <if test="clientid != null">
        clientId,
      <if test="clientId != null">
        client_id,
      </if>
      <if test="money != null">
        money,
@@ -57,25 +56,22 @@
      <if test="amount != null">
        amount,
      </if>
      <if test="afterrecharge != null">
        afterRecharge,
      <if test="afterRecharge != null">
        after_recharge,
      </if>
      <if test="rechargedt != null">
        rechargeDt,
      </if>
      <if test="remarks != null">
        remarks,
      <if test="rechargeTime != null">
        recharge_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="walletid != null">
        #{walletid,jdbcType=BIGINT},
      <if test="walletId != null">
        #{walletId,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=BIGINT},
      <if test="clientId != null">
        #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
@@ -83,14 +79,11 @@
      <if test="amount != null">
        #{amount,jdbcType=FLOAT},
      </if>
      <if test="afterrecharge != null">
        #{afterrecharge,jdbcType=FLOAT},
      <if test="afterRecharge != null">
        #{afterRecharge,jdbcType=FLOAT},
      </if>
      <if test="rechargedt != null">
        #{rechargedt,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      <if test="rechargeTime != null">
        #{rechargeTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
@@ -98,11 +91,11 @@
    <!--@mbg.generated-->
    update se_wallet_recharge
    <set>
      <if test="walletid != null">
        walletId = #{walletid,jdbcType=BIGINT},
      <if test="walletId != null">
        wallet_id = #{walletId,jdbcType=BIGINT},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=BIGINT},
      <if test="clientId != null">
        client_id = #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
@@ -110,14 +103,11 @@
      <if test="amount != null">
        amount = #{amount,jdbcType=FLOAT},
      </if>
      <if test="afterrecharge != null">
        afterRecharge = #{afterrecharge,jdbcType=FLOAT},
      <if test="afterRecharge != null">
        after_recharge = #{afterRecharge,jdbcType=FLOAT},
      </if>
      <if test="rechargedt != null">
        rechargeDt = #{rechargedt,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      <if test="rechargeTime != null">
        recharge_time = #{rechargeTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
@@ -125,13 +115,78 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge">
    <!--@mbg.generated-->
    update se_wallet_recharge
    set walletId = #{walletid,jdbcType=BIGINT},
      clientId = #{clientid,jdbcType=BIGINT},
    set wallet_id = #{walletId,jdbcType=BIGINT},
      client_id = #{clientId,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      amount = #{amount,jdbcType=FLOAT},
      afterRecharge = #{afterrecharge,jdbcType=FLOAT},
      rechargeDt = #{rechargedt,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR}
      after_recharge = #{afterRecharge,jdbcType=FLOAT},
      recharge_time = #{rechargeTime,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_wallet_recharge rec
        INNER JOIN se_client cli ON rec.client_id = cli.id
    <where>
      <if test = "walletId != null and walletId > 0">
        AND rec.wallet_id = ${walletId}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND rec.recharge_time BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
  </select>
  <!--根据指定条件获取电子钱包充值记录-->
  <select id="getWalletRecharges" resultType="com.dy.pipIrrGlobal.voSe.VoWalletRecharge">
    SELECT
        cli.`name`,
        cli.clientNum,
        cli.phone,
        rec.amount,
        rec.after_recharge AS afterRecharge,
        rec.recharge_time AS rechargeTime
    FROM se_wallet_recharge rec
        INNER JOIN se_client cli ON rec.client_id = cli.id
    <where>
      <if test = "walletId != null and walletId > 0">
        AND rec.wallet_id = ${walletId}
      </if>
      <if test = "clientName != null and clientName !=''">
        AND cli.name like CONCAT('%',#{clientName},'%')
      </if>
      <if test = "timeStart != null and timeStop != null">
        AND rec.recharge_time BETWEEN #{timeStart} AND #{timeStop}
      </if>
    </where>
    ORDER BY rec.recharge_time DESC
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
      </if>
    </trim>
  </select>
  <!--获取指定日期微信收款总额,财务对账审核页使用-->
  <select id="getRechargeSum" resultType="java.lang.Double">
    SELECT
        SUM(amount) AS tradeAmount
    FROM se_wallet_recharge
    <where>
      <if test = "tradeDate != null and tradeDate !=''">
        AND Date(recharge_time) = #{tradeDate}
      </if>
    </where>
    GROUP BY Date(recharge_time)
  </select>
</mapper>
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java
@@ -3,15 +3,14 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoBa.BaBlockMapper;
import com.dy.pipIrrGlobal.pojoBa.BaBlock;
import com.dy.pipIrrGlobal.pojoBa.BaClientType;
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 org.springframework.transaction.annotation.Transactional;
import java.util.Map;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
@@ -58,19 +58,20 @@
        Long itemTotal = baRolePermissionsMapper.getRecordCount(params);
        QueryResultVo<List<VoRole>> 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);
        //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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        //rsVo.obj = baRoleMapper.getRoles(params);
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java
@@ -62,19 +62,8 @@
        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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
@@ -44,18 +44,8 @@
        Long itemTotal = prControllerMapper.getRecordCount(params);
        QueryResultVo<List<VoController>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = prControllerMapper.getControllers(params);
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/divide/DivideSv.java
@@ -51,19 +51,8 @@
        Long itemTotal = prDivideMapper.getRecordCount(params);
        QueryResultVo<List<VoDivide>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = prDivideMapper.getDivides(params);
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowMonitoringSv.java
@@ -4,8 +4,6 @@
import com.dy.pipIrrGlobal.daoBa.BaDistrictMapper;
import com.dy.pipIrrGlobal.daoPr.PrFlowMonitoringMapper;
import com.dy.pipIrrGlobal.pojoPr.PrFlowMonitoring;
import com.dy.pipIrrGlobal.pojoPr.PrIntake;
import com.dy.pipIrrGlobal.voPr.VoDivide;
import com.dy.pipIrrGlobal.voPr.VoFlowMonitoring;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -96,19 +94,8 @@
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ;
        QueryResultVo<List<VoFlowMonitoring>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        // 计算符合条件的记录数
        Integer itemTotal = prFlowMonitoringMapper.getRecordCountOfFlowMonitoring(params);
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/FlowmeterSv.java
@@ -4,7 +4,6 @@
import com.dy.pipIrrGlobal.daoPr.PrFlowmeterMapper;
import com.dy.pipIrrGlobal.pojoPr.PrFlowmeter;
import com.dy.pipIrrGlobal.voPr.VoFlowMeter;
import com.dy.pipIrrGlobal.voPr.VoFlowMonitoring;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -63,19 +62,8 @@
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ;
        QueryResultVo<List<VoFlowMeter>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        // 计算符合条件的记录数
        Integer itemTotal = prFlowmeterMapper.getRecordCountOfFlowMeterByOthers(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/activeCard/ActiveCardSv.java
@@ -54,18 +54,8 @@
        Long itemTotal = seActiveCardMapper.getRecordCount(params);
        QueryResultVo<List<VoActiveCard>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seActiveCardMapper.getActiveCards(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cancel/CancelSv.java
@@ -43,18 +43,8 @@
        Long itemTotal = seCancelMapper.getRecordCount(params);
        QueryResultVo<List<VoCancel>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCancelMapper.getCancels(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateCtrl.java
@@ -8,11 +8,9 @@
import com.dy.pipIrrGlobal.pojoBa.BaClient;
import com.dy.pipIrrGlobal.pojoSe.SeCardOperate;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.util.AmountToChinese;
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.pipIrrGlobal.voSe.*;
import com.dy.pipIrrSell.cardOperate.converter.RechargeDtoMapper;
import com.dy.pipIrrSell.cardOperate.dto.*;
import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM;
@@ -35,6 +33,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -482,6 +481,7 @@
        seCardOperate.setClientId(clientId);
        seCardOperate.setMoney(money);
        seCardOperate.setTradeAmount(-refund);
        seCardOperate.setPaymentId(1L);
        seCardOperate.setOperateType(OperateTypeENUM.LOSS.getCode());
        seCardOperate.setRemarks(remarks);
        seCardOperate.setOperator(operator);
@@ -667,7 +667,8 @@
        seCardOperate.setCardId(cardId);
        seCardOperate.setClientId(clientId);
        seCardOperate.setMoney(money);
        seCardOperate.setNoTradeAmount(refund);
        //seCardOperate.setNoTradeAmount(refund);
        seCardOperate.setRefundAmount(refund);
        seCardOperate.setOperateType(OperateTypeENUM.REFUND.getCode());
        seCardOperate.setRemarks(remarks);
        seCardOperate.setOperator(operator);
@@ -791,13 +792,15 @@
    public BaseResponse<QueryResultVo<List<VoRecharge>>> get(QoRecharge vo){
        try {
            QueryResultVo<List<VoRecharge>> res = cardOperateSv.getRecharges(vo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_RECHARGES.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取充值记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据指定条件获取交易明细
@@ -827,33 +830,6 @@
    /**
     * 获取交易汇总记录
     * @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
@@ -869,9 +845,9 @@
    })
    @GetMapping(path = "/getActiveCards")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoActiveCardNew>>> getActiveCards(QoActiveCard vo){
    public BaseResponse<QueryResultVo<List<VoActiveCard>>> getActiveCards(QoActiveCard vo){
        try {
            QueryResultVo<List<VoActiveCardNew>> res = cardOperateSv.getActiveCards(vo);
            QueryResultVo<List<VoActiveCard>> res = cardOperateSv.getActiveCards(vo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_ActiveCards.getMessage());
            }
@@ -881,8 +857,6 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据指定条件获取补卡记录
@@ -913,4 +887,87 @@
        }
    }
    /**
     * 根据指定条件获取通用操作记录
     * 注销、挂失、冲正、解锁通用
     * 注销-3,挂失-6,冲正-7,解锁-8
     * @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 = "/getOptions")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoOperate>>> getCommonOperations(QoCommonOperate vo){
        // 验证操作类型是否正确
        Integer operateType = Optional.ofNullable(vo.getOperateType()).orElse(0);
        if(operateType != 3 && operateType != 6 && operateType != 7 && operateType != 8) {
            return BaseResponseUtils.buildFail(SellResultCode.PARAMS_ERROR.getMessage());
        }
        try {
            QueryResultVo<List<VoOperate>> res = cardOperateSv.getCommonOperations(vo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_CANCELS.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 = "/get_receipts")
    @SsoAop()
    public BaseResponse<Map> getReceipts(QoReceipt vo){
        try {
            Map res = Optional.ofNullable(cardOperateSv.getReceipts(vo)).orElse(new HashMap());
            if(res.size() == 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_RECEIPTS.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取电子钱包账户记录", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 金额转大写
     * @param amount
     * @return
     */
    @GetMapping(path = "/amount_to_chinese")
    public BaseResponse<Boolean> amountToChinese(BigDecimal amount) {
        try {
            AmountToChinese amountToChinese = new AmountToChinese();
            String chinese = amountToChinese.toChinese(amount);
            return BaseResponseUtils.buildSuccess(chinese) ;
        } catch (Exception e) {
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java
@@ -1,5 +1,6 @@
package com.dy.pipIrrSell.cardOperate;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.dy.common.webUtil.BaseResponse;
@@ -8,6 +9,7 @@
import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
import com.dy.pipIrrGlobal.daoSe.SeGeneralMapper;
import com.dy.pipIrrGlobal.pojoSe.SeCardOperate;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.*;
@@ -22,8 +24,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.text.DecimalFormat;
import java.util.*;
/**
@@ -47,6 +48,9 @@
    @Autowired
    private ClientCardSv clientCardSv;
    @Autowired
    private SeGeneralMapper seGeneralMapper;
    /**
@@ -219,24 +223,13 @@
        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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCardOperateMapper.getRecharges(params);
        return rsVo ;
    }
    /**
     * 根据指定条件获取交易记录
@@ -244,6 +237,7 @@
     * @return
     */
    public Map getTransactions(QoTransaction vo){
        DecimalFormat df = new DecimalFormat("0.00");
        // 补齐查询时间
        String operateTimeStart = vo.operateTimeStart;
        String operateTimeStop = vo.operateTimeStop;
@@ -259,132 +253,34 @@
        // 生成查询参数
        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 = Optional.ofNullable(seCardOperateMapper.getTransactionRecordCount(params)).orElse(0L);
        List<VoTradeDetails> list = seCardOperateMapper.getTransactions(params);
        if(list.size() == 0) {
            return new HashMap();
        }
        // 获取符合条件的记录数
        Long itemTotal = seCardOperateMapper.getTransactionRecordCount(params);
        // 遍历交易明细记录,汇总购水金额、购卡金额
        Double totalWaterCost = 0.0;
        Double totalCardCost = 0.0;
        JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));
        for(int i = 0; i < array.size(); i++) {
            JSONObject job = array.getJSONObject(i);
            Double waterCost = Optional.ofNullable(job.getDouble("waterCost")).orElse(0.0);
            Double cardCost = Optional.ofNullable(job.getDouble("cardCost")).orElse(0.0);
            totalWaterCost = totalWaterCost + waterCost;
            totalCardCost = totalCardCost + cardCost;
        }
        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("waterCost", df.format(totalWaterCost));
        map_result.put("cardCost", df.format(totalCardCost));
        map_result.put("records", map_record);
        map_result.put("paymentSums", array_paymentSums);
        return map_result;
    }
@@ -394,7 +290,7 @@
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoActiveCardNew>> getActiveCards(QoActiveCard queryVo) {
    public QueryResultVo<List<VoActiveCard>> getActiveCards(QoActiveCard queryVo) {
        //完善查询充值记录的起止时间
        String activeTimeStart = queryVo.activeTimeStart;
        String activeTimeStop = queryVo.activeTimeStop;
@@ -411,19 +307,10 @@
        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);
        QueryResultVo<List<VoActiveCard>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCardOperateMapper.getActiveCards(params);
@@ -453,21 +340,80 @@
        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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCardOperateMapper.getReissueCards(params);
        return rsVo ;
    }
    /**
     * 根据指定条件获取IC卡注销记录
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoOperate>> getCommonOperations(QoCommonOperate queryVo) {
        //完善查询充值记录的起止时间
        String timeStart = queryVo.getTimeStart();
        String timeStop = queryVo.getTimeStop();
        if(timeStart != null) {
            timeStart = timeStart + " 00:00:00";
            queryVo.setTimeStart(timeStart);
        }
        if(timeStop != null) {
            timeStop = timeStop + " 23:59:59";
            queryVo.setTimeStop(timeStop);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = Optional.ofNullable(seCardOperateMapper.getCommonOperationRecordCount(params)).orElse(0L);
        QueryResultVo<List<VoOperate>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCardOperateMapper.getCommonOperations(params);
        return rsVo ;
    }
    /**
     * 根据指定条件获取收据列表
     * @param queryVo
     * @return
     */
    public Map getReceipts(QoReceipt queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        DecimalFormat df = new DecimalFormat("#.00");
        Double totalAmount = Optional.ofNullable(seCardOperateMapper.getTotalAmount(params)).orElse(0.0);
        Long itemTotal = seCardOperateMapper.getReceiptsRecordCount(params);
        QueryResultVo<List<VoReceipt>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        //rsVo.obj = seCardOperateMapper.getReceipts(params);
        //return rsVo ;
        List<VoReceipt> list = seCardOperateMapper.getReceipts(params);
        Map map_record = new HashMap();
        map_record.put("itemTotal", rsVo.itemTotal);
        map_record.put("pageCurr", rsVo.pageCurr);
        map_record.put("pageSize", rsVo.pageSize);
        map_record.put("pageTotal", rsVo.pageTotal);
        map_record.put("list", list);
        Map map_result = new HashMap();
        map_result.put("totalAmount", df.format(totalAmount));
        map_result.put("records", map_record);
        return map_result;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoCancel.java
New file
@@ -0,0 +1,34 @@
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-02-05 9:29
 * @LastEditTime 2024-02-05 9:29
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "IC卡注销记录查询条件")
public class QoCancel extends QueryConditionVo {
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "水卡编号")
    public String cardNum;
    @Schema(description = "注销时间_开始")
    public String timeStart;
    @Schema(description = "注销时间_结束")
    public String timeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoCommonOperate.java
New file
@@ -0,0 +1,39 @@
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-02-05 11:00
 * @LastEditTime 2024-02-05 11:00
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "IC卡挂失记录查询条件")
public class QoCommonOperate extends QueryConditionVo {
    /**
     * 注销-3,挂失-6,冲正-7,解锁-8
     */
    @Schema(description = "操作类型")
    public Integer operateType;
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "水卡编号")
    public Long cardNum;
    @Schema(description = "挂失时间_开始")
    public String timeStart;
    @Schema(description = "挂失时间_结束")
    public String timeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoReceipt.java
New file
@@ -0,0 +1,28 @@
package com.dy.pipIrrSell.cardOperate.qo;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-02-01 11:03
 * @LastEditTime 2024-02-01 11:03
 * @Description
 */
@Data
@Schema(name = "收据查询条件")
public class QoReceipt extends QueryConditionVo {
    @Schema(description = "交易ID")
    public Long operateId;
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "充值机时间_开始")
    public String timeStart;
    @Schema(description = "充值机时间_结束")
    public String timeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/qo/QoTransaction.java
@@ -22,8 +22,8 @@
    @Schema(description = "村ID")
    public Long villageId;
    @Schema(description = "水卡编号")
    public Long cardNum;
    //@Schema(description = "水卡编号")
    //public Long cardNum;
    @Schema(description = "交易查询起始时间")
    public String operateTimeStart;
@@ -33,4 +33,6 @@
    @Schema(description = "收银员ID")
    public Long cashierId;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientSv.java
@@ -39,18 +39,8 @@
        Long itemTotal = seClientMapper.getRecordCount(params);
        QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seClientMapper.getClients(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardSv.java
@@ -122,18 +122,8 @@
        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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seClientCardMapper.getCards(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/GeneralCtrl.java
@@ -11,6 +11,7 @@
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.QoSummary;
import com.dy.pipIrrSell.general.qo.QoToAudit;
import com.dy.pipIrrSell.result.SellResultCode;
import io.swagger.v3.oas.annotations.Operation;
@@ -65,7 +66,11 @@
        try {
            add_general();
            QueryResultVo<List<VoGeneral>> res = generalSv.getGenerals(vo);
            return BaseResponseUtils.buildSuccess(res);
            if(res.itemTotal > 0) {
                return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(SellResultCode.No_GENERALS.getMessage());
            }
        } catch (Exception e) {
            log.error("查询交易记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -166,7 +171,15 @@
        return BaseResponseUtils.buildSuccess() ;
    }
    @Operation(summary = "获得待审核交易汇总记录", description = "返回待审核交易汇总记录")
    /**
     * 开卡系统交易汇总查询与对账系统交易汇总查询共用接口
     * 开卡系统参数:收银员ID、查询起止日期
     * 对账系统参数:收银员ID、交易日期
     * @param vo
     * @return
     */
    @Operation(summary = "获得开卡系统交易统计记录", description = "返回开卡系统交易统计记录")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
@@ -175,15 +188,49 @@
                            schema = @Schema(implementation = BaClient.class))}
            )
    })
    @GetMapping(path = "getToAudit")
    @GetMapping(path = "getSummaries")
    @SsoAop()
    public BaseResponse<Map> getToAudit(QoToAudit vo){
    public BaseResponse<Map> getSummaries(QoSummary vo){
        try {
            Map res = generalSv.getToAudit(vo);
            return BaseResponseUtils.buildSuccess(res);
            Map res = generalSv.getSummaries(vo);
            if(res.size() > 0) {
                return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(SellResultCode.No_TRADE_SUMMARIES.getMessage());
            }
        } 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 = "get_trade_details")
    @SsoAop()
    public BaseResponse<Map> getTradeDetails(QoToAudit vo){
        try {
            Map res = Optional.ofNullable(generalSv.getTradeDetails(vo)).orElse(new HashMap());
            if(res.size() > 0) {
                return BaseResponseUtils.buildSuccess(res);
            }else {
                return BaseResponseUtils.buildFail(SellResultCode.No_TRADE_DETAILS.getMessage());
            }
        } catch (Exception e) {
            log.error("查询交易记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/GeneralSv.java
@@ -1,22 +1,26 @@
package com.dy.pipIrrSell.general;
import com.alibaba.fastjson2.JSON;
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.daoSe.*;
import com.dy.pipIrrGlobal.pojoSe.SeAudits;
import com.dy.pipIrrGlobal.pojoSe.SeGeneral;
import com.dy.pipIrrGlobal.voSe.VoGeneral;
import com.dy.pipIrrGlobal.voSe.VoTradeDetails;
import com.dy.pipIrrGlobal.voSe.VoTransactionStatistics;
import com.dy.pipIrrSell.general.qo.QoGeneral;
import com.dy.pipIrrSell.general.qo.QoSummary;
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.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@@ -37,6 +41,12 @@
    @Autowired
    private SeCardOperateMapper seCardOperateMapper;
    @Autowired
    private SeWalletRechargeMapper seWalletRechargeMapper;
    @Autowired
    private SeRefundMapper seRefundMapper;
    /**
     * 获取未生成总账的交易日期列表(当天的交易记录不生成总账)
@@ -75,18 +85,9 @@
        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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seGeneralMapper.getGenerals(params);
@@ -112,7 +113,7 @@
    }
    /**
     * t添加总账审核记录
     * 添加总账审核记录
     * @param po
     * @return
     */
@@ -120,59 +121,140 @@
        return seAuditsMapper.insert(po);
    }
    /**
     * 财务对账审核页,收银员+日期分组,排除交易类型分组
     * 开卡系统交易汇总查询与对账系统交易汇总查询共用服务实现类
     * @param vo
     * @return
     * @throws ParseException
     */
    public Map getToAudit(QoToAudit vo) {
        /**
         * 取出指定日期三种支付方式(现金、扫码、转账)实收金额
         */
    public Map getSummaries(QoSummary vo) throws ParseException {
        DecimalFormat df = new DecimalFormat("0.00");
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        // 接收传入参数:交易起止日期、收银员ID
        JSONArray array_paymentSums = new JSONArray();
        String tradeDate = vo.getTradeDate();
        Date timeStart = dateFormat.parse(vo.getTimeStart());
        Date timeStop = dateFormat.parse(vo.getTimeStop());
        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);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(timeStart);
        while (calendar.getTime().before(timeStop) || calendar.getTime().equals(timeStop)) {
            String tradeDate = dateFormat.format(calendar.getTime()) ;
            if(cashierId != 1000000L) {
                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);
            }else {
                // 分级计算指定日期微信收退款合计,再计算实收金额
                Double rechargeWeChat = Optional.ofNullable(seWalletRechargeMapper.getRechargeSum(tradeDate)).orElse(0.0);
                Double refundWeChat = Optional.ofNullable(seRefundMapper.getRefundSum(tradeDate)).orElse(0.0);
                Double receiveWeChat = rechargeWeChat - refundWeChat;
                // 微信实收金额写入返回对象(写入前格式化)
                JSONObject job = new JSONObject();
                job.put("receiveWeChat", df.format(receiveWeChat));
                array_paymentSums.add(job);
            }
            calendar.add(Calendar.DAY_OF_MONTH, 1);
        }
        // 生成查询参数
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
        //获取笔数合计、实收金额合计、赠送金额合计
        // 获取符合条件的记录数(代码全部注释掉了,没删)
        //Long itemTotal = seGeneralMapper.getToAuditRecordCount(params);
        /**
         * 根据收银员编号、交易日期查询汇总记录
         * 遍历汇总记录查询结果,计算笔数合计、实收金额合计、赠送金额合计、返还金额合计
         */
        List<VoTransactionStatistics> list = Optional.ofNullable(seGeneralMapper.getSummaries(params)).orElse(new ArrayList<>());
        if(list.size() == 0) {
            return new HashMap();
        }
        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());
        Float totalRefund = 0f;
        JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));
        for(int i = 0; i < array.size(); i++) {
            JSONObject job_summary = array.getJSONObject(i);
            totalCount = totalCount +  Optional.ofNullable(job_summary.getInteger("count")).orElse(0);
            totalReceived = totalReceived + Optional.ofNullable(job_summary.getFloat("received")).orElse(0f);
            totalGift = totalGift + Optional.ofNullable(job_summary.getFloat("gift")).orElse(0f);
            totalRefund = totalRefund + Optional.ofNullable(job_summary.getFloat("refundAmount")).orElse(0f);
        }
        // 获取符合条件的记录数
        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("itemTotal", itemTotal);
        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("totalRefund", totalRefund);
        map_result.put("records", map_record);
        map_result.put("paymentSums", array_paymentSums);
        return map_result;
    }
    /**
     * 根据收银员ID及日期获取财务对账_交易明细记录
     * @param queryVo
     * @return
     */
    public Map getTradeDetails(QoToAudit queryVo) {
        DecimalFormat df = new DecimalFormat("0.00");
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seGeneralMapper.getTradeDetailsRecordCount(params);
        QueryResultVo<List<VoTradeDetails>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        List<VoTradeDetails> list = Optional.ofNullable(seGeneralMapper.getTradeDetails(params)).orElse(new ArrayList<>());
        if(list.size() == 0) {
            return new HashMap();
        }
        // 遍历交易明细记录,汇总交易金额
        Double totalTradeAmount = 0.0;
        JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));
        for(int i = 0; i < array.size(); i++) {
            JSONObject job = array.getJSONObject(i);
            Double tradeAmount = Optional.ofNullable(job.getDouble("tradeAmount")).orElse(0.0);
            totalTradeAmount = totalTradeAmount + tradeAmount;
        }
        Map map_record = new HashMap();
        map_record.put("itemTotal", rsVo.itemTotal);
        map_record.put("pageCurr", rsVo.pageCurr);
        map_record.put("pageSize", rsVo.pageSize);
        map_record.put("pageTotal", rsVo.pageTotal);
        map_record.put("list", list);
        Map map_result = new HashMap();
        map_result.put("totalTradeAmount", df.format(totalTradeAmount));
        map_result.put("records", map_record);
        return map_result;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/qo/QoSummary.java
New file
@@ -0,0 +1,30 @@
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-02-04 17:15
 * @LastEditTime 2024-02-04 17:15
 * @Description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "交易汇总查询条件")
public class QoSummary extends QueryConditionVo {
    @Schema(description = "查询起始日期")
    public String timeStart;
    @Schema(description = "查询截止日期")
    public String timeStop;
    @Schema(description = "收银员ID")
    public Long cashierId;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/general/qo/QoToAudit.java
@@ -19,7 +19,7 @@
@Builder
@Schema(name = "待审核交易汇总查询条件")
public class QoToAudit extends QueryConditionVo {
    @Schema(description = "交易时间")
    @Schema(description = "交易日期")
    public String tradeDate;
    @Schema(description = "收银员ID")
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/loss/LossSv.java
@@ -9,7 +9,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
@@ -27,21 +26,6 @@
    private SeLossMapper seLossMapper;
    public QueryResultVo<List<VoLoss>> getLosses(QueryVo queryVo) {
        //完善查询挂失记录的起止时间
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        //LocalDateTime lossTimeStart = queryVo.lossTimeStart;
        //LocalDateTime lossTimeStop = queryVo.lossTimeStop;
        //if(lossTimeStart != null) {
        //    lossTimeStart = LocalDateTime.parse(df.format(lossTimeStart) + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setLossTimeStart(lossTimeStart);
        //}
        //
        //if(lossTimeStop != null) {
        //    lossTimeStop = LocalDateTime.parse(df.format(lossTimeStop) + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        //    queryVo.setLossTimeStop(lossTimeStop);
        //}
        String lossTimeStart = queryVo.lossTimeStart;
        String lossTimeStop = queryVo.lossTimeStop;
        if(lossTimeStart != null) {
@@ -59,18 +43,8 @@
        Long itemTotal = seLossMapper.getRecordCount(params);
        QueryResultVo<List<VoLoss>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seLossMapper.getLosses(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/recharge/RechargeSv.java
@@ -48,18 +48,8 @@
        Long itemTotal = seRechargeMapper.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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seRechargeMapper.getRecharges(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/result/SellResultCode.java
@@ -25,10 +25,13 @@
    REPLACE_FAIL_WRITE_CLIENT_CARD_ERROR(10007, "补卡失败-农户卡修改异常"),
    REPLACE_FAIL_WRITE_RECHARGE_ERROR(10008, "补卡失败-补卡记录写入异常"),
    No_ActiveCards(10009, "没有符合条件的开卡数据"),
    No_ReissueCards(10010, "没有符合条件的补卡数据"),
    No_RECHARGES(10010, "没有符合条件的充值数据"),
    No_ReissueCards(10011, "没有符合条件的补卡数据"),
    No_CANCELS(10010, "没有符合条件的注销数据"),
    PARAMS_ERROR(10010, "操作类型参数错误"),
    THE_CARD_NOT_EXIST(10011, "没有符合条件的水卡"),
    THE_CARD_NOT_SUPPORT_THIS_OPERATION(10012, "水卡状态不支持当前操作"),
    THE_CARD_NOT_EXIST(10012, "没有符合条件的水卡"),
    THE_CARD_NOT_SUPPORT_THIS_OPERATION(10013, "水卡状态不支持当前操作"),
    /**
     * 充值
@@ -73,7 +76,38 @@
    GENERAL_ID_CANNOT_BE_NULL(80001, "总账编号不能为空"),
    GENERAL_NOT_EXIST(80001, "总账不存在"),
    GENERAL_AUDIT_FAIL(80001, "总账审核失败"),
    AUDITS_ADD_FAIL(80001, "总账审核记录添加失败");
    AUDITS_ADD_FAIL(80001, "总账审核记录添加失败"),
    /**
     * 电子钱包
     */
    CLIENT_ID_CANNOT_BE_NULL(90001, "农户编号不能为空"),
    WALLET_OPEN_ACCOUNT_FAIL(90002, "电子钱包账户注册失败"),
    WALLET_ACCOUNT_EXIST(90003, "该农户已注册电子钱包"),
    NO_ACCOUNT(90004, "您尚未注册电子钱包账户"),
    UPDATE_ACCOUNT_FAIL(90005, "充值失败,电子钱包账户更新失败"),
    RECHARGE_FAIL(90006, "充值失败"),
    BALANCE_IS_INSUFFICIENT(90007, "消费失败,余额不足"),
    CONSUME_FAIL(90008, "消费失败"),
    REFUND_AMOUNT_CANNOT_GREATER_THAN_MONEY(90009, "申请退款失败,退款金额不能大于余额"),
    APPLICATION_REFUND_FAIL(900010, "申请退款失败"),
    NO_TO_AUDIT_REFUND(900011, "该电子钱包没有待审核的退款申请"),
    AUDIT_REFUND_FAIL(900012, "审核退款申请失败"),
    No_WALLER_RECHARGES(900013, "没有符合条件的充值数据"),
    WALLET_CLIENT_ID_CANNOT_BE_NULL(900014, "查询电子钱包消费汇总失败,农户ID不能为空"),
    No_REFUNDS(900015, "没有符合条件的退款数据"),
    /**
     * 收据
     */
    No_RECEIPTS(100001, "没有符合条件的收据"),
    /**
     * 财务对账
     */
    No_GENERALS(100001, "没有符合条件的总账记录"),
    No_TRADE_SUMMARIES(100001, "没有符合条件的交易汇总记录"),
    No_TRADE_DETAILS(100001, "没有符合条件的交易明细");
    private final Integer code;
    private final String message;
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/reversal/ReversalSv.java
@@ -47,18 +47,8 @@
        Long itemTotal = seReversalMapper.getRecordCount(params);
        QueryResultVo<List<VoReversal>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seReversalMapper.getReversals(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/unlock/UnlockSv.java
@@ -47,18 +47,8 @@
        Long itemTotal = seUnlockMapper.getRecordCount(params);
        QueryResultVo<List<VoUnlock>> 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.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seUnlockMapper.getUnlocks(params);
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWallet.java
File was deleted
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/DtoWalletRecharge.java
File was deleted
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletCtrl.java
@@ -3,27 +3,39 @@
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.pojoSe.SeConsume;
import com.dy.pipIrrGlobal.pojoSe.SeRefund;
import com.dy.pipIrrGlobal.pojoSe.SeWallet;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrGlobal.voSe.VoWallet;
import com.dy.pipIrrGlobal.voSe.VoWalletRecharge;
import com.dy.pipIrrGlobal.voSe.VoWalletRefund;
import com.dy.pipIrrSell.result.SellResultCode;
import com.dy.pipIrrSell.wallet.enums.LastOperateENUM;
import com.dy.pipIrrSell.wallet.enums.RefundStatusENUM;
import com.dy.pipIrrSell.wallet.qo.QoWalletRecharge;
import com.dy.pipIrrSell.wallet.qo.QueryVo;
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 jakarta.validation.constraints.NotNull;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.Optional;
import java.text.DecimalFormat;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -41,6 +53,12 @@
public class WalletCtrl {
    private final WalletSv walletSv;
    /**
     * 注册电子钱包账户
     * 需要考虑已注册账户的情况
     * @param clientId
     * @return
     */
    @Operation(summary = "注册电子钱包", description = "注册电子钱包")
    @ApiResponses(value = {
            @ApiResponse(
@@ -50,56 +68,383 @@
                            schema = @Schema(implementation = Boolean.class))}
            )
    })
    @PostMapping(path = "add")
    @Transactional(rollbackFor = Exception.class)
    @PostMapping(path = "add_wallet")
    @SsoAop()
    //public BaseResponse<Boolean> add(@RequestBody Long clientId){
    public BaseResponse<Boolean> add(@RequestParam("clientId") @NotNull(message = "农户编号不能为空") Long clientId){
    public BaseResponse<Boolean> addWallet(@RequestParam("clientId") @NotNull(message = "农户编号不能为空") Long clientId){
        if(clientId == null || clientId < 0) {
            return BaseResponseUtils.buildFail("农户编号不能为空");
            return BaseResponseUtils.buildFail(SellResultCode.CLIENT_ID_CANNOT_BE_NULL.getMessage());
        }
        if(walletSv.getWalletByClientId(clientId) != null) {
            return BaseResponseUtils.buildFail(SellResultCode.WALLET_ACCOUNT_EXIST.getMessage());
        }
        SeWallet seWallet = new SeWallet();
        seWallet.setClientid(clientId);
        seWallet.setMoney(0f);
        seWallet.setCreatedt(new Date());
        Integer rec = Optional.ofNullable(walletSv.add(seWallet)).orElse(0);
        seWallet.setClientId(clientId);
        seWallet.setMoney(0d);
        seWallet.setLastOperate(LastOperateENUM.OPEN_ACCOUNT.getCode());
        seWallet.setLastOperateTime(new Date());
        seWallet.setCreateTime(new Date());
        Long rec = Optional.ofNullable(walletSv.addWallet(seWallet)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail("注册电子钱包-电子钱包记录写入异常");
            return BaseResponseUtils.buildFail(SellResultCode.WALLET_OPEN_ACCOUNT_FAIL.getMessage());
        }
        return BaseResponseUtils.buildSuccess(true) ;
    }
    //@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 = "addRecharge")
    //@Transactional(rollbackFor = Exception.class)
    //@SsoAop()
    //public BaseResponse<Boolean> addRecharge(@RequestBody  @Valid DtoWalletRecharge po, @Parameter(hidden = true) BindingResult bindingResult){
    //    DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    //    if(bindingResult != null && bindingResult.hasErrors()){
    //        return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
    //    }
    //
    //
    //
    //    SeWallet seWallet = new SeWallet();
    //    seWallet.setClientid(clientId);
    //    seWallet.setMoney(0f);
    //    seWallet.setCreatedt(new Date());
    //    Integer rec = Optional.ofNullable(walletSv.add(seWallet)).orElse(0);
    //    if(rec == 0) {
    //        return BaseResponseUtils.buildFail("注册电子钱包-电子钱包记录写入异常");
    //    }
    //
    //    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 = "add_recharge", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> addRecharge(@RequestBody @Valid SeWalletRecharge po, BindingResult bindingResult){
        Long clientId = Optional.ofNullable(po .getClientId()).orElse(0L);
        Double amount = Optional.ofNullable(po.getAmount()).orElse(0.0);
        // 验证该农户是否已经注册电子钱包账户并取出ID及当前账户余额
        SeWallet seWallet = walletSv.getWalletByClientId(clientId);
        if(seWallet == null) {
            return BaseResponseUtils.buildFail(SellResultCode.NO_ACCOUNT.getMessage());
        }
        Long wallerId = Optional.ofNullable(seWallet.getId()).orElse(0L);
        Double money = Optional.ofNullable(seWallet.getMoney()).orElse(0.0);
        // 计算充值后余额
        Double afterRrecharge = money + amount;
        // 修改电子钱包余额、最后操作类型、最后操作时间
        seWallet.setMoney(afterRrecharge);
        seWallet.setLastOperate(LastOperateENUM.RECHARGE.getCode());
        seWallet.setLastOperateTime(new Date());
        Integer rec_updateWaller = Optional.ofNullable(walletSv.updateWallet(seWallet)).orElse(0);
        if(rec_updateWaller == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.UPDATE_ACCOUNT_FAIL.getMessage());
        }
        // 添加充值记录
        po.setWalletId(wallerId);
        po.setClientId(clientId);
        po.setMoney(money);
        po.setAmount(amount);
        po.setAfterRecharge(afterRrecharge);
        po.setRechargeTime(new Date());
        Long rec = Optional.ofNullable(walletSv.addRecharge(po)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL.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 = "add_consume", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> addConsume(@RequestBody @Valid SeConsume po, BindingResult bindingResult){
        Long clientId = po .getClientId();
        Double consumption = po.getConsumption();
        Date vot = po.getVot();
        Date vct = po.getVct();
        // 计算开关阀时间差及用水时长
        Long timeDifference = vct.getTime() - vot.getTime();
        DecimalFormat df = new DecimalFormat("#.00");
        Double duration = Double.parseDouble(df.format((float)timeDifference / (1000 * 60 * 60)));
        // 验证该农户是否已经注册电子钱包账户并取出ID及当前账户余额
        SeWallet seWallet = walletSv.getWalletByClientId(clientId);
        if(seWallet == null) {
            return BaseResponseUtils.buildFail(SellResultCode.NO_ACCOUNT.getMessage());
        }
        Long wallerId = Optional.ofNullable(seWallet.getId()).orElse(0L);
        Double money = Optional.ofNullable(seWallet.getMoney()).orElse(0.0);
        if(money < consumption) {
            return BaseResponseUtils.buildFail(SellResultCode.BALANCE_IS_INSUFFICIENT.getMessage());
        }
        // 计算消费后余额
        Double afterConsume = money - consumption;
        // 修改电子钱包余额、最后操作类型、最后操作时间
        seWallet.setMoney(afterConsume);
        seWallet.setLastOperate(LastOperateENUM.CONSUME.getCode());
        seWallet.setLastOperateTime(new Date());
        Integer rec_updateWaller = Optional.ofNullable(walletSv.updateWallet(seWallet)).orElse(0);
        if(rec_updateWaller == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.UPDATE_ACCOUNT_FAIL.getMessage());
        }
        // 添加消费记录
        po.setWalletId(wallerId);
        po.setMoney(money);
        po.setAfterConsume(afterConsume);
        po.setDuration(duration);
        Long rec = Optional.ofNullable(walletSv.addConsume(po)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.CONSUME_FAIL.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 = "add_refund", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> addRefund(@RequestBody @Valid SeRefund po, BindingResult bindingResult){
        Long clientId = po .getClientId();
        Double refundAmount = po.getRefundAmount();
        // 验证该农户是否已经注册电子钱包账户并取出ID及当前账户余额
        SeWallet seWallet = walletSv.getWalletByClientId(clientId);
        if(seWallet == null) {
            return BaseResponseUtils.buildFail(SellResultCode.NO_ACCOUNT.getMessage());
        }
        Long wallerId = Optional.ofNullable(seWallet.getId()).orElse(0L);
        Double money = Optional.ofNullable(seWallet.getMoney()).orElse(0.0);
        // 验证退款金额是否大于余额
        if(money < refundAmount) {
            return BaseResponseUtils.buildFail(SellResultCode.REFUND_AMOUNT_CANNOT_GREATER_THAN_MONEY.getMessage());
        }
        // 计算消费后余额
        Double afterRefund = money - refundAmount;
        // 修改电子钱包余额、最后操作类型、最后操作时间
        seWallet.setMoney(afterRefund);
        seWallet.setLastOperate(LastOperateENUM.APPLY_REFUND.getCode());
        seWallet.setLastOperateTime(new Date());
        Integer rec_updateWaller = Optional.ofNullable(walletSv.updateWallet(seWallet)).orElse(0);
        if(rec_updateWaller == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.UPDATE_ACCOUNT_FAIL.getMessage());
        }
        // 添加消费记录
        po.setWalletId(wallerId);
        po.setMoney(money);
        po.setAfterRefund(afterRefund);
        po.setApplicationTime(new Date());
        po.setRefundStatus(RefundStatusENUM.NO_REFUND.getCode());
        Long rec = Optional.ofNullable(walletSv.addRefund(po)).orElse(0L);
        if(rec == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.APPLICATION_REFUND_FAIL.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 = "audit_refund", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> auditRefund(@RequestBody @Valid SeRefund po, BindingResult bindingResult){
        Long clientId = po.getClientId();
        Byte refundStatus = po.getRefundStatus();
        Long auditor = po.getAuditor();
        String remarks = po.getRemarks();
        // 验证该农户是否已经注册电子钱包账户并取出ID及当前账户余额
        SeWallet seWallet = walletSv.getWalletByClientId(clientId);
        if(seWallet == null) {
            return BaseResponseUtils.buildFail(SellResultCode.NO_ACCOUNT.getMessage());
        }
        Long wallerId = Optional.ofNullable(seWallet.getId()).orElse(0L);
        Double money = Optional.ofNullable(seWallet.getMoney()).orElse(0.0);
        // 验证该电子钱包是否有待审核的退款申请(根据钱包ID获取待审核的退款申请对象)
        SeRefund seRefund = walletSv.getRefundByWallerId(wallerId);
        if(seRefund == null) {
            return BaseResponseUtils.buildFail(SellResultCode.NO_TO_AUDIT_REFUND.getMessage());
        }
        // 修改电子钱包最后操作类型、最后操作时间
        seWallet.setLastOperate(LastOperateENUM.AUDIT_REFUND.getCode());
        seWallet.setLastOperateTime(new Date());
        Integer rec_updateWaller = Optional.ofNullable(walletSv.updateWallet(seWallet)).orElse(0);
        if(rec_updateWaller == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.UPDATE_ACCOUNT_FAIL.getMessage());
        }
        // 添加消费记录
        seRefund.setRefundStatus(refundStatus);
        seRefund.setAuditor(auditor);
        seRefund.setAuditTime(new Date());
        seRefund.setRemarks(remarks);
        Integer rec = Optional.ofNullable(walletSv.auditRefund(seRefund)).orElse(0);
        if(rec == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.AUDIT_REFUND_FAIL.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 = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/get_wallets")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoWallet>>> getWallets(QueryVo vo){
        try {
            QueryResultVo<List<VoWallet>> res = walletSv.getWallets(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()) ;
        }
    }
    /**
     * 获取电子钱包充值记录
     * @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 = "/get_recharges")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoWalletRecharge>>> getWalletRecharges(QoWalletRecharge vo){
        try {
            QueryResultVo<List<VoWalletRecharge>> res = walletSv.getWalletRecharges(vo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_WALLER_RECHARGES.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取电子钱包充值记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    @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 = "/get_consume")
    @SsoAop()
    public BaseResponse<Map> getWalletConsumes(QueryVo vo){
        Long clientId = Optional.ofNullable(vo.getClientId()).orElse(0L);
        if(clientId == 0) {
            return BaseResponseUtils.buildFail(SellResultCode.WALLET_CLIENT_ID_CANNOT_BE_NULL.getMessage());
        }
        try {
            Map res = Optional.ofNullable(walletSv.getWalletConsumes(vo)).orElse(new HashMap());
            if(res.size() <= 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_WALLER_RECHARGES.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 = "/get_refunds")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoWalletRefund>>> getWalletRefunds(QueryVo vo){
        try {
            QueryResultVo<List<VoWalletRefund>> res = walletSv.getWalletRefunds(vo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildFail(SellResultCode.No_REFUNDS.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取电子钱包退款记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java
@@ -1,13 +1,29 @@
package com.dy.pipIrrSell.wallet;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoSe.SeConsumeMapper;
import com.dy.pipIrrGlobal.daoSe.SeRefundMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletRechargeHistoryMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletRechargeMapper;
import com.dy.pipIrrGlobal.pojoSe.SeConsume;
import com.dy.pipIrrGlobal.pojoSe.SeRefund;
import com.dy.pipIrrGlobal.pojoSe.SeWallet;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory;
import com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge;
import com.dy.pipIrrGlobal.voSe.VoWallet;
import com.dy.pipIrrGlobal.voSe.VoWalletConsume;
import com.dy.pipIrrGlobal.voSe.VoWalletRecharge;
import com.dy.pipIrrGlobal.voSe.VoWalletRefund;
import com.dy.pipIrrSell.wallet.qo.QueryVo;
import com.dy.pipIrrSell.wallet.qo.QoWalletRecharge;
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
@@ -26,54 +42,203 @@
    private SeWalletRechargeMapper seWalletRechargeMapper;
    @Autowired
    private SeWalletRechargeHistoryMapper seWalletRechargeHistoryMapper;
    private SeConsumeMapper seConsumeMapper;
    @Autowired
    private SeRefundMapper seRefundMapper;
    /**
     * 根据农户ID获取电子钱包对象
     * @param clientId
     * @return
     */
    public SeWallet getWalletByClientId(Long clientId) {
        return seWalletMapper.getWalletByClientId(clientId);
    }
    /**
     * 注册电子钱包账号
     * @param po 电子钱包实体类
     * @return 电子钱包ID
     */
    public Long addWallet(SeWallet po) {
        seWalletMapper.insert(po);
        return po.getId();
    }
    /**
     * 电子钱包充值
     * @param po
     * @return
     */
    public Integer add(SeWallet po) {
        return seWalletMapper.insert(po);
    public Long addRecharge(SeWalletRecharge po) {
        seWalletRechargeMapper.insert(po);
        return po.getId();
    }
    /**
     * 根据编号从钱包表中获取该钱包余额
     * @param id
     * 电子钱包消费
     * @param po
     * @return
     */
    public Float getMoneyById(Long id) {
        SeWallet po = seWalletMapper.selectByPrimaryKey(id);
        return po.getMoney();
    public Long addConsume(SeConsume po) {
        seConsumeMapper.insert(po);
        return po.getId();
    }
    /**
     * 根据钱包编号修改钱包余额
     * @param id 钱包编号(主键)
     * @param money 钱包余额
     * @return 修改记录数量
     */
    public Integer updateMoneyById(Long id, Float money) {
        SeWallet po = seWalletMapper.selectByPrimaryKey(id);
        po.setMoney(money);
        return seWalletMapper.updateByPrimaryKey(po);
    }
    /**
     * 根据id删除充值记录
     * @param id
     * 添加退款申请
     * @param po
     * @return
     */
    public Integer deleteWallerRechargeById(Long id) {
        return seWalletMapper.deleteByPrimaryKey(id);
    public Long addRefund(SeRefund po) {
        seRefundMapper.insert(po);
        return po.getId();
    }
    /**
     * 将充值记录添加到充值历史表
     * @param po 充值历史实体
     * 根据钱包ID获取待审核的退款申请对象
     * @param walletId
     * @return
     */
    public Integer addWallerRechargeHistory(SeWalletRechargeHistory po) {
        return seWalletRechargeHistoryMapper.insert(po);
    public SeRefund getRefundByWallerId(Long walletId) {
        return seRefundMapper.getRefundByWallerId(walletId);
    }
    /**
     * 审核退款申请
     * @param po
     * @return
     */
    public Integer auditRefund(SeRefund po) {
        return seRefundMapper.updateByPrimaryKeySelective(po);
    }
    /**
     * 修改电子钱包
     * 充值、消费、申请退款、审核退款时需要修改电子钱包的:余额、最后操作、最后操作时间
     * @param po
     * @return
     */
    public Integer updateWallet(SeWallet po) {
        return seWalletMapper.updateByPrimaryKeySelective(po);
    }
    /**
     * 根据农户姓名获取电子钱包账户记录
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoWallet>> getWallets(QueryVo queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seWalletMapper.getRecordCount(params);
        QueryResultVo<List<VoWallet>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seWalletMapper.getWallets(params);
        return rsVo ;
    }
    /**
     * 根据指定条件获取电子钱包充值记录
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoWalletRecharge>> getWalletRecharges(QoWalletRecharge queryVo) {
        //完善查询充值记录的起止时间
        String timeStart = queryVo.getTimeStart();
        String timeStop = queryVo.getTimeStop();
        if(timeStart != null) {
            timeStart = timeStart + " 00:00:00";
            queryVo.setTimeStart(timeStart);
        }
        if(timeStop != null) {
            timeStop = timeStop + " 23:59:59";
            queryVo.setTimeStop(timeStop);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seWalletRechargeMapper.getRecordCount(params);
        QueryResultVo<List<VoWalletRecharge>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seWalletRechargeMapper.getWalletRecharges(params);
        return rsVo ;
    }
    /**
     * 根据农户ID获取电子钱包消费记录
     * @param queryVo
     * @return
     */
    public Map getWalletConsumes(QueryVo queryVo) {
        // 获取电子钱包消费汇总信息
        String clientName = "";
        String clientNum = "";
        Double money = 0.0;
        Double totalConsume = 0.0;
        Long clientId = Optional.ofNullable(queryVo.getClientId()).orElse(0L);
        Map map_consumeSum = Optional.ofNullable(seConsumeMapper.getWalletConsumeSum(clientId)).orElse(new HashMap());
        if(map_consumeSum.size() > 0) {
            clientName = map_consumeSum.get("clientName").toString();
            clientNum = map_consumeSum.get("clientNum").toString();
            money = Double.parseDouble(map_consumeSum.get("money").toString());
            totalConsume = Double.parseDouble(map_consumeSum.get("totalConsume").toString());
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seConsumeMapper.getRecordCount(params);
        QueryResultVo<List<VoWalletConsume>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        List<VoWalletConsume> list = seConsumeMapper.getWalletConsumes(params);
        Map map_record = new HashMap();
        map_record.put("itemTotal", rsVo.itemTotal);
        map_record.put("pageCurr", rsVo.pageCurr);
        map_record.put("pageSize", rsVo.pageSize);
        map_record.put("pageTotal", rsVo.pageTotal);
        map_record.put("list", list);
        Map map_result = new HashMap();
        map_result.put("clientName", clientName);
        map_result.put("clientNum", clientNum);
        map_result.put("money", money);
        map_result.put("totalConsume", totalConsume);
        map_result.put("records", map_record);
        return map_result;
    }
    /**
     * 根据指定条件获取电子钱包退款记录
     * @param queryVo
     * @return
     */
    public QueryResultVo<List<VoWalletRefund>> getWalletRefunds(QueryVo queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seRefundMapper.getRecordCount(params);
        QueryResultVo<List<VoWalletRefund>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seRefundMapper.getWalletRefunds(params);
        return rsVo ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/enums/LastOperateENUM.java
New file
@@ -0,0 +1,24 @@
package com.dy.pipIrrSell.wallet.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @author ZhuBaoMin
 * @date 2024-01-30 17:12
 * @LastEditTime 2024-01-30 17:12
 * @Description 电子钱包最后操作枚举类
 */
@Getter
@AllArgsConstructor
public enum LastOperateENUM {
    OPEN_ACCOUNT((byte)1, "开户"),
    RECHARGE((byte)2, "充值"),
    CONSUME((byte)3, "消费"),
    APPLY_REFUND((byte)4, "申请退款"),
    AUDIT_REFUND((byte)5, "退款审核");
    private final Byte code;
    private final String message;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/enums/RefundStatusENUM.java
New file
@@ -0,0 +1,21 @@
package com.dy.pipIrrSell.wallet.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @author ZhuBaoMin
 * @date 2024-01-31 14:19
 * @LastEditTime 2024-01-31 14:19
 * @Description
 */
@Getter
@AllArgsConstructor
public enum RefundStatusENUM {
    NO_REFUND((byte)1, "未退款"),
    REFUNDED((byte)2, "已退款");
    private final Byte code;
    private final String message;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QoWalletRecharge.java
New file
@@ -0,0 +1,28 @@
package com.dy.pipIrrSell.wallet.qo;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-01-31 19:27
 * @LastEditTime 2024-01-31 19:27
 * @Description
 */
@Data
@Schema(name = "电子钱包充值查询条件")
public class QoWalletRecharge extends QueryConditionVo {
    @Schema(description = "电子钱包账户ID")
    public Long walletId;
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "充值机时间_开始")
    public String timeStart;
    @Schema(description = "充值机时间_结束")
    public String timeStop;
}
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/qo/QueryVo.java
New file
@@ -0,0 +1,25 @@
package com.dy.pipIrrSell.wallet.qo;
import com.dy.common.webUtil.QueryConditionVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
 * @author ZhuBaoMin
 * @date 2024-01-31 19:21
 * @LastEditTime 2024-01-31 19:21
 * @Description
 */
@Data
@Schema(name = "电子钱包账户查询条件")
public class QueryVo extends QueryConditionVo {
    @Schema(description = "农户姓名")
    public String clientName;
    @Schema(description = "农户ID")
    public Long clientId;
    @Schema(description = "退款状态")
    public Integer refundStatus;
}
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/.gitignore
New file
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/.mvn/wrapper/maven-wrapper.jar
Binary files differ
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/.mvn/wrapper/maven-wrapper.properties
New file
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/mvnw
New file
@@ -0,0 +1,308 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.2.0
#
# Required ENV vars:
# ------------------
#   JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
#     e.g. to debug Maven itself, use
#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
  if [ -f /usr/local/etc/mavenrc ] ; then
    . /usr/local/etc/mavenrc
  fi
  if [ -f /etc/mavenrc ] ; then
    . /etc/mavenrc
  fi
  if [ -f "$HOME/.mavenrc" ] ; then
    . "$HOME/.mavenrc"
  fi
fi
# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "$(uname)" in
  CYGWIN*) cygwin=true ;;
  MINGW*) mingw=true;;
  Darwin*) darwin=true
    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
    if [ -z "$JAVA_HOME" ]; then
      if [ -x "/usr/libexec/java_home" ]; then
        JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
      else
        JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
      fi
    fi
    ;;
esac
if [ -z "$JAVA_HOME" ] ; then
  if [ -r /etc/gentoo-release ] ; then
    JAVA_HOME=$(java-config --jre-home)
  fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
  [ -n "$JAVA_HOME" ] &&
    JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
  [ -n "$CLASSPATH" ] &&
    CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
  [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
    JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
fi
if [ -z "$JAVA_HOME" ]; then
  javaExecutable="$(which javac)"
  if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
    # readlink(1) is not available as standard on Solaris 10.
    readLink=$(which readlink)
    if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
      if $darwin ; then
        javaHome="$(dirname "\"$javaExecutable\"")"
        javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
      else
        javaExecutable="$(readlink -f "\"$javaExecutable\"")"
      fi
      javaHome="$(dirname "\"$javaExecutable\"")"
      javaHome=$(expr "$javaHome" : '\(.*\)/bin')
      JAVA_HOME="$javaHome"
      export JAVA_HOME
    fi
  fi
fi
if [ -z "$JAVACMD" ] ; then
  if [ -n "$JAVA_HOME"  ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
      # IBM's JDK on AIX uses strange locations for the executables
      JAVACMD="$JAVA_HOME/jre/sh/java"
    else
      JAVACMD="$JAVA_HOME/bin/java"
    fi
  else
    JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
  fi
fi
if [ ! -x "$JAVACMD" ] ; then
  echo "Error: JAVA_HOME is not defined correctly." >&2
  echo "  We cannot execute $JAVACMD" >&2
  exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
  echo "Warning: JAVA_HOME environment variable is not set."
fi
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
  if [ -z "$1" ]
  then
    echo "Path not specified to find_maven_basedir"
    return 1
  fi
  basedir="$1"
  wdir="$1"
  while [ "$wdir" != '/' ] ; do
    if [ -d "$wdir"/.mvn ] ; then
      basedir=$wdir
      break
    fi
    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
    if [ -d "${wdir}" ]; then
      wdir=$(cd "$wdir/.." || exit 1; pwd)
    fi
    # end of workaround
  done
  printf '%s' "$(cd "$basedir" || exit 1; pwd)"
}
# concatenates all lines of a file
concat_lines() {
  if [ -f "$1" ]; then
    # Remove \r in case we run on Windows within Git Bash
    # and check out the repository with auto CRLF management
    # enabled. Otherwise, we may read lines that are delimited with
    # \r\n and produce $'-Xarg\r' rather than -Xarg due to word
    # splitting rules.
    tr -s '\r\n' ' ' < "$1"
  fi
}
log() {
  if [ "$MVNW_VERBOSE" = true ]; then
    printf '%s\n' "$1"
  fi
}
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
if [ -z "$BASE_DIR" ]; then
  exit 1;
fi
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
log "$MAVEN_PROJECTBASEDIR"
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
if [ -r "$wrapperJarPath" ]; then
    log "Found $wrapperJarPath"
else
    log "Couldn't find $wrapperJarPath, downloading it ..."
    if [ -n "$MVNW_REPOURL" ]; then
      wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
    else
      wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
    fi
    while IFS="=" read -r key value; do
      # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
      safeValue=$(echo "$value" | tr -d '\r')
      case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
      esac
    done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
    log "Downloading from: $wrapperUrl"
    if $cygwin; then
      wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
    fi
    if command -v wget > /dev/null; then
        log "Found wget ... using wget"
        [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
            wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
        else
            wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
        fi
    elif command -v curl > /dev/null; then
        log "Found curl ... using curl"
        [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
            curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
        else
            curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
        fi
    else
        log "Falling back to using Java to download"
        javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
        javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
        # For Cygwin, switch paths to Windows format before running javac
        if $cygwin; then
          javaSource=$(cygpath --path --windows "$javaSource")
          javaClass=$(cygpath --path --windows "$javaClass")
        fi
        if [ -e "$javaSource" ]; then
            if [ ! -e "$javaClass" ]; then
                log " - Compiling MavenWrapperDownloader.java ..."
                ("$JAVA_HOME/bin/javac" "$javaSource")
            fi
            if [ -e "$javaClass" ]; then
                log " - Running MavenWrapperDownloader.java ..."
                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
            fi
        fi
    fi
fi
##########################################################################################
# End of extension
##########################################################################################
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
wrapperSha256Sum=""
while IFS="=" read -r key value; do
  case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
  esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
if [ -n "$wrapperSha256Sum" ]; then
  wrapperSha256Result=false
  if command -v sha256sum > /dev/null; then
    if echo "$wrapperSha256Sum  $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
      wrapperSha256Result=true
    fi
  elif command -v shasum > /dev/null; then
    if echo "$wrapperSha256Sum  $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
      wrapperSha256Result=true
    fi
  else
    echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
    echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
    exit 1
  fi
  if [ $wrapperSha256Result = false ]; then
    echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
    echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
    echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
    exit 1
  fi
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
  [ -n "$JAVA_HOME" ] &&
    JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
  [ -n "$CLASSPATH" ] &&
    CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
    MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
# shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
  $MAVEN_OPTS \
  $MAVEN_DEBUG_OPTS \
  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/mvnw.cmd
New file
@@ -0,0 +1,205 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.2.0
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM     e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
    IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
    if "%MVNW_VERBOSE%" == "true" (
        echo Found %WRAPPER_JAR%
    )
) else (
    if not "%MVNW_REPOURL%" == "" (
        SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
    )
    if "%MVNW_VERBOSE%" == "true" (
        echo Couldn't find %WRAPPER_JAR%, downloading it ...
        echo Downloading from: %WRAPPER_URL%
    )
    powershell -Command "&{"^
        "$webclient = new-object System.Net.WebClient;"^
        "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
        "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
        "}"^
        "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
        "}"
    if "%MVNW_VERBOSE%" == "true" (
        echo Finished downloading %WRAPPER_JAR%
    )
)
@REM End of extension
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
SET WRAPPER_SHA_256_SUM=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
    IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
)
IF NOT %WRAPPER_SHA_256_SUM%=="" (
    powershell -Command "&{"^
       "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
       "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
       "  Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
       "  Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
       "  Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
       "  exit 1;"^
       "}"^
       "}"
    if ERRORLEVEL 1 goto error
)
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
  %JVM_CONFIG_MAVEN_PROPS% ^
  %MAVEN_OPTS% ^
  %MAVEN_DEBUG_OPTS% ^
  -classpath %WRAPPER_JAR% ^
  "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
  %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/pom.xml
New file
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.dy</groupId>
        <artifactId>pipIrr-web</artifactId>
        <version>1.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <packaging>jar</packaging>
    <artifactId>pipIrr-web-webchat</artifactId>
    <name>pipIrr-web-webchat</name>
    <description>web微信支付模块</description>
    <build>
        <plugins>
            <!-- 生成不包含依赖jar的可执行jar包
            <plugin>
                !- spring boot提供的maven打包插件 -
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        !-
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        -
                        <configuration>
                            !- 不加的话最终包名为: ${artifactId}-${version}.jar, 加了的话最终包名: ${artifactId}-${version}-${classifier}.jar  -
                            <classifier>execute</classifier>
                            !- 不指定生成路径的话, 默认保存在 ${build.directory} 下 -
                            <outputDirectory>${project.build.directory}/execute</outputDirectory>
                            <finalName>${artifactId}-${version}</finalName>
                            <layout>ZIP</layout>
                            <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass>
                            <includes>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-common</artifactId>
                                </include>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-global</artifactId>
                                </include>
                            </includes>
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            -->
            <!-- 拷贝依赖的jar包到lib目录-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <!-- 不加的话最终包名为: ${artifactId}-${version}.jar, 加了的话最终包名: ${artifactId}-${version}-${classifier}.jar
                            <classifier>execute</classifier>
                            -->
                            <!-- ${project.build.directory}是maven变量,内置的,表示target目录,如果不写,将在根目录下创建/lib -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <!-- excludeTransitive:是否不包含间接依赖包,比如我们依赖A,但是A又依赖了B,我们是否也要把B打进去 默认不打-->
                            <excludeTransitive>false</excludeTransitive>
                            <!-- 复制的jar文件去掉版本信息 -->
                            <stripVersion>false</stripVersion>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <layout>ZIP</layout>
                            <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass>
                            <includes>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-common</artifactId>
                                </include>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-global</artifactId>
                                </include>
                            </includes>
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- 设置java编译版本,运行环境版本 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- source: 源代码编译版本;target: 目标平台编译版本;encoding: 字符集编码。 -->
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- 解决资源文件的编码问题 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- maven里执行测试用例的插件 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <!-- 下面解决:当进行Maven Lifecycle package时报错:Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)-->
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
</project>
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/PipIrrWebChatApplication.java
New file
@@ -0,0 +1,28 @@
package com.dy.pipirrWebChat;
import com.dy.common.multiDataSource.EnableMultiDataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
/**
 * @author ZhuBaoMin
 * @date 2024/02/21 16:07
 * @LastEditTime 2024/02/21 16:07
 * @Description
 */
@SpringBootApplication
@EnableAspectJAutoProxy
@EnableMultiDataSource
@ComponentScan(basePackages = {"com.dy.common", "com.dy.pipIrrGlobal", "com.dy.pipirrWebChat"})
@MapperScan({"com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoBa"})
public class PipIrrWebChatApplication {
    public static void main(String[] args) {
        SpringApplication.run(PipIrrWebChatApplication.class, args);
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/config/WebFilterConfiguration.java
New file
@@ -0,0 +1,52 @@
package com.dy.pipirrWebChat.config;
import com.dy.common.webFilter.DevOfDataSourceNameSetFilter;
import com.dy.common.webFilter.UserTokenFilter;
import jakarta.servlet.Filter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * @author ZhuBaoMin
 * @date 2024-02-21 16:10
 * @LastEditTime 2024-02-21 16:10
 * @Description
 */
@Configuration
public class WebFilterConfiguration {
    @Value("${pipIrr.global.dev}")
    public String isDevStage ;//是否为开发阶段
    @Value("${pipIrr.global.dsName}")
    public String dsName ;//开发阶段的数据源名称
    /**
     * DevOfDataSourceNameSetFilter与UserTokenFilter只能一个被配置上,
     * 所以他们的order都是1
     */
    private static final int order_UserTokenFilter = 1 ;//与下面
    private static final int order_DevOfDataSourceNameSetFilter = 1 ;
    @Bean
    public FilterRegistrationBean<? extends Filter> RegFilter() {
        FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<>();
        if(this.isDevStage != null && !this.isDevStage.trim().equals("") && this.isDevStage.trim().equalsIgnoreCase("true")){
            filterRegistrationBean.setFilter(new DevOfDataSourceNameSetFilter());
            filterRegistrationBean.addUrlPatterns("/*");//配置过滤规则
            filterRegistrationBean.addInitParameter("dataSourceName",dsName);//设置init参数
            filterRegistrationBean.setName("DevOfDataSourceNameSetFilter");//设置过滤器名称
            filterRegistrationBean.setOrder(order_DevOfDataSourceNameSetFilter);//执行次序
        }else{
            filterRegistrationBean.setFilter(new UserTokenFilter());
            filterRegistrationBean.addUrlPatterns("/*");//配置过滤规则
            filterRegistrationBean.setName("UserTokenFilter");//设置过滤器名称
            filterRegistrationBean.setOrder(order_UserTokenFilter);//执行次序
        }
        return filterRegistrationBean;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/config/WebListenerConfiguration.java
New file
@@ -0,0 +1,69 @@
package com.dy.pipirrWebChat.config;
import com.dy.common.webListener.GenerateIdSetSuffixListener;
import jakarta.servlet.ServletContextListener;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * @author ZhuBaoMin
 * @date 2024-02-21 16:11
 * @LastEditTime 2024-02-21 16:11
 * @Description
 */
@Configuration
public class WebListenerConfiguration {
    /**
     * 启动顺序
     */
    //private static final int order_config = 0 ;
    private static final int order_idSetSuffix = 1 ;
    //private static final int order_init = 2 ;
    /*
    * 解析各种***.config配置的ConfigListener,暂时不采用此种配置方式
    *
    @Bean
    public ConfigListener getGlConfigListener(){
        return new ConfigListener() ;
    }
    /**
     * 外部提供Listener
     * @param listener 外部提供Listener
     * @return 注册Bean
    @Bean
    public ServletListenerRegistrationBean<? extends ServletContextListener> regConfigListener(ConfigListener listener) {
        ServletListenerRegistrationBean<ConfigListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>();
        listenerRegistrationBean.setListener(listener);
        listenerRegistrationBean.setOrder(order_config);
        return listenerRegistrationBean;
    }
    */
    /**
     * 内部提供listener,该listener在系统启动时,根据配置 设置ID产生器的后缀
     * @return 注册Bean
     */
    @Bean
    public ServletListenerRegistrationBean<? extends ServletContextListener> regSsoListener() {
        ServletListenerRegistrationBean<GenerateIdSetSuffixListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>();
        listenerRegistrationBean.setListener(new GenerateIdSetSuffixListener());
        listenerRegistrationBean.setOrder(order_idSetSuffix);
        return listenerRegistrationBean;
    }
//    /**
//     * 内部提供listener,该listener在系统启动时,初始化数据库数据
//     * @return 注册Bean
//     */
//    @Bean
//    public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() {
//        ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>();
//        listenerRegistrationBean.setListener(new InitListener());
//        listenerRegistrationBean.setOrder(order_init);
//        return listenerRegistrationBean;
//    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/java/com/dy/pipirrWebChat/result/WebChatResultCode.java
New file
@@ -0,0 +1,23 @@
package com.dy.pipirrWebChat.result;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @author ZhuBaoMin
 * @date 2024-02-21 16:13
 * @LastEditTime 2024-02-21 16:13
 * @Description
 */
@Getter
@AllArgsConstructor
public enum WebChatResultCode {
    /**
     * 微信支付
     */
    DIVIDE_FAIL(10001, "分水房添加失败");
    private final Integer code;
    private final String message;
}
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/resources/application.yml
New file
@@ -0,0 +1,18 @@
spring:
  profiles:
    include: global, database, database-ym, database-pj
#actutor的web端口
management:
  server:
    port: ${pipIrr.project.actutorPort}
#web服务端口,8086
server:
  port: ${pipIrr.webchat.webPort}
  servlet:
    context-path: /webchat #web访问上下文路径
    context-parameters:
      #GenerateIdSetSuffixListener中应用,取值范围是0-99
      idSuffix: ${pipIrr.webchat.idSuffix}
      #ConfigListener中应用
      #configFileNames: config-global.xml,config-demo.xml
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/main/resources/log4j2.yml
New file
@@ -0,0 +1,73 @@
Configuration:
  #status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出;可以设置成Off(关闭)或Error(只输出错误信息)
  status: Error
  Properties: # 定义全局变量
    Property:
      #日志文件存储的目录
      - name: log.path
        value: ./logs
      #日志文件存储名称
      - name: project.name
        value: pipIrrBase
  #定义输出器,可以输出到控制台和文件.
  Appenders:
    #输出到控制台
    Console:
      #Appender命名
      name: CONSOLE
      target: SYSTEM_OUT
      ThresholdFilter:
        level: debug #输出日志级别,输出日志时,首先由Loggers.Root.level或Loggers.Logger.level判断是否输出,然后再由本level判断是否输出
        onMatch: ACCEPT #onMatch=ACCEPT 大于等于 "level" 配置的等级地日志输出
        onMismatch: DENY #onMismatch=DENY 小于 "level" 配置的等级地日志不输出
      #日志内容样式
      PatternLayout:
        #%n-换行
        #%m-日志内容,输出代码中指定的日志信息
        #%p-输出优先级,即DEBUG,INFO,WARN,ERROR,FATAL
        #%r-程序启动到现在的毫秒数
        #%%- 输出一个"%" 字符
        #%t-当前线程名
        #%d-日期和时间, 常用的格式有%d{DATE},%d{ABSOLUTE},%d{HH:mm:ss,SSS},%d{ddMMyyyyHH:mm:ss,SSS}
        #%l-同%F%L%C%M
        #%F-java源文件名
        #%L-java源码行数
        #%C-java类名,%C{1}输出最后一个元素
        #%M-java方法名
        pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n"
    # 输出到文件,超过10MB归档
    RollingFile:
      - name: ROLLING_FILE
        ignoreExceptions: false
        fileName: ${log.path}/${project.name}.log
        filePattern: "${log.path}/$${date:yyyy-MM}/${project.name}-%d{yyyy-MM-dd}-%i.log.gz"
        ThresholdFilter:
          level: error #输出日志级别,输出日志时,首先由Loggers.Root.level或Loggers.Logger.level判断是否输出,然后再由本level判断是否输出
          onMatch: ACCEPT #onMatch=ACCEPT 大于等于 "level" 配置的等级地日志输出
          onMismatch: DENY #onMismatch=DENY 小于 "level" 配置的等级地日志不输出
        #日志内容样式
        PatternLayout:
          pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n"
        Policies:
          SizeBasedTriggeringPolicy:
            size: "10 MB"
        DefaultRolloverStrategy:
          max: 1000
  Loggers:
    Root:
      level: info #日志输出级别,共有8个级别,按照从低到高为:all < trace < debug < info < warn < error < fatal < off
      AppenderRef: #Root的子节点,用来指定该日志输出到哪个Appender.
        - ref: CONSOLE #输出日志时,首先由本level判断是否输出,然后再由上面的Appenders.Console.ThresholdFilter.level判断是否输出
        - ref: ROLLING_FILE  #输出日志时,首先由本level判断是否输出,然后再由上面的Appenders.RollingFile.ThresholdFilter.level判断是否输出
    # 为包配置特殊的Log级别,方便调试,
    # 不受Loggers.Root.level限制
    Logger:
      - name: com.dy.pipIrrGlobal.daoSe
        additivity: false #去除重复的log
        level: debug #输出日志级别
        AppenderRef:
          - ref: CONSOLE #输出日志时,首先由本.level判断是否输出,然后再由上面的Appenders.Console.ThresholdFilter.level判断是否输出
          - ref: ROLLING_FILE #输出日志时,首先由本level判断是否输出,然后再由上面的Appenders.RollingFile.ThresholdFilter.level判断是否输出
pipIrr-platform/pipIrr-web/pipIrr-web-webchat/src/test/java/com/dy/pipirrWebChat/PipIrrWebWebchatApplicationTests.java
New file
@@ -0,0 +1,13 @@
package com.dy.pipirrWebChat;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PipIrrWebWebchatApplicationTests {
    @Test
    void contextLoads() {
    }
}
pipIrr-platform/pipIrr-web/pom.xml
@@ -26,6 +26,7 @@
        <module>pipIrr-web-gis</module>
        <module>pipIrr-web-sell</module>
        <module>pipIrr-web-project</module>
        <module>pipIrr-web-webchat</module>
    </modules>
    <dependencies>