|
|
@@ -344,45 +344,45 @@ public class AppCockpitServiceImpl implements AppCockpitService {
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 综合数据-预案演练
|
|
|
- *
|
|
|
- * @param date
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public AppSyntheticDrillVo syntheticDrill(Date date) {
|
|
|
- SysOrg org = getLoginOrg();
|
|
|
- DateRange range = DateUtils.getStartAndEnd(date, CycleCommonEnum.QUARTERLY);
|
|
|
- List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticDrill(org.getPath(), range.getStartTime(), range.getEndTime());
|
|
|
- AppSyntheticDrillVo vo = new AppSyntheticDrillVo();
|
|
|
- vo.setInfoByType(new LinkedHashMap<>());
|
|
|
- vo.setRateByType(new LinkedHashMap<>());
|
|
|
-
|
|
|
- Predicate3<List<String>, String, String> predicate3 = (List<String> types, String label, String no) -> {
|
|
|
- List<AppSyntheticTaskCategoryDto> used = taskCategoryDtos.stream().filter(d -> types.contains(d.getPlanType())).collect(Collectors.toList());
|
|
|
- int total = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getTotal).sum();
|
|
|
- int completed = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getCompleted).sum();
|
|
|
- Float rate = computeRate(total, completed);
|
|
|
-
|
|
|
- vo.getRateByType().put(label, rate);
|
|
|
- vo.getInfoByType().put(label, AppSyntheticTaskInfoVo.builder()
|
|
|
- .shouldCompleteCount(total)
|
|
|
- .completedCount(completed)
|
|
|
- .completedRate(rate)
|
|
|
- .build());
|
|
|
-
|
|
|
- return true;
|
|
|
- };
|
|
|
-
|
|
|
- predicate3.test(Arrays.asList("1"), "防抢", null);
|
|
|
- predicate3.test(Arrays.asList("2"), "防盗", null);
|
|
|
- predicate3.test(Arrays.asList("3"), "反诈", null);
|
|
|
- predicate3.test(Arrays.asList("5"), "自然灾害", null);
|
|
|
- predicate3.test(Arrays.asList("4"), "消防及疏散", null);
|
|
|
- predicate3.test(Arrays.asList("6"), "其它", null);
|
|
|
- return vo;
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 综合数据-预案演练
|
|
|
+// *
|
|
|
+// * @param date
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @Override
|
|
|
+// public AppSyntheticDrillVo syntheticDrill(Date date) {
|
|
|
+// SysOrg org = getLoginOrg();
|
|
|
+// DateRange range = DateUtils.getStartAndEnd(date, CycleCommonEnum.QUARTERLY);
|
|
|
+// List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticDrill(org.getPath(), range.getStartTime(), range.getEndTime());
|
|
|
+// AppSyntheticDrillVo vo = new AppSyntheticDrillVo();
|
|
|
+// vo.setInfoByType(new LinkedHashMap<>());
|
|
|
+// vo.setRateByType(new LinkedHashMap<>());
|
|
|
+//
|
|
|
+// Predicate3<List<String>, String, String> predicate3 = (List<String> types, String label, String no) -> {
|
|
|
+// List<AppSyntheticTaskCategoryDto> used = taskCategoryDtos.stream().filter(d -> types.contains(d.getPlanType())).collect(Collectors.toList());
|
|
|
+// int total = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getTotal).sum();
|
|
|
+// int completed = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getCompleted).sum();
|
|
|
+// Float rate = computeRate(total, completed);
|
|
|
+//
|
|
|
+// vo.getRateByType().put(label, rate);
|
|
|
+// vo.getInfoByType().put(label, AppSyntheticTaskInfoVo.builder()
|
|
|
+// .shouldCompleteCount(total)
|
|
|
+// .completedCount(completed)
|
|
|
+// .completedRate(rate)
|
|
|
+// .build());
|
|
|
+//
|
|
|
+// return true;
|
|
|
+// };
|
|
|
+//
|
|
|
+// predicate3.test(Arrays.asList("1"), "防抢", null);
|
|
|
+// predicate3.test(Arrays.asList("2"), "防盗", null);
|
|
|
+// predicate3.test(Arrays.asList("3"), "反诈", null);
|
|
|
+// predicate3.test(Arrays.asList("5"), "自然灾害", null);
|
|
|
+// predicate3.test(Arrays.asList("4"), "消防及疏散", null);
|
|
|
+// predicate3.test(Arrays.asList("6"), "其它", null);
|
|
|
+// return vo;
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public AppSyntheticOtherVo syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
@@ -391,6 +391,9 @@ public class AppCockpitServiceImpl implements AppCockpitService {
|
|
|
CompletableFuture<AppSyntheticTaskCategoryDto> edu = CompletableFuture.supplyAsync(() ->
|
|
|
appCockpitMapper.selectSyntheticEdu(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
|
|
|
);
|
|
|
+ CompletableFuture<AppSyntheticTaskCategoryDto> drill = CompletableFuture.supplyAsync(() ->
|
|
|
+ appCockpitMapper.selectSyntheticDrill(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
|
|
|
+ );
|
|
|
CompletableFuture<AppSyntheticTaskCategoryDto> monitor = CompletableFuture.supplyAsync(() ->
|
|
|
appCockpitMapper.selectSyntheticMonitor(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
|
|
|
);
|
|
|
@@ -400,13 +403,16 @@ public class AppCockpitServiceImpl implements AppCockpitService {
|
|
|
);
|
|
|
|
|
|
CompletableFuture<Void> allQueries = CompletableFuture.allOf(
|
|
|
- inout, edu, monitor
|
|
|
+ inout, edu,drill, monitor
|
|
|
);
|
|
|
|
|
|
-
|
|
|
allQueries.get(TIMEOUT, TimeUnit.SECONDS);
|
|
|
|
|
|
AppSyntheticOtherVo vo = new AppSyntheticOtherVo();
|
|
|
+ vo.getDrill().setShouldCompleteCount(drill.get().getTotal());
|
|
|
+ vo.getDrill().setCompletedCount(drill.get().getCompleted());
|
|
|
+ vo.getDrill().setCompletedRate(computeRate(drill.get().getTotal(), drill.get().getCompleted()));
|
|
|
+
|
|
|
vo.getEdu().setShouldCompleteCount(edu.get().getTotal());
|
|
|
vo.getEdu().setCompletedCount(edu.get().getCompleted());
|
|
|
vo.getEdu().setCompletedRate(computeRate(edu.get().getTotal(), edu.get().getCompleted()));
|