diff --git a/common/src/main/java/com/sdm/common/entity/req/system/UserListReq.java b/common/src/main/java/com/sdm/common/entity/req/system/UserListReq.java index 1a772590..a90add7c 100644 --- a/common/src/main/java/com/sdm/common/entity/req/system/UserListReq.java +++ b/common/src/main/java/com/sdm/common/entity/req/system/UserListReq.java @@ -7,6 +7,9 @@ import lombok.Data; @Schema(description = "用户列表查询请求参数") @Data public class UserListReq extends BaseReq { + @Schema(description = "租户ID") + private Long tenantId; + @Schema(description = "用户ID") private Long userId; diff --git a/data/src/main/java/com/sdm/data/model/entity/FileMetadataInfo.java b/data/src/main/java/com/sdm/data/model/entity/FileMetadataInfo.java index 6b00cc5c..c65c59a8 100644 --- a/data/src/main/java/com/sdm/data/model/entity/FileMetadataInfo.java +++ b/data/src/main/java/com/sdm/data/model/entity/FileMetadataInfo.java @@ -126,5 +126,51 @@ public class FileMetadataInfo implements Serializable { @TableField("fileSize") private Long fileSize; + @ApiModelProperty(value = "任务ID") + @TableField("taskId") + private String taskId; + @ApiModelProperty(value = "算列ID") + @TableField("runId") + private String runId; + + @ApiModelProperty(value = "tag1") + @TableField("tag1") + private String tag1; + + @ApiModelProperty(value = "tag2") + @TableField("tag2") + private String tag2; + + @ApiModelProperty(value = "tag3") + @TableField("tag3") + private String tag3; + + @ApiModelProperty(value = "tag4") + @TableField("tag4") + private String tag4; + + @ApiModelProperty(value = "tag5") + @TableField("tag5") + private String tag5; + + @ApiModelProperty(value = "tag6") + @TableField("tag6") + private String tag6; + + @ApiModelProperty(value = "tag7") + @TableField("tag7") + private String tag7; + + @ApiModelProperty(value = "tag8") + @TableField("tag8") + private String tag8; + + @ApiModelProperty(value = "tag9") + @TableField("tag9") + private String tag9; + + @ApiModelProperty(value = "tag10") + @TableField("tag10") + private String tag10; } diff --git a/data/src/main/java/com/sdm/data/model/req/GetSimulationTaskFileReq.java b/data/src/main/java/com/sdm/data/model/req/GetSimulationTaskFileReq.java index 6df2b7be..75b0046b 100644 --- a/data/src/main/java/com/sdm/data/model/req/GetSimulationTaskFileReq.java +++ b/data/src/main/java/com/sdm/data/model/req/GetSimulationTaskFileReq.java @@ -9,8 +9,11 @@ import java.time.LocalDateTime; @Data public class GetSimulationTaskFileReq extends BaseReq { - @Schema(description = "任务ID(simulationtTask的id)") - Long taskId; + @Schema(description = "任务工况ID(simulationtTask的id)") + String taskId; + + @Schema(description = "算列ID") + String runId; @Schema(description = "文件类型", implementation = Constants.FileType.class) Integer fileType; @@ -25,4 +28,34 @@ public class GetSimulationTaskFileReq extends BaseReq { @Schema(description = "结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endTime; + + @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; } diff --git a/data/src/main/java/com/sdm/data/service/impl/DataAnalysisServiceImpl.java b/data/src/main/java/com/sdm/data/service/impl/DataAnalysisServiceImpl.java index 4c87f317..b8ec665e 100644 --- a/data/src/main/java/com/sdm/data/service/impl/DataAnalysisServiceImpl.java +++ b/data/src/main/java/com/sdm/data/service/impl/DataAnalysisServiceImpl.java @@ -37,18 +37,20 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService { @Override public SdmResponse getSimulationTaskFile(GetSimulationTaskFileReq getSimulationTaskFileReq) { - 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(); - } - PageHelper.startPage(getSimulationTaskFileReq.getCurrent(), getSimulationTaskFileReq.getSize()); List simulationTaskFileMetadataInfos = fileMetadataInfoService.lambdaQuery() - .likeRight(ObjectUtils.isNotNull(objectKey), FileMetadataInfo::getObjectKey, objectKey) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getRunId()), FileMetadataInfo::getRunId, getSimulationTaskFileReq.getRunId()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTaskId()), FileMetadataInfo::getTaskId, getSimulationTaskFileReq.getTaskId()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag1()), FileMetadataInfo::getTag1, getSimulationTaskFileReq.getTag1()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag2()), FileMetadataInfo::getTag2, getSimulationTaskFileReq.getTag2()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag3()), FileMetadataInfo::getTag3, getSimulationTaskFileReq.getTag3()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag4()), FileMetadataInfo::getTag4, getSimulationTaskFileReq.getTag4()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag5()), FileMetadataInfo::getTag5, getSimulationTaskFileReq.getTag5()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag6()), FileMetadataInfo::getTag6, getSimulationTaskFileReq.getTag6()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag7()), FileMetadataInfo::getTag7, getSimulationTaskFileReq.getTag7()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag8()), FileMetadataInfo::getTag8, getSimulationTaskFileReq.getTag8()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag9()), FileMetadataInfo::getTag9, getSimulationTaskFileReq.getTag9()) + .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getTag10()), FileMetadataInfo::getTag10, getSimulationTaskFileReq.getTag10()) .eq(ObjectUtils.isNotNull(getSimulationTaskFileReq.getFileType()), FileMetadataInfo::getFileType, getSimulationTaskFileReq.getFileType()) .like(ObjectUtils.isNotNull(getSimulationTaskFileReq.getFileName()), FileMetadataInfo::getOriginalName, getSimulationTaskFileReq.getFileName()) .ge(ObjectUtils.isNotNull(getSimulationTaskFileReq.getStartTime()), FileMetadataInfo::getCreateTime, getSimulationTaskFileReq.getStartTime()) diff --git a/project/src/main/java/com/sdm/project/controller/SimulationAnalysisController.java b/project/src/main/java/com/sdm/project/controller/SimulationAnalysisController.java index a3259323..99cd98a5 100644 --- a/project/src/main/java/com/sdm/project/controller/SimulationAnalysisController.java +++ b/project/src/main/java/com/sdm/project/controller/SimulationAnalysisController.java @@ -4,6 +4,8 @@ import com.sdm.common.common.SdmResponse; import com.sdm.project.model.req.SpdmAnalysisPerformanceListReq; import com.sdm.project.model.req.SpdmAnalysisRunListReq; import com.sdm.project.model.req.SpdmAnalysisTaskListReq; +import com.sdm.project.model.resp.GetAllRunResultByTaskIdResp; +import com.sdm.project.model.resp.RunResultResp; import com.sdm.project.service.ITaskService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; @RestController @RequestMapping("/analysis") @@ -59,10 +62,10 @@ public class SimulationAnalysisController { /** - * 数据分析(数据查询)-根据任务id获取所有算列结果和5种文件 + * 数据分析(数据查询)-根据任务id获取所有算列结果 */ - @GetMapping("/getAllRunResult") - public SdmResponse getAllRunResultByTaskId(String taskId) { + @GetMapping("/getAllRunResultByTaskId") + public SdmResponse getAllRunResultByTaskId(String taskId) { return taskService.getAllRunResultByTaskId(taskId); } diff --git a/project/src/main/java/com/sdm/project/model/resp/GetAllRunResultByTaskIdResp.java b/project/src/main/java/com/sdm/project/model/resp/GetAllRunResultByTaskIdResp.java new file mode 100644 index 00000000..e4e97e62 --- /dev/null +++ b/project/src/main/java/com/sdm/project/model/resp/GetAllRunResultByTaskIdResp.java @@ -0,0 +1,16 @@ +package com.sdm.project.model.resp; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class GetAllRunResultByTaskIdResp { + @Schema(description = "任务指标列表") + List tasKPerformanceRespList = new ArrayList<>(); + + @Schema(description = "工况算列运行结果") + List runResultResp; +} diff --git a/project/src/main/java/com/sdm/project/model/resp/RunResultResp.java b/project/src/main/java/com/sdm/project/model/resp/RunResultResp.java new file mode 100644 index 00000000..7de1265d --- /dev/null +++ b/project/src/main/java/com/sdm/project/model/resp/RunResultResp.java @@ -0,0 +1,15 @@ +package com.sdm.project.model.resp; + +import com.sdm.project.model.entity.SimulationPerformance; +import com.sdm.project.model.entity.SimulationRun; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class RunResultResp { + SimulationRun simulationRun; + List simulationPerformance = new ArrayList<>(); +} + diff --git a/project/src/main/java/com/sdm/project/model/resp/TasKPerformanceResp.java b/project/src/main/java/com/sdm/project/model/resp/TasKPerformanceResp.java new file mode 100644 index 00000000..953b8c8c --- /dev/null +++ b/project/src/main/java/com/sdm/project/model/resp/TasKPerformanceResp.java @@ -0,0 +1,19 @@ +package com.sdm.project.model.resp; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class TasKPerformanceResp { + @Schema(description = "指标名称") + String performanceName; + + @Schema(description = "单位") + String unit; + + @Schema(description = "达成方式") + String method; + + @Schema(description = "目标值") + String targetValue; +} diff --git a/project/src/main/java/com/sdm/project/service/ITaskService.java b/project/src/main/java/com/sdm/project/service/ITaskService.java index 3d121e62..b826cf3b 100644 --- a/project/src/main/java/com/sdm/project/service/ITaskService.java +++ b/project/src/main/java/com/sdm/project/service/ITaskService.java @@ -6,6 +6,8 @@ import com.sdm.project.model.req.SpdmAnalysisPerformanceListReq; import com.sdm.project.model.req.SpdmAnalysisRunListReq; import com.sdm.project.model.req.SpdmAnalysisTaskListReq; import com.sdm.project.model.req.SpdmTaskListReq; +import com.sdm.project.model.resp.GetAllRunResultByTaskIdResp; +import com.sdm.project.model.resp.RunResultResp; import org.springframework.stereotype.Service; import java.util.List; @@ -28,5 +30,5 @@ public interface ITaskService { SdmResponse edit(ModifyTaskNode req); - SdmResponse getAllRunResultByTaskId(String taskId); + SdmResponse getAllRunResultByTaskId(String taskId); } diff --git a/project/src/main/java/com/sdm/project/service/impl/TaskServiceImpl.java b/project/src/main/java/com/sdm/project/service/impl/TaskServiceImpl.java index 0dbcefc1..8d4ceec5 100644 --- a/project/src/main/java/com/sdm/project/service/impl/TaskServiceImpl.java +++ b/project/src/main/java/com/sdm/project/service/impl/TaskServiceImpl.java @@ -13,13 +13,18 @@ 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.SimulationPerformance; 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.resp.GetAllRunResultByTaskIdResp; +import com.sdm.project.model.resp.RunResultResp; +import com.sdm.project.model.resp.TasKPerformanceResp; import com.sdm.project.model.vo.*; +import com.sdm.project.service.ISimulationPerformanceService; import com.sdm.project.service.ISimulationRunService; import com.sdm.project.service.ITaskService; import lombok.extern.slf4j.Slf4j; @@ -58,6 +63,9 @@ public class TaskServiceImpl implements ITaskService { @Autowired private ISimulationRunService simulationRunService; + @Autowired + private ISimulationPerformanceService simulationPerformanceService; + @Override public SdmResponse list(SpdmTaskListReq req) { @@ -703,9 +711,53 @@ public class TaskServiceImpl implements ITaskService { } @Override - public SdmResponse getAllRunResultByTaskId(String taskId) { - List list = simulationRunService.lambdaQuery().eq(SimulationRun::getTaskId, taskId).list(); + public SdmResponse getAllRunResultByTaskId(String taskId) { + GetAllRunResultByTaskIdResp result= new GetAllRunResultByTaskIdResp(); + // taskId不为null,runid为null,查询所有工况设定的标准指标 + List simulationTaskPerformances = simulationPerformanceService + .lambdaQuery() + .eq(SimulationPerformance::getTaskId, taskId) + .isNull(SimulationPerformance::getRunId) + .list(); + if(CollectionUtils.isEmpty(simulationTaskPerformances)) { + return SdmResponse.success(); + } - return null; + simulationTaskPerformances.forEach(simulationPerformance -> { + TasKPerformanceResp taskPerformanceResp = new TasKPerformanceResp(); + BeanUtils.copyProperties(simulationPerformance, taskPerformanceResp); + result.getTasKPerformanceRespList().add(taskPerformanceResp); + }); + + + + // // taskId不为null,runid不为null,获取算列计算结果 + List simulationRunList = simulationRunService.lambdaQuery().eq(SimulationRun::getTaskId, taskId).list(); + + Map> simulationRunPerformanceMap = simulationPerformanceService + .lambdaQuery() + .eq(SimulationPerformance::getTaskId, taskId) + .isNotNull(SimulationPerformance::getRunId) + .list() + .stream() + .collect(Collectors.groupingBy(SimulationPerformance::getRunId)); + + List runResultRespList = new ArrayList<>(); + + if(CollectionUtils.isNotEmpty(simulationRunList)) { + for (SimulationRun simulationRun : simulationRunList) { + RunResultResp runResultResp = new RunResultResp(); + runResultResp.setSimulationRun(simulationRun); + List simulationPerformance = simulationRunPerformanceMap.get(simulationRun.getUuid()); + if (CollectionUtils.isNotEmpty(simulationPerformance)) { + runResultResp.setSimulationPerformance(simulationPerformance); + } + runResultRespList.add(runResultResp); + } + } + + result.setRunResultResp(runResultRespList); + + return SdmResponse.success(result); } } diff --git a/system/src/main/java/com/sdm/system/model/req/user/GroupMemberQueryReq.java b/system/src/main/java/com/sdm/system/model/req/user/GroupMemberQueryReq.java index 3a5b2c41..570a6066 100644 --- a/system/src/main/java/com/sdm/system/model/req/user/GroupMemberQueryReq.java +++ b/system/src/main/java/com/sdm/system/model/req/user/GroupMemberQueryReq.java @@ -1,6 +1,7 @@ package com.sdm.system.model.req.user; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import io.swagger.v3.oas.annotations.media.Schema; @@ -8,7 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema; @Data public class GroupMemberQueryReq { - @NotBlank(message = "groupID不能为空") + @NotNull(message = "groupID不能为空") @Schema(description = "groupID", requiredMode = Schema.RequiredMode.REQUIRED) private Long groupId; diff --git a/system/src/main/java/com/sdm/system/model/req/user/GroupQueryReq.java b/system/src/main/java/com/sdm/system/model/req/user/GroupQueryReq.java index bd178946..c8444079 100644 --- a/system/src/main/java/com/sdm/system/model/req/user/GroupQueryReq.java +++ b/system/src/main/java/com/sdm/system/model/req/user/GroupQueryReq.java @@ -2,6 +2,7 @@ package com.sdm.system.model.req.user; import com.sdm.system.model.req.BaseReq; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.Data; @Schema(description = "用户组查询请求参数") @@ -9,4 +10,8 @@ import lombok.Data; public class GroupQueryReq extends BaseReq { @Schema(description = "用户组名称") private String groupName; + + @Schema(description = "租户ID") + @NotNull(message = "租户ID不能为空") + private Long tenantId; } \ No newline at end of file diff --git a/system/src/main/java/com/sdm/system/model/req/user/QueryGroupDetailReq.java b/system/src/main/java/com/sdm/system/model/req/user/QueryGroupDetailReq.java index d0a93561..359be139 100644 --- a/system/src/main/java/com/sdm/system/model/req/user/QueryGroupDetailReq.java +++ b/system/src/main/java/com/sdm/system/model/req/user/QueryGroupDetailReq.java @@ -12,4 +12,7 @@ public class QueryGroupDetailReq extends BaseReq { @Schema(description = "用户组id") @NotNull(message = "用户组id不能为空") Long id; + + @Parameter(description = "租户id") + Long tenantId; } diff --git a/system/src/main/java/com/sdm/system/service/impl/CID/CIDISysUserServiceImpl.java b/system/src/main/java/com/sdm/system/service/impl/CID/CIDISysUserServiceImpl.java index c14994ff..aae29162 100644 --- a/system/src/main/java/com/sdm/system/service/impl/CID/CIDISysUserServiceImpl.java +++ b/system/src/main/java/com/sdm/system/service/impl/CID/CIDISysUserServiceImpl.java @@ -207,7 +207,7 @@ public class CIDISysUserServiceImpl extends ServiceImpl @Override public SdmResponse queryGroupMember(GroupMemberQueryReq req) { try { - String userJson = HttpUtil.post(cidUrl + queryGroupDetail, JSONUtil.toJsonStr(req)); + String userJson = HttpUtil.post(cidUrl + queryGroupMember, JSONUtil.toJsonStr(req)); SdmResponse cIDUserResp = JSON.parseObject(userJson, SdmResponse.class); if (cIDUserResp != null) { return cIDUserResp; diff --git a/system/src/main/resources/application-dev.yml b/system/src/main/resources/application-dev.yml index f57ff5f9..0faa27bd 100644 --- a/system/src/main/resources/application-dev.yml +++ b/system/src/main/resources/application-dev.yml @@ -125,7 +125,8 @@ tenantSystem: localTenant: local cid: - url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + ## url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + url: http://192.168.65.75:8989/honeycom-spdm # 朱欣茹地址 user: listUser: /spdm-user/listUser queryUserDetail: /spdm-user/queryUserDetail diff --git a/system/src/main/resources/application-local.yml b/system/src/main/resources/application-local.yml index f553474e..bfaf21f6 100644 --- a/system/src/main/resources/application-local.yml +++ b/system/src/main/resources/application-local.yml @@ -116,7 +116,8 @@ tenantSystem: localTenant: local cid: - url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + ## url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + url: http://192.168.65.75:8989/honeycom-spdm # 朱欣茹地址 user: listUser: /spdm-user/listUser queryUserDetail: /spdm-user/queryUserDetail diff --git a/system/src/main/resources/application-prod.yml b/system/src/main/resources/application-prod.yml index 36a90554..7636bf4f 100644 --- a/system/src/main/resources/application-prod.yml +++ b/system/src/main/resources/application-prod.yml @@ -144,7 +144,8 @@ tenantSystem: localTenant: local cid: - url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + ## url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + url: http://192.168.65.75:8989/honeycom-spdm # 朱欣茹地址 user: listUser: /spdm-user/listUser queryUserDetail: /spdm-user/queryUserDetail diff --git a/system/src/main/resources/application-test.yml b/system/src/main/resources/application-test.yml index 9524593f..7d919535 100644 --- a/system/src/main/resources/application-test.yml +++ b/system/src/main/resources/application-test.yml @@ -143,7 +143,8 @@ tenantSystem: localTenant: local cid: - url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + ## url: http://192.168.65.162:8989/honeycom-spdm # 请根据实际CID服务地址修改 + url: http://192.168.65.75:8989/honeycom-spdm # 朱欣茹地址 user: listUser: /spdm-user/listUser queryUserDetail: /spdm-user/queryUserDetail