1、异步推送报告,并更新工位节点的审批状态为进行中

This commit is contained in:
2026-02-02 13:35:41 +08:00
parent 0a4afd7217
commit 8161cd284f

View File

@@ -21,6 +21,7 @@ import com.sdm.outbridge.entity.*;
import com.sdm.outbridge.mode.GetProcessDataReq;
import com.sdm.outbridge.mode.HkUploadFileReq;
import com.sdm.outbridge.service.lyric.*;
import com.sdm.project.common.ApprovalStatusEnum;
import com.sdm.project.common.MemberTypeEnum;
import com.sdm.project.common.generator.UniqueFileNameGenerator;
import com.sdm.project.dao.SimulationDemandMapper;
@@ -1363,20 +1364,27 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
uploadFileReq.setXmh(req.getProjectCode());
uploadFileReq.setGwh(req.getWorkspaceCode());
uploadFileReq.setFiles(Collections.singletonList(zipFilePath));
try {
lyricIntegrateService.uploadHkFile(jobNumber, uploadFileReq);
} catch (Exception e) {
log.error("推送zip异常{}", e.getMessage());
throw new RuntimeException(e);
} finally {
// 删除临时路径
log.info("删除临时路径:{},中。。。。。。", tempPath);
String finalJobNumber = jobNumber;
CompletableFuture.runAsync(() -> {
try {
FilesUtil.deleteFolderNonRecursive(tempPath);
} catch (IOException e) {
lyricIntegrateService.uploadHkFile(finalJobNumber, uploadFileReq);
} catch (Exception e) {
log.error("推送zip异常{}", e.getMessage());
throw new RuntimeException(e);
} finally {
// 删除临时路径
log.info("删除临时路径:{},中。。。。。。", tempPath);
try {
FilesUtil.deleteFolderNonRecursive(tempPath);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
},projectTaskThreadPoolExecutor);
nodeService.lambdaUpdate().set(SimulationNode::getApprovalStatus, String.valueOf(ApprovalStatusEnum.ING.getCode()))
.eq(SimulationNode::getNodeCode, req.getWorkspaceCode())
.eq(SimulationNode::getNodeType, NodeTypeEnum.WORKSPACE.getValue())
.update();
return SdmResponse.success();
}