|
@@ -1170,7 +1170,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
|
|
|
|
Boolean assignOverdueInterest = hasAssignOverdueInterest(allPlanFactoringList, goodsAssignVo.getHasAssignOverdueInterest());
|
|
Boolean assignOverdueInterest = hasAssignOverdueInterest(allPlanFactoringList, goodsAssignVo.getHasAssignOverdueInterest());
|
|
//5.获取截至到分账日期的新的本金计划
|
|
//5.获取截至到分账日期的新的本金计划
|
|
- List<PaymentCollectionPlanFactoring> newPrincipalFactoringList = new ArrayList<>();
|
|
|
|
|
|
+ List<PaymentCollectionPlanFactoring> newPrincipalFactoringList;
|
|
if (assignOverdueInterest) {
|
|
if (assignOverdueInterest) {
|
|
//判断是否存在逾期利息不豁免且需要分逾期利息的场景,如果存在分账日期取系统当前日期
|
|
//判断是否存在逾期利息不豁免且需要分逾期利息的场景,如果存在分账日期取系统当前日期
|
|
newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, new Date(), returnedAmount);
|
|
newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, new Date(), returnedAmount);
|
|
@@ -1179,10 +1179,10 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
}
|
|
}
|
|
//6.计算截至到分账日期计划应收管理费总和
|
|
//6.计算截至到分账日期计划应收管理费总和
|
|
BigDecimal planManagementTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, managementFeeDict,
|
|
BigDecimal planManagementTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, managementFeeDict,
|
|
- goodsAssignVo, paymentCalculateVo);
|
|
|
|
|
|
+ goodsAssignVo, paymentCalculateVo, ledgerDate);
|
|
//7.计算截至到分账日期计划应收利息总和
|
|
//7.计算截至到分账日期计划应收利息总和
|
|
BigDecimal planInterestTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, interestDict,
|
|
BigDecimal planInterestTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, interestDict,
|
|
- goodsAssignVo, paymentCalculateVo);
|
|
|
|
|
|
+ goodsAssignVo, paymentCalculateVo, ledgerDate);
|
|
//剩余未分配管理费
|
|
//剩余未分配管理费
|
|
BigDecimal unAssignManagement = BigDecimal.ZERO;
|
|
BigDecimal unAssignManagement = BigDecimal.ZERO;
|
|
//剩余未分配利息
|
|
//剩余未分配利息
|
|
@@ -2301,7 +2301,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private BigDecimal getAllocatedAmountByPlanFactoring(List<PaymentCollectionPlanFactoring> principalList, Dictionary dict,
|
|
private BigDecimal getAllocatedAmountByPlanFactoring(List<PaymentCollectionPlanFactoring> principalList, Dictionary dict,
|
|
- LedgerFundGoodsAssign goodsAssign, PrePaymentCalculateVo paymentCalculateVo) {
|
|
|
|
|
|
+ LedgerFundGoodsAssign goodsAssign, PrePaymentCalculateVo paymentCalculateVo, Date ledgerDate) {
|
|
//计算需要分配掉的利息或管理费
|
|
//计算需要分配掉的利息或管理费
|
|
if (principalList == null || principalList.isEmpty()) {
|
|
if (principalList == null || principalList.isEmpty()) {
|
|
return BigDecimal.ZERO;
|
|
return BigDecimal.ZERO;
|
|
@@ -2323,10 +2323,12 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
newPrincipalList.add(factoring);
|
|
newPrincipalList.add(factoring);
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- PaymentCollectionPlanFactoring factoring = new PaymentCollectionPlanFactoring();
|
|
|
|
- factoring.setPlanDate(p.getPlanDate());
|
|
|
|
- factoring.setAmount(p.getAmount());
|
|
|
|
- newPrincipalList.add(factoring);
|
|
|
|
|
|
+ if (p.getPlanDate().compareTo(ledgerDate) == 0) {
|
|
|
|
+ PaymentCollectionPlanFactoring factoring = new PaymentCollectionPlanFactoring();
|
|
|
|
+ factoring.setPlanDate(p.getPlanDate());
|
|
|
|
+ factoring.setAmount(p.getAmount());
|
|
|
|
+ newPrincipalList.add(factoring);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|