6 Commits

  1. 23
      src/main/java/com/example/demo/controller/cash/CashCollectionController.java
  2. 15
      src/main/java/com/example/demo/controller/coin/MarketController.java
  3. 1
      src/main/java/com/example/demo/domain/DTO/AddFundsDTO.java
  4. 19
      src/main/java/com/example/demo/domain/DTO/AreaPayTypeDTO.java
  5. 2
      src/main/java/com/example/demo/domain/entity/CashRecord.java
  6. 20
      src/main/java/com/example/demo/domain/vo/cash/AreaPayTypeTreeVO.java
  7. 1
      src/main/java/com/example/demo/domain/vo/cash/CashCollection.java
  8. 6
      src/main/java/com/example/demo/domain/vo/cash/FundsDTO.java
  9. 16
      src/main/java/com/example/demo/domain/vo/cash/PayTypeVO.java
  10. 2
      src/main/java/com/example/demo/mapper/cash/CashCollectionMapper.java
  11. 3
      src/main/java/com/example/demo/mapper/coin/MarketMapper.java
  12. 2
      src/main/java/com/example/demo/service/cash/CashCollectionService.java
  13. 4
      src/main/java/com/example/demo/service/coin/MarketService.java
  14. 45
      src/main/java/com/example/demo/serviceImpl/cash/CashCollectionServiceImpl.java
  15. 31
      src/main/java/com/example/demo/serviceImpl/cash/CashRefundServiceImpl.java
  16. 40
      src/main/java/com/example/demo/serviceImpl/coin/MarketServiceImpl.java
  17. 21
      src/main/resources/cashMapper/CashCollectionMapper.xml
  18. 26
      src/main/resources/cashMapper/CashRefundMapper.xml
  19. 12
      src/main/resources/mapper/MarketMapper.xml

23
src/main/java/com/example/demo/controller/cash/CashCollectionController.java

@ -472,6 +472,29 @@ public class CashCollectionController {
return Result.error(errorMsg); return Result.error(errorMsg);
} }
} }
/**
*新增iPay88手续费
*/
@PostMapping("/addiPay88Fee")
public Result addIpay88Fee(@RequestBody CashCollection cashCollection, @RequestHeader(defaultValue = "zh_CN") String lang) {
try {
// 解析语言代码
String languageCode = parseLanguageCode(lang);
// 如果不是中文环境将查询条件中的翻译文本转换为中文简体
if (!"zh".equalsIgnoreCase(languageCode) && !"zh_cn".equalsIgnoreCase(languageCode)) {
convertTranslatedFieldsToChinese(cashCollection, languageCode);
}
String result = cashCollectionService.addIpay88Fee(cashCollection);
String successMsg = languageTranslationUtil.translate(result, lang);
return Result.success(successMsg);
} catch (Exception e) {
String errorMsg = languageTranslationUtil.translate(e.getMessage(), lang);
return Result.error(errorMsg);
}
}
/** /**
* 查询所有钱包类型 * 查询所有钱包类型

15
src/main/java/com/example/demo/controller/coin/MarketController.java

@ -2,6 +2,7 @@ package com.example.demo.controller.coin;
import com.example.demo.config.interfac.Log; import com.example.demo.config.interfac.Log;
import com.example.demo.domain.entity.Market; import com.example.demo.domain.entity.Market;
import com.example.demo.domain.vo.cash.AreaPayTypeTreeVO;
import com.example.demo.domain.vo.coin.Result; import com.example.demo.domain.vo.coin.Result;
import com.example.demo.service.coin.MarketService; import com.example.demo.service.coin.MarketService;
import com.example.demo.Util.LanguageTranslationUtil; import com.example.demo.Util.LanguageTranslationUtil;
@ -48,6 +49,20 @@ public class MarketController {
} }
} }
//获取市场-支付方式树形结构
@RequestMapping("/getAreaPayTypeTree")
public Result getAreaPayTypeTree(@RequestHeader(defaultValue = "zh_CN") String lang) {
try {
List<AreaPayTypeTreeVO> marketsTree = marketService.getAreaPayTypeTree();
return Result.success(marketsTree);
} catch (Exception e) {
log.error("获取市场列表失败", e);
return Result.error("获取市场列表失败");
}
}
/** /**
* 递归转换市场名称为指定语言 * 递归转换市场名称为指定语言

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

@ -20,7 +20,6 @@ import java.util.Date;
@NoArgsConstructor @NoArgsConstructor
public class AddFundsDTO { public class AddFundsDTO {
private String performanceMarket; //业绩归属地区 private String performanceMarket; //业绩归属地区
private String incomeType; //收入类别
private Integer goodNum; //商品数量 private Integer goodNum; //商品数量
private String payType; //付款方式 private String payType; //付款方式
private Integer paymentCurrency; //付款币种 private Integer paymentCurrency; //付款币种

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

@ -0,0 +1,19 @@
package com.example.demo.domain.DTO;
import lombok.Data;
/**
* @program: gold-java
* @ClassName AreaPayTypeDTO
* @description:
* @author: Ethan
* @create: 202604-03 16:06
* @Version 1.0
**/
@Data
public class AreaPayTypeDTO {
private Integer areaId;
private String areaName;
private Integer payTypeId;
private String payTypeName;
private String payType; // 支付方式名称pay_type
}

