fix:数据存储预警通知

This commit is contained in:
2025-12-30 19:56:17 +08:00
parent 75aca76150
commit 70693ae821
19 changed files with 116 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
package com.sdm.common.entity.constants;
public class CommonConstants {
/**
* 系统管理员角色编码
*/
public static final String ROLE_CODE_ADMIN = "ROLE_ADMIN";
/**
* 普通用户角色编码
*/
public static final String ROLE_CODE_GENERAL = "GENERAL_USER";
}

View File

@@ -7,6 +7,7 @@ public enum MessageTemplateEnum {
TASK_ISSUE("任务通知", "接收到下发的仿真任务:%s请前往仿真数据管理平台查看"),
DATA_ALERT("数据通知", "您的数据存储空间已达阈值,请前往仿真数据管理平台查看"),
DATA_ALERT_MANAGER("数据通知", "%s的数据存储空间已达阈值请前往仿真数据管理平台查看"),
APPROVE_ALERT("审批通知", "收到一条%s消息请前往仿真数据管理平台查看"),
HPC_START("作业通知", "作业已发起"),
HPC_END("作业通知", "作业已结束")

View File

@@ -83,4 +83,19 @@ public class SysUserFeignClientImpl implements ISysUserFeignClient {
return SdmResponse.failed("查询用户组信息失败");
}
}
@Override
public SdmResponse<List<Long>> getUserByRoleCode(String roleCode, Long tenantId) {
SdmResponse<List<Long>> sdmResponse;
try {
sdmResponse = sysUserClient.getUserByRoleCode(roleCode, tenantId);
if (!sdmResponse.isSuccess() || sdmResponse.getData() == null){
return SdmResponse.failed("根据角色编码查询用户失败");
}
return sdmResponse;
} catch (Exception e) {
log.error("根据角色编码查询用户失败", e);
return SdmResponse.failed("根据角色编码查询用户失败");
}
}
}

View File

@@ -12,9 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@@ -35,4 +33,7 @@ public interface ISysUserFeignClient {
*/
@PostMapping("/user/queryGroupDetail")
SdmResponse<SysUserGroupDetailResp> queryGroupDetail(@RequestBody @Validated QueryGroupDetailReq req);
@GetMapping("/user/getUserByRoleCode")
SdmResponse<List<Long>> getUserByRoleCode(@RequestParam("roleCode") String roleCode, @RequestParam("tenantId") Long tenantId);
}