From 39a4962bdba2258169c235066a4be595e0f1c396 Mon Sep 17 00:00:00 2001 From: hdka <823267011@qq.com> Date: Mon, 11 Aug 2025 18:31:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/service/impl/IndustryStepServiceImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java b/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java index 3d074179..69002746 100644 --- a/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java +++ b/industry-system/src/main/java/com/industry/work/service/impl/IndustryStepServiceImpl.java @@ -13,6 +13,7 @@ import com.industry.common.plc.PLCSystemData; import com.industry.common.utils.DateUtils; import com.industry.common.utils.Threads; +import com.industry.work.domain.IndustryBatch; import com.industry.work.domain.IndustryMaterial; import com.industry.work.domain.IndustryStep; import com.industry.work.domain.IndustryTechnology; @@ -444,8 +445,17 @@ public class IndustryStepServiceImpl implements IIndustryStepService { // 将状态改为了轧制中 List successList = industryMaterialService.resourceToWorkAndCreateStep(industryMaterial); + + if (Objects.nonNull(successList) && !successList.isEmpty()) { + // 强行对齐batch数据,避免batch出现比实际多的情况导致开始轧制失败 + IndustryBatch industryBatch = new IndustryBatch(); + industryBatch.setId(industryMaterial.getBatchId()); + industryBatch.setBatchSize((long) successList.size()); + industryBatchService.updateIndustryBatch(industryBatch); + + for (IndustryMaterialVo success : successList) { // 进入这里说明工艺没问题接下里根据工艺表创建道次 // 判断当前是粗轧还是精轧