训练模型
This commit is contained in:
@@ -184,4 +184,13 @@ public class SimulationNodeController implements ISimuluationNodeFeignClient {
|
||||
return nodeService.getCommonCompleteStatistics(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工位评审通过统计查询
|
||||
*/
|
||||
@PostMapping("/getWorkstationReviewStatistics")
|
||||
@Operation(summary = "工位评审通过统计查询", description = "工位评审通过统计查询")
|
||||
public SdmResponse getWorkstationReviewStatistics(@RequestBody GetWorkstationApproveStatusReq req) {
|
||||
return nodeService.getWorkstationReviewStatistics(req);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -83,4 +83,6 @@ public interface SimulationNodeMapper extends BaseMapper<SimulationNode> {
|
||||
|
||||
List<CommonGetCompleteFromPerformanceVo> getCommonCompleteStatisticsFromPerformance(@Param("req")CommonGetCompleteStatisticsReq req);
|
||||
|
||||
List<WorkstationApproveStatusVo> getWorkstationApproveStatus(@Param("req") GetWorkstationApproveStatusReq req);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GetWorkstationApproveStatusReq {
|
||||
@Schema(description = "数据返回Tag类型: tag1、tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10")
|
||||
@NotNull
|
||||
private String resultTagType;
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class CommonCompleteStatisticsVo {
|
||||
public class CommonStatisticsVo {
|
||||
private String name;
|
||||
private Map<String, Integer> statusCount = new HashMap<>();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.sdm.project.model.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WorkstationApproveStatusVo {
|
||||
private String tag;
|
||||
private String nodeName;
|
||||
private String approvalStatus;
|
||||
}
|
||||
@@ -39,4 +39,7 @@ public interface INodeService extends IService<SimulationNode> {
|
||||
|
||||
SdmResponse getCommonCompleteStatistics(CommonGetCompleteStatisticsReq req);
|
||||
|
||||
// 工位评审通过统计查询
|
||||
SdmResponse getWorkstationReviewStatistics(GetWorkstationApproveStatusReq req);
|
||||
|
||||
}
|
||||
|
||||
@@ -810,13 +810,13 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
List<CommonGetCompleteFromTaskVo> commonCompleteStatisticsFromTask = this.baseMapper.getCommonCompleteStatisticsFromTask(req);
|
||||
|
||||
// 按tag分组统计任务状态
|
||||
Map<String, CommonCompleteStatisticsVo> taskStatisticsMap = new HashMap<>();
|
||||
Map<String, CommonStatisticsVo> taskStatisticsMap = new HashMap<>();
|
||||
|
||||
// 统计每个tag的各种状态任务数量
|
||||
for (CommonGetCompleteFromTaskVo item : commonCompleteStatisticsFromTask) {
|
||||
String name = item.getNodeName();
|
||||
|
||||
CommonCompleteStatisticsVo stat = taskStatisticsMap.getOrDefault(name, new CommonCompleteStatisticsVo());
|
||||
CommonStatisticsVo stat = taskStatisticsMap.getOrDefault(name, new CommonStatisticsVo());
|
||||
stat.setName(name);
|
||||
|
||||
Map<String, Integer> statusCount = stat.getStatusCount();
|
||||
@@ -832,7 +832,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
|
||||
// 转换为列表返回
|
||||
List<CommonCompleteStatisticsVo> taskResult = new ArrayList<>(taskStatisticsMap.values());
|
||||
List<CommonStatisticsVo> taskResult = new ArrayList<>(taskStatisticsMap.values());
|
||||
JSONObject resultResponse = new JSONObject();
|
||||
resultResponse.put("allExeStatus", allExeStatus);
|
||||
resultResponse.put("result", taskResult);
|
||||
@@ -842,13 +842,13 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
List<CommonGetCompleteFromPerformanceVo> commonCompleteStatisticsFromPerformance = this.baseMapper.getCommonCompleteStatisticsFromPerformance(req);
|
||||
|
||||
// 按tag分组统计指标状态
|
||||
Map<String, CommonCompleteStatisticsVo> performanceStatisticsMap = new HashMap<>();
|
||||
Map<String, CommonStatisticsVo> performanceStatisticsMap = new HashMap<>();
|
||||
|
||||
// 统计每个tag的各种状态指标数量
|
||||
for (CommonGetCompleteFromPerformanceVo item : commonCompleteStatisticsFromPerformance) {
|
||||
String nodeName = item.getNodeName();
|
||||
|
||||
CommonCompleteStatisticsVo stat = performanceStatisticsMap.getOrDefault(nodeName, new CommonCompleteStatisticsVo());
|
||||
CommonStatisticsVo stat = performanceStatisticsMap.getOrDefault(nodeName, new CommonStatisticsVo());
|
||||
stat.setName(nodeName);
|
||||
|
||||
Map<String, Integer> statusCount = stat.getStatusCount();
|
||||
@@ -865,7 +865,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
|
||||
// 转换为列表返回
|
||||
List<CommonCompleteStatisticsVo> performanceResult = new ArrayList<>(performanceStatisticsMap.values());
|
||||
List<CommonStatisticsVo> performanceResult = new ArrayList<>(performanceStatisticsMap.values());
|
||||
JSONObject resultResponse = new JSONObject();
|
||||
resultResponse.put("allExeStatus", allExeStatus);
|
||||
resultResponse.put("result", performanceResult);
|
||||
@@ -873,4 +873,41 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse getWorkstationReviewStatistics(GetWorkstationApproveStatusReq req) {
|
||||
List<WorkstationApproveStatusVo> workstationApproveStatus = this.baseMapper.getWorkstationApproveStatus(req);
|
||||
|
||||
// 按tag分组统计审批状态
|
||||
Map<String, CommonStatisticsVo> reviewStatisticsMap = new HashMap<>();
|
||||
|
||||
// 所有审批状态
|
||||
Set<String> allApprovalStatus = new HashSet<>();
|
||||
|
||||
// 统计每个tag的各种审批状态数量
|
||||
for (WorkstationApproveStatusVo item : workstationApproveStatus) {
|
||||
String nodeName = item.getNodeName();
|
||||
|
||||
CommonStatisticsVo stat = reviewStatisticsMap.getOrDefault(nodeName, new CommonStatisticsVo());
|
||||
stat.setName(nodeName);
|
||||
|
||||
Map<String, Integer> statusCount = stat.getStatusCount();
|
||||
if (statusCount == null) {
|
||||
statusCount = new HashMap<>();
|
||||
stat.setStatusCount(statusCount);
|
||||
}
|
||||
|
||||
String approvalStatus = item.getApprovalStatus();
|
||||
allApprovalStatus.add(approvalStatus);
|
||||
statusCount.put(approvalStatus, statusCount.getOrDefault(approvalStatus, 0) + 1);
|
||||
reviewStatisticsMap.put(nodeName, stat);
|
||||
}
|
||||
|
||||
// 转换为列表返回
|
||||
List<CommonStatisticsVo> result = new ArrayList<>(reviewStatisticsMap.values());
|
||||
JSONObject resultResponse = new JSONObject();
|
||||
resultResponse.put("allApprovalStatus", allApprovalStatus);
|
||||
resultResponse.put("result", result);
|
||||
return SdmResponse.success(resultResponse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,4 +538,48 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getWorkstationApproveStatus"
|
||||
parameterType="com.sdm.project.model.req.GetWorkstationApproveStatusReq"
|
||||
resultType="com.sdm.project.model.vo.WorkstationApproveStatusVo">
|
||||
select
|
||||
task.${req.resultTagType} as tag,
|
||||
node.nodeName,
|
||||
task.approval_status as approvalStatus
|
||||
from simulation_task task
|
||||
left join simulation_node node on task.${req.resultTagType} = node.uuid
|
||||
<where>
|
||||
1=1 and task.approval_status is not null
|
||||
<if test="req.tag1 != null and req.tag1 !='' ">
|
||||
and task.tag1 = #{req.tag1}
|
||||
</if>
|
||||
<if test="req.tag2 != null and req.tag2 !='' ">
|
||||
and task.tag2 = #{req.tag2}
|
||||
</if>
|
||||
<if test="req.tag3 != null and req.tag3 !='' ">
|
||||
and task.tag3 = #{req.tag3}
|
||||
</if>
|
||||
<if test="req.tag4 != null and req.tag4 !='' ">
|
||||
and task.tag4 = #{req.tag4}
|
||||
</if>
|
||||
<if test="req.tag5 != null and req.tag5 !='' ">
|
||||
and task.tag5 = #{req.tag5}
|
||||
</if>
|
||||
<if test="req.tag6 != null and req.tag6 !='' ">
|
||||
and task.tag6 = #{req.tag6}
|
||||
</if>
|
||||
<if test="req.tag7 != null and req.tag7 !='' ">
|
||||
and task.tag7 = #{req.tag7}
|
||||
</if>
|
||||
<if test="req.tag8 != null and req.tag8 !='' ">
|
||||
and task.tag8 = #{req.tag8}
|
||||
</if>
|
||||
<if test="req.tag9 != null and req.tag9 !='' ">
|
||||
and task.tag9 = #{req.tag9}
|
||||
</if>
|
||||
<if test="req.tag10 != null and req.tag10 !='' ">
|
||||
and task.tag10 = #{req.tag10}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user