rentaiming
2024-07-12 0ef39b8062c67eeab10d368d8942ea82a83bcb3e
ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionCkServiceImpl.java
@@ -5,10 +5,14 @@
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.ManagementimgVolumeProductionCkQuery;
import com.ruoyi.management.domain.dto.SlGoodsMaterialsSlVolumeProductionRkQuery;
import com.ruoyi.management.domain.dto.SlVolumeProductionCkDTO;
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.SlGoodsMaterialsMapper;
import com.ruoyi.management.mapper.SlGoodsShelfMapper;
import com.ruoyi.management.mapper.SlVolumeProductionCkMapper;
import com.ruoyi.management.mapper.SlVolumeProductionRkMapper;
import com.ruoyi.management.service.SlVolumeProductionCkService;
@@ -33,6 +37,12 @@
    @Resource
    private SlVolumeProductionRkMapper  slVolumeProductionRkMapper;
    @Resource
    private SlGoodsMaterialsMapper slGoodsMaterialsMapper;
    @Resource
    private SlGoodsShelfMapper slGoodsShelfMapper;
    @Override
    public PageDTO<ManagementimgSlVolumeProductionCkVO> getManagementimgSlVolumeProductionCkList(SlGoodsMaterialsSlVolumeProductionRkQuery slGoodsMaterialsSlVolumeProductionRkQuery) {
        Page<SlVolumeProductionCk> page = new Page<>(slGoodsMaterialsSlVolumeProductionRkQuery.getPageCurr(), slGoodsMaterialsSlVolumeProductionRkQuery.getPageSize());
@@ -55,6 +65,7 @@
    public void addSlVolumeProductionCk(SlVolumeProductionCkDTO slVolumeProductionCkDTO) {
        if (slVolumeProductionCkDTO.getId()==null){
            SlVolumeProductionCk slVolumeProductionCk=new SlVolumeProductionCk();
            slVolumeProductionCk.setCkglId(slVolumeProductionCkDTO.getId());
            slVolumeProductionCk.setRkId(slVolumeProductionCkDTO.getRkId());
        }else{
            SlVolumeProductionCk byId = this.getById(slVolumeProductionCkDTO.getId());
@@ -62,4 +73,31 @@
            this.updateById(byId);
        }
    }
    @Override
    public PageDTO<ManagementimgVolumeProductionCkVO> getSlVolumeProductionCkList(ManagementimgVolumeProductionCkQuery managementimgVolumeProductionCkQuery) {
        Page<SlVolumeProductionCk> page = new Page<>(managementimgVolumeProductionCkQuery.getPageCurr(), managementimgVolumeProductionCkQuery.getPageSize());
        LambdaQueryWrapper< SlVolumeProductionCk> wrapper1= Wrappers.lambdaQuery();
        wrapper1.eq(SlVolumeProductionCk::getCkglId,managementimgVolumeProductionCkQuery.getVolumeProductionCKglId());
        wrapper1.eq( SlVolumeProductionCk::getDelFlag,0);
        wrapper1.orderByDesc(SlVolumeProductionCk::getCreateTime);
        Page<SlVolumeProductionCk> page2 = this.page(page, wrapper1);
        PageDTO<ManagementimgVolumeProductionCkVO> SlGoodsShelfDTO = PageDTO.of(page2, ManagementimgVolumeProductionCkVO.class);
        List<ManagementimgVolumeProductionCkVO> list2 = SlGoodsShelfDTO.getList();
        for(ManagementimgVolumeProductionCkVO list:list2) {{
            SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(list.getRkId());
            list.setStoreManagementNumber(slVolumeProductionRk.getStoreManagementNumber());
            list.setRkNumber(slVolumeProductionRk.getRkNumber());
            list.setRepertoryZhai(slVolumeProductionRk.getRepertoryZhai());
            SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(slVolumeProductionRk.getMaterialsId());
            list.setGoodsMaterialsName(slGoodsMaterials.getGoodsMaterialsName());
            list.setIsConsume(slGoodsMaterials.getIsConsume());
            SlGoodsShelf slGoodsShelf = slGoodsShelfMapper.selectById(slVolumeProductionRk.getShelfId());
            list.setGoodsShelfName(slGoodsShelf.getGoodsShelfName());
        }
        }
        return SlGoodsShelfDTO;
    }
}