|
@@ -1368,7 +1368,13 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
|
}
|
|
|
//增加一笔剩余利息计划
|
|
|
//计算剩余应收利息
|
|
|
- BigDecimal calculateInterest = calculateAssignInterest(returnedAmount, ledgerDate, lastPlanDate,
|
|
|
+ Date actualDate;
|
|
|
+ if (assignOverdueInterest) {
|
|
|
+ actualDate = new Date();
|
|
|
+ }else {
|
|
|
+ actualDate = ledgerDate;
|
|
|
+ }
|
|
|
+ BigDecimal calculateInterest = calculateAssignInterest(returnedAmount, actualDate, lastPlanDate,
|
|
|
!hasPrincipalAssign, paymentCalculateVo, IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode());
|
|
|
BigDecimal surplusInterest = calculateInterest.add(unAssignInterest);
|
|
|
if (surplusInterest.compareTo(new BigDecimal("0.5")) <= 0 && surplusInterest.compareTo(new BigDecimal("-0.5")) >= 0) {
|
|
@@ -1379,13 +1385,13 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
|
if (surplusInterest.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
refundInterest = surplusInterest.negate();
|
|
|
|
|
|
- ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, surplusInterest, BigDecimal.ZERO,
|
|
|
+ ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(actualDate, surplusInterest, BigDecimal.ZERO,
|
|
|
IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
|
|
|
}
|
|
|
if (surplusInterest.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
PaymentCollectionPlanFactoring lastInterestFactoring = getLastPrincipalFactoring(allPlanFactoringList, interestDict, lastPlanDate);
|
|
|
if (lastInterestFactoring == null) {
|
|
|
- ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, surplusInterest, BigDecimal.ZERO,
|
|
|
+ ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(actualDate, surplusInterest, BigDecimal.ZERO,
|
|
|
IncomeExpenditureTypeDict.ChildEnum.INTEREST.getCode(), goodsAssignVo, 0));
|
|
|
} else {
|
|
|
//可能存在计划已经在之前的判断中被删除的情况,所以需要再判断一次
|
|
@@ -1406,7 +1412,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
|
}
|
|
|
//增加一笔剩余管理费计划
|
|
|
//计算剩余应收管理费
|
|
|
- BigDecimal calculateManagementFee = calculateAssignInterest(returnedAmount, ledgerDate, lastPlanDate,
|
|
|
+ BigDecimal calculateManagementFee = calculateAssignInterest(returnedAmount, actualDate, lastPlanDate,
|
|
|
!hasPrincipalAssign, paymentCalculateVo, IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode());
|
|
|
BigDecimal surplusManagement = calculateManagementFee.add(unAssignManagement);
|
|
|
if (surplusManagement.compareTo(new BigDecimal("0.5")) <= 0 && surplusManagement.compareTo(new BigDecimal("-0.5")) >= 0) {
|
|
@@ -1417,14 +1423,14 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
|
|
|
if (surplusManagement.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
refundManagement = surplusManagement.negate();
|
|
|
|
|
|
- ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, surplusManagement, BigDecimal.ZERO,
|
|
|
+ ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(actualDate, surplusManagement, BigDecimal.ZERO,
|
|
|
IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode(), goodsAssignVo, 0));
|
|
|
}
|
|
|
if (surplusManagement.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
PaymentCollectionPlanFactoring lastManagementFactoring = getLastPrincipalFactoring(allPlanFactoringList, managementFeeDict, lastPlanDate);
|
|
|
//可能存在计划已经在之前的判断中被删除的情况,所以需要再判断一次
|
|
|
if (lastManagementFactoring == null) {
|
|
|
- ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(ledgerDate, surplusManagement, BigDecimal.ZERO,
|
|
|
+ ledgerPlanFactoringAssignList.add(addPlanFactoringInsertAssign(actualDate, surplusManagement, BigDecimal.ZERO,
|
|
|
IncomeExpenditureTypeDict.ChildEnum.MANAGEMENT_FEE.getCode(), goodsAssignVo, 0));
|
|
|
} else {
|
|
|
//可能存在计划已经在之前的判断中被删除的情况,所以需要再判断一次
|