9bccf323 sonin

巡检分析 任务指标 详情

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