2
src/main/java/com/example/demo/domain/entity/CashRecord.java

@ -83,7 +83,7 @@ public class CashRecord implements Serializable {
private LocalDateTime refundTime; // 退款日期到天 private LocalDateTime refundTime; // 退款日期到天
private String refundRemark; // 退款备注执行人填写 private String refundRemark; // 退款备注执行人填写
private String refundVoucher; // 退款截图 private String refundVoucher; // 退款截图
private Integer performanceMarket; // 业绩地区
private String performanceMarket; // 业绩地区
private String performanceMarketName; // 业绩地区名称 private String performanceMarketName; // 业绩地区名称
// 系统字段 // 系统字段
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")

20
src/main/java/com/example/demo/domain/vo/cash/AreaPayTypeTreeVO.java

@ -0,0 +1,20 @@
package com.example.demo.domain.vo.cash;
import lombok.Data;
import java.util.List;
/**
* @program: gold-java
* @ClassName AreaPayTypeTreeVO
* @description:
* @author: Ethan
* @create: 202604-03 16:04
* @Version 1.0
**/
@Data
public class AreaPayTypeTreeVO {
private Integer id; // 地区ID
private String name; // 地区名称
private List<PayTypeVO> children; // 支付方式列表
}

1
src/main/java/com/example/demo/domain/vo/cash/CashCollection.java

@ -35,7 +35,6 @@ public class CashCollection implements Serializable {
private Integer jwcode; // 精网号 private Integer jwcode; // 精网号
private String name; // 姓名 private String name; // 姓名
private String performanceMarket; //业绩归属地区 private String performanceMarket; //业绩归属地区
private String incomeType; //收入类别
@ExcelIgnore @ExcelIgnore
private String market; // 所属地区 private String market; // 所属地区
private String marketName; // 所属地区名称 private String marketName; // 所属地区名称

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

@ -1,6 +1,7 @@
package com.example.demo.domain.vo.cash; package com.example.demo.domain.vo.cash;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.example.demo.domain.DTO.AreaPayTypeDTO;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@ -31,10 +32,13 @@ public class FundsDTO {
private String performanceMarket; //业绩归属地区 private String performanceMarket; //业绩归属地区
private String name; private String name;
private Integer jwcode; private Integer jwcode;
private String incomeType; //收入类别
private String remark; //备注 private String remark; //备注
private Integer goodNum; //商品数量 private Integer goodNum; //商品数量
private String goodsName;
private String payType; private String payType;
// 地区+支付方式组合列表
@ExcelIgnore
private List<AreaPayTypeDTO> areaPayTypeList;
@ExcelIgnore @ExcelIgnore
private Integer receivedCurrency; private Integer receivedCurrency;
private BigDecimal paymentAmount; private BigDecimal paymentAmount;

16
src/main/java/com/example/demo/domain/vo/cash/PayTypeVO.java

@ -0,0 +1,16 @@
package com.example.demo.domain.vo.cash;
import lombok.Data;
/**
* @program: gold-java
* @ClassName PayTypeVO
* @description:
* @author: Ethan
* @create: 202604-03 16:04
* @Version 1.0
**/
@Data
public class PayTypeVO {
private Integer id;
private String name;
}

2
src/main/java/com/example/demo/mapper/cash/CashCollectionMapper.java

@ -130,4 +130,6 @@ public interface CashCollectionMapper {
@Param("sortWalletId") Integer sortWalletId); @Param("sortWalletId") Integer sortWalletId);
// 添加流水--其他收入 // 添加流水--其他收入
void addExFund(@Param("addFundsDTO") CashCollection addFundsDTO); void addExFund(@Param("addFundsDTO") CashCollection addFundsDTO);
// 添加流水--iPay88手续费
void addIpay88Fee(CashCollection cashCollection);
} }

