数据训练实时日志展示
This commit is contained in:
@@ -9,14 +9,16 @@ public class CommonHeader {
|
||||
private String sessionId;
|
||||
private Long userId;
|
||||
private Long tenantId;
|
||||
private String userName;
|
||||
|
||||
private UserContext userContext;
|
||||
|
||||
public CommonHeader(String jobNumber, String company, UserContext userContext,Long userId) {
|
||||
public CommonHeader(String jobNumber, String company, UserContext userContext,Long userId,String userName) {
|
||||
this.jobNumber = jobNumber;
|
||||
this.company = company;
|
||||
this.userContext = userContext;
|
||||
this.userId = userId;
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public CommonHeader() {
|
||||
|
||||
@@ -63,6 +63,15 @@ public class ThreadLocalContext {
|
||||
current.get().setTenantId(tenantId);
|
||||
}
|
||||
|
||||
// userName
|
||||
public static String getUserName() {
|
||||
return current.get().getUserName();
|
||||
}
|
||||
|
||||
public static void setUserName(String userName) {
|
||||
current.get().setUserName(userName);
|
||||
}
|
||||
|
||||
|
||||
public static CommonHeader getCommonHeader() {
|
||||
return current.get();
|
||||
|
||||
@@ -24,7 +24,7 @@ public class DataAnalysisController {
|
||||
private IDataAnalysisService dataAnalysisService;
|
||||
|
||||
/**
|
||||
* 数据分析-获取 simulationtTask的文件
|
||||
* 数据分析(数据查询)-获取 simulationtTask的文件
|
||||
*
|
||||
*/
|
||||
@Operation(summary = "获取 simulationtTask的文件,文件类型: 1:模型文件 2:仿真报告 3:计算文件 4:曲线文件 5:云图文件")
|
||||
|
||||
@@ -28,11 +28,13 @@ public class AuthFilter implements Filter {
|
||||
String jobNumber = StringUtils.isEmpty(req.getHeader("jobNumber")) ? "" : req.getHeader("jobNumber");
|
||||
Long usrId = StringUtils.isEmpty(req.getHeader("userId")) ? null : Long.valueOf(req.getHeader("userId"));
|
||||
Long tenantId = StringUtils.isEmpty(req.getHeader("tenantId")) ? null : Long.valueOf(req.getHeader("tenantId"));
|
||||
String userName = StringUtils.isEmpty(req.getHeader("userName")) ? null : req.getHeader("userName");
|
||||
ThreadLocalContext.setJobNumber(jobNumber);
|
||||
ThreadLocalContext.setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.setSessionId(req.getHeader("sessionId"));
|
||||
ThreadLocalContext.setUserId(usrId);
|
||||
ThreadLocalContext.setTenantId(tenantId);
|
||||
ThreadLocalContext.setUserName(userName);
|
||||
|
||||
// User user = userService.getUserByIdCode(idCode);
|
||||
// if (user != null) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class GetSimulationTaskFileReq extends BaseReq {
|
||||
@Schema(description = "任务ID(simulationtTask的id)")
|
||||
Integer taskId;
|
||||
Long taskId;
|
||||
|
||||
@Schema(description = "文件类型", implementation = Constants.FileType.class)
|
||||
Integer fileType;
|
||||
|
||||
@@ -40,6 +40,9 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
|
||||
String objectKey = null;
|
||||
if (ObjectUtils.isNotNull(getSimulationTaskFileReq.getTaskId())) {
|
||||
FileMetadataInfo nodeFileMetadataInfo = fileMetadataInfoService.lambdaQuery().eq(FileMetadataInfo::getNodeId, getSimulationTaskFileReq.getTaskId()).one();
|
||||
if(nodeFileMetadataInfo == null ){
|
||||
return SdmResponse.failed("节点不存在");
|
||||
}
|
||||
objectKey = nodeFileMetadataInfo.getObjectKey();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class SimulationAnalysisController {
|
||||
private ITaskService taskService;
|
||||
|
||||
/**
|
||||
* 仿真工况
|
||||
* 数据分析(数据查询)-根据节点id获取仿真工况
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
@@ -34,7 +34,7 @@ public class SimulationAnalysisController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 指标
|
||||
* 数据分析(数据查询)-根据节点id获取指标
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
@@ -46,7 +46,7 @@ public class SimulationAnalysisController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 算例
|
||||
* 数据分析(数据查询)-根据节点id获取算例
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
@@ -57,4 +57,14 @@ public class SimulationAnalysisController {
|
||||
return taskService.analysisRunList(req);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据分析(数据查询)-根据任务id获取所有算列结果和5种文件
|
||||
*/
|
||||
@GetMapping("/getAllRunResult")
|
||||
public SdmResponse getAllRunResultByTaskId(String taskId) {
|
||||
return taskService.getAllRunResultByTaskId(taskId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.sdm.project.service.INodeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -152,7 +153,7 @@ public class SimulationNodeController implements ISimuluationNodeFeignClient {
|
||||
*/
|
||||
@GetMapping("/getUserGroupProjectStatistics")
|
||||
@Operation(summary = "用户组项目统计", description = "用户组项目统计")
|
||||
public SdmResponse getUserGroupProjectStatistics(@Parameter(description = "用户组ID")@RequestParam( value = "userGroupId") Integer userGroupId,@Parameter(description = "用户ID")@RequestParam( value = "userId", required = false) Integer userId) {
|
||||
public SdmResponse getUserGroupProjectStatistics(@Parameter(description = "用户组ID")@RequestParam( value = "userGroupId" )@NotNull(message = "用户组ID(userGroupId)为必传参数,请补充后重试") Integer userGroupId, @Parameter(description = "用户ID")@RequestParam( value = "userId", required = false) Integer userId) {
|
||||
return nodeService.getUserGroupProjectStatistics(userGroupId,userId);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.project.dao;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationPerformance;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface SimulationPerformanceMapper extends BaseMapper<SimulationPerformance> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.project.dao;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface SimulationRunMapper extends BaseMapper<SimulationRun> {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.sdm.project.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.project.model.entity.SimulationTask;
|
||||
import com.sdm.project.model.req.SpdmAnalysisTaskListReq;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.model.vo.*;
|
||||
@@ -10,7 +12,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SimulationTaskMapper {
|
||||
public interface SimulationTaskMapper extends BaseMapper<SimulationTask> {
|
||||
|
||||
|
||||
SdmResponse list(SpdmTaskListReq req);
|
||||
|
||||
@@ -24,9 +24,16 @@ public class AuthFilter implements Filter {
|
||||
if (servletRequest instanceof HttpServletRequest) {
|
||||
HttpServletRequest req = (HttpServletRequest) servletRequest;
|
||||
String jobNumber = StringUtils.isEmpty(req.getHeader("jobNumber")) ? "" : req.getHeader("jobNumber");
|
||||
ThreadLocalContext.getCommonHeader().setJobNumber(jobNumber);
|
||||
ThreadLocalContext.getCommonHeader().setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.getCommonHeader().setSessionId(req.getHeader("sessionId"));
|
||||
Long usrId = StringUtils.isEmpty(req.getHeader("userId")) ? null : Long.valueOf(req.getHeader("userId"));
|
||||
Long tenantId = StringUtils.isEmpty(req.getHeader("tenantId")) ? null : Long.valueOf(req.getHeader("tenantId"));
|
||||
String userName = StringUtils.isEmpty(req.getHeader("userName")) ? null : req.getHeader("userName");
|
||||
ThreadLocalContext.setJobNumber(jobNumber);
|
||||
ThreadLocalContext.setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.setSessionId(req.getHeader("sessionId"));
|
||||
ThreadLocalContext.setUserId(usrId);
|
||||
ThreadLocalContext.setTenantId(tenantId);
|
||||
ThreadLocalContext.setUserName(userName);
|
||||
|
||||
// User user = userService.getUserByIdCode(idCode);
|
||||
// if (user != null) {
|
||||
// ThreadLocalContext.setUserContext(new UserContext(user));
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.sdm.project.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("simulation_performance")
|
||||
@ApiModel(value="SimulationPerformance对象", description="")
|
||||
public class SimulationPerformance implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("uuid")
|
||||
private String uuid;
|
||||
|
||||
@TableField("nodeId")
|
||||
private String nodeId;
|
||||
|
||||
@TableField("taskId")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "算列runId")
|
||||
@TableField("runId")
|
||||
private String runId;
|
||||
|
||||
@TableField("performanceName")
|
||||
private String performanceName;
|
||||
|
||||
@TableField("nodeName")
|
||||
private String nodeName;
|
||||
|
||||
@TableField("englishName")
|
||||
private String englishName;
|
||||
|
||||
@TableField("nodeCode")
|
||||
private String nodeCode;
|
||||
|
||||
@TableField("poolName")
|
||||
private String poolName;
|
||||
|
||||
@TableField("performanceType")
|
||||
private String performanceType;
|
||||
|
||||
@TableField("unit")
|
||||
private String unit;
|
||||
|
||||
@TableField("targetValue")
|
||||
private String targetValue;
|
||||
|
||||
@TableField("lowValue")
|
||||
private String lowValue;
|
||||
|
||||
@TableField("highValue")
|
||||
private String highValue;
|
||||
|
||||
@TableField("method")
|
||||
private String method;
|
||||
|
||||
@ApiModelProperty(value = " 指标完成情况 未分析 不合格 合格")
|
||||
@TableField("completeStatus")
|
||||
private String completeStatus;
|
||||
|
||||
@ApiModelProperty(value = "计算及结果值")
|
||||
@TableField("resultValue")
|
||||
private String resultValue;
|
||||
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@TableField("taskName")
|
||||
private String taskName;
|
||||
|
||||
@TableField("standard")
|
||||
private String standard;
|
||||
|
||||
@TableField("tenantId")
|
||||
private String tenantId;
|
||||
|
||||
@TableField("createTime")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField("pid")
|
||||
private Integer pid;
|
||||
|
||||
@TableField("tag1")
|
||||
private String tag1;
|
||||
|
||||
@TableField("tag2")
|
||||
private String tag2;
|
||||
|
||||
@TableField("tag3")
|
||||
private String tag3;
|
||||
|
||||
@TableField("tag4")
|
||||
private String tag4;
|
||||
|
||||
@TableField("tag5")
|
||||
private String tag5;
|
||||
|
||||
@TableField("tag6")
|
||||
private String tag6;
|
||||
|
||||
@TableField("tag7")
|
||||
private String tag7;
|
||||
|
||||
@TableField("tag8")
|
||||
private String tag8;
|
||||
|
||||
@TableField("tag9")
|
||||
private String tag9;
|
||||
|
||||
@TableField("tag10")
|
||||
private String tag10;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.sdm.project.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("simulation_run")
|
||||
@ApiModel(value="SimulationRun对象", description="")
|
||||
public class SimulationRun implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("uuid")
|
||||
private String uuid;
|
||||
|
||||
@TableField("run_name")
|
||||
private String runName;
|
||||
|
||||
@ApiModelProperty(value = "1:server 2:pbs 3:local only")
|
||||
@TableField("type")
|
||||
private Integer type;
|
||||
|
||||
@TableField("task_id")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "Run状态 0:未执行 1:执行中 2:完成 3:失败")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "Run执行结果 0:gray 1:red 2:yellow 3:green")
|
||||
@TableField("achieve_status")
|
||||
private Integer achieveStatus;
|
||||
|
||||
@ApiModelProperty(value = "run描述信息")
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "Run对应在文件系统中的路径")
|
||||
@TableField("folder_id")
|
||||
private String folderId;
|
||||
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
@TableField("tag1")
|
||||
private String tag1;
|
||||
|
||||
@TableField("tag2")
|
||||
private String tag2;
|
||||
|
||||
@TableField("tag3")
|
||||
private String tag3;
|
||||
|
||||
@TableField("tag4")
|
||||
private String tag4;
|
||||
|
||||
@TableField("tag5")
|
||||
private String tag5;
|
||||
|
||||
@TableField("tag6")
|
||||
private String tag6;
|
||||
|
||||
@TableField("tag7")
|
||||
private String tag7;
|
||||
|
||||
@TableField("tag8")
|
||||
private String tag8;
|
||||
|
||||
@TableField("tag9")
|
||||
private String tag9;
|
||||
|
||||
@TableField("tag10")
|
||||
private String tag10;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package com.sdm.project.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("simulation_task")
|
||||
@ApiModel(value="SimulationTask对象", description="")
|
||||
public class SimulationTask implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "loadcase名称")
|
||||
@TableField("uuid")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "loadcase所属学科名称")
|
||||
@TableField("task_name")
|
||||
private String taskName;
|
||||
|
||||
@TableField("task_code")
|
||||
private String taskCode;
|
||||
|
||||
@ApiModelProperty(value = "loadcase 库名称")
|
||||
@TableField("task_pool_name")
|
||||
private String taskPoolName;
|
||||
|
||||
@TableField("task_pool_version")
|
||||
private String taskPoolVersion;
|
||||
|
||||
@ApiModelProperty(value = "task所属节点Id,0表示不从属任何节点")
|
||||
@TableField("node_id")
|
||||
private String nodeId;
|
||||
|
||||
@ApiModelProperty(value = "loadcase预估的工作周期")
|
||||
@TableField("days")
|
||||
private Integer days;
|
||||
|
||||
@TableField("real_days")
|
||||
private Integer realDays;
|
||||
|
||||
@ApiModelProperty(value = "loadcase参照的标准")
|
||||
@TableField("standard")
|
||||
private String standard;
|
||||
|
||||
@TableField("fold_id")
|
||||
private String foldId;
|
||||
|
||||
@ApiModelProperty(value = "loadcase当前状态 1:red 2:yellow 3:grey 4:green")
|
||||
@TableField("status")
|
||||
private Integer status;
|
||||
|
||||
@TableField("achieve_status")
|
||||
private String achieveStatus;
|
||||
|
||||
@ApiModelProperty(value = "loadcase开始时间")
|
||||
@TableField("begin_time")
|
||||
private String beginTime;
|
||||
|
||||
@ApiModelProperty(value = "loadcase执行结束时间")
|
||||
@TableField("end_time")
|
||||
private String endTime;
|
||||
|
||||
@TableField("finish_time")
|
||||
private String finishTime;
|
||||
|
||||
@ApiModelProperty(value = "loadcase进度")
|
||||
@TableField("progress")
|
||||
private Integer progress;
|
||||
|
||||
@ApiModelProperty(value = "上汽大众:SVW 德国大众:VW")
|
||||
@TableField("exe_status")
|
||||
private String exeStatus;
|
||||
|
||||
@ApiModelProperty(value = "置信度")
|
||||
@TableField("confidence")
|
||||
private String confidence;
|
||||
|
||||
@TableField("analyse_target")
|
||||
private String analyseTarget;
|
||||
|
||||
@ApiModelProperty(value = "分析软件")
|
||||
@TableField("analyse_software")
|
||||
private String analyseSoftware;
|
||||
|
||||
@TableField("approval_status")
|
||||
private String approvalStatus;
|
||||
|
||||
@TableField("comfirm_status")
|
||||
private String comfirmStatus;
|
||||
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@TableField("difficult")
|
||||
private Float difficult;
|
||||
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
@TableField("pid")
|
||||
private Integer pid;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@TableField("creator")
|
||||
private String creator;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("create_time")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人")
|
||||
@TableField("updater")
|
||||
private String updater;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField("update_time")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty(value = "部门")
|
||||
@TableField("department")
|
||||
private String department;
|
||||
|
||||
@ApiModelProperty(value = "科")
|
||||
@TableField("sectionName")
|
||||
private String sectionName;
|
||||
|
||||
@ApiModelProperty(value = "组")
|
||||
@TableField("groupName")
|
||||
private String groupName;
|
||||
|
||||
@ApiModelProperty(value = "仿真能力")
|
||||
@TableField("bCapacity")
|
||||
private String bCapacity;
|
||||
|
||||
@ApiModelProperty(value = "任务流程模板")
|
||||
@TableField("flowTemplateName")
|
||||
private String flowTemplateName;
|
||||
|
||||
@TableField("englishName")
|
||||
private String englishName;
|
||||
|
||||
@ApiModelProperty(value = "关联的需求id")
|
||||
@TableField("demand_id")
|
||||
private String demandId;
|
||||
|
||||
@TableField("tag1")
|
||||
private String tag1;
|
||||
|
||||
@TableField("tag2")
|
||||
private String tag2;
|
||||
|
||||
@TableField("tag3")
|
||||
private String tag3;
|
||||
|
||||
@TableField("tag4")
|
||||
private String tag4;
|
||||
|
||||
@TableField("tag5")
|
||||
private String tag5;
|
||||
|
||||
@TableField("tag6")
|
||||
private String tag6;
|
||||
|
||||
@TableField("tag7")
|
||||
private String tag7;
|
||||
|
||||
@TableField("tag8")
|
||||
private String tag8;
|
||||
|
||||
@TableField("tag9")
|
||||
private String tag9;
|
||||
|
||||
@TableField("tag10")
|
||||
private String tag10;
|
||||
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import lombok.Data;
|
||||
@Schema(description = "用户组任务完成情况统计请求参数")
|
||||
public class GetUserGroupTaskCompleteStatisticsReq {
|
||||
@Schema(description = "用户组ID")
|
||||
@NotNull
|
||||
@NotNull(message = "用户组ID不能为空")
|
||||
private Integer userGroupId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -13,16 +14,22 @@ public class SpdmAnalysisPerformanceListReq extends BaseEntity {
|
||||
@NotNull(message = "size不能为空")
|
||||
private Integer size;
|
||||
|
||||
@Schema( description = "项目节点id")
|
||||
private String projectNodeId;
|
||||
|
||||
@Schema( description = "阶段节点id")
|
||||
private String phaseNodeId;
|
||||
|
||||
@Schema( description = "专业节点id")
|
||||
private String disciplineNodeId;
|
||||
|
||||
@Schema( description = "指标名称")
|
||||
private String performanceName;
|
||||
|
||||
@Schema( description = "开始时间")
|
||||
private String beginTime;
|
||||
|
||||
@Schema( description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -13,16 +14,22 @@ public class SpdmAnalysisRunListReq extends BaseEntity {
|
||||
@NotNull(message = "size不能为空")
|
||||
private Integer size;
|
||||
|
||||
@Schema( description = "项目节点id")
|
||||
private String projectNodeId;
|
||||
|
||||
@Schema( description = "阶段节点id")
|
||||
private String phaseNodeId;
|
||||
|
||||
@Schema( description = "专业节点id")
|
||||
private String disciplineNodeId;
|
||||
|
||||
@Schema( description = "算例名称")
|
||||
private String runName;
|
||||
|
||||
@Schema( description = "开始时间")
|
||||
private String beginTime;
|
||||
|
||||
@Schema( description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -13,16 +14,52 @@ public class SpdmAnalysisTaskListReq extends BaseEntity {
|
||||
@NotNull(message = "size不能为空")
|
||||
private Integer size;
|
||||
|
||||
@Schema( description = "项目节点id")
|
||||
private String projectNodeId;
|
||||
|
||||
@Schema( description = "阶段节点id")
|
||||
private String phaseNodeId;
|
||||
|
||||
@Schema( description = "专业节点id")
|
||||
private String disciplineNodeId;
|
||||
|
||||
@Schema(description = "标签1")
|
||||
private String tag1;
|
||||
|
||||
@Schema(description = "标签2")
|
||||
private String tag2;
|
||||
|
||||
@Schema(description = "标签3")
|
||||
private String tag3;
|
||||
|
||||
@Schema(description = "标签4")
|
||||
private String tag4;
|
||||
|
||||
@Schema(description = "标签5")
|
||||
private String tag5;
|
||||
|
||||
@Schema(description = "标签6")
|
||||
private String tag6;
|
||||
|
||||
@Schema(description = "标签7")
|
||||
private String tag7;
|
||||
|
||||
@Schema(description = "标签8")
|
||||
private String tag8;
|
||||
|
||||
@Schema(description = "标签9")
|
||||
private String tag9;
|
||||
|
||||
@Schema(description = "标签10")
|
||||
private String tag10;
|
||||
|
||||
@Schema( description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema( description = "开始时间")
|
||||
private String beginTime;
|
||||
|
||||
@Schema( description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.project.service;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationPerformance;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface ISimulationPerformanceService extends IService<SimulationPerformance> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.project.service;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface ISimulationRunService extends IService<SimulationRun> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.project.service;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationTask;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface ISimulationTaskService extends IService<SimulationTask> {
|
||||
|
||||
}
|
||||
@@ -27,4 +27,6 @@ public interface ITaskService {
|
||||
SdmResponse attention(String taskId, List<Integer> addUserIdList,List<Integer> cancelUserIdList);
|
||||
|
||||
SdmResponse edit(ModifyTaskNode req);
|
||||
|
||||
SdmResponse getAllRunResultByTaskId(String taskId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.sdm.project.service.impl;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationPerformance;
|
||||
import com.sdm.project.dao.SimulationPerformanceMapper;
|
||||
import com.sdm.project.service.ISimulationPerformanceService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Service
|
||||
public class SimulationPerformanceServiceImpl extends ServiceImpl<SimulationPerformanceMapper, SimulationPerformance> implements ISimulationPerformanceService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.sdm.project.service.impl;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
import com.sdm.project.dao.SimulationRunMapper;
|
||||
import com.sdm.project.service.ISimulationRunService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Service
|
||||
public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, SimulationRun> implements ISimulationRunService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.sdm.project.service.impl;
|
||||
|
||||
import com.sdm.project.model.entity.SimulationTask;
|
||||
import com.sdm.project.dao.SimulationTaskMapper;
|
||||
import com.sdm.project.service.ISimulationTaskService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
@Service
|
||||
public class SimulationTaskServiceImpl extends ServiceImpl<SimulationTaskMapper, SimulationTask> implements ISimulationTaskService {
|
||||
|
||||
}
|
||||
@@ -13,12 +13,14 @@ import com.sdm.project.model.bo.ModifyTaskNode;
|
||||
import com.sdm.project.model.bo.TaskExtraNode;
|
||||
import com.sdm.project.model.bo.TaskMemberNode;
|
||||
import com.sdm.project.model.bo.TaskNodeTag;
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
import com.sdm.project.model.po.PerformanceNodePo;
|
||||
import com.sdm.project.model.po.ProjectNodePo;
|
||||
import com.sdm.project.model.po.TaskNodeMemberPo;
|
||||
import com.sdm.project.model.po.TaskRunPo;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.model.vo.*;
|
||||
import com.sdm.project.service.ISimulationRunService;
|
||||
import com.sdm.project.service.ITaskService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -53,6 +55,9 @@ public class TaskServiceImpl implements ITaskService {
|
||||
@Resource
|
||||
private SimulationDemandMapper demandMapper;
|
||||
|
||||
@Autowired
|
||||
private ISimulationRunService simulationRunService;
|
||||
|
||||
|
||||
@Override
|
||||
public SdmResponse list(SpdmTaskListReq req) {
|
||||
@@ -697,4 +702,10 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse getAllRunResultByTaskId(String taskId) {
|
||||
List<SimulationRun> list = simulationRunService.lambdaQuery().eq(SimulationRun::getTaskId, taskId).list();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sdm.project.dao.SimulationPerformanceMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sdm.project.dao.SimulationRunMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -9,6 +9,8 @@ import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.feign.inter.system.ISysUserFeignClient;
|
||||
import com.sdm.system.model.entity.SysRole;
|
||||
import com.sdm.system.model.req.user.*;
|
||||
import com.sdm.system.model.resp.SysUserGroupDetailResp;
|
||||
import com.sdm.system.model.resp.SysUserGroupResp;
|
||||
import com.sdm.system.service.ISysUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -164,7 +166,7 @@ public class SysUserController implements ISysUserFeignClient {
|
||||
*/
|
||||
@Operation(summary = "查询用户组", description = "查询用户组接口,支持分页和条件查询")
|
||||
@PostMapping("/queryGroup")
|
||||
public SdmResponse queryGroup(@Parameter(description = "用户组查询请求参数") @RequestBody @Validated GroupQueryReq req) {
|
||||
public SdmResponse<PageDataResp<List<SysUserGroupResp>>> queryGroup(@Parameter(description = "用户组查询请求参数") @RequestBody @Validated GroupQueryReq req) {
|
||||
return ISysUserService.queryGroup(req);
|
||||
}
|
||||
|
||||
@@ -172,9 +174,9 @@ public class SysUserController implements ISysUserFeignClient {
|
||||
* 根据用户组id查询用户组详情
|
||||
*/
|
||||
@Operation(summary = "根据用户组id查询用户组详情", description = "根据用户组id查询用户组详细信息")
|
||||
@GetMapping("/queryGroupDetail")
|
||||
public SdmResponse queryGroupDetail(@Parameter(description = "用户组id") @NotNull @RequestParam Integer id) {
|
||||
return ISysUserService.queryGroupDetail(id);
|
||||
@PostMapping("/queryGroupDetail")
|
||||
public SdmResponse<SysUserGroupDetailResp> queryGroupDetail(@RequestBody @Validated QueryGroupDetailReq req) {
|
||||
return ISysUserService.queryGroupDetail(req);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +211,7 @@ public class SysUserController implements ISysUserFeignClient {
|
||||
*/
|
||||
@Operation(summary = "查询用户组成员", description = "查询用户组成员接口,用于查询指定用户组的成员列表")
|
||||
@PostMapping("/queryGroupMember")
|
||||
public SdmResponse queryGroupMember(@Parameter(description = "用户组成员查询请求参数") @RequestBody @Validated GroupMemberQueryReq req) {
|
||||
public SdmResponse<CIDUserResp> queryGroupMember(@Parameter(description = "用户组成员查询请求参数") @RequestBody @Validated GroupMemberQueryReq req) {
|
||||
return ISysUserService.queryGroupMember(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ import java.util.List;
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public interface SysUserGroupRelationMapper extends BaseMapper<SysUserGroupRelation> {
|
||||
List<SysUser> queryUserByGroupId(@Param("groupId") Integer groupId, @Param("userName") String userName);
|
||||
List<SysUser> queryUserByGroupId(@Param("groupId") Long groupId, @Param("userName") String userName);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.sdm.system.filter;
|
||||
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
//import com.sdm.system.service.UserService;
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
@@ -23,17 +21,24 @@ public class AuthFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
/*if (servletRequest instanceof HttpServletRequest) {
|
||||
if (servletRequest instanceof HttpServletRequest) {
|
||||
HttpServletRequest req = (HttpServletRequest) servletRequest;
|
||||
String jobNumber = StringUtils.isEmpty(req.getHeader("jobNumber")) ? "" : req.getHeader("jobNumber");
|
||||
ThreadLocalContext.getCommonHeader().setJobNumber(jobNumber);
|
||||
ThreadLocalContext.getCommonHeader().setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.getCommonHeader().setSessionId(req.getHeader("sessionId"));
|
||||
Long usrId = StringUtils.isEmpty(req.getHeader("userId")) ? null : Long.valueOf(req.getHeader("userId"));
|
||||
Long tenantId = StringUtils.isEmpty(req.getHeader("tenantId")) ? null : Long.valueOf(req.getHeader("tenantId"));
|
||||
String userName = StringUtils.isEmpty(req.getHeader("userName")) ? null : req.getHeader("userName");
|
||||
ThreadLocalContext.setJobNumber(jobNumber);
|
||||
ThreadLocalContext.setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.setSessionId(req.getHeader("sessionId"));
|
||||
ThreadLocalContext.setUserId(usrId);
|
||||
ThreadLocalContext.setTenantId(tenantId);
|
||||
ThreadLocalContext.setUserName(userName);
|
||||
|
||||
// User user = userService.getUserByIdCode(idCode);
|
||||
// if (user != null) {
|
||||
// ThreadLocalContext.setUserContext(new UserContext(user));
|
||||
// }
|
||||
}*/
|
||||
}
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GroupMemberQueryReq {
|
||||
|
||||
@NotBlank(message = "groupID不能为空")
|
||||
@Schema(description = "groupID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer groupID;
|
||||
private Long groupId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String userName;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.sdm.system.model.req.user;
|
||||
|
||||
import com.sdm.system.model.req.BaseReq;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Data
|
||||
public class QueryGroupDetailReq extends BaseReq {
|
||||
@Schema(description = "用户组id")
|
||||
@NotNull(message = "用户组id不能为空")
|
||||
Long id;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.sdm.system.model.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户组
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@Schema( description="用户组和组成员信息查询")
|
||||
public class SysUserGroupDetailResp implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户组信息")
|
||||
SysUserGroupResp sysUserGroup;
|
||||
|
||||
@Schema(description = "用户信息")
|
||||
PageDataResp<List<CIDUserResp>> users;
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public interface ISysUserGroupRelationService extends IService<SysUserGroupRelation> {
|
||||
List<SysUser> queryUserByGroupId(Integer groupId, String userName);
|
||||
List<SysUser> queryUserByGroupId(Long groupId, String userName);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@ import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.system.CIDRoleResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.system.model.entity.SysRole;
|
||||
import com.sdm.system.model.entity.SysUser;
|
||||
import com.sdm.system.model.req.user.*;
|
||||
import com.sdm.system.model.resp.SysUserGroupDetailResp;
|
||||
import com.sdm.system.model.resp.SysUserGroupResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,13 +39,13 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
|
||||
SdmResponse delGroup(Integer id);
|
||||
|
||||
SdmResponse queryGroup(GroupQueryReq req);
|
||||
SdmResponse<PageDataResp<List<SysUserGroupResp>>> queryGroup(GroupQueryReq req);
|
||||
|
||||
SdmResponse queryGroupDetail(Integer id);
|
||||
SdmResponse<SysUserGroupDetailResp> queryGroupDetail(QueryGroupDetailReq req);
|
||||
|
||||
SdmResponse updateGroup(GroupUpdateReq req);
|
||||
|
||||
SdmResponse updateGroupMember(UpdateGroupMemberBatchReq req);
|
||||
|
||||
SdmResponse queryGroupMember(GroupMemberQueryReq req);
|
||||
SdmResponse<CIDUserResp> queryGroupMember(GroupMemberQueryReq req);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.sdm.system.model.entity.SysRole;
|
||||
import com.sdm.system.model.entity.SysUser;
|
||||
import com.sdm.system.model.req.user.*;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.system.model.resp.SysUserGroupDetailResp;
|
||||
import com.sdm.system.model.resp.SysUserGroupResp;
|
||||
import com.sdm.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -41,6 +43,15 @@ public class CIDISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
||||
@Value("${cid.user.queryUserRole}")
|
||||
private String queryUserRole;
|
||||
|
||||
@Value("${cid.user.queryGroup}")
|
||||
private String queryGroup;
|
||||
|
||||
@Value("${cid.user.queryGroupDetail}")
|
||||
private String queryGroupDetail;
|
||||
|
||||
@Value("${cid.user.queryGroupMember}")
|
||||
private String queryGroupMember;
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return type;
|
||||
@@ -91,9 +102,6 @@ public class CIDISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
||||
try {
|
||||
String userJson = HttpUtil.post(cidUrl + listUser, JSONUtil.toJsonStr(req));
|
||||
SdmResponse<PageDataResp<List<CIDUserResp>>> cidUserAddReq = JSON.parseObject(userJson, SdmResponse.class);
|
||||
if (cidUserAddReq.getCode() != 0 ) {
|
||||
return SdmResponse.failed("用户不存在");
|
||||
}
|
||||
return cidUserAddReq;
|
||||
} catch (Exception e) {
|
||||
log.error("查询用户失败", e);
|
||||
@@ -157,13 +165,33 @@ public class CIDISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryGroup(GroupQueryReq req) {
|
||||
return null;
|
||||
public SdmResponse<PageDataResp<List<SysUserGroupResp>>> queryGroup(GroupQueryReq req) {
|
||||
try {
|
||||
String userJson = HttpUtil.post(cidUrl + queryGroup, JSONUtil.toJsonStr(req));
|
||||
SdmResponse<PageDataResp<List<SysUserGroupResp>>> CIDGroupRespose = JSON.parseObject(userJson, SdmResponse.class);
|
||||
if (CIDGroupRespose != null) {
|
||||
return CIDGroupRespose;
|
||||
}
|
||||
return SdmResponse.failed("用户组不存在");
|
||||
} catch (Exception e) {
|
||||
log.error("查询用户组失败", e);
|
||||
return SdmResponse.failed("查询用户组失败: ");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryGroupDetail(Integer id) {
|
||||
return null;
|
||||
public SdmResponse<SysUserGroupDetailResp> queryGroupDetail(QueryGroupDetailReq req) {
|
||||
try {
|
||||
String userJson = HttpUtil.post(cidUrl + queryGroupDetail, JSONUtil.toJsonStr(req));
|
||||
SdmResponse<SysUserGroupDetailResp> CIDGroupDetailRespose = JSON.parseObject(userJson, SdmResponse.class);
|
||||
if (CIDGroupDetailRespose != null) {
|
||||
return CIDGroupDetailRespose;
|
||||
}
|
||||
return SdmResponse.failed("用户组不存在");
|
||||
} catch (Exception e) {
|
||||
log.error("查询用户组失败", e);
|
||||
return SdmResponse.failed("查询用户组失败: ");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,7 +205,17 @@ public class CIDISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryGroupMember(GroupMemberQueryReq req) {
|
||||
return null;
|
||||
public SdmResponse<CIDUserResp> queryGroupMember(GroupMemberQueryReq req) {
|
||||
try {
|
||||
String userJson = HttpUtil.post(cidUrl + queryGroupDetail, JSONUtil.toJsonStr(req));
|
||||
SdmResponse<CIDUserResp> cIDUserResp = JSON.parseObject(userJson, SdmResponse.class);
|
||||
if (cIDUserResp != null) {
|
||||
return cIDUserResp;
|
||||
}
|
||||
return SdmResponse.failed("用户组成员不存在");
|
||||
} catch (Exception e) {
|
||||
log.error("查询用户组成员失败", e);
|
||||
return SdmResponse.failed("查询用户组成员失败: ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class LocalUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> im
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryGroup(GroupQueryReq req) {
|
||||
public SdmResponse<PageDataResp<List<SysUserGroupResp>>> queryGroup(GroupQueryReq req) {
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
List<SysUserGroup> sysUserGroups = sysUserGroupService.lambdaQuery()
|
||||
.like(ObjectUtils.isNotEmpty(req.getGroupName()), SysUserGroup::getGroupName, req.getGroupName()).list();
|
||||
@@ -217,7 +217,8 @@ public class LocalUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> im
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryGroupDetail(Integer id) {
|
||||
public SdmResponse queryGroupDetail(QueryGroupDetailReq req) {
|
||||
Long id = req.getId();
|
||||
SysUserGroup sysUserGroup = sysUserGroupService.lambdaQuery().eq(SysUserGroup::getId, id).one();
|
||||
List<SysUser> list = sysUserGroupRelationService.queryUserByGroupId(id,null);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -289,7 +290,7 @@ public class LocalUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> im
|
||||
|
||||
@Override
|
||||
public SdmResponse queryGroupMember(GroupMemberQueryReq req) {
|
||||
List<SysUser> sysUsers = sysUserGroupRelationService.queryUserByGroupId(req.getGroupID(), req.getUserName());
|
||||
List<SysUser> sysUsers = sysUserGroupRelationService.queryUserByGroupId(req.getGroupId(), req.getUserName());
|
||||
return SdmResponse.success(sysUsers);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
public class SysUserGroupRelationServiceImpl extends ServiceImpl<SysUserGroupRelationMapper, SysUserGroupRelation> implements ISysUserGroupRelationService {
|
||||
|
||||
@Override
|
||||
public List<SysUser> queryUserByGroupId(Integer groupId, String userName) {
|
||||
public List<SysUser> queryUserByGroupId(Long groupId, String userName) {
|
||||
return baseMapper.queryUserByGroupId(groupId, userName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,9 @@ cid:
|
||||
listUser: /spdm-user/listUser
|
||||
queryUserDetail: /spdm-user/queryUserDetail
|
||||
queryUserRole: /spdm-user/queryUserRole
|
||||
queryGroup: /spdm-user/queryGroup
|
||||
queryGroupDetail: /spdm-user/queryGroupDetail
|
||||
queryGroupMember: /spdm-user/queryGroupMember
|
||||
role:
|
||||
getRoleByRoleName: /spdm-role/getRoleByRoleName
|
||||
getRoleByRoleCode: /spdm-role/getRoleByRoleCode
|
||||
|
||||
@@ -121,6 +121,9 @@ cid:
|
||||
listUser: /spdm-user/listUser
|
||||
queryUserDetail: /spdm-user/queryUserDetail
|
||||
queryUserRole: /spdm-user/queryUserRole
|
||||
queryGroup: /spdm-user/queryGroup
|
||||
queryGroupDetail: /spdm-user/queryGroupDetail
|
||||
queryGroupMember: /spdm-user/queryGroupMember
|
||||
role:
|
||||
getRoleByRoleName: /spdm-role/getRoleByRoleName
|
||||
getRoleByRoleCode: /spdm-role/getRoleByRoleCode
|
||||
|
||||
@@ -149,6 +149,9 @@ cid:
|
||||
listUser: /spdm-user/listUser
|
||||
queryUserDetail: /spdm-user/queryUserDetail
|
||||
queryUserRole: /spdm-user/queryUserRole
|
||||
queryGroup: /spdm-user/queryGroup
|
||||
queryGroupDetail: /spdm-user/queryGroupDetail
|
||||
queryGroupMember: /spdm-user/queryGroupMember
|
||||
role:
|
||||
getRoleByRoleName: /spdm-role/getRoleByRoleName
|
||||
getRoleByRoleCode: /spdm-role/getRoleByRoleCode
|
||||
|
||||
@@ -148,6 +148,9 @@ cid:
|
||||
listUser: /spdm-user/listUser
|
||||
queryUserDetail: /spdm-user/queryUserDetail
|
||||
queryUserRole: /spdm-user/queryUserRole
|
||||
queryGroup: /spdm-user/queryGroup
|
||||
queryGroupDetail: /spdm-user/queryGroupDetail
|
||||
queryGroupMember: /spdm-user/queryGroupMember
|
||||
role:
|
||||
getRoleByRoleName: /spdm-role/getRoleByRoleName
|
||||
getRoleByRoleCode: /spdm-role/getRoleByRoleCode
|
||||
|
||||
@@ -24,9 +24,16 @@ public class AuthFilter implements Filter {
|
||||
if (servletRequest instanceof HttpServletRequest) {
|
||||
HttpServletRequest req = (HttpServletRequest) servletRequest;
|
||||
String jobNumber = StringUtils.isEmpty(req.getHeader("jobNumber")) ? "" : req.getHeader("jobNumber");
|
||||
ThreadLocalContext.getCommonHeader().setJobNumber(jobNumber);
|
||||
ThreadLocalContext.getCommonHeader().setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.getCommonHeader().setSessionId(req.getHeader("sessionId"));
|
||||
Long usrId = StringUtils.isEmpty(req.getHeader("userId")) ? null : Long.valueOf(req.getHeader("userId"));
|
||||
Long tenantId = StringUtils.isEmpty(req.getHeader("tenantId")) ? null : Long.valueOf(req.getHeader("tenantId"));
|
||||
String userName = StringUtils.isEmpty(req.getHeader("userName")) ? null : req.getHeader("userName");
|
||||
ThreadLocalContext.setJobNumber(jobNumber);
|
||||
ThreadLocalContext.setCompany(req.getHeader("company"));
|
||||
ThreadLocalContext.setSessionId(req.getHeader("sessionId"));
|
||||
ThreadLocalContext.setUserId(usrId);
|
||||
ThreadLocalContext.setTenantId(tenantId);
|
||||
ThreadLocalContext.setUserName(userName);
|
||||
|
||||
// User user = userService.getUserByIdCode(idCode);
|
||||
// if (user != null) {
|
||||
// ThreadLocalContext.setUserContext(new UserContext(user));
|
||||
|
||||
Reference in New Issue
Block a user