From 69bb9404667723b3f4fb5dc7835c650a2ebf7055 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期四, 25 十二月 2025 16:01:29 +0800
Subject: [PATCH] 新增发票服务商代码

---
 service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java b/service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java
index 0aa86b0..d24c80a 100644
--- a/service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java
+++ b/service/src/main/java/com/ruoyi/cwgl/service/impl/PayableBillManagementServiceImpl.java
@@ -4,6 +4,11 @@
 
 import com.ruoyi.common.utils.DateUtils;
 import javax.annotation.Resource;
+
+import com.ruoyi.cwgl.mapper.PayableFeeManagementMapper;
+import com.ruoyi.cwgl.service.IPayableBillManagementLogService;
+import com.ruoyi.cwgl.service.IPayableFeeManagementService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.stereotype.Service;
 import org.springframework.scheduling.annotation.Async;
@@ -33,7 +38,10 @@
     protected final Logger logger = LoggerFactory.getLogger(getClass());
     @Resource
     private PayableBillManagementMapper payableBillManagementMapper;
-
+    @Autowired
+    private IPayableBillManagementLogService logService;
+    @Resource
+    private PayableFeeManagementMapper payableFeeManagementMapper;
 
     /**
      * 鏌ヨ搴斾粯璐﹀崟绠$悊
@@ -179,4 +187,41 @@
     {
         return payableBillManagementMapper.deletePayableBillManagementById(id);
     }
+    
+    /**
+     * 浣滃簾搴斾粯璐﹀崟绠$悊璁板綍
+     *
+     * @param id 搴斾粯璐﹀崟绠$悊ID
+     * @return 缁撴灉
+     */
+    @Override
+    public int voidPayableBillManagement(Integer id)
+    {
+        // 鏌ヨ璐﹀崟淇℃伅
+        PayableBillManagement bill = selectPayableBillManagementById(id);
+        if (bill == null) {
+            throw new RuntimeException("搴斾粯璐﹀崟涓嶅瓨鍦�");
+        }
+        
+        // 妫�鏌ヨ处鍗曠姸鎬侊紝鍙湁鐘舵�佷负"0"锛堟湭缁撶畻锛夌殑璐﹀崟鍙互浣滃簾
+        if (!"0".equals(bill.getStatus())) {
+            throw new RuntimeException("鍙兘浣滃簾鐘舵�佷负鏈粨绠楃殑搴斾粯璐﹀崟");
+        }
+        
+        // 鏇存柊璐﹀崟鐘舵�佷负"2"锛堜綔搴燂級
+        bill.setStatus("2");
+        bill.setUpdateTime(DateUtils.getNowDate());
+        
+        int result = updatePayableBillManagement(bill);
+        
+        if (result > 0) {
+            // 浣滃簾搴斾粯璐﹀崟鍚庯紝闇�瑕佸皢鍏宠仈鐨勫簲浠樿垂鐢ㄨ褰曟仮澶嶄负寰呯敓鎴愯处鍗曠姸鎬�
+            String relatedBillNo = bill.getSystemNo();
+            if (relatedBillNo != null && !relatedBillNo.isEmpty()) {
+                payableFeeManagementMapper.updatePayableFeeManagementByRelatedBillNo(relatedBillNo);
+            }
+        }
+        
+        return result;
+    }
 }

--
Gitblit v1.8.0