| | |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.constant.StorageAttachmentConstants; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.production.bean.dto.ProductionOperationTaskDto; |
| | | import com.ruoyi.production.bean.dto.ProductionOrderDto; |
| | | import com.ruoyi.production.bean.vo.ProductionBomStructureVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOperationTaskVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOrderPickVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOrderVo; |
| | | import com.ruoyi.production.bean.vo.ProductionPlanVo; |
| | | import com.ruoyi.production.bean.vo.ProductionOrderWorkOrderDetailVo; |
| | | import com.ruoyi.production.enums.ProductOrderStatusEnum; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.quality.mapper.QualityInspectFileMapper; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.quality.mapper.QualityInspectParamMapper; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | | import com.ruoyi.production.service.ProductionOrderService; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.technology.mapper.*; |
| | | import com.ruoyi.technology.pojo.*; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final ProductionOrderBomMapper productionOrderBomMapper; |
| | | private final ProductionBomStructureMapper productionBomStructureMapper; |
| | | private final ProductionProductMainMapper productionProductMainMapper; |
| | | private final ProductionProductOutputMapper productionProductOutputMapper; |
| | | private final ProductionOrderPickMapper productionOrderPickMapper; |
| | | private final ProductionOrderPickRecordMapper productionOrderPickRecordMapper; |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | private final QualityInspectParamMapper qualityInspectParamMapper; |
| | | private final QualityInspectFileMapper qualityInspectFileMapper; |
| | | private final ProductionPlanMapper productionPlanMapper; |
| | | private final StockInventoryMapper stockInventoryMapper; |
| | | private final StorageAttachmentMapper storageAttachmentMapper; |
| | | private final StorageBlobMapper storageBlobMapper; |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | |
| | | || productionOrderRoutingMapper.selectCount(Wrappers.<ProductionOrderRouting>lambdaQuery() |
| | | .eq(ProductionOrderRouting::getProductionOrderId, productionOrder.getId())) == 0); |
| | | if (needSync) { |
| | | // 工艺、产品或数量变化后,订单快照必须和当前下单数据重新对齐。 |
| | | syncProductionOrderSnapshot(productionOrder.getId()); |
| | | } else { |
| | | // 未重建快照时,也要确保备料主单和订单数量保持同步。 |
| | | upsertOrderPick(productionOrder); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | List<TechnologyRoutingOperation> routingOperations = technologyRoutingOperationMapper.selectList( |
| | | Wrappers.<TechnologyRoutingOperation>lambdaQuery() |
| | | .eq(TechnologyRoutingOperation::getTechnologyRoutingId, technologyRouting.getId()) |
| | | .orderByAsc(TechnologyRoutingOperation::getDragSort) |
| | | .orderByAsc(TechnologyRoutingOperation::getId)); |
| | | .orderByDesc(TechnologyRoutingOperation::getDragSort) |
| | | .orderByDesc(TechnologyRoutingOperation::getId)); |
| | | Map<Long, String> operationNameMap = technologyOperationMapper.selectBatchIds( |
| | | routingOperations.stream() |
| | | .map(TechnologyRoutingOperation::getTechnologyOperationId) |
| | |
| | | .collect(Collectors.toSet())) |
| | | .stream() |
| | | .collect(Collectors.toMap(TechnologyOperation::getId, TechnologyOperation::getName, (a, b) -> a)); |
| | | Integer lastDragSort = routingOperations.stream() |
| | | .map(TechnologyRoutingOperation::getDragSort) |
| | | .filter(Objects::nonNull) |
| | | .max(Integer::compareTo) |
| | | .orElse(null); |
| | | for (TechnologyRoutingOperation sourceOperation : routingOperations) { |
| | | // 订单工序保存的是工艺工序快照,后续报工只依赖快照,不再直接引用工艺主数据。 |
| | | ProductionOrderRoutingOperation targetOperation = new ProductionOrderRoutingOperation(); |
| | |
| | | targetOperation.setOrderRoutingId(orderRouting.getId()); |
| | | targetOperation.setProductModelId(sourceOperation.getProductModelId()); |
| | | targetOperation.setDragSort(sourceOperation.getDragSort()); |
| | | targetOperation.setIsProduction(sourceOperation.getIsProduction()); |
| | | targetOperation.setIsQuality(sourceOperation.getIsQuality()); |
| | | targetOperation.setOperationName(operationNameMap.get(sourceOperation.getTechnologyOperationId())); |
| | | targetOperation.setTechnologyOperationId(sourceOperation.getTechnologyOperationId()); |
| | | productionOrderRoutingOperationMapper.insert(targetOperation); |
| | | |
| | | ProductionOperationTask task = new ProductionOperationTask(); |
| | | task.setTechnologyRoutingOperationId(targetOperation.getId()); |
| | | task.setProductionOrderId(productionOrder.getId()); |
| | | task.setPlanQuantity(defaultDecimal(productionOrder.getQuantity())); |
| | | task.setCompleteQuantity(BigDecimal.ZERO); |
| | | task.setWorkOrderNo(generateNextTaskNo()); |
| | | task.setStatus(2); |
| | | productionOperationTaskMapper.insert(task); |
| | | boolean isLastOperation = lastDragSort != null && Objects.equals(sourceOperation.getDragSort(), lastDragSort); |
| | | if (isLastOperation || Boolean.TRUE.equals(targetOperation.getIsProduction())) { |
| | | ProductionOperationTask task = new ProductionOperationTask(); |
| | | task.setProductionOrderRoutingOperationId(targetOperation.getId()); |
| | | task.setProductionOrderId(productionOrder.getId()); |
| | | task.setPlanQuantity(defaultDecimal(productionOrder.getQuantity())); |
| | | task.setCompleteQuantity(BigDecimal.ZERO); |
| | | task.setWorkOrderNo(generateNextTaskNo()); |
| | | task.setStatus(2); |
| | | productionOperationTaskMapper.insert(task); |
| | | } |
| | | |
| | | List<TechnologyRoutingOperationParam> sourceParams = technologyRoutingOperationParamMapper.selectList( |
| | | Wrappers.<TechnologyRoutingOperationParam>lambdaQuery() |
| | |
| | | syncedParamCount++; |
| | | } |
| | | } |
| | | |
| | | upsertOrderPick(productionOrder); |
| | | return syncedParamCount; |
| | | } |
| | | |
| | |
| | | if (productionPlans.size() != planIds.size()) { |
| | | throw new ServiceException("部分生产计划不存在"); |
| | | } |
| | | Map<Long, ProductionPlan> planMap = productionPlans.stream() |
| | | .collect(Collectors.toMap(ProductionPlan::getId, item -> item, (left, right) -> left)); |
| | | ProductionPlan mainPlan = planMap.get(planIds.get(0)); |
| | | if (mainPlan == null) { |
| | | throw new ServiceException("主生产计划不存在"); |
| | | } |
| | | Set<Long> productModelIds = productionPlans.stream() |
| | | .map(ProductionPlan::getProductModelId) |
| | | .collect(Collectors.toSet()); |
| | |
| | | if (productionPlans.stream().anyMatch(item -> item.getStatus() != null && item.getStatus() == 2)) { |
| | | throw new ServiceException("所选生产计划已下发"); |
| | | } |
| | | ProductionPlan firstPlan = productionPlans.get(0); |
| | | ProductionPlan firstPlan = mainPlan; |
| | | if (productionOrder.getProductModelId() == null) { |
| | | productionOrder.setProductModelId(firstPlan.getProductModelId()); |
| | | } else if (!Objects.equals(productionOrder.getProductModelId(), firstPlan.getProductModelId())) { |
| | |
| | | return 0; |
| | | } |
| | | return issuedQuantity.compareTo(requiredQuantity) < 0 ? 1 : 2; |
| | | } |
| | | |
| | | private void upsertOrderPick(ProductionOrder productionOrder) { |
| | | if (productionOrder == null || productionOrder.getId() == null) { |
| | | return; |
| | | } |
| | | // 订单下达后自动生成一张备料主单,后续领料记录都挂在这张单上。 |
| | | ProductionOrderPick orderPick = productionOrderPickMapper.selectOne( |
| | | Wrappers.<ProductionOrderPick>lambdaQuery() |
| | | .eq(ProductionOrderPick::getProductionOrderId, productionOrder.getId()) |
| | | .last("limit 1")); |
| | | if (orderPick == null) { |
| | | orderPick = new ProductionOrderPick(); |
| | | orderPick.setProductionOrderId(productionOrder.getId()); |
| | | } |
| | | orderPick.setProductModelId(productionOrder.getProductModelId() == null ? null : Math.toIntExact(productionOrder.getProductModelId())); |
| | | orderPick.setQuantity(defaultDecimal(productionOrder.getQuantity())); |
| | | orderPick.setRemark("下单自动生成"); |
| | | if (orderPick.getId() == null) { |
| | | productionOrderPickMapper.insert(orderPick); |
| | | } else { |
| | | productionOrderPickMapper.updateById(orderPick); |
| | | } |
| | | } |
| | | |
| | | private List<Long> parsePlanIds(String productionPlanIds) { |
| | |
| | | vo.setDownloadURL(fileUtil.buildSignedDownloadUrl(vo)); |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public ProductionOrderWorkOrderDetailVo getWorkOrderReportInspectDetail(ProductionOrderDto dto) { |
| | | Long productionOrderId = resolveProductionOrderId(dto); |
| | | ProductionOrderVo orderInfo = getProductionOrderInfo(productionOrderId); |
| | | if (orderInfo == null) { |
| | | throw new ServiceException("生产订单不存在"); |
| | | } |
| | | |
| | | ProductionOrderWorkOrderDetailVo detailVo = new ProductionOrderWorkOrderDetailVo(); |
| | | detailVo.setProductionOrder(orderInfo); |
| | | |
| | | ProductionOperationTaskDto taskQuery = new ProductionOperationTaskDto(); |
| | | taskQuery.setProductionOrderId(productionOrderId); |
| | | IPage<ProductionOperationTaskVo> workOrderPage = productionOperationTaskMapper.pageProductionOperationTask( |
| | | new Page<ProductionOperationTaskVo>(1, -1), taskQuery); |
| | | List<ProductionOperationTaskVo> workOrderList = workOrderPage == null || workOrderPage.getRecords() == null |
| | | ? Collections.emptyList() |
| | | : workOrderPage.getRecords().stream() |
| | | .filter(Objects::nonNull) |
| | | .sorted(Comparator.comparing(ProductionOperationTaskVo::getId, Comparator.nullsLast(Comparator.naturalOrder()))) |
| | | .collect(Collectors.toList()); |
| | | if (workOrderList == null || workOrderList.isEmpty()) { |
| | | detailVo.setWorkOrderList(Collections.emptyList()); |
| | | return detailVo; |
| | | } |
| | | |
| | | List<Long> workOrderIdList = workOrderList.stream() |
| | | .map(ProductionOperationTaskVo::getId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | List<ProductionProductMain> reportMainList = workOrderIdList.isEmpty() |
| | | ? Collections.emptyList() |
| | | : productionProductMainMapper.selectList( |
| | | Wrappers.<ProductionProductMain>lambdaQuery() |
| | | .in(ProductionProductMain::getProductionOperationTaskId, workOrderIdList) |
| | | .orderByAsc(ProductionProductMain::getId)); |
| | | Map<Long, List<ProductionProductMain>> reportMainByWorkOrderMap = new LinkedHashMap<>(); |
| | | for (ProductionProductMain reportMain : reportMainList) { |
| | | if (reportMain == null || reportMain.getProductionOperationTaskId() == null) { |
| | | continue; |
| | | } |
| | | reportMainByWorkOrderMap.computeIfAbsent(reportMain.getProductionOperationTaskId(), key -> new ArrayList<>()).add(reportMain); |
| | | } |
| | | |
| | | List<Long> reportMainIdList = reportMainList.stream() |
| | | .map(ProductionProductMain::getId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | Map<Long, List<ProductionProductOutput>> reportOutputMap = new LinkedHashMap<>(); |
| | | Map<Long, List<ProductionOrderRoutingOperationParam>> reportParamMap = new LinkedHashMap<>(); |
| | | Map<Long, List<QualityInspect>> inspectMap = new LinkedHashMap<>(); |
| | | Map<Long, List<QualityInspectParam>> inspectParamMap = new LinkedHashMap<>(); |
| | | Map<Long, List<QualityInspectFile>> inspectFileMap = new LinkedHashMap<>(); |
| | | if (!reportMainIdList.isEmpty()) { |
| | | List<ProductionProductOutput> reportOutputList = productionProductOutputMapper.selectList( |
| | | Wrappers.<ProductionProductOutput>lambdaQuery() |
| | | .in(ProductionProductOutput::getProductionProductMainId, reportMainIdList) |
| | | .orderByAsc(ProductionProductOutput::getId)); |
| | | for (ProductionProductOutput reportOutput : reportOutputList) { |
| | | if (reportOutput == null) { |
| | | continue; |
| | | } |
| | | Long reportMainId = reportOutput.getProductionProductMainId() != null |
| | | ? reportOutput.getProductionProductMainId() |
| | | : reportOutput.getProductMainId(); |
| | | if (reportMainId == null) { |
| | | continue; |
| | | } |
| | | reportOutputMap.computeIfAbsent(reportMainId, k -> new ArrayList<>()).add(reportOutput); |
| | | } |
| | | |
| | | List<ProductionOrderRoutingOperationParam> reportParamList = productionOrderRoutingOperationParamMapper.selectList( |
| | | Wrappers.<ProductionOrderRoutingOperationParam>lambdaQuery() |
| | | .in(ProductionOrderRoutingOperationParam::getProductionProductMainId, reportMainIdList) |
| | | .orderByAsc(ProductionOrderRoutingOperationParam::getId)); |
| | | for (ProductionOrderRoutingOperationParam reportParam : reportParamList) { |
| | | if (reportParam == null || reportParam.getProductionProductMainId() == null) { |
| | | continue; |
| | | } |
| | | reportParamMap.computeIfAbsent(reportParam.getProductionProductMainId(), k -> new ArrayList<>()).add(reportParam); |
| | | } |
| | | |
| | | List<QualityInspect> inspectList = qualityInspectMapper.selectList( |
| | | Wrappers.<QualityInspect>lambdaQuery() |
| | | .in(QualityInspect::getProductMainId, reportMainIdList) |
| | | .orderByAsc(QualityInspect::getId)); |
| | | for (QualityInspect inspect : inspectList) { |
| | | if (inspect == null || inspect.getProductMainId() == null) { |
| | | continue; |
| | | } |
| | | inspectMap.computeIfAbsent(inspect.getProductMainId(), key -> new ArrayList<>()).add(inspect); |
| | | } |
| | | |
| | | List<Long> inspectIdList = inspectList.stream() |
| | | .map(QualityInspect::getId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | if (!inspectIdList.isEmpty()) { |
| | | List<QualityInspectParam> inspectParamList = qualityInspectParamMapper.selectList( |
| | | Wrappers.<QualityInspectParam>lambdaQuery() |
| | | .in(QualityInspectParam::getInspectId, inspectIdList) |
| | | .orderByAsc(QualityInspectParam::getId)); |
| | | for (QualityInspectParam inspectParam : inspectParamList) { |
| | | if (inspectParam == null || inspectParam.getInspectId() == null) { |
| | | continue; |
| | | } |
| | | inspectParamMap.computeIfAbsent(inspectParam.getInspectId(), k -> new ArrayList<>()).add(inspectParam); |
| | | } |
| | | |
| | | List<QualityInspectFile> inspectFileList = qualityInspectFileMapper.selectList( |
| | | Wrappers.<QualityInspectFile>lambdaQuery() |
| | | .in(QualityInspectFile::getInspectId, inspectIdList) |
| | | .orderByAsc(QualityInspectFile::getId)); |
| | | for (QualityInspectFile inspectFile : inspectFileList) { |
| | | if (inspectFile == null || inspectFile.getInspectId() == null) { |
| | | continue; |
| | | } |
| | | inspectFileMap.computeIfAbsent(inspectFile.getInspectId(), k -> new ArrayList<>()).add(inspectFile); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<ProductionOrderWorkOrderDetailVo.WorkOrderDetail> workOrderDetailList = new ArrayList<>(); |
| | | for (ProductionOperationTaskVo workOrder : workOrderList) { |
| | | ProductionOrderWorkOrderDetailVo.WorkOrderDetail workOrderDetail = new ProductionOrderWorkOrderDetailVo.WorkOrderDetail(); |
| | | workOrderDetail.setWorkOrder(workOrder); |
| | | |
| | | List<ProductionProductMain> workOrderReportMainList = reportMainByWorkOrderMap.getOrDefault(workOrder.getId(), Collections.emptyList()); |
| | | if (workOrderReportMainList.isEmpty()) { |
| | | workOrderDetail.setReportList(Collections.emptyList()); |
| | | workOrderDetail.setInspectList(Collections.emptyList()); |
| | | workOrderDetailList.add(workOrderDetail); |
| | | continue; |
| | | } |
| | | |
| | | List<ProductionOrderWorkOrderDetailVo.ReportDetail> reportDetailList = new ArrayList<>(); |
| | | List<ProductionOrderWorkOrderDetailVo.InspectDetail> inspectDetailList = new ArrayList<>(); |
| | | for (ProductionProductMain reportMain : workOrderReportMainList) { |
| | | Long reportMainId = reportMain.getId(); |
| | | |
| | | ProductionOrderWorkOrderDetailVo.ReportDetail reportDetail = new ProductionOrderWorkOrderDetailVo.ReportDetail(); |
| | | reportDetail.setReportMain(reportMain); |
| | | reportDetail.setReportOutputList(reportOutputMap.getOrDefault(reportMainId, Collections.emptyList())); |
| | | reportDetail.setReportParamList(reportParamMap.getOrDefault(reportMainId, Collections.emptyList())); |
| | | reportDetailList.add(reportDetail); |
| | | |
| | | List<QualityInspect> reportInspectList = inspectMap.getOrDefault(reportMainId, Collections.emptyList()); |
| | | for (QualityInspect inspect : reportInspectList) { |
| | | ProductionOrderWorkOrderDetailVo.InspectDetail inspectDetail = new ProductionOrderWorkOrderDetailVo.InspectDetail(); |
| | | inspectDetail.setReportId(reportMainId); |
| | | inspectDetail.setReportNo(reportMain.getProductNo()); |
| | | inspectDetail.setReportMain(reportMain); |
| | | inspectDetail.setInspect(inspect); |
| | | inspectDetail.setInspectParamList(inspectParamMap.getOrDefault(inspect.getId(), Collections.emptyList())); |
| | | inspectDetail.setInspectFileList(inspectFileMap.getOrDefault(inspect.getId(), Collections.emptyList())); |
| | | inspectDetailList.add(inspectDetail); |
| | | } |
| | | } |
| | | |
| | | workOrderDetail.setReportList(reportDetailList); |
| | | workOrderDetail.setInspectList(inspectDetailList); |
| | | workOrderDetailList.add(workOrderDetail); |
| | | } |
| | | |
| | | detailVo.setWorkOrderList(workOrderDetailList); |
| | | return detailVo; |
| | | } |
| | | |
| | | private Long resolveProductionOrderId(ProductionOrderDto dto) { |
| | | if (dto == null) { |
| | | throw new ServiceException("请传入生产订单ID或生产订单号"); |
| | | } |
| | | if (dto.getId() != null) { |
| | | return dto.getId(); |
| | | } |
| | | if (dto.getNpsNo() == null || dto.getNpsNo().trim().isEmpty()) { |
| | | throw new ServiceException("请传入生产订单ID或生产订单号"); |
| | | } |
| | | ProductionOrder productionOrder = baseMapper.selectOne( |
| | | Wrappers.<ProductionOrder>lambdaQuery() |
| | | .eq(ProductionOrder::getNpsNo, dto.getNpsNo().trim()) |
| | | .last("limit 1")); |
| | | if (productionOrder == null || productionOrder.getId() == null) { |
| | | throw new ServiceException("生产订单不存在"); |
| | | } |
| | | return productionOrder.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionOrderPickVo> pick(Long productionOrderId) { |
| | | if (productionOrderId == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | ProductionOrderBom orderBom = productionOrderBomMapper.selectOne( |
| | | Wrappers.<ProductionOrderBom>lambdaQuery() |
| | | .eq(ProductionOrderBom::getProductionOrderId, productionOrderId) |
| | | .orderByDesc(ProductionOrderBom::getId) |
| | | .last("limit 1")); |
| | | if (orderBom == null || orderBom.getId() == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | List<ProductionBomStructureVo> bomStructureList = productionBomStructureMapper.pickByBomId(orderBom.getId()); |
| | | if (bomStructureList == null || bomStructureList.isEmpty()) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | List<Long> productModelIds = bomStructureList.stream() |
| | | .map(ProductionBomStructureVo::getProductModelId) |
| | | .filter(Objects::nonNull) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | Map<Long, BigDecimal> stockQuantityMap = new HashMap<>(); |
| | | Map<Long, LinkedHashSet<String>> stockBatchNoMap = new HashMap<>(); |
| | | if (!productModelIds.isEmpty()) { |
| | | List<StockInventory> stockList = stockInventoryMapper.selectList( |
| | | Wrappers.<StockInventory>lambdaQuery() |
| | | .in(StockInventory::getProductModelId, productModelIds)); |
| | | for (StockInventory stockItem : stockList) { |
| | | if (stockItem == null || stockItem.getProductModelId() == null) { |
| | | continue; |
| | | } |
| | | Long productModelId = stockItem.getProductModelId(); |
| | | stockQuantityMap.merge(productModelId, defaultDecimal(stockItem.getQualitity()), BigDecimal::add); |
| | | String batchNo = stockItem.getBatchNo(); |
| | | if (batchNo != null && !batchNo.trim().isEmpty()) { |
| | | stockBatchNoMap.computeIfAbsent(productModelId, key -> new LinkedHashSet<>()).add(batchNo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Map<String, ProductionOrderPickVo> mergedPickMap = new LinkedHashMap<>(); |
| | | for (ProductionBomStructureVo structure : bomStructureList) { |
| | | if (structure == null || structure.getProductModelId() == null) { |
| | | continue; |
| | | } |
| | | Long productModelId = structure.getProductModelId(); |
| | | String mergeKey = String.valueOf(structure.getTechnologyOperationId()) + "#" + productModelId; |
| | | ProductionOrderPickVo vo = mergedPickMap.get(mergeKey); |
| | | if (vo == null) { |
| | | vo = new ProductionOrderPickVo(); |
| | | vo.setProductModelId(productModelId); |
| | | vo.setOperationName(structure.getOperationName()); |
| | | vo.setTechnologyOperationId(structure.getTechnologyOperationId()); |
| | | vo.setProductName(structure.getProductName()); |
| | | vo.setModel(structure.getModel()); |
| | | vo.setDemandedQuantity(BigDecimal.ZERO); |
| | | vo.setUnit(structure.getUnit()); |
| | | List<String> batchNoList = stockBatchNoMap.get(productModelId) == null |
| | | ? Collections.emptyList() |
| | | : new ArrayList<>(stockBatchNoMap.get(productModelId)); |
| | | vo.setBatchNoList(batchNoList); |
| | | vo.setStockQuantity(stockQuantityMap.getOrDefault(productModelId, BigDecimal.ZERO)); |
| | | vo.setBom(true); |
| | | mergedPickMap.put(mergeKey, vo); |
| | | } |
| | | vo.setDemandedQuantity(defaultDecimal(vo.getDemandedQuantity()).add(defaultDecimal(structure.getDemandedQuantity()))); |
| | | } |
| | | return new ArrayList<>(mergedPickMap.values()); |
| | | } |
| | | |
| | | @Override |
| | | public int updateOrder(ProductionOrderDto productionOrderDto) { |
| | | productionOrderDto.setStatus(5); |
| | | return baseMapper.updateById(productionOrderDto); |
| | | } |
| | | } |