...
|
...
|
@@ -68,11 +68,16 @@ public class HkAccountSettlement { |
|
|
log.info("{} settle fail, it already in the process", uid);
|
|
|
return;
|
|
|
}
|
|
|
List<TradeBills> tradeBills = tradeBillsMapper.selectByUidTradeStatusAndDealTime(uid, HK_AMOUNT_PAYING.getCode(), dealTime);
|
|
|
Integer sumIncome = tradeBills.stream().mapToInt(TradeBills::getIncomeOutcome).sum();
|
|
|
List<TradeBills> tradeBills = tradeBillsMapper.selectByUidTradeStatusAndDealTime(uid, HK_AMOUNT_PAYING.getCode(), dealTime).stream()
|
|
|
// 用户收入
|
|
|
.filter(e -> e.getIncomeOutcome() == 1)
|
|
|
.collect(Collectors.toList());
|
|
|
BigDecimal sumIncome = tradeBills.stream()
|
|
|
.map(TradeBills::getAmount)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
log.info("{} settle, sum income is {}", uid, sumIncome);
|
|
|
// 满足打款条件,通知财务打款
|
|
|
if (sumIncome > 100) {
|
|
|
if (sumIncome.compareTo(BigDecimal.valueOf(100)) > 0) {
|
|
|
try {
|
|
|
log.info("{} settle, send email", uid, sumIncome);
|
|
|
List<TradeBillResult> tradeBillResults = getTradeBillResults(uid, tradeBills);
|
...
|
...
|
@@ -115,7 +120,7 @@ public class HkAccountSettlement { |
|
|
.productName(product.getProductName())
|
|
|
.rate(BigDecimal.ZERO)
|
|
|
.platformServiceAmount(tradeBill.getSystemAmount())
|
|
|
.payAmount(BigDecimal.valueOf(tradeBill.getIncomeOutcome()))
|
|
|
.payAmount(tradeBill.getAmount())
|
|
|
.payType(tradeBill.getTradeType() == 1 ? "保证金"
|
|
|
: tradeBill.getTradeType() == 2 ? "货款"
|
|
|
: tradeBill.getTradeType() == 3 ? "补偿款" : "")
|
...
|
...
|
|