Browse Source

04-03 资金流水账 地区-支付方式筛选

lijianlin/feature-20260401-现金管理四期
lijianlin 6 days ago
parent
commit
03dc6b4c46
  1. 1
      src/main/java/com/example/demo/domain/DTO/AreaPayTypeDTO.java
  2. 4
      src/main/java/com/example/demo/domain/vo/cash/FundsDTO.java
  3. 1
      src/main/java/com/example/demo/serviceImpl/cash/CashCollectionServiceImpl.java
  4. 31
      src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java
  5. 22
      src/main/resources/cashMapper/CashRefundMapper.xml

1
src/main/java/com/example/demo/domain/DTO/AreaPayTypeDTO.java

@ -15,4 +15,5 @@ public class AreaPayTypeDTO {
private String areaName;
private Integer payTypeId;
private String payTypeName;
private String payType; // 支付方式名称pay_type
}

4
src/main/java/com/example/demo/domain/vo/cash/FundsDTO.java

@ -1,6 +1,7 @@
package com.example.demo.domain.vo.cash;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.example.demo.domain.DTO.AreaPayTypeDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -35,6 +36,9 @@ public class FundsDTO {
private Integer goodNum; //商品数量
private String goodsName;
private String payType;
// 地区+支付方式组合列表
@ExcelIgnore
private List<AreaPayTypeDTO> areaPayTypeList;
@ExcelIgnore
private Integer receivedCurrency;
private BigDecimal paymentAmount;

1
src/main/java/com/example/demo/serviceImpl/cash/CashCollectionServiceImpl.java

@ -736,6 +736,7 @@ public class CashCollectionServiceImpl implements CashCollectionService {
cashCollection.setOrderCode("QT_" + orderNumber); //订单号
cashCollection.setGoodsName("手续费");
cashCollection.setReceivedMarket("5");
cashCollection.setStatus(4);
cashCollection.setPaymentAmount(BigDecimal.ZERO);
cashCollection.setJwcode(90039082);
cashCollection.setName("HomilyLink");

31
src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java

@ -1000,36 +1000,7 @@ public class CashRefundServiceImpl implements RefundService {
}
/**
* 复制 FundsDTO 对象浅拷贝
*/
private FundsDTO copyFundsDTO(FundsDTO source) {
FundsDTO target = new FundsDTO();
target.setId(source.getId());
target.setPayTime(source.getPayTime());
target.setOrderCode("TK" + source.getOrderCode());
target.setReceivedMarket(source.getReceivedMarket());
target.setPerformanceMarket(source.getPerformanceMarket());
target.setName(source.getName());
target.setJwcode(source.getJwcode());
target.setGoodsName(source.getGoodsName());
target.setGoodNum(source.getGoodNum());
target.setPayType(source.getPayType());
target.setReceivedCurrency(source.getReceivedCurrency());
target.setPaymentAmount(source.getPaymentAmount());
target.setHandlingCharge(source.getHandlingCharge());
target.setReceivedAmount(source.getReceivedAmount());
target.setMarket(source.getMarket());
target.setMarketName(source.getMarketName());
target.setMarkets(source.getMarkets());
target.setPerformanceMarkets(source.getPerformanceMarkets());
target.setPaymentCurrency(source.getPaymentCurrency());
target.setPaymentCurrencyName(source.getPaymentCurrencyName());
target.setReceivedCurrencyName(source.getReceivedCurrencyName());
target.setStatus(source.getStatus());
target.setStatusName(source.getStatusName());
return target;
}
/**
* 计算用户指定钱包列表的总可用余额
* @param jwcode 用户标识

22
src/main/resources/cashMapper/CashRefundMapper.xml

@ -498,9 +498,6 @@
<if test="startTime != null and endTime != null">
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime}
</if>
<if test="payType!= null and payType.length > 0">
AND crc.pay_type like CONCAT('%', #{payType}, '%')
</if>
<if test="orderCode!= null and orderCode.length > 0">
AND crc.order_code like CONCAT('%', #{orderCode}, '%')
</if>
@ -510,6 +507,13 @@
#{statuses}
</foreach>
</if>
<if test="areaPayTypeList != null and areaPayTypeList.size > 0">
AND (
<foreach collection="areaPayTypeList" item="item" separator=" OR ">
(crc.received_market = #{item.areaId} AND crc.pay_type = #{item.payType})
</foreach>
)
</if>
UNION ALL
@ -531,7 +535,7 @@
NULL as handlingCharge,
NULL as permanentGold,
NULL as freeGold,
NULL as pay_type,
crc.pay_type,
crr.refund_time as pay_time,
crc.status,
crr.refund_currency as refundCurrency,
@ -565,12 +569,16 @@
<if test="startTime != null and endTime != null">
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime}
</if>
<if test="payType!= null and payType.length > 0">
AND crc.pay_type like CONCAT('%', #{payType}, '%')
</if>
<if test="orderCode!= null and orderCode.length > 0">
AND crc.order_code like CONCAT('%', #{orderCode}, '%')
</if>
<if test="areaPayTypeList != null and areaPayTypeList.size > 0">
AND (
<foreach collection="areaPayTypeList" item="item" separator=" OR ">
(crc.received_market = #{item.areaId} AND crc.pay_type = #{item.payType})
</foreach>
)
</if>
) AS combined_result
ORDER BY
id,

Loading…
Cancel
Save