From 82485bffcb962b8c583979a770ed6b70e404589a Mon Sep 17 00:00:00 2001 From: yangyang01000846 <15195822163@163.com> Date: Tue, 30 Dec 2025 20:15:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9Ahpc=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E5=AE=8C=E6=88=90=E9=80=9A=E7=9F=A5=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedule/hpc/hander/FinishedStatusHandler.java | 11 ----------- .../sdm/pbs/service/impl/PbsServiceDecorator.java | 12 +++++++++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pbs/src/main/java/com/sdm/pbs/schedule/hpc/hander/FinishedStatusHandler.java b/pbs/src/main/java/com/sdm/pbs/schedule/hpc/hander/FinishedStatusHandler.java index a7ad7f18..b1b973a8 100644 --- a/pbs/src/main/java/com/sdm/pbs/schedule/hpc/hander/FinishedStatusHandler.java +++ b/pbs/src/main/java/com/sdm/pbs/schedule/hpc/hander/FinishedStatusHandler.java @@ -2,8 +2,6 @@ package com.sdm.pbs.schedule.hpc.hander; import com.alibaba.fastjson2.JSONObject; import com.sdm.common.common.SdmResponse; -import com.sdm.common.entity.req.flowable.AsyncCallbackRequest; -import com.sdm.common.feign.inter.flowable.IFlowableFeignClient; import com.sdm.common.log.CoreLogger; import com.sdm.common.utils.DateUtils; import com.sdm.common.utils.String2NumberUtil; @@ -28,9 +26,6 @@ public class FinishedStatusHandler implements JobStatusHandler { @Autowired private HpcInstructionService hpcInstructionService; - @Autowired - private IFlowableFeignClient flowableFeignClient; - @Override public void handle(SimulationJob simJob, HpcJobStatusInfo statusInfo) { try { @@ -55,12 +50,6 @@ public class FinishedStatusHandler implements JobStatusHandler { // 通知成功修改状态 newDbJob.setFileStatus("uploading"); simulationJobService.updateById(newDbJob); - // todo 先直接流程结束 - AsyncCallbackRequest asyncCallbackRequest = new AsyncCallbackRequest(); - asyncCallbackRequest.setAsyncTaskId(newDbJob.getJobId()); - asyncCallbackRequest.setResultJson("finished"); - SdmResponse sdmResponse = flowableFeignClient.asyncCallback(asyncCallbackRequest); - CoreLogger.info("flowableFeignClient asyncCallback result:{}", JSONObject.toJSONString(sdmResponse)); } catch (Exception e) { CoreLogger.error("HpcJobStatus finshed handle error:{},newDbJob:{},statusInfo:{}",e.getMessage(), JSONObject.toJSONString(simJob),JSONObject.toJSONString(statusInfo)); diff --git a/pbs/src/main/java/com/sdm/pbs/service/impl/PbsServiceDecorator.java b/pbs/src/main/java/com/sdm/pbs/service/impl/PbsServiceDecorator.java index a489ad49..a480a421 100644 --- a/pbs/src/main/java/com/sdm/pbs/service/impl/PbsServiceDecorator.java +++ b/pbs/src/main/java/com/sdm/pbs/service/impl/PbsServiceDecorator.java @@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sdm.common.common.SdmResponse; +import com.sdm.common.entity.req.flowable.AsyncCallbackRequest; import com.sdm.common.entity.resp.PageDataResp; import com.sdm.common.entity.resp.pbs.hpc.FileNodeInfo; +import com.sdm.common.feign.inter.flowable.IFlowableFeignClient; import com.sdm.common.log.CoreLogger; import com.sdm.common.utils.HpcCommandExcuteUtil; import com.sdm.common.utils.PageUtils; @@ -43,6 +45,9 @@ public class PbsServiceDecorator implements IPbsServiceDecorator { @Autowired private HpcCommandExcuteUtil hpcCommandExcuteUtil; + @Autowired + private IFlowableFeignClient flowableFeignClient; + // 正则匹配%后的单词(\w+ 匹配字母、数字、下划线) private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("%(\\w+)"); @@ -319,7 +324,12 @@ public class PbsServiceDecorator implements IPbsServiceDecorator { newDbJob.setFileStatus("finished"); newDbJob.setUpdateTime(LocalDateTime.now()); simulationJobService.updateById(newDbJob); - // 回调通知工作流节点,继续 todo + // 回调通知工作流节点 + AsyncCallbackRequest asyncCallbackRequest = new AsyncCallbackRequest(); + asyncCallbackRequest.setAsyncTaskId(newDbJob.getJobId()); + asyncCallbackRequest.setResultJson("finished"); + SdmResponse sdmResponse = flowableFeignClient.asyncCallback(asyncCallbackRequest); + CoreLogger.info("flowableFeignClient asyncCallback result:{}", JSONObject.toJSONString(sdmResponse)); return SdmResponse.success(true); } return SdmResponse.success(false);