From 2712f2602444fb9208984f8b839e5b823b94e5a2 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期三, 03 九月 2025 16:50:52 +0800
Subject: [PATCH] 供应商erp库存

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
index 2dde23d..0c2b4a6 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpSupplierWarehousingServiceImpl.java
@@ -3,6 +3,8 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.basic.PageInfo;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.system.dto.WarehousingGoodsDto;
+import com.ruoyi.system.dto.WarehousingGoodsNextDto;
 import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.model.*;
 import com.ruoyi.system.query.TErpGoodsQuery;
@@ -182,4 +184,31 @@
         pageInfo.setRecords( list);
         return pageInfo;
     }
+
+    @Override
+    public void warehousingGoods(List<WarehousingGoodsDto> dtos, SysUser user) {
+        for (WarehousingGoodsDto dto : dtos) {
+            TErpSupplierWarehousing tErpSupplierWarehousing = new TErpSupplierWarehousing();
+            tErpSupplierWarehousing.setSupplierId(user.getUserId().toString());
+            tErpSupplierWarehousing.setWarehouseId(dto.getWarehouseId());
+            tErpSupplierWarehousing.setGoodsId(dto.getGoodsId());
+            TErpGoods goods = erpGoodsMapper.selectById(dto.getGoodsId());
+            tErpSupplierWarehousing.setGoodsName(goods.getGoodsName());
+            tErpSupplierWarehousing.setGoodsCount(tErpSupplierWarehousing.getGoodsCount());
+            tErpSupplierWarehousing.setUnitAmount(tErpSupplierWarehousing.getUnitAmount());
+            tErpSupplierWarehousing.setTotalPrice(tErpSupplierWarehousing.getTotalPrice());
+            erpSupplierWarehousingMapper.insert(tErpSupplierWarehousing);
+            List<WarehousingGoodsNextDto> warehousingGoodsNextDtos = dto.getWarehousingGoodsNextDtos();
+            for (WarehousingGoodsNextDto warehousingGoodsNextDto : warehousingGoodsNextDtos) {
+                TErpSupplierWarehousingBatch tErpSupplierWarehousingBatch = new TErpSupplierWarehousingBatch();
+                tErpSupplierWarehousingBatch.setWarehousingId(tErpSupplierWarehousing.getId());
+                tErpSupplierWarehousingBatch.setWarehousingNumber(warehousingGoodsNextDto.getWarehousingNum());
+                tErpSupplierWarehousingBatch.setBatchNumber(warehousingGoodsNextDto.getBatchNumber());
+                tErpSupplierWarehousingBatch.setProductionDate(warehousingGoodsNextDto.getProductionDate().atStartOfDay());
+                tErpSupplierWarehousingBatch.setExpiryDate(warehousingGoodsNextDto.getExpiryDate().atStartOfDay());
+                erpSupplierWarehousingBatchMapper.insert(tErpSupplierWarehousingBatch);
+            }
+        }
+
+    }
 }

--
Gitblit v1.7.1