From 72670c7c29928d9e324fccd95a4372b41e1cddc7 Mon Sep 17 00:00:00 2001
From: jiangxiaoming <7548901@qq.com>
Date: Tue, 6 Aug 2024 17:24:27 +0800
Subject: [PATCH] 111

---
 .../application/command/InvoiceCommandServieceImpl.java    | 6 ++++--
 .../infrastructure/repository/EntryBillRepositoryImpl.java | 7 -------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/ServiceSite/src/main/java/com/seasky/ledgerincome/application/command/InvoiceCommandServieceImpl.java b/ServiceSite/src/main/java/com/seasky/ledgerincome/application/command/InvoiceCommandServieceImpl.java
index ed6478f3..16c1c1a7 100644
--- a/ServiceSite/src/main/java/com/seasky/ledgerincome/application/command/InvoiceCommandServieceImpl.java
+++ b/ServiceSite/src/main/java/com/seasky/ledgerincome/application/command/InvoiceCommandServieceImpl.java
@@ -452,6 +452,8 @@ public class InvoiceCommandServieceImpl extends BaseCommandAbstractService<Invoi
                 preInvoiceCmd.getVoucherCode(),null, VoucherStateEnum.寰呭紑绁�.getValue(),vchDetailList);
         Long voucherId = voucherRepository.save(voucherAggregate);
         //3 淇濆瓨鍏ヨ处
+        //鍏堝幓鏌gg
+        EntryBillAggregate entryBillAggregate = entryBillRepository.findByIncomeId(preInvoiceCmd.getIncomeId());
         List<EntryBillFlowEntity> flowEntityList = new ArrayList<>();
         flowEntityList.add(new EntryBillFlowEntity(null,null,new Date(),
                 EntryTypeEnum.getByValue(EntryTypeEnum.鏈埌娆�.getValue()),
@@ -459,8 +461,8 @@ public class InvoiceCommandServieceImpl extends BaseCommandAbstractService<Invoi
                 preInvoiceCmd.getIncomeId(),
                 Arrays.asList(invoiceId),voucherId
                 ));
-        EntryBillAggregate entryBillAggregate = new EntryBillAggregate(
-                null,preInvoiceCmd.getIncomeId(),null,null,
+         entryBillAggregate = new EntryBillAggregate(
+                entryBillAggregate.getEntryBillId(),preInvoiceCmd.getIncomeId(),null,null,
                 VoucherStateEnum.getByValue(VoucherStateEnum.寰呭紑绁�.getValue())
                 ,flowEntityList
         );
diff --git a/ServiceSite/src/main/java/com/seasky/ledgerincome/infrastructure/repository/EntryBillRepositoryImpl.java b/ServiceSite/src/main/java/com/seasky/ledgerincome/infrastructure/repository/EntryBillRepositoryImpl.java
index 608b3862..65830e9f 100644
--- a/ServiceSite/src/main/java/com/seasky/ledgerincome/infrastructure/repository/EntryBillRepositoryImpl.java
+++ b/ServiceSite/src/main/java/com/seasky/ledgerincome/infrastructure/repository/EntryBillRepositoryImpl.java
@@ -77,13 +77,6 @@ public class EntryBillRepositoryImpl implements EntryBillRepository {
 
     @Override
     public Long save(@NotNull @Valid EntryBillAggregate entryBillAggregate) {
-        //鍒ゆ柇涔嬪墠鏈夋病鏈夊叆璐d
-        QueryWrapper<EntryBillPo> queryWrapper = Wrappers.query();
-        queryWrapper.eq("income_id",entryBillAggregate.getIncomeId());
-        EntryBillPo billPo = mapper.selectOne(queryWrapper);
-        if(billPo!=null){
-            entryBillAggregate.setEntryBillId(billPo.getId());
-        }
         EntryBillPo entryBillPo = EntryBillConvert.toEntryBillPo(entryBillAggregate);
         EntryBillPo finalEntryBillPo = Objects.isNull(entryBillAggregate.getEntryBillId())
                 ? service.insert(entryBillPo) : service.update(entryBillPo);
-- 
GitLab