| | |
| | | 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.service.InventoriesSuppliesInfoService; |
| | |
| | | |
| | | @Resource |
| | | private SlGoodsMaterialsMapper slGoodsMaterialsMapper; |
| | | |
| | | @Resource |
| | | private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; |
| | | @Override |
| | | public PageDTO<InventoriesSuppliesInfoVO> inventoriesSuppliesInfoService(InventoriesSuppliesInfoQuery inventoriesSuppliesInfoQuery) { |
| | | |
| | | Page<InventoriesSuppliesInfo> page = new Page<>(inventoriesSuppliesInfoQuery.getPageCurr(), inventoriesSuppliesInfoQuery.getPageSize()); |
| | | LambdaQueryWrapper< InventoriesSuppliesInfo> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.gt(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoQuery.getSuppliesId()); |
| | | wrapper1.eq(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoQuery.getSuppliesId()); |
| | | wrapper1.eq( InventoriesSuppliesInfo::getDelFlag,0); |
| | | wrapper1.orderByDesc(InventoriesSuppliesInfo::getCreateTime); |
| | | wrapper1.orderByDesc(InventoriesSuppliesInfo::getType); |
| | |
| | | SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(sl.getRkId()); |
| | | sl.setRkNumber(slVolumeProductionRk.getRkNumber()); |
| | | sl.setRkModel(slVolumeProductionRk.getRkModel()); |
| | | sl.setZkNum(slVolumeProductionRk.getRepertoryZhai()); |
| | | SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(slVolumeProductionRk.getMaterialsId()); |
| | | sl.setGoodsMaterialsName(slGoodsMaterials.getGoodsMaterialsName()); |
| | | sl.setIsConsume(slGoodsMaterials.getIsConsume()); |
| | |
| | | |
| | | @Override |
| | | public void addInventoriesSuppliesInfo(InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) { |
| | | if (inventoriesSuppliesInfoDTO.getId()==0){ |
| | | if (inventoriesSuppliesInfoDTO.getId()==null){ |
| | | InventoriesSuppliesInfo inventoriesSuppliesInf=new InventoriesSuppliesInfo(); |
| | | inventoriesSuppliesInf.setSuppliesId(inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | inventoriesSuppliesInf.setRkId(inventoriesSuppliesInfoDTO.getRkId()); |
| | |
| | | @Override |
| | | public InventoriesSuppliesInfo getInventoriesSuppliesInfo(InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) { |
| | | LambdaQueryWrapper< InventoriesSuppliesInfo> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.gt(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.gt(InventoriesSuppliesInfo::getRkId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.eq(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.eq(InventoriesSuppliesInfo::getRkId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.eq( InventoriesSuppliesInfo::getDelFlag,0); |
| | | InventoriesSuppliesInfo page2 = this.getOne(wrapper1); |
| | | return page2; |
| | |
| | | @Override |
| | | public void submitInventoriesSuppliesInfo(InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) { |
| | | LambdaQueryWrapper< InventoriesSuppliesInfo> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.gt(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.eq(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.eq( InventoriesSuppliesInfo::getDelFlag,0); |
| | | List<InventoriesSuppliesInfo> page2 = this.list(wrapper1); |
| | | for (InventoriesSuppliesInfo page:page2){ |
| | |
| | | public void accomplishInventoriesSuppliesInfo(InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) { |
| | | |
| | | LambdaQueryWrapper< InventoriesSuppliesInfo> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.gt(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.gt(InventoriesSuppliesInfo::getType, 2); |
| | | wrapper1.eq(InventoriesSuppliesInfo::getSuppliesId, inventoriesSuppliesInfoDTO.getSuppliesId()); |
| | | wrapper1.eq(InventoriesSuppliesInfo::getType, 2); |
| | | wrapper1.eq( InventoriesSuppliesInfo::getDelFlag,0); |
| | | List<InventoriesSuppliesInfo> page2 = this.list(wrapper1); |
| | | for (InventoriesSuppliesInfo page:page2){ |
| | | SlVolumeProductionRk slVolumeProductionRk = slVolumeProductionRkMapper.selectById(page.getRkId()); |
| | | slVolumeProductionRk.setRepertoryZhai(page.getSuppliesNum()); |
| | | slVolumeProductionRkMapper.updateById(slVolumeProductionRk); |
| | | |
| | | |
| | | LambdaQueryWrapper<ManagementGoodsMaterials> wrapper2 = Wrappers.lambdaQuery(); |
| | | wrapper2.eq(ManagementGoodsMaterials::getGoodsMaterialsId,slVolumeProductionRk.getMaterialsId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getManagementId,slVolumeProductionRk.getManagementId()); |
| | | wrapper2.eq(ManagementGoodsMaterials::getDelFlag, 0); |
| | | ManagementGoodsMaterials managementGoodsMaterials = managementGoodsMaterialsMapper.selectOne(wrapper2); |
| | | if (managementGoodsMaterials!=null){ |
| | | managementGoodsMaterials.setRepertoryZhai(page.getSuppliesNum()); |
| | | managementGoodsMaterialsMapper.updateById(managementGoodsMaterials); |
| | | } |
| | | } |
| | | |
| | | } |