From d4afabe6cb07b4129f995c82641189b2256b15a7 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 16 三月 2026 14:50:51 +0800
Subject: [PATCH] 1.耗材模块 2.出入库磅单

---
 src/main/java/com/ruoyi/consumables/service/impl/ConsumablesUnInventoryServiceImpl.java |   82 ++++++++++++++++++++--------------------
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesUnInventoryServiceImpl.java b/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesUnInventoryServiceImpl.java
index a504657..48217d6 100644
--- a/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesUnInventoryServiceImpl.java
+++ b/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesUnInventoryServiceImpl.java
@@ -35,91 +35,91 @@
 @AllArgsConstructor
 public class ConsumablesUnInventoryServiceImpl extends ServiceImpl<ConsumablesUnInventoryMapper, ConsumablesUnInventory> implements ConsumablesUnInventoryService {
 
-    private ConsumablesUnInventoryMapper ConsumablesUnInventoryMapper;
+    private ConsumablesUnInventoryMapper consumablesUnInventoryMapper;
     private ConsumablesOutRecordService ConsumablesOutRecordService;
     private ConsumablesInRecordService ConsumablesInRecordService;
 
     @Override
-    public IPage<ConsumablesUnInventoryDto> pageConsumablesUnInventory(Page page, ConsumablesUnInventoryDto ConsumablesUnInventoryDto) {
-        return ConsumablesUnInventoryMapper.pageConsumablesUnInventory(page, ConsumablesUnInventoryDto);
+    public IPage<ConsumablesUnInventoryDto> pageConsumablesUnInventory(Page page, ConsumablesUnInventoryDto consumablesUnInventoryDto) {
+        return consumablesUnInventoryMapper.pageConsumablesUnInventory(page, consumablesUnInventoryDto);
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Integer addConsumablesUnInventory(ConsumablesUnInventoryDto ConsumablesUnInventoryDto) {
+    public Integer addConsumablesUnInventory(ConsumablesUnInventoryDto consumablesUnInventoryDto) {
         //鏂板鍏ュ簱璁板綍鍐嶆坊鍔犲簱瀛�
-        ConsumablesInRecordDto ConsumablesInRecordDto = new ConsumablesInRecordDto();
-        ConsumablesInRecordDto.setRecordId(ConsumablesUnInventoryDto.getRecordId());
-        ConsumablesInRecordDto.setRecordType(ConsumablesUnInventoryDto.getRecordType());
-        ConsumablesInRecordDto.setConsumablesInNum(ConsumablesUnInventoryDto.getQualitity());
-        ConsumablesInRecordDto.setProductModelId(ConsumablesUnInventoryDto.getProductModelId());
-        ConsumablesInRecordDto.setType("1");
-        ConsumablesInRecordService.add(ConsumablesInRecordDto);
+        ConsumablesInRecordDto consumablesInRecordDto = new ConsumablesInRecordDto();
+        consumablesInRecordDto.setRecordId(consumablesUnInventoryDto.getRecordId());
+        consumablesInRecordDto.setRecordType(consumablesUnInventoryDto.getRecordType());
+        consumablesInRecordDto.setStockInNum(consumablesUnInventoryDto.getQualitity());
+        consumablesInRecordDto.setProductModelId(consumablesUnInventoryDto.getProductModelId());
+        consumablesInRecordDto.setType("1");
+        ConsumablesInRecordService.add(consumablesInRecordDto);
         //鍐嶈繘琛屾柊澧炲簱瀛樻暟閲忓簱瀛�
         //鍏堟煡璇㈠簱瀛樿〃涓殑浜у搧鏄惁瀛樺湪锛屼笉瀛樺湪鏂板锛屽瓨鍦ㄦ洿鏂�
-        ConsumablesUnInventory oldConsumablesUnInventory = ConsumablesUnInventoryMapper.selectOne(new QueryWrapper<ConsumablesUnInventory>().lambda().eq(ConsumablesUnInventory::getProductModelId, ConsumablesUnInventoryDto.getProductModelId()));
+        ConsumablesUnInventory oldConsumablesUnInventory = consumablesUnInventoryMapper.selectOne(new QueryWrapper<ConsumablesUnInventory>().lambda().eq(ConsumablesUnInventory::getProductModelId, consumablesUnInventoryDto.getProductModelId()));
         if (ObjectUtils.isEmpty(oldConsumablesUnInventory)) {
             ConsumablesUnInventory newConsumablesUnInventory = new ConsumablesUnInventory();
-            newConsumablesUnInventory.setProductModelId(ConsumablesUnInventoryDto.getProductModelId());
-            newConsumablesUnInventory.setQualitity(ConsumablesUnInventoryDto.getQualitity());
+            newConsumablesUnInventory.setProductModelId(consumablesUnInventoryDto.getProductModelId());
+            newConsumablesUnInventory.setQualitity(consumablesUnInventoryDto.getQualitity());
             newConsumablesUnInventory.setVersion(1);
-            newConsumablesUnInventory.setRemark(ConsumablesUnInventoryDto.getRemark());
-            ConsumablesUnInventoryMapper.insert(newConsumablesUnInventory);
+            newConsumablesUnInventory.setRemark(consumablesUnInventoryDto.getRemark());
+            consumablesUnInventoryMapper.insert(newConsumablesUnInventory);
         }else {
-            ConsumablesUnInventoryMapper.updateAddConsumablesUnInventory(ConsumablesUnInventoryDto);
+            consumablesUnInventoryMapper.updateAddConsumablesUnInventory(consumablesUnInventoryDto);
         }
         return 1;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Integer subtractConsumablesUnInventory(ConsumablesUnInventoryDto ConsumablesUnInventoryDto) {
+    public Integer subtractConsumablesUnInventory(ConsumablesUnInventoryDto consumablesUnInventoryDto) {
 
         //  鏂板鍑哄簱璁板綍
-        ConsumablesOutRecordDto ConsumablesOutRecordDto = new ConsumablesOutRecordDto();
-        ConsumablesOutRecordDto.setRecordId(ConsumablesUnInventoryDto.getRecordId());
-        ConsumablesOutRecordDto.setRecordType(ConsumablesUnInventoryDto.getRecordType());
-        ConsumablesOutRecordDto.setConsumablesOutNum(ConsumablesUnInventoryDto.getQualitity());
-        ConsumablesOutRecordDto.setProductModelId(ConsumablesUnInventoryDto.getProductModelId());
-        ConsumablesOutRecordDto.setType("1");
-        ConsumablesOutRecordService.add(ConsumablesOutRecordDto);
-        ConsumablesUnInventory oldConsumablesInventory = ConsumablesUnInventoryMapper.selectOne(new QueryWrapper<ConsumablesUnInventory>().lambda().eq(ConsumablesUnInventory::getProductModelId, ConsumablesUnInventoryDto.getProductModelId()));
+        ConsumablesOutRecordDto consumablesOutRecordDto = new ConsumablesOutRecordDto();
+        consumablesOutRecordDto.setRecordId(consumablesUnInventoryDto.getRecordId());
+        consumablesOutRecordDto.setRecordType(consumablesUnInventoryDto.getRecordType());
+        consumablesOutRecordDto.setStockOutNum(consumablesUnInventoryDto.getQualitity());
+        consumablesOutRecordDto.setProductModelId(consumablesUnInventoryDto.getProductModelId());
+        consumablesOutRecordDto.setType("1");
+        ConsumablesOutRecordService.add(consumablesOutRecordDto);
+        ConsumablesUnInventory oldConsumablesInventory = consumablesUnInventoryMapper.selectOne(new QueryWrapper<ConsumablesUnInventory>().lambda().eq(ConsumablesUnInventory::getProductModelId, consumablesUnInventoryDto.getProductModelId()));
         if (ObjectUtils.isEmpty(oldConsumablesInventory)) {
             throw new RuntimeException("浜у搧搴撳瓨涓嶅瓨鍦�");
         }else {
-            ConsumablesUnInventoryMapper.updateSubtractConsumablesUnInventory(ConsumablesUnInventoryDto);
+            consumablesUnInventoryMapper.updateSubtractConsumablesUnInventory(consumablesUnInventoryDto);
         }
         return 1;
     }
 
     @Override
-    public void exportConsumablesUnInventory(HttpServletResponse response, ConsumablesUnInventoryDto ConsumablesUnInventoryDto) {
-        List<ConsumablesUnInventoryExportData> list = ConsumablesUnInventoryMapper.listConsumablesInventoryExportData(ConsumablesUnInventoryDto);
+    public void exportConsumablesUnInventory(HttpServletResponse response, ConsumablesUnInventoryDto consumablesUnInventoryDto) {
+        List<ConsumablesUnInventoryExportData> list = consumablesUnInventoryMapper.listConsumablesInventoryExportData(consumablesUnInventoryDto);
         ExcelUtil<ConsumablesUnInventoryExportData> util = new ExcelUtil<>(ConsumablesUnInventoryExportData.class);
         util.exportExcel(response,list, "涓嶅悎鏍煎簱瀛樹俊鎭�");
     }
 
     @Override
-    public Boolean frozenConsumables(ConsumablesInventoryDto ConsumablesInventoryDto) {
-        ConsumablesUnInventory ConsumablesUnInventory = ConsumablesUnInventoryMapper.selectById(ConsumablesInventoryDto.getId());
-        if (ConsumablesUnInventory.getQualitity().compareTo(ConsumablesInventoryDto.getLockedQuantity())<0) {
+    public Boolean frozenConsumables(ConsumablesInventoryDto consumablesInventoryDto) {
+        ConsumablesUnInventory consumablesUnInventory = consumablesUnInventoryMapper.selectById(consumablesInventoryDto.getId());
+        if (consumablesUnInventory.getQualitity().compareTo(consumablesInventoryDto.getLockedQuantity())<0) {
             throw new RuntimeException("鍐荤粨鏁伴噺涓嶈兘瓒呰繃搴撳瓨鏁伴噺");
         }
-        if (ObjectUtils.isEmpty(ConsumablesUnInventory.getLockedQuantity())) {
-            ConsumablesUnInventory.setLockedQuantity(ConsumablesInventoryDto.getLockedQuantity());
+        if (ObjectUtils.isEmpty(consumablesUnInventory.getLockedQuantity())) {
+            consumablesUnInventory.setLockedQuantity(consumablesInventoryDto.getLockedQuantity());
         }else {
-            ConsumablesUnInventory.setLockedQuantity(ConsumablesUnInventory.getLockedQuantity().add(ConsumablesInventoryDto.getLockedQuantity()));
+            consumablesUnInventory.setLockedQuantity(consumablesUnInventory.getLockedQuantity().add(consumablesInventoryDto.getLockedQuantity()));
         }
-        return this.updateById(ConsumablesUnInventory);
+        return this.updateById(consumablesUnInventory);
     }
 
     @Override
-    public Boolean thawConsumables(ConsumablesInventoryDto ConsumablesInventoryDto) {
-        ConsumablesUnInventory ConsumablesUnInventory = ConsumablesUnInventoryMapper.selectById(ConsumablesInventoryDto.getId());
-        if (ConsumablesUnInventory.getLockedQuantity().compareTo(ConsumablesInventoryDto.getLockedQuantity())<0) {
+    public Boolean thawConsumables(ConsumablesInventoryDto consumablesInventoryDto) {
+        ConsumablesUnInventory consumablesUnInventory = consumablesUnInventoryMapper.selectById(consumablesInventoryDto.getId());
+        if (consumablesUnInventory.getLockedQuantity().compareTo(consumablesInventoryDto.getLockedQuantity())<0) {
             throw new RuntimeException("瑙e喕鏁伴噺涓嶈兘瓒呰繃鍐荤粨鏁伴噺");
         }
-        ConsumablesUnInventory.setLockedQuantity(ConsumablesUnInventory.getLockedQuantity().subtract(ConsumablesInventoryDto.getLockedQuantity()));
-        return this.updateById(ConsumablesUnInventory);
+        consumablesUnInventory.setLockedQuantity(consumablesUnInventory.getLockedQuantity().subtract(consumablesInventoryDto.getLockedQuantity()));
+        return this.updateById(consumablesUnInventory);
     }
 }

--
Gitblit v1.9.3