From 8876b1b9cd27fad076ea9e5f3e04197b84ba02bd Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 01 八月 2024 14:26:56 +0800 Subject: [PATCH] 代码提交 bug解决 --- ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesInfoServiceImpl.java | 34 ++++++++++++++++++---------------- 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesInfoServiceImpl.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesInfoServiceImpl.java index 47f122c..a133ae4 100644 --- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesInfoServiceImpl.java +++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesInfoServiceImpl.java @@ -9,18 +9,12 @@ import com.ruoyi.management.domain.dto.InventoriesSuppliesInfoQuery; import com.ruoyi.management.domain.vo.InventoriesSuppliesInfoVO; import com.ruoyi.management.domain.vo.InventoriesSuppliesVO; -import com.ruoyi.management.mapper.InventoriesSuppliesInfoMapper; -import com.ruoyi.management.mapper.ManagementGoodsMaterialsMapper; -import com.ruoyi.management.mapper.SlGoodsMaterialsMapper; -import com.ruoyi.management.mapper.SlVolumeProductionRkMapper; +import com.ruoyi.management.mapper.*; import com.ruoyi.management.service.InventoriesSuppliesInfoService; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.HashSet; -import java.util.List; -import java.util.ListResourceBundle; -import java.util.Set; +import java.util.*; /** * <p> @@ -42,6 +36,9 @@ @Resource private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; + + @Resource + private SlGoodsShelfMapper slGoodsShelfMapper; @Override public PageDTO<InventoriesSuppliesInfoVO> inventoriesSuppliesInfoService(InventoriesSuppliesInfoQuery inventoriesSuppliesInfoQuery) { @@ -62,24 +59,29 @@ SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(slVolumeProductionRk.getMaterialsId()); sl.setGoodsMaterialsName(slGoodsMaterials.getGoodsMaterialsName()); sl.setIsConsume(slGoodsMaterials.getIsConsume()); + sl.setStoreManagementNumber(slVolumeProductionRk.getStoreManagementNumber()); + SlGoodsShelf slGoodsShelf = slGoodsShelfMapper.selectById(slVolumeProductionRk.getShelfId()); + sl.setGoodsShelfName(slGoodsShelf.getGoodsShelfName()); } return slGoodsMaterialsVO; } @Override - public void addInventoriesSuppliesInfo(InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) { - if (inventoriesSuppliesInfoDTO.getId()==null){ + public void addInventoriesSuppliesInfo(List<InventoriesSuppliesInfoDTO> inventoriesSuppliesInfoDTO) { + for (InventoriesSuppliesInfoDTO m:inventoriesSuppliesInfoDTO) + if (m.getId()==null){ InventoriesSuppliesInfo inventoriesSuppliesInf=new InventoriesSuppliesInfo(); - inventoriesSuppliesInf.setSuppliesId(inventoriesSuppliesInfoDTO.getSuppliesId()); - inventoriesSuppliesInf.setRkId(inventoriesSuppliesInfoDTO.getRkId()); - SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(inventoriesSuppliesInfoDTO.getRkId()); + inventoriesSuppliesInf.setSuppliesId(m.getSuppliesId()); + inventoriesSuppliesInf.setRkId(m.getRkId()); + inventoriesSuppliesInf.setCreateTime(new Date()); + SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(m.getRkId()); inventoriesSuppliesInf.setZkNum(slVolumeProductionRk.getRepertoryZhai()); - inventoriesSuppliesInf.setSuppliesNum(inventoriesSuppliesInfoDTO.getSuppliesNum()); + inventoriesSuppliesInf.setSuppliesNum(m.getSuppliesNum()); this.save(inventoriesSuppliesInf); }else{ - InventoriesSuppliesInfo byId = this.getById(inventoriesSuppliesInfoDTO.getId()); - byId.setSuppliesNum(inventoriesSuppliesInfoDTO.getSuppliesNum()); + InventoriesSuppliesInfo byId = this.getById(m.getId()); + byId.setSuppliesNum(m.getSuppliesNum()); this.updateById(byId); } -- Gitblit v1.7.1