Commit 36ab7f02 authored by W_Y's avatar W_Y

查询处理中任务返回进度&查看子任务

parent 8ce0c93a
......@@ -18,4 +18,6 @@ public interface ReviewDetailsMapper extends BaseMapper<ReviewDetails> {
* @return
*/
List<ReviewDetails> findNoResult(@Param("taskId") Long taskId);
Long count (@Param("taskId")Long taskId, @Param("type")String type);
}
......@@ -140,7 +140,7 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
for(ReviewDetails details : reviewDetailsList) {
ReviewDetailsResult reviewDetailsResult = resultMap.get(details.getId());
if(reviewDetailsResult.getPassed() != 0) {
if(reviewDetailsResult != null && reviewDetailsResult.getPassed() != 0) {
standard.setPassed(reviewDetailsResult.getPassed());
}
details.setResult(reviewDetailsResult);
......
......@@ -147,7 +147,7 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
for(ReviewDetails details : reviewDetailsList) {
ReviewDetailsResult reviewDetailsResult = resultMap.get(details.getId());
if(reviewDetailsResult.getPassed() != 0) {
if(reviewDetailsResult != null && reviewDetailsResult.getPassed() != 0) {
standard.setPassed(reviewDetailsResult.getPassed());
}
details.setResult(reviewDetailsResult);
......
......@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.CarReviewTaskMapper;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.*;
......@@ -54,6 +55,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired
private CarReviewTaskMapper carReviewTaskMapper;
@Autowired
private ReviewDetailsMapper reviewDetailsMapper;
@Override
public List<Task> findList(TaskListRequest request) {
return taskMapper.findList(request);
......@@ -117,7 +121,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Override
public List<TaskFindPendingResponse> findPending(TaskFindPendingRequest request) {
return taskMapper.findPending(request);
List<TaskFindPendingResponse> responses = taskMapper.findPending(request);
for (TaskFindPendingResponse response : responses) {
if (response.getSystemReviewTaskId() != null) {
response.setSystemReview(reviewDetailsMapper.count(response.getSystemReviewTaskId(),"system"));
}
if (response.getCarReviewTaskId() != null) {
response.setCarReview(reviewDetailsMapper.count(response.getCarReviewTaskId(),"car"));
}
}
return responses;
}
@Override
......
......@@ -45,4 +45,13 @@ public class TaskFindPendingResponse {
@ApiModelProperty("测试任务状态")
private String carTestStatus;
@ApiModelProperty("体系审查任务进度")
private Long systemReview;
@ApiModelProperty("车型审查任务进度")
private Long carReview;
@ApiModelProperty("测试任务进度")
private Long carTest;
}
......@@ -17,4 +17,13 @@
<select id="findNoResult" resultType="com.ruoyi.domain.ReviewDetails">
SELECT * FROM t_review_details WHERE id NOT IN (SELECT review_details_id FROM t_review_details_result WHERE task_id = #{taskId})
</select>
<select id="count" resultType="long">
SELECT
IFNULL((SELECT COUNT(*) FROM t_review_details_result WHERE task_id = #{taskId}), 0) /
IFNULL((SELECT COUNT(*) FROM t_review_details trd
INNER JOIN t_review_keypoint trk ON trk.id = trd.review_keypoint_id
INNER JOIN t_review_standard trs ON trs.id = trk.review_standard_id
WHERE trs.type = #{type}), 1) AS resultOverSum
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment