| | |
| | | package com.ruoyi.management.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.management.domain.*; |
| | | import com.ruoyi.management.domain.dto.AddSlVolumeProductionCkDTO; |
| | | import com.ruoyi.management.domain.dto.ManagementimgVolumeProductionCkQuery; |
| | | import com.ruoyi.management.domain.dto.SlGoodsMaterialsSlVolumeProductionRkQuery; |
| | | import com.ruoyi.management.domain.dto.SlVolumeProductionCkDTO; |
| | | import com.ruoyi.management.domain.dto.*; |
| | | import com.ruoyi.management.domain.vo.InventoriesSuppliesInfoVO; |
| | | import com.ruoyi.management.domain.vo.ManagementimgSlVolumeProductionCkVO; |
| | | import com.ruoyi.management.domain.vo.ManagementimgVolumeProductionCkVO; |
| | | import com.ruoyi.management.domain.vo.ManagementimgVolumeProductionRkVO; |
| | |
| | | import com.ruoyi.management.mapper.SlGoodsShelfMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionCkMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionRkMapper; |
| | | import com.ruoyi.management.service.ManagementGoodsMaterialsService; |
| | | import com.ruoyi.management.service.SlVolumeProductionCkService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.management.service.SlVolumeProductionRkService; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private SlGoodsShelfMapper slGoodsShelfMapper; |
| | | @Autowired |
| | | private ManagementGoodsMaterialsService managementGoodsMaterialsService; |
| | | |
| | | @Override |
| | | public PageDTO<ManagementimgSlVolumeProductionCkVO> getManagementimgSlVolumeProductionCkList(SlGoodsMaterialsSlVolumeProductionRkQuery slGoodsMaterialsSlVolumeProductionRkQuery) { |
| | |
| | | } |
| | | return SlGoodsShelfDTO; |
| | | } |
| | | |
| | | @Autowired |
| | | private SlVolumeProductionRkService slVolumeProductionRkService; |
| | | @Override |
| | | public PageDTO<InventoriesSuppliesInfoVO> getMaterialByManagementIdList(GetMaterialsByManagementIdQuery query) { |
| | | List<InventoriesSuppliesInfoVO> res = new ArrayList<>(); |
| | | |
| | | Page<SlVolumeProductionRk> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | QueryWrapper<ManagementGoodsMaterials> wrapper1 = new QueryWrapper<>(); |
| | | wrapper1.eq("del_flag","0"); |
| | | wrapper1.eq("management_id",query.getManagementId()); |
| | | // 获取对应仓库下所有入库的物资ids |
| | | List<Long> collect = managementGoodsMaterialsService.list(wrapper1).stream().map(ManagementGoodsMaterials::getGoodsMaterialsId).collect(Collectors.toList()); |
| | | QueryWrapper<SlGoodsMaterials> wrapper2 = new QueryWrapper<>(); |
| | | if (StringUtils.hasLength(query.getMaterialsName())){ |
| | | wrapper2.like("goods_materials_name",query.getMaterialsName()); |
| | | } |
| | | if (query.getIsConsume()!=null){ |
| | | wrapper2.eq("is_consume",query.getIsConsume()); |
| | | } |
| | | wrapper2.eq("del_flag","0"); |
| | | wrapper2.in("id",collect); |
| | | List<Long> collect1 = slGoodsMaterialsMapper.selectList(wrapper2).stream().map(SlGoodsMaterials::getId).collect(Collectors.toList()); |
| | | QueryWrapper<SlVolumeProductionRk> wrapper = new QueryWrapper<>(); |
| | | wrapper.in("materials_id",collect1); |
| | | wrapper.eq("del_flag","0"); |
| | | |
| | | Page<SlVolumeProductionRk> page2 = slVolumeProductionRkService.page(page, wrapper); |
| | | List<SlVolumeProductionRk> list = page2.getRecords(); |
| | | |
| | | PageDTO<InventoriesSuppliesInfoVO> slGoodsMaterialsVO = PageDTO.of(page2, InventoriesSuppliesInfoVO.class); |
| | | for (SlVolumeProductionRk slVolumeProductionRk : list) { |
| | | SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(slVolumeProductionRk.getMaterialsId()); |
| | | SlGoodsShelf slGoodsShelf = slGoodsShelfMapper.selectById(slVolumeProductionRk.getShelfId()); |
| | | if (slGoodsMaterials == null || slGoodsShelf == null){ |
| | | continue; |
| | | } |
| | | InventoriesSuppliesInfoVO inventoriesSuppliesInfoVO = new InventoriesSuppliesInfoVO(); |
| | | inventoriesSuppliesInfoVO.setId(slVolumeProductionRk.getId()); |
| | | inventoriesSuppliesInfoVO.setGoodsMaterialsName(slGoodsMaterials.getGoodsMaterialsName()); |
| | | inventoriesSuppliesInfoVO.setIsConsume(slGoodsMaterials.getIsConsume()); |
| | | inventoriesSuppliesInfoVO.setRkNumber(slVolumeProductionRk.getRkNumber()); |
| | | inventoriesSuppliesInfoVO.setRkModel(slVolumeProductionRk.getRkModel()); |
| | | inventoriesSuppliesInfoVO.setRkId(slVolumeProductionRk.getId()); |
| | | inventoriesSuppliesInfoVO.setZkNum(slVolumeProductionRk.getRepertoryZhai()); |
| | | inventoriesSuppliesInfoVO.setGoodsShelfName(slGoodsShelf.getGoodsShelfName()); |
| | | inventoriesSuppliesInfoVO.setStoreManagementNumber(slVolumeProductionRk.getStoreManagementNumber()); |
| | | res.add(inventoriesSuppliesInfoVO); |
| | | } |
| | | slGoodsMaterialsVO.setList(res); |
| | | return slGoodsMaterialsVO; |
| | | } |
| | | } |