Merge pull request 'demand: 1.超期额度计算时间规则只取天数(不精确到时分秒),2.小数点去除问题修复' (#10) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/10
This commit is contained in:
commit
f1ea61609e
@ -43,6 +43,8 @@ package com.xdadan.erp.emis.service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -1592,7 +1594,7 @@ public class EmisBaseService {
|
||||
// 账期内金额
|
||||
BigDecimal inTermMoney = getInTermMoney(emisWaybillList);
|
||||
// 超期金额
|
||||
BigDecimal overTermMoney = BigDecimal.valueOf(useMoney.subtract(inTermMoney).stripTrailingZeros().longValue());
|
||||
BigDecimal overTermMoney = new BigDecimal(useMoney.subtract(inTermMoney).stripTrailingZeros().toPlainString());
|
||||
EmisCreditSalesmen emisCreditSalesmen = new EmisCreditSalesmen();
|
||||
emisCreditSalesmen.setId(item.getId());
|
||||
emisCreditSalesmen.setUseMoney(useMoney);
|
||||
@ -1634,11 +1636,11 @@ public class EmisBaseService {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
log.info("query emisSettleSubBillList , emisSettleSubBillList,{}", emisSettleSubBillList);
|
||||
BigDecimal inTermMoney = BigDecimal.valueOf(emisSettleSubBillList.stream()
|
||||
BigDecimal inTermMoney = new BigDecimal(emisSettleSubBillList.stream()
|
||||
.map(EmisSettleSubBill::getBillFee)
|
||||
.filter(i -> i != null)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
||||
.stripTrailingZeros().longValue());
|
||||
.stripTrailingZeros().toPlainString());
|
||||
log.info("success.getInTermMoney , inTermMoney,{}", inTermMoney);
|
||||
return inTermMoney;
|
||||
}
|
||||
@ -1650,7 +1652,7 @@ public class EmisBaseService {
|
||||
}
|
||||
List<EmisWaybill> overTermList = list.stream()
|
||||
.filter(item -> item.getSendDate() != null)
|
||||
.filter(item -> (System.currentTimeMillis() - item.getSendDate().getTime()) > (10 * 1000 * 60 * 60 * 24))
|
||||
.filter(item -> ChronoUnit.DAYS.between(item.getSendDate().toInstant(), Instant.now()) > 10)
|
||||
.collect(Collectors.toList());
|
||||
log.info("success.filterOverTermEmisWaybillList , overTermList,{}", overTermList);
|
||||
return overTermList;
|
||||
|
||||
@ -1378,11 +1378,11 @@
|
||||
<!-- 查询现金客户额度属性; 1:查询超期额度,2:查询账期内额度 -->
|
||||
<if test="params.queryQuotaType != null and params.queryQuotaType == 1">
|
||||
and a.send_date is not null
|
||||
and (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(a.send_date)) > (10 * 24 * 60 * 60)
|
||||
and DATEDIFF(NOW(), a.send_date) > 10
|
||||
</if>
|
||||
<if test="params.queryQuotaType != null and params.queryQuotaType == 2">
|
||||
and a.send_date is not null
|
||||
and (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(a.send_date)) <![CDATA[ <= ]]> (10 * 24 * 60 * 60)
|
||||
and DATEDIFF(NOW(), a.send_date) <![CDATA[ <= ]]> 10
|
||||
</if>
|
||||
|
||||
<if test="(params.isNeedBatch == null or (params.isNeedBatch != null and params.isNeedBatch != 1) ) " >
|
||||
@ -1767,11 +1767,11 @@
|
||||
<!-- 查询现金客户额度属性; 1:查询超期额度,2:查询账期内额度 -->
|
||||
<if test="params.queryQuotaType != null and params.queryQuotaType == 1">
|
||||
and a.send_date is not null
|
||||
and (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(a.send_date)) > (10 * 24 * 60 * 60)
|
||||
and DATEDIFF(NOW(), a.send_date) > 10
|
||||
</if>
|
||||
<if test="params.queryQuotaType != null and params.queryQuotaType == 2">
|
||||
and a.send_date is not null
|
||||
and (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(a.send_date)) <![CDATA[ <= ]]> (10 * 24 * 60 * 60)
|
||||
and DATEDIFF(NOW(), a.send_date) <![CDATA[ <= ]]> 10
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user