From 0838f85fa74b36638adf2621bc2f49a345982dec Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 03 九月 2025 17:21:04 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- 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