| | |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | |
| | | return procurementDtos; |
| | | } |
| | | |
| | | public ProcurementRecordStorage getProcurementRecordById(Integer id){ |
| | | public ProcurementRecordStorage getProcurementRecordById(Integer id) { |
| | | ProcurementRecordStorage procurementRecordStorage = procurementRecordMapper.selectById(id); |
| | | if(procurementRecordStorage == null) { |
| | | if (procurementRecordStorage == null) { |
| | | throw new RuntimeException("未找到该采购入库记录"); |
| | | } |
| | | return procurementRecordStorage; |
| | | } |
| | | |
| | | public List<ProcurementRecordStorage> getProcurementRecordByIds(List<Integer> id){ |
| | | public List<ProcurementRecordStorage> getProcurementRecordByIds(List<Integer> id) { |
| | | List<ProcurementRecordStorage> procurementRecordStorage = procurementRecordMapper.selectBatchIds(id); |
| | | if(procurementRecordStorage == null) { |
| | | if (procurementRecordStorage == null) { |
| | | throw new RuntimeException("未找到该采购入库记录"); |
| | | } |
| | | return procurementRecordStorage; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response,Integer type) { |
| | | public void export(HttpServletResponse response, Integer type) { |
| | | List<ProcurementPageDto> list = new ArrayList<>(); |
| | | if(type == 1){ |
| | | if (type == 1) { |
| | | list = procurementRecordMapper.list(); |
| | | }else{ |
| | | } else { |
| | | list = procurementRecordMapper.listOne(); |
| | | } |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = list.stream().map(ProcurementPageDto::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | ExcelUtil<ProcurementPageDto> util = new ExcelUtil<ProcurementPageDto>(ProcurementPageDto.class); |
| | | util.exportExcel(response, list, "入库台账"); |
| | | return; |
| | |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, type); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | ExcelUtil<ProcurementPageDto> util = new ExcelUtil<ProcurementPageDto>(ProcurementPageDto.class); |
| | | util.exportExcel(response, list, "入库台账"); |
| | | return; |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | |
| | | public int updateManagement(ProcurementManagementUpdateDto procurementDto) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SysUser sysUser = sysUserMapper.selectUserById(procurementDto.getCreateUser()); |
| | | if(sysUser == null){ |
| | | if (sysUser == null) { |
| | | throw new RuntimeException("入库人不存在"); |
| | | } |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String entryDateStr = procurementDto.getEntryDate() + " 00:00:00"; |
| | | String createTimeStr = procurementDto.getCreateTime() + " 00:00:00"; |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(procurementDto.getSalesLedgerProductId()); |
| | | if(salesLedgerProduct == null){ |
| | | if (salesLedgerProduct == null) { |
| | | throw new RuntimeException("销售台账产品不存在"); |
| | | } |
| | | // 根据大类,规格查询所有产品id |
| | |
| | | .eq(SalesLedgerProduct::getSpecificationModel, salesLedgerProduct.getSpecificationModel()) |
| | | .eq(SalesLedgerProduct::getType, 1); |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectList(salesLedgerProductLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty(salesLedgerProducts)){ |
| | | if (CollectionUtils.isEmpty(salesLedgerProducts)) { |
| | | throw new RuntimeException("没有找到对应的产品"); |
| | | } |
| | | salesLedgerProduct.setMinStock(procurementDto.getMinStock()); |
| | |
| | | procurementRecordStorage.setTotalPrice(procurementDto.getTotalPrice()); |
| | | procurementRecordStorage.setCreateBy(sysUser.getNickName()); |
| | | procurementRecordStorage.setCreateUser(sysUser.getUserId()); |
| | | procurementRecordStorage.setUpdateTime(LocalDateTime.parse(entryDateStr,df)); |
| | | procurementRecordStorage.setUpdateTime(LocalDateTime.parse(entryDateStr, df)); |
| | | procurementRecordStorage.setUpdateUser(loginUser.getUserId()); |
| | | procurementRecordStorage.setCreateTime(LocalDateTime.parse(createTimeStr,df)); |
| | | procurementRecordMapper.update(procurementRecordStorage,procurementRecordStorageLambdaQueryWrapper); |
| | | procurementRecordStorage.setCreateTime(LocalDateTime.parse(createTimeStr, df)); |
| | | procurementRecordMapper.update(procurementRecordStorage, procurementRecordStorageLambdaQueryWrapper); |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public void exportCopy(HttpServletResponse response,Integer type) { |
| | | public void exportCopy(HttpServletResponse response, Integer type) { |
| | | List<ProcurementPageDtoCopy> list = new ArrayList<>(); |
| | | if(type == 1){ |
| | | if (type == 1) { |
| | | list = procurementRecordMapper.listCopy(); |
| | | }else{ |
| | | } else { |
| | | list = procurementRecordMapper.listCopyOne(); |
| | | } |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = list.stream().map(ProcurementPageDtoCopy::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | ExcelUtil<ProcurementPageDtoCopy> util = new ExcelUtil<ProcurementPageDtoCopy>(ProcurementPageDtoCopy.class); |
| | | util.exportExcel(response, list, "库存管理"); |
| | | return; |
| | |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, type); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | ExcelUtil<ProcurementPageDtoCopy> util = new ExcelUtil<ProcurementPageDtoCopy>(ProcurementPageDtoCopy.class); |
| | | util.exportExcel(response, list, "库存管理"); |
| | | return; |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void exportCopyTwo(HttpServletResponse response,Integer type) { |
| | | public void exportCopyTwo(HttpServletResponse response, Integer type) { |
| | | LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | customStorageLambdaQueryWrapper.groupBy(CustomStorage::getSupplierName, CustomStorage::getProductCategory, CustomStorage::getSpecificationModel); |
| | | List<CustomStorage> list = customStorageMapper.selectList(customStorageLambdaQueryWrapper); |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = list.stream().map(CustomStorage::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | ExcelUtil<CustomStorage> util = new ExcelUtil<CustomStorage>(CustomStorage.class); |
| | | util.exportExcel(response, list, "库存管理"); |
| | | return; |
| | |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, type); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, type); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | ExcelUtil<CustomStorage> util = new ExcelUtil<CustomStorage>(CustomStorage.class); |
| | | util.exportExcel(response, list, "库存管理"); |
| | | return; |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | |
| | | reportData.put("tableData", procurementPageDtoCopyList); |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = procurementPageDtoCopyList.stream().map(ProcurementPageDtoCopy::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | return reportData; |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | return reportData; |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | return reportData; |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | return reportData; |
| | | } |
| | | int totalIn =0; |
| | | int totalOut =0; |
| | | int currentStock =0; |
| | | int turnoverRate =0; |
| | | int totalIn = 0; |
| | | int totalOut = 0; |
| | | int currentStock = 0; |
| | | int turnoverRate = 0; |
| | | List<String> dates = new ArrayList<>(); |
| | | List<Integer> values = new ArrayList<>(); |
| | | List<String> comparisonDates = new ArrayList<>(); |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | |
| | | public InventoryInformationDto getReportList() { |
| | | InventoryInformationDto inventoryInformationDto = new InventoryInformationDto(); |
| | | IPage<ProcurementPageDto> procurementPageDtoIPage = this.listPage(new Page<>(1, -1), new ProcurementPageDto()); |
| | | if(CollectionUtils.isEmpty(procurementPageDtoIPage.getRecords())){ |
| | | if (CollectionUtils.isEmpty(procurementPageDtoIPage.getRecords())) { |
| | | return inventoryInformationDto; |
| | | } |
| | | // 计算总库存数量 |
| | |
| | | inventoryInformationDto.setInventoryChangeValue(inventoryChangeValue.subtract(totalInventoryValue)); |
| | | return inventoryInformationDto; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProcurementPageDto> listPageByProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> procurementPageDtoIPage = procurementRecordMapper.listPageByProduction(page, procurementDto); |
| | |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = procurementPageDtos.stream().map(ProcurementPageDto::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | return procurementPageDtoIPage; |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect) |
| | | .eq(ProcurementRecordOut::getType,2); |
| | | .eq(ProcurementRecordOut::getType, 2); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | return procurementPageDtoIPage; |
| | | } |
| | | for (ProcurementPageDto dto : procurementPageDtos) { |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | |
| | | @Override |
| | | public AjaxResult addCustom(List<CustomStorage> customStorage) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if(CollectionUtils.isEmpty(customStorage)){ |
| | | if (CollectionUtils.isEmpty(customStorage)) { |
| | | return AjaxResult.error("数据不能为空"); |
| | | } |
| | | customStorage.forEach(item -> { |
| | | // 查询采购入库数量 |
| | | Long aLong = customStorageMapper.selectCount(null); |
| | | item.setInboundBatches(aLong.equals(0L) ? "第1批次(自定义入库)" : "第"+ (aLong + 1) + "批次(自定义入库)" ); |
| | | item.setInboundBatches(aLong.equals(0L) ? "第1批次(自定义入库)" : "第" + (aLong + 1) + "批次(自定义入库)"); |
| | | item.setCreateBy(loginUser.getNickName()); |
| | | item.setCode(OrderUtils.countTodayByCreateTime(customStorageMapper, "")); |
| | | customStorageMapper.insert(item); |
| | |
| | | @Override |
| | | public IPage<CustomStorage> listPageByCustom(Page page, CustomStorage customStorage) { |
| | | LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(customStorage != null){ |
| | | if(!StringUtils.isEmpty(customStorage.getSupplierName())){ |
| | | if (customStorage != null) { |
| | | if (!StringUtils.isEmpty(customStorage.getSupplierName())) { |
| | | customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName()); |
| | | } |
| | | // 筛选入库时间 |
| | | if(customStorage.getTimeStr() != null){ |
| | | if (customStorage.getTimeStr() != null) { |
| | | customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getTimeStr()); |
| | | } |
| | | if(!StringUtils.isEmpty(customStorage.getProductCategory())){ |
| | | if (!StringUtils.isEmpty(customStorage.getProductCategory())) { |
| | | customStorageLambdaQueryWrapper.like(CustomStorage::getProductCategory, customStorage.getProductCategory()); |
| | | } |
| | | } |
| | |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = procurementPageDtos.stream().map(CustomStorage::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | return procurementPageDtoIPage; |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect) |
| | | .eq(ProcurementRecordOut::getType, 3); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | return procurementPageDtoIPage; |
| | | } |
| | | for (CustomStorage dto : procurementPageDtos) { |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = procurementPageDtoCopyList.stream().map(ProcurementPageDtoCopy::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | return procurementPageDtoCopyIPage; |
| | | } |
| | | // 1. 查询采购记录已入库的出库记录(按storageId分组) |
| | |
| | | // 计算待入库数量 |
| | | // 查询采购记录已入库数量 |
| | | List<Integer> collect = procurementPageDtoCopyList.stream().map(CustomStorage::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty( collect)){ |
| | | if (CollectionUtils.isEmpty(collect)) { |
| | | return pageList; |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getType, 3); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | if (CollectionUtils.isEmpty(procurementRecords)) { |
| | | return pageList; |
| | | } |
| | | for (CustomStorage dto : procurementPageDtoCopyList) { |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 如果没有相关的出库记录,跳过该条数据 |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | if (CollectionUtils.isEmpty(collect1)) { |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | dto.setTotalInboundNum(BigDecimal.ZERO); |
| | | continue; |
| | |
| | | // 待出库数量 = 总数量 - 已出库数量 |
| | | dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); |
| | | // 库存价值 |
| | | if(dto.getTaxInclusiveUnitPrice() != null){ |
| | | if (dto.getTaxInclusiveUnitPrice() != null) { |
| | | dto.setTaxInclusiveTotalPrice(dto.getInboundNum0().multiply(dto.getTaxInclusiveUnitPrice())); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public int updateManagementByCustom(ProcurementManagementUpdateDto procurementDto) { |
| | | CustomStorage customStorage = customStorageMapper.selectById(procurementDto.getId()); |
| | | if(customStorage == null){ |
| | | if (customStorage == null) { |
| | | throw new RuntimeException("材料库存不存在"); |
| | | } |
| | | LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | CustomStorage one = new CustomStorage(); |
| | | one.setTaxInclusiveUnitPrice(procurementDto.getTaxInclusiveUnitPrice()); |
| | | one.setTaxInclusiveTotalPrice(procurementDto.getTaxInclusiveTotalPrice()); |
| | | return customStorageMapper.update(one,customStorageLambdaQueryWrapper); |
| | | return customStorageMapper.update(one, customStorageLambdaQueryWrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | procurementRecordStorageLambdaQueryWrapper.eq(ProcurementRecordStorage::getSalesLedgerProductId, salesProductId) |
| | | .eq(ProcurementRecordStorage::getType, 2); |
| | | List<ProcurementRecordStorage> procurementRecordStorages = procurementRecordMapper.selectList(procurementRecordStorageLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecordStorages)){ |
| | | if (CollectionUtils.isEmpty(procurementRecordStorages)) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | return procurementRecordStorages.stream() |
| | |
| | | } |
| | | ProcurementRecordStorage.ProcurementRecordStorageBuilder procurementRecordBuilder = ProcurementRecordStorage.builder() |
| | | .salesLedgerProductId(detail.getId()) |
| | | .inboundBatches(aLong.equals(0L) ? "第1批次("+ procurementDto.getTypeName() +")" : "第"+ (aLong + 1) + "批次(" + procurementDto.getTypeName() + ")" ) |
| | | .inboundBatches(aLong.equals(0L) ? "第1批次(" + procurementDto.getTypeName() + ")" : "第" + (aLong + 1) + "批次(" + procurementDto.getTypeName() + ")") |
| | | .inboundNum(detail.getInboundQuantity()) |
| | | .type(procurementDto.getType()) |
| | | .warnNum(detail.getWarnNum()) |
| | |
| | | .updateTime(LocalDateTime.now()) |
| | | .updateUser(loginUser.getUserId()) |
| | | .createBy(procurementDto.getNickName()) |
| | | .productModelId(detail.getProductModelId()); |
| | | .productModelId(detail.getProductModelId()) |
| | | .qualityInspectId(ObjectUtils.isNotNull(procurementDto.getQualityInspectId())?procurementDto.getQualityInspectId():0L); |
| | | this.save(procurementRecordBuilder.build()); |
| | | // 入库成功减掉采购数量 |
| | | // LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | return procurementPageDtoCopyIPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProductModel> listPageProductionStock(Page page) { |
| | | ProductModel productModel = new ProductModel(); |
| | | IPage<ProductModel> iPage = productModelMapper.listPageProductModel(page, productModel); |
| | | iPage.getRecords().forEach(item -> { |
| | | item.setInboundNum(stockUtils.getStockQuantity(item.getId()).get("inboundNum")); |
| | | item.setOutboundNum(stockUtils.getStockQuantity(item.getId()).get("outboundNum")); |
| | | item.setStockQuantity(stockUtils.getStockQuantity(item.getId()).get("stockQuantity")); |
| | | }); |
| | | return iPage; |
| | | public IPage<ProductModel> listPageProductionStock(Page page, ProcurementPageDto dto) { |
| | | return productModelMapper.listPageProductionStock(page, dto); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<ProcurementPageDto> listPageByProductProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> procurementPageDtoIPage = procurementRecordMapper.listPageByProductProduction(page, procurementDto); |