Преглед на файлове

APP驾驶舱-综合数据安全检查

jiawuxian преди 1 година
родител
ревизия
f71cd38049

+ 34 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/AppCockpitServiceImpl.java

@@ -268,7 +268,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         predicate3.test(Arrays.asList("5"), "UPS维护", null);
         predicate3.test(Arrays.asList("6"), "夜间值守", null);
         predicate3.test(Arrays.asList("7"), "离行巡检", null);
-        predicate3.test(Arrays.asList("8"), "其它", null);
+        predicate3.test(Arrays.asList("8"), "其它履职", null);
         return vo;
     }
 
@@ -279,7 +279,39 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 
     @Override
     public AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month) {
-        return new AppSyntheticSafetycheckVo();
+        SysOrg org = getLoginOrg();
+        DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
+        List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticResumption(org.getPath(), range.getStartTime(), range.getEndTime());
+
+        AppSyntheticSafetycheckVo vo = new AppSyntheticSafetycheckVo();
+        vo.setTaskInfoByType(new HashMap<>());
+        vo.setRateByType(new HashMap<>());
+
+        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.getTaskInfoByType().put(label, AppSyntheticSafetycheckTaskVo.builder()
+                    .questionCount(completed)
+                    .shouldCheckCount(total)
+                    .checkedCount(completed)
+                    .completedRate(rate)
+                    .build());
+
+            return true;
+        };
+
+        predicate3.test(Arrays.asList("3"),"网点自查",null);
+        predicate3.test(Arrays.asList("4"),"全面检查",null);
+        predicate3.test(Arrays.asList("2"),"办事处检查",null);
+        predicate3.test(Arrays.asList("1"),"省联社检查",null);
+        predicate3.test(Arrays.asList("5"),"阶段性检查",null);
+        predicate3.test(Arrays.asList("6"),"专项检查",null);
+        predicate3.test(Arrays.asList("7"),"其它检查",null);
+        return  vo;
     }
 
     @Override

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppSyntheticSafetycheckTaskVo.java

@@ -2,12 +2,14 @@ package com.xunmei.core.board.vo.app;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
 import lombok.Data;
 
 /**
  * 综合数据-安全检查-任务信息
  */
 @Data
+@Builder
 public class AppSyntheticSafetycheckTaskVo {
     @ApiModelProperty("隐患数")
     private Integer questionCount;
@@ -16,5 +18,5 @@ public class AppSyntheticSafetycheckTaskVo {
     @ApiModelProperty("已检查")
     private  Integer checkedCount;
     @ApiModelProperty("完成率")
-    private Float completedCount;
+    private Float completedRate;
 }