| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | .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 |
| | |
| | | return procurementPageDtoIPage; |
| | | } |
| | | |
| | | @Override |
| | | public boolean frozenQuality(List<Integer> frozenIds) { |
| | | if (frozenIds == null || frozenIds.isEmpty()) { |
| | | return true; |
| | | } |
| | | |
| | | LambdaUpdateWrapper<ProcurementRecordStorage> storageLambdaUpdateWrapper = new LambdaUpdateWrapper<ProcurementRecordStorage>() |
| | | .set(ProcurementRecordStorage::getIsFrozen, true) |
| | | .in(ProcurementRecordStorage::getId, frozenIds) |
| | | .eq(ProcurementRecordStorage::getIsFrozen, false); |
| | | |
| | | return update(storageLambdaUpdateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean thawQuality(List<Integer> thawIds) { |
| | | if (thawIds == null || thawIds.isEmpty()) { |
| | | return true; |
| | | } |
| | | |
| | | LambdaUpdateWrapper<ProcurementRecordStorage> storageLambdaUpdateWrapper = new LambdaUpdateWrapper<ProcurementRecordStorage>() |
| | | .set(ProcurementRecordStorage::getIsFrozen, false) |
| | | .in(ProcurementRecordStorage::getId, thawIds) |
| | | .eq(ProcurementRecordStorage::getIsFrozen, true); |
| | | |
| | | return update(storageLambdaUpdateWrapper); |
| | | } |
| | | |
| | | } |