From 8022b86794323a3ab5e71ef6bb786ba8237f344c Mon Sep 17 00:00:00 2001 From: gulongcheng <474084054@qq.com> Date: Thu, 13 Nov 2025 15:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9F=BA=E4=BA=8ECID=20?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/mdc/FeignMdcRequestInterceptor.java | 7 +++++++ .../entity/resp/system/SysUserGroupResp.java | 4 ++-- .../resources/mapper/SimulationNodeMapper.xml | 4 ++-- .../service/impl/CID/CIDISysUserServiceImpl.java | 15 +++++++++++++++ .../service/impl/CID/CIDSysRoleServiceImpl.java | 13 ++++++++++++- .../service/impl/CID/CIDtenantServiceImpl.java | 11 +++++++++-- 6 files changed, 47 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/sdm/common/common/mdc/FeignMdcRequestInterceptor.java b/common/src/main/java/com/sdm/common/common/mdc/FeignMdcRequestInterceptor.java index 098f6922..6b2dd38b 100644 --- a/common/src/main/java/com/sdm/common/common/mdc/FeignMdcRequestInterceptor.java +++ b/common/src/main/java/com/sdm/common/common/mdc/FeignMdcRequestInterceptor.java @@ -1,5 +1,6 @@ package com.sdm.common.common.mdc; +import com.sdm.common.common.ThreadLocalContext; import feign.RequestInterceptor; import feign.RequestTemplate; import org.apache.commons.lang3.StringUtils; @@ -15,5 +16,11 @@ public class FeignMdcRequestInterceptor implements RequestInterceptor { if (StringUtils.isNotBlank(traceId)) { template.header("X-Trace-Id", traceId); } + + // 传递tenantId + Long tenantId = ThreadLocalContext.getTenantId(); + if (tenantId != null) { + template.header("tenantid", String.valueOf(tenantId)); + } } } \ No newline at end of file diff --git a/common/src/main/java/com/sdm/common/entity/resp/system/SysUserGroupResp.java b/common/src/main/java/com/sdm/common/entity/resp/system/SysUserGroupResp.java index 766eb409..0bf6eb73 100644 --- a/common/src/main/java/com/sdm/common/entity/resp/system/SysUserGroupResp.java +++ b/common/src/main/java/com/sdm/common/entity/resp/system/SysUserGroupResp.java @@ -25,7 +25,7 @@ public class SysUserGroupResp implements Serializable { private static final long serialVersionUID = 1L; @Schema(description = "组唯一标识ID") - private Integer id; + private Long id; @Schema(description = "组名") private String groupName; @@ -40,4 +40,4 @@ public class SysUserGroupResp implements Serializable { @Schema(description = "更新时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updatedTime; -} +} \ No newline at end of file diff --git a/project/src/main/resources/mapper/SimulationNodeMapper.xml b/project/src/main/resources/mapper/SimulationNodeMapper.xml index 485cc12d..da1a0c9c 100644 --- a/project/src/main/resources/mapper/SimulationNodeMapper.xml +++ b/project/src/main/resources/mapper/SimulationNodeMapper.xml @@ -329,8 +329,8 @@