From dcd1aab9b5bec2556161c16bd1bc4fe71fef476d Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 08 六月 2026 17:17:47 +0800
Subject: [PATCH] 关于社保补缴的计算,如果社保保险设置有多条数据,根据创建时间来判断,当月即以后得参考标准用对应的配置,并且需要统计当年从1月到现在缴纳的所有社保金额,和最新的社保比列得出的金额进行比较,计算需要补缴的金额,只有社会保险设置新增一条数据的当月会计算,其余月份对应的都是0

---
 src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java b/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
index 1cbdc47..dd0bcc2 100644
--- a/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
+++ b/src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
@@ -11,6 +11,7 @@
 import com.ruoyi.basic.pojo.ProductModel;
 import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.stock.enums.StockInventorySourceEnum;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.domain.R;
@@ -68,7 +69,25 @@
 
     @Override
     public IPage<StockInventoryDto> pageListCombinedStockInventory(Page page, StockInventoryDto stockInventoryDto) {
-        return stockInventoryMapper.pageListCombinedStockInventory(page, stockInventoryDto);
+        IPage<StockInventoryDto> result = stockInventoryMapper.pageListCombinedStockInventory(page, stockInventoryDto);
+        // 杞崲鏉ユ簮缂栫爜涓烘潵婧愬悕绉�
+        for (StockInventoryDto dto : result.getRecords()) {
+            // 鍚堟牸搴撳瓨鏉ユ簮
+            if (StringUtils.isNotBlank(dto.getQualifiedSource())) {
+                StockInventorySourceEnum qualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getQualifiedSource());
+                if (qualifiedSourceEnum != null) {
+                    dto.setQualifiedSourceText(qualifiedSourceEnum.getValue());
+                }
+            }
+            // 涓嶅悎鏍煎簱瀛樻潵婧�
+            if (StringUtils.isNotBlank(dto.getUnQualifiedSource())) {
+                StockInventorySourceEnum unQualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getUnQualifiedSource());
+                if (unQualifiedSourceEnum != null) {
+                    dto.setUnQualifiedSourceText(unQualifiedSourceEnum.getValue());
+                }
+            }
+        }
+        return result;
     }
 
     //鍏ュ簱璋冪敤
@@ -170,6 +189,12 @@
         stockInRecordDto.setRemark(stockInventoryDto.getRemark());
         stockInRecordDto.setWarnNum(stockInventoryDto.getWarnNum());
         stockInRecordDto.setManufacturerId(stockInventoryDto.getManufacturerId());
+        stockInRecordDto.setSource(stockInventoryDto.getSource());
+        // 璁剧疆鍚按閲忕浉鍏充俊鎭�
+        stockInRecordDto.setIsContainsWater(stockInventoryDto.getIsContainsWater());
+        stockInRecordDto.setWaterContent(stockInventoryDto.getWaterContent());
+        stockInRecordDto.setTheoryStockInNum(stockInventoryDto.getTheoryStockInNum());
+        stockInRecordDto.setDifferenceNum(stockInventoryDto.getDifferenceNum());
         stockInRecordService.add(stockInRecordDto);
         return true;
     }
@@ -439,6 +464,29 @@
 
     @Override
     public IPage<StockInventoryDto> getBatchNoQty(Page page, StockInventoryDto stockInventoryDto) {
-        return stockInventoryMapper.getBatchNoQty(page, stockInventoryDto);
+        IPage<StockInventoryDto> resultPage = stockInventoryMapper.getBatchNoQty(page, stockInventoryDto);
+
+        // 閬嶅巻缁撴灉锛岃缃潵婧愪腑鏂囧悕
+        resultPage.getRecords().forEach(dto -> {
+            // 璁剧疆鍚堟牸搴撳瓨鏉ユ簮涓枃鍚�
+            if (StringUtils.isNotEmpty(dto.getQualifiedSource())) {
+                System.out.println("鍚堟牸搴撳瓨鏉ユ簮锛�" + dto.getQualifiedSource());
+                StockInventorySourceEnum qualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getQualifiedSource());
+                if (qualifiedSourceEnum != null) {
+                    dto.setQualifiedSourceText(qualifiedSourceEnum.getValue());
+                    System.out.println("鍚堟牸搴撳瓨鏉ユ簮鍊硷細" + qualifiedSourceEnum.getValue());
+                }
+            }
+
+            // 璁剧疆涓嶅悎鏍煎簱瀛樻潵婧愪腑鏂囧悕
+            if (StringUtils.isNotEmpty(dto.getUnQualifiedSource())) {
+                StockInventorySourceEnum unQualifiedSourceEnum = StockInventorySourceEnum.fromCode(dto.getUnQualifiedSource());
+                if (unQualifiedSourceEnum != null) {
+                    dto.setUnQualifiedSourceText(unQualifiedSourceEnum.getValue());
+                }
+            }
+        });
+
+        return resultPage;
     }
 }

--
Gitblit v1.9.3