Browse Source

分账管理优化

liuj 6 months ago
parent
commit
773dfbe5aa

+ 14 - 6
src/main/java/com/sunxung/factoring/service/ledger/impl/LedgerManagementServiceImpl.java

@@ -1171,18 +1171,26 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                             Boolean assignOverdueInterest = hasAssignOverdueInterest(allPlanFactoringList, goodsAssignVo.getHasAssignOverdueInterest());
                             Boolean assignOverdueInterest = hasAssignOverdueInterest(allPlanFactoringList, goodsAssignVo.getHasAssignOverdueInterest());
                             //5.获取截至到分账日期的新的本金计划
                             //5.获取截至到分账日期的新的本金计划
                             List<PaymentCollectionPlanFactoring> newPrincipalFactoringList;
                             List<PaymentCollectionPlanFactoring> newPrincipalFactoringList;
+                            BigDecimal planManagementTotal;
+                            BigDecimal planInterestTotal;
                             if (assignOverdueInterest) {
                             if (assignOverdueInterest) {
                                 //判断是否存在逾期利息不豁免且需要分逾期利息的场景,如果存在分账日期取系统当前日期
                                 //判断是否存在逾期利息不豁免且需要分逾期利息的场景,如果存在分账日期取系统当前日期
                                 newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, new Date(), returnedAmount);
                                 newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, new Date(), returnedAmount);
+                                //6.计算截至到分账日期计划应收管理费总和
+                                planManagementTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, managementFeeDict,
+                                        goodsAssignVo, paymentCalculateVo, new Date());
+                                //7.计算截至到分账日期计划应收利息总和
+                                planInterestTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, interestDict,
+                                        goodsAssignVo, paymentCalculateVo, new Date());
                             } else {
                             } else {
                                 newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, ledgerDate, returnedAmount);
                                 newPrincipalFactoringList = getPrincipalFactoringByLedgerDate(principalFactoringList, ledgerDate, returnedAmount);
+                                //6.计算截至到分账日期计划应收管理费总和
+                                planManagementTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, managementFeeDict,
+                                        goodsAssignVo, paymentCalculateVo, ledgerDate);
+                                //7.计算截至到分账日期计划应收利息总和
+                                planInterestTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, interestDict,
+                                        goodsAssignVo, paymentCalculateVo, ledgerDate);
                             }
                             }
-                            //6.计算截至到分账日期计划应收管理费总和
-                            BigDecimal planManagementTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, managementFeeDict,
-                                    goodsAssignVo, paymentCalculateVo, ledgerDate);
-                            //7.计算截至到分账日期计划应收利息总和
-                            BigDecimal planInterestTotal = getAllocatedAmountByPlanFactoring(newPrincipalFactoringList, interestDict,
-                                    goodsAssignVo, paymentCalculateVo, ledgerDate);
                             //剩余未分配管理费
                             //剩余未分配管理费
                             BigDecimal unAssignManagement = BigDecimal.ZERO;
                             BigDecimal unAssignManagement = BigDecimal.ZERO;
                             //剩余未分配利息
                             //剩余未分配利息