fix[project]: 修改任务统计接口
This commit is contained in:
@@ -55,7 +55,7 @@ public interface SimulationTaskMapper extends BaseMapper<SimulationTask> {
|
||||
|
||||
List<TaskNodeExtraPo> getTaskExtraList(@Param("taskIdList") List<String> taskIdList);
|
||||
|
||||
List<SpdmTaskVo> getTaskListByTag(@Param("req") TaskCompleteStatisticsReq req);
|
||||
List<SpdmTaskVo> getTaskListByTag(@Param("req") TaskCompleteStatisticsReq req,@Param("userId") Long userId,@Param("tenantId") Long tenantId);
|
||||
|
||||
List<SpdmTaskVo> getTaskListByName(@Param("taskNameList") List<String> taskNameList);
|
||||
|
||||
|
||||
@@ -3445,7 +3445,9 @@ public class TaskServiceImpl implements ITaskService {
|
||||
public SdmResponse getTaskCompleteStatistics(TaskCompleteStatisticsReq req) {
|
||||
// 所有任务执行状态
|
||||
Set<String> allExeStatus = new HashSet<>();
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(req);
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(req,userId,tenantId);
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
log.error("根据参数:{},未查询到任务", req);
|
||||
JSONObject resultResponse = new JSONObject();
|
||||
@@ -3572,7 +3574,9 @@ public class TaskServiceImpl implements ITaskService {
|
||||
Set<String> allExeStatus = new HashSet<>();
|
||||
TaskCompleteStatisticsReq taskCompleteStatisticsReq = new TaskCompleteStatisticsReq();
|
||||
BeanUtils.copyProperties(req, taskCompleteStatisticsReq);
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(taskCompleteStatisticsReq);
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(taskCompleteStatisticsReq,userId,tenantId);
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
log.error("根据参数:{},未查询到任务", req);
|
||||
JSONObject resultResponse = new JSONObject();
|
||||
@@ -3988,7 +3992,9 @@ public class TaskServiceImpl implements ITaskService {
|
||||
public SdmResponse getTaskAchieveStatistics(TaskCompleteStatisticsReq req) {
|
||||
// 所有任务达成状态
|
||||
Set<String> allAchieveStatus = new HashSet<>();
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(req);
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(req,userId,tenantId);
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
log.error("根据参数:{},未查询到任务", req);
|
||||
JSONObject resultResponse = new JSONObject();
|
||||
@@ -4305,7 +4311,9 @@ public class TaskServiceImpl implements ITaskService {
|
||||
public SdmResponse<List<ProjectDifficultStatisticsResp>> getProjectDifficultStatistics(ProjectDifficultCompleteStatisticsReq req) {
|
||||
TaskCompleteStatisticsReq taskCompleteStatisticsReq = new TaskCompleteStatisticsReq();
|
||||
taskCompleteStatisticsReq.setTag1(req.getTag1());
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(taskCompleteStatisticsReq);
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
List<SpdmTaskVo> taskList = mapper.getTaskListByTag(taskCompleteStatisticsReq,userId,tenantId);
|
||||
List<ProjectDifficultStatisticsResp> projectDifficultStatisticsRespList = new ArrayList<>();
|
||||
for (int i = 1; i < 6; i++) {
|
||||
ProjectDifficultStatisticsResp projectDifficultStatisticsResp = new ProjectDifficultStatisticsResp();
|
||||
|
||||
@@ -688,9 +688,66 @@
|
||||
</select>
|
||||
|
||||
<select id="getTaskListByTag" resultType="com.sdm.common.entity.resp.project.SpdmTaskVo">
|
||||
select * from simulation_task task
|
||||
SELECT task.*
|
||||
FROM simulation_task task
|
||||
LEFT JOIN simulation_task_member stm ON task.uuid = stm.task_id
|
||||
<where>
|
||||
task.exe_status is not null
|
||||
stm.user_id = #{userId}
|
||||
AND task.tenant_id = #{tenantId}
|
||||
AND task.exe_status is not null
|
||||
<if test="req.tag1 != null and req.tag1 !='' ">
|
||||
<bind name="searchKey1" value="'%' + req.tag1 + '%'"/>
|
||||
and task.tag1 like #{searchKey1}
|
||||
</if>
|
||||
<if test="req.tag2 != null and req.tag2 !='' ">
|
||||
<bind name="searchKey2" value="'%' + req.tag2 + '%'"/>
|
||||
and task.tag2 like #{searchKey2}
|
||||
</if>
|
||||
<if test="req.tag3 != null and req.tag3 !='' ">
|
||||
<bind name="searchKey3" value="'%' + req.tag3 + '%'"/>
|
||||
and task.tag3 like #{searchKey3}
|
||||
</if>
|
||||
<if test="req.tag4 != null and req.tag4 !='' ">
|
||||
<bind name="searchKey4" value="'%' + req.tag4 + '%'"/>
|
||||
and task.tag4 like #{searchKey4}
|
||||
</if>
|
||||
<if test="req.tag5 != null and req.tag5 !='' ">
|
||||
<bind name="searchKey5" value="'%' + req.tag5 + '%'"/>
|
||||
and task.tag5 like #{searchKey5}
|
||||
</if>
|
||||
<if test="req.tag6 != null and req.tag6 !='' ">
|
||||
<bind name="searchKey6" value="'%' + req.tag6 + '%'"/>
|
||||
and task.discipline like #{searchKey6}
|
||||
</if>
|
||||
<if test="req.tag7 != null and req.tag7 !='' ">
|
||||
<bind name="searchKey7" value="'%' + req.tag7 + '%'"/>
|
||||
and task.tag7 like #{searchKey7}
|
||||
</if>
|
||||
<if test="req.tag8 != null and req.tag8 !='' ">
|
||||
<bind name="searchKey8" value="'%' + req.tag8 + '%'"/>
|
||||
and task.tag8 like #{searchKey8}
|
||||
</if>
|
||||
<if test="req.tag9 != null and req.tag9 !='' ">
|
||||
<bind name="searchKey9" value="'%' + req.tag9 + '%'"/>
|
||||
and task.tag9 like #{searchKey9}
|
||||
</if>
|
||||
<if test="req.tag10 != null and req.tag10 !='' ">
|
||||
<bind name="searchKey10" value="'%' + req.tag10 + '%'"/>
|
||||
and task.tag10 like #{searchKey10}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
UNION
|
||||
|
||||
|
||||
|
||||
SELECT task.*
|
||||
FROM simulation_task task
|
||||
LEFT JOIN simulation_node_member snm ON task.uuid = snm.nodeId
|
||||
<where>
|
||||
snm.user_id = #{userId}
|
||||
AND task.tenant_id = #{tenantId}
|
||||
AND task.exe_status is not null
|
||||
<if test="req.tag1 != null and req.tag1 !='' ">
|
||||
<bind name="searchKey1" value="'%' + req.tag1 + '%'"/>
|
||||
and task.tag1 like #{searchKey1}
|
||||
@@ -787,7 +844,8 @@
|
||||
and expStatus = #{req.expStatusValue}
|
||||
</if>
|
||||
<if test="req.tag10 != null and req.tag10 != ''">
|
||||
and tag10 = #{req.tag10}
|
||||
<bind name="searchKey3" value="'%' + req.tag10 + '%'"/>
|
||||
and tag10 like #{searchKey3}
|
||||
</if>
|
||||
<if test="req.diffcult != null and req.diffcult != ''">
|
||||
and diffcult = #{req.diffcult}
|
||||
@@ -927,7 +985,8 @@
|
||||
and expStatus = #{req.expStatusValue}
|
||||
</if>
|
||||
<if test="req.tag10 != null and req.tag10 != ''">
|
||||
and tag10 = #{req.tag10}
|
||||
<bind name="searchKey4" value="'%' + req.tag10 + '%'"/>
|
||||
and tag10 like #{searchKey4}
|
||||
</if>
|
||||
<if test="req.diffcult != null and req.diffcult != ''">
|
||||
and diffcult = #{req.diffcult}
|
||||
|
||||
Reference in New Issue
Block a user