zss
14 小时以前 3bdaa5708b94e64f813f70ede8ba0bbd1a3179ec
src/main/java/com/ruoyi/production/service/impl/ProductionRecordServiceImpl.java
@@ -93,6 +93,9 @@
    private ProductMaterialService productMaterialService;
    @Autowired
    private ProductBomService productBomService;
    @Autowired
    private TempFileMapper tempFileMapper;
    @Override
@@ -226,7 +229,7 @@
            throw new ServiceException("报工失败,生产订单更新失败");
        }
        //  完成报工主表-投入表-产出表数据
        //  完成报工主表-产出表-产出明细表数据
        ProductionProductMain productionProductMain = new ProductionProductMain();
        productionProductMain.setProductNo(productionProductMainService.generateProductNo());
        productionProductMain.setProductOrderId(dto.getProductOrderId());
@@ -244,7 +247,7 @@
        productionProductInput.setQuantity(dto.getQuantity());
        result = productionProductInputService.save(productionProductInput);
        if (!result) {
            throw new ServiceException("报工失败,生产投入存储失败");
            throw new ServiceException("报工失败,生产产出存储失败");
        }
        ProductionProductOutput productionProductOutput = new ProductionProductOutput();
@@ -470,6 +473,7 @@
            throw new ServiceException("查询失败,未查询到生产订单信息");
        }
        dto.setNpsNo(productOrder.getNpsNo());
        dto.setStrength(productOrder.getStrength());
        /// 产品信息
        ProductMaterialSkuDto productMaterialSkuDto = productMaterialService.selectProductByProductMainId(productOrder.getId());
@@ -477,7 +481,7 @@
        dto.setMaterialCode(productMaterialSkuDto.getMaterialCode());
        dto.setModel(productMaterialSkuDto.getModel());
        //  查询投入表(获取产品ID和投入数量)
        //  查询总的产出数量(这里把投入表弄成了产出总表)
        ProductionProductInput input = productionProductInputService.getOne(
                new LambdaQueryWrapper<ProductionProductInput>()
                        .eq(ProductionProductInput::getProductMainId, productMainId)
@@ -507,6 +511,11 @@
                ProductionProductRouteItemDto routeItemDto = new ProductionProductRouteItemDto();
                BeanUtils.copyProperties(routeItem, routeItemDto);
                //  工序名称/编号
                ProductProcess productProcess = productProcessService.getById(routeItem.getProcessId());
                routeItemDto.setProcessName(productProcess.getName());
                routeItemDto.setProcessNo(productProcess.getNo());
                //  查询工序参数
                List<ProductionProductRouteItemParam> paramList = productionProductRouteItemParamService.list(
                        new LambdaQueryWrapper<ProductionProductRouteItemParam>()
@@ -519,6 +528,10 @@
                            ProductMaterialSkuDto materialSkuDto = productMaterialService.selectProductByModelId(paramDto.getProductId());
                            productMaterialService.selectProductByModelId(paramDto.getProductId());
                            paramDto.setParamName(materialSkuDto.getProductName());
                            paramDto.setModel(materialSkuDto.getModel());
                            paramDto.setMaterialCode(materialSkuDto.getMaterialCode());
                            String strength = productBomService.strengthById(paramDto.getBomId());
                            paramDto.setStrength(strength);
                        }
                        return paramDto;
                    }).collect(Collectors.toList());
@@ -652,7 +665,7 @@
                    .eq(ProductionProductRouteItemParam::getProductionProductRouteItemId, routeItemId));
            List<ProductionProductRouteItemParamDto> paramDtoList = routeItemDto.getProductionProductRouteItemParamDtoList();
                if (paramDtoList != null && !paramDtoList.isEmpty()) {
            if (paramDtoList != null && !paramDtoList.isEmpty()) {
                for (ProductionProductRouteItemParamDto paramDto : paramDtoList) {
                    ProductionProductRouteItemParam paramEntity = new ProductionProductRouteItemParam();
                    BeanUtils.copyProperties(paramDto, paramEntity, "id");