云
2026-10-26 5bf3fb623c646bfeb6b72d7b9dc770ba89f51ef8
fix(mes): 修正产品路由中的物料类型枚举判断

- 将 MdmItemTypeEnum.PRODUCT 替换为 MdmItemTypeEnum.FINISHED_PRODUCT
- 统一使用成品和半成品类型枚举进行判断
- 修复因历史数据同步导致的类型匹配问题
已修改2个文件
4 ■■■■■ 文件已修改
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteProductServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteProductServiceImpl.java
@@ -146,7 +146,7 @@
            Integer mdmType = mdmItem.getItemType();
            // 历史同步曾将分类 ID 写入 itemType;与 categoryId 相同的值不能当作类型枚举。
            if (!Objects.equals(mdmItem.getCategoryId(), mdmType == null ? null : mdmType.longValue())
                    && (MdmItemTypeEnum.PRODUCT.getType().equals(mdmType)
                    && (MdmItemTypeEnum.FINISHED_PRODUCT.getType().equals(mdmType)
                    || MdmItemTypeEnum.SEMI_FINISHED.getType().equals(mdmType))) {
                return;
            }
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java
@@ -268,7 +268,7 @@
        if (Objects.equals(mdmItem.getCategoryId(), mdmType == null ? null : mdmType.longValue())) {
            return false;
        }
        return "FG".equals(rootCode) ? MdmItemTypeEnum.PRODUCT.getType().equals(mdmType)
        return "FG".equals(rootCode) ? MdmItemTypeEnum.FINISHED_PRODUCT.getType().equals(mdmType)
                : "SF".equals(rootCode) && MdmItemTypeEnum.SEMI_FINISHED.getType().equals(mdmType);
    }