Commit dd4a8063 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

任务状态分布&委托单位任务分布

See merge request !411
parents 76af877d 318f4828
...@@ -8,10 +8,7 @@ import com.ruoyi.domain.vo.InspectionPersonnelVO; ...@@ -8,10 +8,7 @@ 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.*; import com.ruoyi.web.request.*;
import com.ruoyi.web.response.TaskFindResponse; import com.ruoyi.web.response.*;
import com.ruoyi.web.response.TaskScenarioResponse;
import com.ruoyi.web.response.TaskStateDistributionResponse;
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;
...@@ -81,5 +78,15 @@ public interface TaskMapper extends BaseMapper<Task> { ...@@ -81,5 +78,15 @@ public interface TaskMapper extends BaseMapper<Task> {
*/ */
InspectionPersonnelVO selectInspectionPersonnelById(Long taskId); InspectionPersonnelVO selectInspectionPersonnelById(Long taskId);
List<TaskStateDistributionResponse> taskStateDistribution(@Param("request") TaskStateDistributionRequest request); /**
* 根据状态查看任务数据统计
* @return
*/
List<TaskStateDistributionResponse> taskStateDistribution();
/**
* 委托单位任务分布
* @return
*/
List<EntrustedUnitResponse> entrustedUnitDistribution();
} }
...@@ -3,10 +3,7 @@ package com.ruoyi.service; ...@@ -3,10 +3,7 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.Task; import com.ruoyi.domain.Task;
import com.ruoyi.web.request.*; import com.ruoyi.web.request.*;
import com.ruoyi.web.response.DataStatisticsResponse; import com.ruoyi.web.response.*;
import com.ruoyi.web.response.TaskFindResponse;
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;
...@@ -74,8 +71,13 @@ public interface TaskService extends IService<Task> { ...@@ -74,8 +71,13 @@ public interface TaskService extends IService<Task> {
/** /**
* 根据状态查看任务数据统计 * 根据状态查看任务数据统计
* @param request
* @return * @return
*/ */
List<TaskStateDistributionResponse> taskStateDistribution(TaskStateDistributionRequest request); List<TaskStateDistributionResponse> taskStateDistribution();
/**
* 委托单位任务分布
* @return
*/
List<EntrustedUnitResponse> entrustedUnitDistribution();
} }
...@@ -868,12 +868,20 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -868,12 +868,20 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
/** /**
* 根据状态查看任务数据统计 * 根据状态查看任务数据统计
* @param request
* @return * @return
*/ */
@Override @Override
public List<TaskStateDistributionResponse> taskStateDistribution(TaskStateDistributionRequest request) { public List<TaskStateDistributionResponse> taskStateDistribution() {
return taskMapper.taskStateDistribution(request); return taskMapper.taskStateDistribution();
}
/**
* 委托单位任务分布
* @return
*/
@Override
public List<EntrustedUnitResponse> entrustedUnitDistribution() {
return taskMapper.entrustedUnitDistribution();
} }
/** /**
......
package com.ruoyi.web; package com.ruoyi.web;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
...@@ -13,10 +14,7 @@ import com.ruoyi.service.TaskSampleRelationService; ...@@ -13,10 +14,7 @@ import com.ruoyi.service.TaskSampleRelationService;
import com.ruoyi.service.TaskService; import com.ruoyi.service.TaskService;
import com.ruoyi.service.TaskUserRelationService; import com.ruoyi.service.TaskUserRelationService;
import com.ruoyi.web.request.*; import com.ruoyi.web.request.*;
import com.ruoyi.web.response.DataStatisticsResponse; import com.ruoyi.web.response.*;
import com.ruoyi.web.response.TaskFindResponse;
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;
...@@ -211,13 +209,24 @@ public class TaskController extends BaseController { ...@@ -211,13 +209,24 @@ public class TaskController extends BaseController {
return R.ok(taskService.getPicture(request)); return R.ok(taskService.getPicture(request));
} }
@Anonymous
@ApiOperation("根据状态查看任务数据统计") @ApiOperation("根据状态查看任务数据统计")
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/taskStateDistribution") @RequestMapping(method = RequestMethod.POST, value = "/taskStateDistribution")
public TableDataInfo<TaskStateDistributionResponse> taskStateDistribution(@Validated @RequestBody TaskStateDistributionRequest request) { public TableDataInfo<TaskStateDistributionResponse> taskStateDistribution() {
return getDataTable(taskService.taskStateDistribution(request)); return getDataTable(taskService.taskStateDistribution());
}
@Anonymous
@ApiOperation("委托单位任务分布")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/entrustedUnitDistribution")
public TableDataInfo<EntrustedUnitResponse> entrustedUnitDistribution() {
return getDataTable(taskService.entrustedUnitDistribution());
} }
} }
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "EntrustedUnitResponse", description = "委托单位任务分布")
@Data
public class EntrustedUnitResponse {
@ApiModelProperty("委托单位")
private String entrustedUnit;
@ApiModelProperty("数量")
private String number;
}
...@@ -425,14 +425,19 @@ ...@@ -425,14 +425,19 @@
</select> </select>
<select id="taskStateDistribution" resultType="com.ruoyi.web.response.TaskStateDistributionResponse"> <select id="taskStateDistribution" resultType="com.ruoyi.web.response.TaskStateDistributionResponse">
select task_status, count(*) number from t_task select task_status, count(*) number from t_task
<where> where task_status not in ("TEMPORARILY")
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 group by task_status
</select> </select>
<select id="entrustedUnitDistribution" resultType="com.ruoyi.web.response.EntrustedUnitResponse">
select
entrusted_unit,
count(*) number
from
t_task
where
task_status not in ("TEMPORARILY")
group by entrusted_unit
</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