huminmin
2026-05-07 c1608e8e40d61f0e90d4cf90e11e739b8b37c17c
修改报错
已修改1个文件
29 ■■■■■ 文件已修改
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -16,6 +16,7 @@
import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum;
import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.procurementrecord.utils.StockUtils;
import com.ruoyi.production.dto.ProductStructureDto;
@@ -169,8 +170,14 @@
        }
        String productNo = String.format("%s%03d", datePrefix, sequenceNumber);
        productionProductMain.setProductNo(productNo);
        productionProductMain.setUserId(dto.getUserId());
        productionProductMain.setUserName(dto.getUserName());
        Long userId = dto.getUserId();
        String userName = dto.getUserName();
        if (userId == null) {
            userId = SecurityUtils.getLoginUser().getUserId();
            userName = SecurityUtils.getLoginUser().getNickName();
        }
        productionProductMain.setUserId(userId);
        productionProductMain.setUserName(userName);
        productionProductMain.setProductProcessRouteItemId(dto.getProductProcessRouteItemId());
        productionProductMain.setWorkOrderId(dto.getWorkOrderId());
        productionProductMain.setStatus(0);
@@ -188,13 +195,15 @@
                .map(ProductStructureDto::getParentId)
                .filter(Objects::nonNull)
                .collect(Collectors.toSet());
        Map<Long, ProductStructureDto> parentMap =
                productStructureMapper.selectByIds(parentIds)
                        .stream()
                        .collect(Collectors.toMap(
                                ProductStructureDto::getId,
                                Function.identity()
                        ));
        Map<Long, ProductStructureDto> parentMap = new HashMap<>();
        if (!parentIds.isEmpty()) {
            parentMap = productStructureMapper.selectByIds(parentIds)
                    .stream()
                    .collect(Collectors.toMap(
                            ProductStructureDto::getId,
                            Function.identity()
                    ));
        }
        for (ProductStructureDto productStructureDto : productStructureDtos) {
            ProductionProductInput productionProductInput = new ProductionProductInput();
            productionProductInput.setProductModelId(productStructureDto.getProductModelId());
@@ -474,4 +483,4 @@
        
        return productionProductMainDtos;
    }
}
}