From 2756f7581ad6743ff796670a26787b85b8aaa2b2 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期一, 02 十一月 2026 12:58:50 +0800
Subject: [PATCH] fix(mes): 修复工艺路线【本工序产出】保存不生效 - 后端补齐 outputs 字段与 JSON 存储/解析
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleService.java | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleService.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleService.java
index 936c385..c32c99d 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleService.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/task/schedule/MesProBatchScheduleService.java
@@ -22,6 +22,7 @@
import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderProcessService;
import cn.iocoder.yudao.module.mes.service.pro.task.MesProTaskService;
import cn.iocoder.yudao.module.mes.service.cal.holiday.MesCalHolidayService;
+import cn.iocoder.yudao.module.mes.util.MesOutputItemUtils;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@@ -252,9 +253,9 @@
}
Long itemId = order.getProductId();
if (process.getOutputItemId() != null && !process.getOutputItemId().isBlank()) {
- String[] output = process.getOutputItemId().split(",");
- if (output.length != 1) throw new IllegalArgumentException("澶氫骇鍑哄伐搴忚浣跨敤鎵嬪伐鎺掍骇纭鍚勪骇鍑烘暟閲�");
- itemId = Long.valueOf(output[0].trim());
+ List<Long> outputIds = MesOutputItemUtils.parseItemIds(process.getOutputItemId());
+ if (outputIds.size() != 1) throw new IllegalArgumentException("澶氫骇鍑哄伐搴忚浣跨敤鎵嬪伐鎺掍骇纭鍚勪骇鍑烘暟閲�");
+ itemId = outputIds.get(0);
}
var item = itemService.validateItemExists(itemId);
if (!Objects.equals(item.getStatus(), 0)) throw new IllegalArgumentException("宸ュ簭浜у嚭浜у搧宸插仠鐢�");
--
Gitblit v1.9.3