From 1fd7a7d67a5df84b57af4fbcc310aa66da3cd8ca Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 25 三月 2026 17:51:16 +0800
Subject: [PATCH] feat:1.出入库单位转换 2.仓储/耗材导出字段值优化 3.仓储/耗材库存为0不展示

---
 src/main/java/com/ruoyi/consumables/service/impl/ConsumablesOutRecordServiceImpl.java |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesOutRecordServiceImpl.java b/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesOutRecordServiceImpl.java
index e4c9238..521c6dc 100644
--- a/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesOutRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/consumables/service/impl/ConsumablesOutRecordServiceImpl.java
@@ -18,7 +18,6 @@
 import com.ruoyi.consumables.mapper.ConsumablesInventoryMapper;
 import com.ruoyi.consumables.mapper.ConsumablesOutRecordMapper;
 import com.ruoyi.consumables.mapper.ConsumablesUnInventoryMapper;
-import com.ruoyi.consumables.pojo.ConsumablesInRecord;
 import com.ruoyi.consumables.pojo.ConsumablesInventory;
 import com.ruoyi.consumables.pojo.ConsumablesOutRecord;
 import com.ruoyi.consumables.pojo.ConsumablesUnInventory;
@@ -45,30 +44,28 @@
     private ConsumablesUnInventoryMapper consumablesUnInventoryMapper;
 
     @Override
-    public IPage<ConsumablesOutRecordDto> listPage(Page page, ConsumablesOutRecordDto ConsumablesOutRecordDto) {
-        return consumablesOutRecordMapper.listPage(page, ConsumablesOutRecordDto);
+    public IPage<ConsumablesOutRecordDto> listPage(Page page, ConsumablesOutRecordDto consumablesOutRecordDto) {
+        return consumablesOutRecordMapper.listPage(page, consumablesOutRecordDto);
     }
 
     @Override
-    public int add(ConsumablesOutRecordDto ConsumablesOutRecordDto) {
+    public int add(ConsumablesOutRecordDto consumablesOutRecordDto) {
         String no = OrderUtils.countTodayByCreateTime(consumablesOutRecordMapper, "CK");
-        ConsumablesOutRecordDto.setOutboundBatches(no);
-        ConsumablesInRecord ConsumablesInRecord = new ConsumablesInRecord();
-        BeanUtils.copyProperties(ConsumablesOutRecordDto, ConsumablesInRecord);
-        return consumablesOutRecordMapper.insert(ConsumablesOutRecordDto);
+        consumablesOutRecordDto.setOutboundBatches(no);
+        return consumablesOutRecordMapper.insert(consumablesOutRecordDto);
     }
 
     @Override
-    public int update(Long id, ConsumablesOutRecordDto ConsumablesOutRecordDto) {
+    public int update(Long id, ConsumablesOutRecordDto consumablesOutRecordDto) {
         // 鍒ゆ柇瀵硅薄鏄惁瀛樺湪
-        ConsumablesOutRecord ConsumablesOutRecord = consumablesOutRecordMapper.selectById(id);
-        if (ConsumablesOutRecord == null){
+        ConsumablesOutRecord consumablesOutRecord = consumablesOutRecordMapper.selectById(id);
+        if (consumablesOutRecord == null){
             throw new BaseException("璇ュ嚭搴撹褰曚笉瀛樺湪,鏃犳硶鏇存柊!!!");
         }
 
         String[] ignoreProperties = {"id", "outbound_batches"};//鎺掗櫎id灞炴��
-        BeanUtils.copyProperties(ConsumablesOutRecordDto, ConsumablesOutRecord, ignoreProperties);
-        return consumablesOutRecordMapper.updateById(ConsumablesOutRecord);
+        BeanUtils.copyProperties(consumablesOutRecordDto, consumablesOutRecord, ignoreProperties);
+        return consumablesOutRecordMapper.updateById(consumablesOutRecord);
     }
 
     @Override
@@ -82,7 +79,7 @@
                 }else {
                     ConsumablesInventoryDto consumablesInRecordDto = new ConsumablesInventoryDto();
                     consumablesInRecordDto.setProductModelId(consumablesInventory.getProductModelId());
-                    consumablesInRecordDto.setQualitity(consumablesOutRecord.getConsumablesOutNum());
+                    consumablesInRecordDto.setQualitity(consumablesOutRecord.getStockOutNum());
                     consumablesInventoryMapper.updateAddConsumablesInventory(consumablesInRecordDto);
                 }
             }else if (consumablesOutRecord.getType().equals("1")) {
@@ -92,7 +89,7 @@
                 }else {
                     ConsumablesUnInventoryDto consumablesUnInventoryDto = new ConsumablesUnInventoryDto();
                     consumablesUnInventoryDto.setProductModelId(consumablesUnInventory.getProductModelId());
-                    consumablesUnInventoryDto.setQualitity(consumablesOutRecord.getConsumablesOutNum());
+                    consumablesUnInventoryDto.setQualitity(consumablesOutRecord.getStockOutNum());
                     consumablesUnInventoryMapper.updateAddConsumablesUnInventory(consumablesUnInventoryDto);
                 }
             }
@@ -101,8 +98,8 @@
     }
 
     @Override
-    public void exportConsumablesOutRecord(HttpServletResponse response, ConsumablesOutRecordDto ConsumablesOutRecordDto) {
-        List<ConsumablesOutRecordExportData> list = consumablesOutRecordMapper.listConsumablesOutRecordExportData(ConsumablesOutRecordDto);
+    public void exportConsumablesOutRecord(HttpServletResponse response, ConsumablesOutRecordDto consumablesOutRecordDto) {
+        List<ConsumablesOutRecordExportData> list = consumablesOutRecordMapper.listConsumablesOutRecordExportData(consumablesOutRecordDto);
         for (ConsumablesOutRecordExportData consumablesInRecordExportData : list) {
             if (consumablesInRecordExportData.getType().equals("0")) {
                 consumablesInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(consumablesInRecordExportData.getRecordType())).getValue());

--
Gitblit v1.9.3