From 5cbfd0b2270edf6390cc1bb7c683956dbe93d66f Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 23 三月 2026 11:08:28 +0800
Subject: [PATCH] feat:耗材物料更改(字段变动)

---
 src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java |   31 +++++++------------------------
 1 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java b/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java
index b0ecb27..3b69ba0 100644
--- a/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java
+++ b/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesInventoryServiceImpl.java
@@ -19,10 +19,8 @@
 import com.ruoyi.framework.web.domain.R;
 import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
 import com.ruoyi.sales.pojo.SalesLedgerProduct;
-import com.ruoyi.stock.dto.StockInRecordDto;
 import com.ruoyi.stock.word.WeighbridgeDocGenerator;
 import lombok.RequiredArgsConstructor;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -64,21 +62,12 @@
         ConsumablesInRecordDto consumablesInRecordDto = new ConsumablesInRecordDto();
         consumablesInRecordDto.setRecordId(consumablesInventoryDto.getRecordId());
         consumablesInRecordDto.setRecordType(consumablesInventoryDto.getRecordType());
-        consumablesInRecordDto.setStockInNum(consumablesInventoryDto.getNetWeight());
+        consumablesInRecordDto.setStockInNum(consumablesInventoryDto.getQualitity());
         consumablesInRecordDto.setWeighingDate(consumablesInventoryDto.getWeighingDate());
-        consumablesInRecordDto.setNetWeight(consumablesInventoryDto.getNetWeight());
-        consumablesInRecordDto.setGrossWeight(consumablesInventoryDto.getGrossWeight());
-        consumablesInRecordDto.setTareWeight(consumablesInventoryDto.getTareWeight());
-        consumablesInRecordDto.setLicensePlateNo(consumablesInventoryDto.getLicensePlateNo());
-        consumablesInRecordDto.setWeighingOperator(consumablesInventoryDto.getWeighingOperator());
         consumablesInRecordDto.setProductModelId(consumablesInventoryDto.getProductModelId());
         consumablesInRecordDto.setProductId(consumablesInventoryDto.getProductId());
+        consumablesInRecordDto.setPurchaser(consumablesInventoryDto.getPurchaser());
         consumablesInRecordDto.setType("0");
-        //鐢熸垚纾呭崟
-        StockInRecordDto stockInRecordDto = new StockInRecordDto();
-        BeanUtils.copyProperties(consumablesInventoryDto, stockInRecordDto);
-        String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto);
-        consumablesInRecordDto.setWeighbridgeDocPath(absoluteDocPath);
         consumablesInRecordService.add(consumablesInRecordDto);
         //鍐嶈繘琛屾柊澧炲簱瀛樻暟閲忓簱瀛�
         //鍏堟煡璇㈠簱瀛樿〃涓殑浜у搧鏄惁瀛樺湪锛屼笉瀛樺湪鏂板锛屽瓨鍦ㄦ洿鏂�
@@ -86,15 +75,16 @@
         if (ObjectUtils.isEmpty(oldConsumablesInventory)) {
             ConsumablesInventory newConsumablesInventory = new ConsumablesInventory();
             newConsumablesInventory.setProductModelId(consumablesInventoryDto.getProductModelId());
-            newConsumablesInventory.setQualitity(consumablesInventoryDto.getNetWeight());
+            newConsumablesInventory.setQualitity(consumablesInventoryDto.getQualitity());
             newConsumablesInventory.setVersion(1);
             newConsumablesInventory.setRemark(consumablesInventoryDto.getRemark());
             newConsumablesInventory.setLockedQuantity(consumablesInventoryDto.getLockedQuantity());
             newConsumablesInventory.setWarnNum(consumablesInventoryDto.getWarnNum());
             newConsumablesInventory.setProductId(consumablesInventoryDto.getProductId());
+            newConsumablesInventory.setPurchaser(consumablesInventoryDto.getPurchaser());
             consumablesInventoryMapper.insert(newConsumablesInventory);
         } else {
-            consumablesInventoryDto.setQualitity(consumablesInventoryDto.getNetWeight());
+            consumablesInventoryDto.setQualitity(consumablesInventoryDto.getQualitity());
             consumablesInventoryMapper.updateAddConsumablesInventory(consumablesInventoryDto);
         }
         return true;
@@ -109,20 +99,13 @@
         consumablesOutRecordDto.setRecordId(consumablesInventoryDto.getRecordId());
         consumablesOutRecordDto.setRecordType(consumablesInventoryDto.getRecordType());
         consumablesOutRecordDto.setWeighingDate(consumablesInventoryDto.getWeighingDate());
-        consumablesOutRecordDto.setStockOutNum(consumablesInventoryDto.getNetWeight());
-        consumablesOutRecordDto.setNetWeight(consumablesInventoryDto.getNetWeight());
-        consumablesOutRecordDto.setGrossWeight(consumablesInventoryDto.getGrossWeight());
-        consumablesOutRecordDto.setTareWeight(consumablesInventoryDto.getTareWeight());
+        consumablesOutRecordDto.setStockOutNum(consumablesInventoryDto.getQualitity());
         consumablesOutRecordDto.setWeighingOperator(consumablesInventoryDto.getWeighingOperator());
         consumablesOutRecordDto.setProductModelId(consumablesInventoryDto.getProductModelId());
         consumablesOutRecordDto.setLicensePlateNo(consumablesInventoryDto.getLicensePlateNo());
         consumablesOutRecordDto.setProductId(consumablesInventoryDto.getProductId());
+        consumablesOutRecordDto.setPurchaser(consumablesInventoryDto.getPurchaser());
         consumablesOutRecordDto.setType("0");
-        //鐢熸垚纾呭崟
-        StockInRecordDto stockInRecordDto = new StockInRecordDto();
-        BeanUtils.copyProperties(consumablesInventoryDto, stockInRecordDto);
-        String absoluteDocPath = weighbridgeDocGenerator.generateWeighbridgeDoc(stockInRecordDto);
-        consumablesOutRecordDto.setWeighbridgeDocPath(absoluteDocPath);
         consumablesOutRecordService.add(consumablesOutRecordDto);
         ConsumablesInventory oldConsumablesInventory = consumablesInventoryMapper.selectOne(new QueryWrapper<ConsumablesInventory>().lambda().eq(ConsumablesInventory::getProductModelId, consumablesInventoryDto.getProductModelId()));
         if (ObjectUtils.isEmpty(oldConsumablesInventory)) {

--
Gitblit v1.9.3