Commit 76af877d authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

任务状态分布

See merge request !410
parents cdb52718 46df3df7
...@@ -7,12 +7,10 @@ import com.ruoyi.domain.vo.EnterpriseFilePdfVO; ...@@ -7,12 +7,10 @@ import com.ruoyi.domain.vo.EnterpriseFilePdfVO;
import com.ruoyi.domain.vo.InspectionPersonnelVO; import com.ruoyi.domain.vo.InspectionPersonnelVO;
import com.ruoyi.domain.vo.InspectionReportPdfVO; import com.ruoyi.domain.vo.InspectionReportPdfVO;
import com.ruoyi.domain.vo.TestConclusionVO; import com.ruoyi.domain.vo.TestConclusionVO;
import com.ruoyi.web.request.TaskFindFinishRequest; import com.ruoyi.web.request.*;
import com.ruoyi.web.request.TaskFindPendingRequest;
import com.ruoyi.web.request.TaskFindRequest;
import com.ruoyi.web.request.TaskListRequest;
import com.ruoyi.web.response.TaskFindResponse; import com.ruoyi.web.response.TaskFindResponse;
import com.ruoyi.web.response.TaskScenarioResponse; import com.ruoyi.web.response.TaskScenarioResponse;
import com.ruoyi.web.response.TaskStateDistributionResponse;
import com.ruoyi.web.response.UserNameResponse; import com.ruoyi.web.response.UserNameResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -82,4 +80,6 @@ public interface TaskMapper extends BaseMapper<Task> { ...@@ -82,4 +80,6 @@ public interface TaskMapper extends BaseMapper<Task> {
* @return * @return
*/ */
InspectionPersonnelVO selectInspectionPersonnelById(Long taskId); InspectionPersonnelVO selectInspectionPersonnelById(Long taskId);
List<TaskStateDistributionResponse> taskStateDistribution(@Param("request") TaskStateDistributionRequest request);
} }
...@@ -6,6 +6,7 @@ import com.ruoyi.web.request.*; ...@@ -6,6 +6,7 @@ import com.ruoyi.web.request.*;
import com.ruoyi.web.response.DataStatisticsResponse; import com.ruoyi.web.response.DataStatisticsResponse;
import com.ruoyi.web.response.TaskFindResponse; import com.ruoyi.web.response.TaskFindResponse;
import com.ruoyi.web.response.TaskGetInfoResponse; import com.ruoyi.web.response.TaskGetInfoResponse;
import com.ruoyi.web.response.TaskStateDistributionResponse;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
...@@ -70,4 +71,11 @@ public interface TaskService extends IService<Task> { ...@@ -70,4 +71,11 @@ public interface TaskService extends IService<Task> {
String createProject(String request) throws IOException; String createProject(String request) throws IOException;
String getPicture(TaskPictureRequest request) throws IOException; String getPicture(TaskPictureRequest request) throws IOException;
/**
* 根据状态查看任务数据统计
* @param request
* @return
*/
List<TaskStateDistributionResponse> taskStateDistribution(TaskStateDistributionRequest request);
} }
...@@ -866,6 +866,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -866,6 +866,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
} }
} }
/**
* 根据状态查看任务数据统计
* @param request
* @return
*/
@Override
public List<TaskStateDistributionResponse> taskStateDistribution(TaskStateDistributionRequest request) {
return taskMapper.taskStateDistribution(request);
}
/** /**
* pdf转图片 * pdf转图片
* @param urlStr * @param urlStr
......
...@@ -16,6 +16,7 @@ import com.ruoyi.web.request.*; ...@@ -16,6 +16,7 @@ import com.ruoyi.web.request.*;
import com.ruoyi.web.response.DataStatisticsResponse; import com.ruoyi.web.response.DataStatisticsResponse;
import com.ruoyi.web.response.TaskFindResponse; import com.ruoyi.web.response.TaskFindResponse;
import com.ruoyi.web.response.TaskGetInfoResponse; import com.ruoyi.web.response.TaskGetInfoResponse;
import com.ruoyi.web.response.TaskStateDistributionResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
...@@ -210,4 +211,13 @@ public class TaskController extends BaseController { ...@@ -210,4 +211,13 @@ public class TaskController extends BaseController {
return R.ok(taskService.getPicture(request)); return R.ok(taskService.getPicture(request));
} }
@ApiOperation("根据状态查看任务数据统计")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/taskStateDistribution")
public TableDataInfo<TaskStateDistributionResponse> taskStateDistribution(@Validated @RequestBody TaskStateDistributionRequest request) {
return getDataTable(taskService.taskStateDistribution(request));
}
} }
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TaskStateDistributionRequest", description = "任务状态分布")
@Data
public class TaskStateDistributionRequest {
@ApiModelProperty("标准id")
private Long standardId;
}
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "TaskStateDistributionResponse", description = "任务状态分布")
@Data
public class TaskStateDistributionResponse {
@ApiModelProperty("任务状态NEW(新建的)、PENDING(运行中的)、FINISH(已结束的)")
private String taskStatus;
@ApiModelProperty("数量")
private String number;
}
...@@ -423,6 +423,16 @@ ...@@ -423,6 +423,16 @@
t.id = #{taskId} t.id = #{taskId}
group by t.id group by t.id
</select> </select>
<select id="taskStateDistribution" resultType="com.ruoyi.web.response.TaskStateDistributionResponse">
select task_status, count(*) number from t_task
<where>
and task_status not in ("TEMPORARILY")
<if test="request.standardId != null and request.standardId != ''">
and standard_id = #{request.standardId}
</if>
</where>
group by task_status
</select>
</mapper> </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