9bccf323 sonin

巡检分析 任务指标 详情

1 个父辈 99fae81f
......@@ -158,19 +158,19 @@ public class InspectionAnalysisController {
@GetMapping("/getInspectionTaskIndicators")
public Result<InspectionTaskIndicatorsVO> getInspectionTaskIndicators(String startDate,String endDate){
Result<InspectionTaskIndicatorsVO> result = new Result<>();
InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = inspectionAnalysisService.getInspectionTaskIndicatorsNew(startDate,endDate);
InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = inspectionAnalysisService.getInspectionTaskIndicators(startDate,endDate);
result.setSuccess(true);
result.setResult(inspectionTaskIndicatorsVO);
return result;
}
@ApiOperation(value = "巡检分析-巡检任务指标-详情", notes = "巡检分析-巡检任务指标-详情")
@GetMapping("/getInspectionTaskIndicatorsDetail")
public Result<List<InspectionEquipIndicatorsDetailVO>> getInspectionTaskIndicatorsDetail(String departId,String startDate,String endDate){
Result<List<InspectionEquipIndicatorsDetailVO>> result = new Result<>();
public Result<List<InspectionTaskIndicatorsVO>> getInspectionTaskIndicatorsDetail(String departId,String startDate,String endDate){
Result<List<InspectionTaskIndicatorsVO>> result = new Result<>();
if(StringUtils.isEmpty(departId)){
departId = BaseContextHandler.getDeparts();
}
List<InspectionEquipIndicatorsDetailVO> dataList = inspectionAnalysisService.getInspectionTaskIndicatorsDetail( JSUtils.quoteEach(departId,",") ,startDate,endDate);
List<InspectionTaskIndicatorsVO> dataList = inspectionAnalysisService.getInspectionTaskIndicatorsDetail( JSUtils.quoteEach(departId,",") ,startDate,endDate);
result.setSuccess(true);
result.setResult(dataList);
return result;
......
......@@ -28,7 +28,7 @@ public interface IInspectionAnalysisService {
* @param endDate
* @return
*/
List<InspectionEquipIndicatorsDetailVO> getInspectionTaskIndicatorsDetail(String departIds, String startDate, String endDate);
List<InspectionTaskIndicatorsVO> getInspectionTaskIndicatorsDetail(String departIds, String startDate, String endDate);
/***
* 巡检分析-巡检设备指标
* @param startDate
......
......@@ -26,4 +26,6 @@ public class InspectionTaskIndicatorsVO {
private String abnormalRate;
@ApiModelProperty(value = "异常项处理率")
private String processedAbnormalRate;
private String departName;
}
......
......@@ -45,4 +45,32 @@ public class TaskPoolConfig {
executor.initialize();
return executor;
}
@Bean(name="taskExecutor2")
public ThreadPoolTaskExecutor taskExecutor2() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//配置核心线程数:就是线程池中的核心线程数量,这几个核心线程,只是在没有用的时候,也不会被回收
executor.setCorePoolSize(50);
//配置最大线程数:就是线程池中可以容纳的最大线程的数量
executor.setMaxPoolSize(200);
//配置队列大小
executor.setQueueCapacity(500);
//线程池维护线程所允许的空闲时间:就是线程池中除了核心线程之外的其他的最长可以保留的时间,因为在线程池中,除了核心线程即使在无任务的情况下也不能被清除,其余的都是有存活时间的,意思就是非核心线程可以保留的最长的空闲时间
executor.setKeepAliveSeconds(60);
//配置线程池中的线程的名称前缀
executor.setThreadNamePrefix("task-executor2-");
// handler,是一种拒绝策略,我们可以在任务满了之后,拒绝执行某些任务。
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// AbortPolicy:用于被拒绝任务的处理程序,它将抛出RejectedExecutionException
// CallerRunsPolicy:用于被拒绝任务的处理程序,它直接在execute方法的调用线程中运行被拒绝的任务。
// DiscardOldestPolicy:用于被拒绝任务的处理程序,它放弃最旧的未处理请求,然后重试execute。
// DiscardPolicy:用于被拒绝任务的处理程序,默认情况下它将丢弃被拒绝的任务。
//执行初始化
executor.initialize();
return executor;
}
}
\ No newline at end of file
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!