3
src/main/java/com/example/demo/mapper/coin/MarketMapper.java

@ -1,6 +1,7 @@
package com.example.demo.mapper.coin; package com.example.demo.mapper.coin;
import cn.hutool.core.lang.Opt; import cn.hutool.core.lang.Opt;
import com.example.demo.domain.DTO.AreaPayTypeDTO;
import com.example.demo.domain.entity.Market; import com.example.demo.domain.entity.Market;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -23,4 +24,6 @@ public interface MarketMapper {
String getMarketById(String market); String getMarketById(String market);
//获取市场id //获取市场id
List<Market> getMarketByIds(@Param("marketIds") Set<Integer> marketIds); List<Market> getMarketByIds(@Param("marketIds") Set<Integer> marketIds);
//获取市场-支付方式树形结构
List<AreaPayTypeDTO> selectAreaPayTypeList();
} }

2
src/main/java/com/example/demo/service/cash/CashCollectionService.java

@ -56,4 +56,6 @@ public interface CashCollectionService {
PageInfo<UserWalletVO> selectUserWallets(Integer jwcode, String market, Integer pageNum, Integer pageSize, String sortField, String sortOrder, Integer sortWalletId); PageInfo<UserWalletVO> selectUserWallets(Integer jwcode, String market, Integer pageNum, Integer pageSize, String sortField, String sortOrder, Integer sortWalletId);
// 添加流水--其他收入 // 添加流水--其他收入
String addExFund(CashCollection addFundsDTO); String addExFund(CashCollection addFundsDTO);
//添加iPay88手续费
String addIpay88Fee(CashCollection cashCollection);
} }

4
src/main/java/com/example/demo/service/coin/MarketService.java

@ -1,6 +1,7 @@
package com.example.demo.service.coin; package com.example.demo.service.coin;
import com.example.demo.domain.entity.Market; import com.example.demo.domain.entity.Market;
import com.example.demo.domain.vo.cash.AreaPayTypeTreeVO;
import java.util.List; import java.util.List;
@ -19,4 +20,7 @@ public interface MarketService {
List<String> getMarketIds(List<String> list); List<String> getMarketIds(List<String> list);
//dao获取市场id //dao获取市场id
String getMarketIdsDao(String country); String getMarketIdsDao(String country);
//获取市场-支付方式树形结构
List<AreaPayTypeTreeVO> getAreaPayTypeTree();
} }

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

