fix[project]: 异常删除文件夹时,设置租户id等信息

This commit is contained in:
2026-03-26 11:20:42 +08:00
parent dae7447443
commit c11d45fcb0

View File

@@ -376,6 +376,9 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
public SdmResponse delete(SpdmDeleteNodeReq req) {
log.info("node delete参数{}", req);
Long tenantId = ThreadLocalContext.getTenantId();
Long userId = ThreadLocalContext.getUserId();
String jobNumber = ThreadLocalContext.getJobNumber();
String userName = ThreadLocalContext.getUserName();
log.info("当前租户id为{}", tenantId);
// 删
List<String> deleteNodeIdList = req.getDeleteNodeIdList();
@@ -396,6 +399,10 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
}
CompletableFuture.runAsync(() -> {
ThreadLocalContext.setTenantId(tenantId);
ThreadLocalContext.setUserId(userId);
ThreadLocalContext.setJobNumber(jobNumber);
ThreadLocalContext.setUserName(userName);
SdmResponse response = deleteDirNew(deleteNodeIdList.get(0));
if (ObjectUtils.isEmpty(response) || response.getCode() != ResultCode.SUCCESS.getCode()) {
log.error("删除id为{}的节点时,删除文件夹失败,原因为:{}", deleteNodeIdList.get(0),response.getMessage());