From 437ceb214daff5a57253a59a2d8065a088173514 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期一, 13 四月 2020 09:42:10 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/money/TeamDividentsDebtServiceImpl.java | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/money/TeamDividentsDebtServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/money/TeamDividentsDebtServiceImpl.java index 347696f..49645f1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/money/TeamDividentsDebtServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/money/TeamDividentsDebtServiceImpl.java @@ -64,13 +64,14 @@ @Transactional(rollbackFor = Exception.class) @Override - public BigDecimal repayDebtByUid(Long uid, BigDecimal money) throws TeamDividentsDebtException { + public BigDecimal repayDebtByUid(Long uid, Date maxEstimatePayTime, BigDecimal money) + throws TeamDividentsDebtException { // 杩橀挶 - long count = countNeedRepayDebt(uid); + long count = countNeedRepayDebt(uid, maxEstimatePayTime); int page = (int) (count % 200 == 0 ? count / 200 : count / 200 + 1); List<TeamDividentsDebt> totalList = new ArrayList<>(); for (int i = 0; i < page; i++) { - List<TeamDividentsDebt> tempList = listNeedRepayDebt(uid, i + 1, 200); + List<TeamDividentsDebt> tempList = listNeedRepayDebt(uid, maxEstimatePayTime, i + 1, 200); if (tempList != null && tempList.size() > 0) { totalList.addAll(tempList); } @@ -99,19 +100,20 @@ } @Override - public List<TeamDividentsDebt> listNeedRepayDebt(Long uid, int page, int count) { - return teamDividentsDebtMapper.listByLeftMoneyAndUid(new BigDecimal("0.01"), null, uid, (page - 1) * count, - count); + public List<TeamDividentsDebt> listNeedRepayDebt(Long uid, Date maxEstimatePayTime, int page, int count) { + return teamDividentsDebtMapper.listByLeftMoneyAndUidAndMaxEstimatePayTime(new BigDecimal("0.01"), null, uid, + maxEstimatePayTime, (page - 1) * count, count); } @Override - public long countNeedRepayDebt(Long uid) { - return teamDividentsDebtMapper.countByLeftMoneyAndUid(new BigDecimal("0.01"), null, uid); + public long countNeedRepayDebt(Long uid, Date maxEstimatePayTime) { + return teamDividentsDebtMapper.countByLeftMoneyAndUidAndMaxEstimatePayTime(new BigDecimal("0.01"), null, uid, + maxEstimatePayTime); } @Override - public BigDecimal getTotalDebtMoney(Long uid) { - BigDecimal money = teamDividentsDebtMapper.sumLeftMoneyByUid(uid); + public BigDecimal getTotalDebtMoney(Long uid, Date maxEstimatePayTime) { + BigDecimal money = teamDividentsDebtMapper.sumLeftMoneyByUid(uid, maxEstimatePayTime); if (money == null) money = new BigDecimal(0); return money; -- Gitblit v1.8.0