@ -140,9 +140,9 @@ public class CashCollectionServiceImpl implements CashCollectionService {
cashRecord.setOrderType(1); //订单类型1-收款 cashRecord.setOrderType(1); //订单类型1-收款
cashRecord.setMarket(cashCollection.getMarket()); cashRecord.setMarket(cashCollection.getMarket());
if(areaInfo.getArea().equals("0")){ if(areaInfo.getArea().equals("0")){
cashRecord.setPerformanceMarket(Integer.valueOf(cashCollection.getMarket()));
cashRecord.setPerformanceMarket(cashCollection.getMarket());
}else { }else {
cashRecord.setPerformanceMarket(Integer.valueOf(areaInfo.getArea()));
cashRecord.setPerformanceMarket(areaInfo.getArea());
} }
//地区根据 jwcode 插入 //地区根据 jwcode 插入
@ -521,6 +521,7 @@ public class CashCollectionServiceImpl implements CashCollectionService {
}else cashRecord.setName("未知"); }else cashRecord.setName("未知");
cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(gOrder.getJwcode())); cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(gOrder.getJwcode()));
cashRecord.setPerformanceMarket(cashRecord.getMarket());
if (gOrder.getType().equals("gold")){ //充金豆 if (gOrder.getType().equals("gold")){ //充金豆
cashRecord.setActivity("99"); cashRecord.setActivity("99");
cashRecord.setGoodsName("Link充值金豆"); cashRecord.setGoodsName("Link充值金豆");
@ -545,6 +546,7 @@ public class CashCollectionServiceImpl implements CashCollectionService {
cashRecord.setPayType("IOS内购"); cashRecord.setPayType("IOS内购");
cashRecord.setBankCode(gOrder.getIosTransactionId()); cashRecord.setBankCode(gOrder.getIosTransactionId());
cashRecord.setReceivedMarket("4"); cashRecord.setReceivedMarket("4");
cashRecord.setPerformanceMarket("4");
cashRecord.setPayload("IOS"); cashRecord.setPayload("IOS");
break; break;
case 5: case 5:
@ -689,7 +691,7 @@ public class CashCollectionServiceImpl implements CashCollectionService {
public String addExFund(CashCollection addFundsDTO) { public String addExFund(CashCollection addFundsDTO) {
if (addFundsDTO.getPerformanceMarket() == null|| addFundsDTO.getPerformanceMarket().isEmpty()) if (addFundsDTO.getPerformanceMarket() == null|| addFundsDTO.getPerformanceMarket().isEmpty())
throw new IllegalArgumentException("业绩归属地区不能为空"); throw new IllegalArgumentException("业绩归属地区不能为空");
if (addFundsDTO.getIncomeType() == null|| addFundsDTO.getIncomeType().isEmpty())
if (addFundsDTO.getGoodsName() == null|| addFundsDTO.getGoodsName().isEmpty())
throw new IllegalArgumentException("收入类别不能为空"); throw new IllegalArgumentException("收入类别不能为空");
if (addFundsDTO.getPayType() == null|| addFundsDTO.getPayType().isEmpty()) if (addFundsDTO.getPayType() == null|| addFundsDTO.getPayType().isEmpty())
throw new IllegalArgumentException("付款方式不能为空"); throw new IllegalArgumentException("付款方式不能为空");
@ -697,17 +699,54 @@ public class CashCollectionServiceImpl implements CashCollectionService {
throw new IllegalArgumentException("币种不能为空"); throw new IllegalArgumentException("币种不能为空");
if (addFundsDTO.getPaymentAmount() == null) if (addFundsDTO.getPaymentAmount() == null)
throw new IllegalArgumentException("付款金额不能为空"); throw new IllegalArgumentException("付款金额不能为空");
if (addFundsDTO.getGoodNum() == null)
addFundsDTO.setGoodNum(0);
//生成订单号后半部分 //生成订单号后半部分
String orderNumber = UUID.randomUUID().toString().replaceAll("-", ""); String orderNumber = UUID.randomUUID().toString().replaceAll("-", "");
//构建订单信息 //构建订单信息
addFundsDTO.setOrderCode("QT_" + orderNumber); //订单号 addFundsDTO.setOrderCode("QT_" + orderNumber); //订单号
addFundsDTO.setStatus(4);
addFundsDTO.setActivity("123");
addFundsDTO.setJwcode(90039082);
addFundsDTO.setName("HomilyLink");
addFundsDTO.setMarket("24032");
addFundsDTO.setOrderType(1); addFundsDTO.setOrderType(1);
addFundsDTO.setReceivedMarket(addFundsDTO.getPerformanceMarket()); addFundsDTO.setReceivedMarket(addFundsDTO.getPerformanceMarket());
addFundsDTO.setReceivedAmount(addFundsDTO.getPaymentAmount()); addFundsDTO.setReceivedAmount(addFundsDTO.getPaymentAmount());
addFundsDTO.setReceivedCurrency(addFundsDTO.getPaymentCurrency());
cashCollectionMapper.addExFund(addFundsDTO); cashCollectionMapper.addExFund(addFundsDTO);
return "添加成功"; return "添加成功";
} }
//添加iPay88手续费
@Override
public String addIpay88Fee(CashCollection cashCollection) {
if (cashCollection.getPayType()== null|| cashCollection.getPayType().isEmpty())
throw new IllegalArgumentException("支付方式不能为空");
if (cashCollection.getPerformanceMarket()== null|| cashCollection.getPerformanceMarket().isEmpty())
throw new IllegalArgumentException("业绩归属地区不能为空");
if (cashCollection.getPaymentCurrency()== null|| cashCollection.getPaymentCurrency().isEmpty())
throw new IllegalArgumentException("币种不能为空");
if (cashCollection.getHandlingCharge()== null|| cashCollection.getHandlingCharge().compareTo(BigDecimal.ZERO) < 0)
throw new IllegalArgumentException("手续费不能为空");
if (cashCollection.getRemark()== null|| cashCollection.getRemark().isEmpty())
throw new IllegalArgumentException("备注不能为空");
//生成订单号后半部分
String orderNumber = UUID.randomUUID().toString().replaceAll("-", "");
//构建订单信息
cashCollection.setOrderCode("QT_" + orderNumber); //订单号
cashCollection.setGoodsName("手续费");
cashCollection.setReceivedMarket("5");
cashCollection.setStatus(4);
cashCollection.setPaymentAmount(BigDecimal.ZERO);
cashCollection.setJwcode(90039082);
cashCollection.setName("HomilyLink");
cashCollection.setMarket("24032");
cashCollection.setOrderType(1);
cashCollection.setActivity("124");
cashCollectionMapper.addIpay88Fee(cashCollection);
return "添加成功";
}
/** /**
* 校验钱包 ID 和到账地区的对应关系 * 校验钱包 ID 和到账地区的对应关系

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

@ -979,36 +979,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.setIncomeType(source.getIncomeType());
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 用户标识 * @param jwcode 用户标识

40
src/main/java/com/example/demo/serviceImpl/coin/MarketServiceImpl.java

@ -1,12 +1,17 @@
package com.example.demo.serviceImpl.coin; package com.example.demo.serviceImpl.coin;
import com.example.demo.domain.DTO.AreaPayTypeDTO;
import com.example.demo.domain.entity.Market; import com.example.demo.domain.entity.Market;
import com.example.demo.domain.vo.cash.AreaPayTypeTreeVO;
import com.example.demo.domain.vo.cash.PayTypeVO;
import com.example.demo.mapper.coin.MarketMapper; import com.example.demo.mapper.coin.MarketMapper;
import com.example.demo.service.coin.MarketService; import com.example.demo.service.coin.MarketService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -83,4 +88,39 @@ public class MarketServiceImpl implements MarketService {
return "24030"; // 异常时返回默认市场 return "24030"; // 异常时返回默认市场
} }
} }
@Override
public List<AreaPayTypeTreeVO> getAreaPayTypeTree() {
// 1. 查询关联数据
List<AreaPayTypeDTO> dtoList = marketMapper.selectAreaPayTypeList();
// 2. 按地区分组
Map<Integer, List<AreaPayTypeDTO>> groupByArea = dtoList.stream()
.collect(Collectors.groupingBy(AreaPayTypeDTO::getAreaId));
List<AreaPayTypeTreeVO> treeList = new ArrayList<>();
// 3. 封装树形
for (Map.Entry<Integer, List<AreaPayTypeDTO>> entry : groupByArea.entrySet()) {
AreaPayTypeDTO first = entry.getValue().get(0);
AreaPayTypeTreeVO tree = new AreaPayTypeTreeVO();
tree.setId(first.getAreaId());
tree.setName(first.getAreaName());
// 封装支付方式
List<PayTypeVO> children = entry.getValue().stream()
.map(dto -> {
PayTypeVO vo = new PayTypeVO();
vo.setId(dto.getPayTypeId());
vo.setName(dto.getPayTypeName());
return vo;
})
.distinct() // 去重
.collect(Collectors.toList());
tree.setChildren(children);
treeList.add(tree);
}
return treeList;
}
} }

21
src/main/resources/cashMapper/CashCollectionMapper.xml

@ -424,7 +424,26 @@
<!--新增流水——其他收入--> <!--新增流水——其他收入-->
<insert id="addExFund" > <insert id="addExFund" >
insert into cash_record_collection insert into cash_record_collection
(jwcode,name,market,activity,order_code,goods_name,good_num,pay_type,payment_currency,
payment_amount,status,order_type,received_market,received_amount,received_currency,
performance_market,remark,handling_charge,pay_time,submitter_id,submitter_market)
values(#{addFundsDTO.jwcode},#{addFundsDTO.name},#{addFundsDTO.market},
#{addFundsDTO.activity},#{addFundsDTO.orderCode},#{addFundsDTO.goodsName},
#{addFundsDTO.goodNum},#{addFundsDTO.payType},#{addFundsDTO.paymentCurrency},
#{addFundsDTO.paymentAmount},#{addFundsDTO.status},#{addFundsDTO.orderType},
#{addFundsDTO.receivedMarket},#{addFundsDTO.receivedAmount},#{addFundsDTO.receivedCurrency},
#{addFundsDTO.performanceMarket},#{addFundsDTO.remark},#{addFundsDTO.handlingCharge},#{addFundsDTO.payTime},
#{addFundsDTO.submitterId},#{addFundsDTO.submitterMarket})
</insert>
<insert id="addIpay88Fee">
insert into cash_record_collection
(order_type,jwcode,name,market,activity,order_code,goods_name,pay_type,payment_currency,handling_charge,remark,payment_amount,
received_market,performance_market,submitter_id,submitter_market,pay_time)
values(#{orderType},#{jwcode},#{name},#{market},#{activity},#{orderCode},
#{goodsName},#{payType},#{paymentCurrency},#{handlingCharge},#{remark},
#{paymentAmount},#{receivedMarket},#{performanceMarket},#{submitterId},
#{submitterMarket},now()
)
</insert> </insert>
<!-- 根据精网号和钱包 ID 查询用户钱包明细列表 --> <!-- 根据精网号和钱包 ID 查询用户钱包明细列表 -->

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

@ -450,7 +450,7 @@
SELECT SELECT
crc.id, crc.id,
crc.jwcode, crc.jwcode,
crc.income_type,
crc.goods_name,
crc.remark, crc.remark,
crc.good_num, crc.good_num,
crc.performance_market, crc.performance_market,
@ -498,9 +498,6 @@
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime} and crc.`pay_time` BETWEEN #{startTime} AND #{endTime}
</if> </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"> <if test="orderCode!= null and orderCode.length > 0">
AND crc.order_code like CONCAT('%', #{orderCode}, '%') AND crc.order_code like CONCAT('%', #{orderCode}, '%')
</if> </if>
@ -510,13 +507,20 @@
#{statuses} #{statuses}
</foreach> </foreach>
</if> </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 UNION ALL
SELECT SELECT
crc.id, crc.id,
crc.jwcode, crc.jwcode,
crc.income_type,
crc.goods_name,
crc.remark, crc.remark,
crc.good_num, crc.good_num,
crc.performance_market, crc.performance_market,
@ -531,7 +535,7 @@
NULL as handlingCharge, NULL as handlingCharge,
NULL as permanentGold, NULL as permanentGold,
NULL as freeGold, NULL as freeGold,
NULL as pay_type,
crc.pay_type,
crr.refund_time as pay_time, crr.refund_time as pay_time,
crc.status, crc.status,
crr.refund_currency as refundCurrency, crr.refund_currency as refundCurrency,
@ -565,12 +569,16 @@
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
and crc.`pay_time` BETWEEN #{startTime} AND #{endTime} and crc.`pay_time` BETWEEN #{startTime} AND #{endTime}
</if> </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"> <if test="orderCode!= null and orderCode.length > 0">
AND crc.order_code like CONCAT('%', #{orderCode}, '%') AND crc.order_code like CONCAT('%', #{orderCode}, '%')
</if> </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 ) AS combined_result
ORDER BY ORDER BY
id, id,

12
src/main/resources/mapper/MarketMapper.xml

@ -55,4 +55,16 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="selectAreaPayTypeList" resultType="com.example.demo.domain.DTO.AreaPayTypeDTO">
SELECT
m.id AS areaId,
m.name AS areaName,
pt.id AS payTypeId,
pt.name AS payTypeName
FROM payment_type_tree ptt
LEFT JOIN market m ON ptt.area_id = m.id
LEFT JOIN payment_type pt ON ptt.type_id = pt.id
WHERE m.id IS NOT NULL AND pt.id IS NOT NULL
ORDER BY areaId
</select>
</mapper> </mapper>
Loading…
Cancel
Save