liuj 6 місяців тому
батько
коміт
847fbde154

+ 10 - 5
src/main/java/com/sunxung/factoring/service/ledger/impl/LedgerManagementServiceImpl.java

@@ -443,8 +443,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
                             .filter(p -> p.getActualAmount().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
                 }
                 //向sop同步现金流入账数据
-                BillingNonbusinessManageFactoringentry nonbusinessManageFactoringentry = addCashFlowOutInfoToSop(ledgerAccountBasicInfo, planFactoringAssignList,
-                        ledgerFundGoodsAssign, cashFlowManageBasicInfo);
+                BillingNonbusinessManageFactoringentry nonbusinessManageFactoringentry = addCashFlowOutInfoToSop(ledgerAccountBasicInfo, planFactoringAssignList, ledgerFundGoodsAssign);
                 if (nonbusinessManageFactoringentry != null) {
                     cashFlowManageBasicInfo.setBillingFactoringEntryId(nonbusinessManageFactoringentry.getId());
                     cashFlowManageBasicInfoService.updateById(cashFlowManageBasicInfo);
@@ -548,7 +547,7 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
      * @param planFactoringAssignList 关联的出账信息
      */
     private BillingNonbusinessManageFactoringentry addCashFlowOutInfoToSop(LedgerAccountBasicInfo ledgerAccountBasicInfo, List<LedgerPlanFactoringAssign> planFactoringAssignList,
-                                                                           LedgerFundGoodsAssign ledgerFundGoodsAssign, CashFlowManageBasicInfo cashFlowManageBasicInfo1) {
+                                                                           LedgerFundGoodsAssign ledgerFundGoodsAssign) {
         //组装数据
         BillingRecordBasic billingRecordBasic = new BillingRecordBasic();
         BillingNonbusinessManageFactoringentry nobusinessManage = new BillingNonbusinessManageFactoringentry();
@@ -588,8 +587,14 @@ public class LedgerManagementServiceImpl implements LedgerManagementService {
             }
             nobusinessManage.setCurrency(currencyDict);
         }
-
-        nobusinessManage.setBillDate(ledgerAccountBasicInfo.getLedgerDate());
+        if (CollectionUtil.isNotEmpty(planFactoringAssignList)) {
+            LedgerPlanFactoringAssign planFactoringAssign = planFactoringAssignList.get(0);
+            if (planFactoringAssign != null && planFactoringAssign.getActualDate() != null) {
+                nobusinessManage.setBillDate(planFactoringAssign.getActualDate());
+            }
+        } else {
+            nobusinessManage.setBillDate(ledgerAccountBasicInfo.getLedgerDate());
+        }
         BankAccountInfo bankAccountInfo = new BankAccountInfo();
         //贸理通临时同步数据账号
         bankAccountInfo.setBankCardNo("888888");