Explorar o código

APP驾驶舱数据调试

jiawuxian hai 1 ano
pai
achega
ed3f83bc85

+ 5 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/controller/AppCockpitController.java

@@ -12,11 +12,14 @@ import io.swagger.annotations.ApiResponses;
 import io.swagger.v3.oas.annotations.media.Content;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
@@ -73,7 +76,7 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-履职", response = AppSyntheticResumptionVo.class)
     @GetMapping("/synthetic/resumption")
-    public AjaxResult syntheticResumption(@NotNull Date month) {
+    public AjaxResult syntheticResumption(@NotNull @Validated Date month) {
         AppSyntheticResumptionVo vo = appCockpitService.syntheticResumption(month);
         return success(vo);
     }
@@ -93,7 +96,7 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-安全检查", response = AppSyntheticSafetycheckVo.class)
     @GetMapping("/synthetic/safethcheck")
-    public AjaxResult syntheticSafetycheck(Date month) {
+    public AjaxResult syntheticSafetycheck(@RequestParam @Valid Date month) {
         AppSyntheticSafetycheckVo vo = appCockpitService.syntheticSafetyCheck(month);
         return success(vo);
     }

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

@@ -151,8 +151,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         vo.getSecurityPeopleInfo().put("未配备", baseInfoDto.getBankingCount() - baseInfoDto.getOrgWithSecurityCount());
 
         vo.setOnlineATMPropertyRight(new LinkedHashMap<>());
-        vo.getOnlineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
-        vo.getOnlineATMPropertyRight().put("大堂式设备", baseInfoDto.getOffATMObbyDeviceCount());
+        vo.getOnlineATMPropertyRight().put("穿墙式设备", baseInfoDto.getBankingWallDeviceCount());
+        vo.getOnlineATMPropertyRight().put("大堂式设备", baseInfoDto.getBankingObbyDeviceCount());
 
         vo.setOfflineATMPropertyRight(new LinkedHashMap<>());
         vo.getOfflineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
@@ -266,8 +266,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         predicate3.test(Arrays.asList("1", "2", "3"), "每日履职", null);
         predicate3.test(Arrays.asList("4"), "报警测试", null);
         predicate3.test(Arrays.asList("5"), "UPS维护", null);
-        predicate3.test(Arrays.asList("6"), "夜间值守", null);
-        predicate3.test(Arrays.asList("7"), "离行巡检", null);
+        predicate3.test(Arrays.asList("7"), "夜间值守", null);
+        predicate3.test(Arrays.asList("6"), "离行巡检", null);
         predicate3.test(Arrays.asList("8"), "其它履职", null);
         return vo;
     }
@@ -320,11 +320,12 @@ public class AppCockpitServiceImpl implements AppCockpitService {
             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();
+            int exceptionCount = used.stream().mapToInt(AppSyntheticTaskCategoryDto::getExceptionCount).sum();
             Float rate = computeRate(total, completed);
 
             vo.getRateByType().put(label, rate);
             vo.getTaskInfoByType().put(label, AppSyntheticSafetycheckTaskVo.builder()
-                    .questionCount(completed)
+                    .questionCount(exceptionCount)
                     .shouldCheckCount(total)
                     .checkedCount(completed)
                     .completedRate(rate)
@@ -485,4 +486,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
             return (divisor.floatValue() / total.floatValue());
         }
     }
+
+//    private void throwIfNull(Date date){
+//
+//    }
 }

+ 17 - 29
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -108,32 +108,23 @@
                sum(if(oh.org_id is null, 1, 0))                      as unreachedCount,
                sum(if(o.type = 4, 1, 0))                             as bankingCount,
                sum(if(o.type = 5, 1, 0))                             as offATMCount,
-               sum(if(o.type = 4 and oh.ga382021 is not null, 1, 0)) as bankingGA382021,
-               sum(if(o.type = 4 and oh.ga382015 is not null, 1, 0)) as bankingGA382015,
-               sum(if(o.type = 5 and oh.ga382021 is not null, 1, 0)) as offATMGA382021,
-               sum(if(o.type = 5 and oh.ga382015 is not null, 1, 0)) as offATMGA382015,
-               sum(if(oe.business_library_type = 1, 1, 0))           as businessLibraryOne,
-               sum(if(oe.business_library_type = 2, 1, 0))           as businessLibraryTwo,
-               sum(if(oe.business_library_type = 3, 1, 0))           as businessLibraryThree,
-               sum(if(oe.business_library_type = 4, 1, 0))           as businessLibraryFour,
-               sum(if(oe.askari = 1, 1, 0))                          as orgWithSecurityCount,
-               sum(if(o.type = 4 and oe.lobby_equipment is not null, oe.lobby_equipment,
-                      0))                                            as bankingObbyDeviceCount,
-               sum(if(o.type = 4 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
-                      0))                                            as bankingWallDeviceCount,
-               sum(if(o.type = 5 and oe.lobby_equipment is not null, oe.lobby_equipment,
-                      0))                                            as offATMObbyDeviceCount,
-               sum(if(o.type = 5 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
-                      0))                                            as offATMWallDeviceCount
+               sum(if(o.type = 4, oh.ga382021, 0)) as bankingGA382021,
+               sum(if(o.type = 4, oh.ga382015, 0)) as bankingGA382015,
+               sum(if(o.type = 5, oh.ga382021, 0)) as offATMGA382021,
+               sum(if(o.type = 5, oh.ga382015 , 0)) as offATMGA382015,
+               sum(oe.business_library_type = 1)           as businessLibraryOne,
+               sum(oe.business_library_type = 2)           as businessLibraryTwo,
+               sum(oe.business_library_type = 3)           as businessLibraryThree,
+               sum(oe.business_library_type = 4)           as businessLibraryFour,
+               sum(if(oe.askari = 1, 1, 0))                             as orgWithSecurityCount,
+               sum(if(o.type = 4, oe.lobby_equipment,0))    as bankingObbyDeviceCount,
+               sum(if(o.type = 4, oe.wall_penetrating_equipment,0))     as bankingWallDeviceCount,
+               sum(if(o.type = 5, oe.lobby_equipment,0))    as offATMObbyDeviceCount,
+               sum(if(o.type = 5, oe.wall_penetrating_equipment,0))     as offATMWallDeviceCount
         FROM sys_org o
                  LEFT JOIN (SELECT org_id,
-                                   IF
-                                       (standard = 1, 1, 0) AS ga382021,
-
-
-                                   IF
-                                       (standard = 2, 1, 0) AS ga382015
-
+                                   sum(standard = 1) AS ga382021,
+                                   sum(standard = 2) AS ga382015
                             FROM sys_org_physical_defense_construction
                             WHERE type = 1
                                OR type = 3
@@ -141,8 +132,7 @@
                  LEFT JOIN sys_org_extend oe on o.id = oe.org_id
         WHERE o.deleted = 0
           and path like concat(#{orgPath}, '%')
-          AND (
-                    o.type = 4
+          AND ( o.type = 4
                 OR o.type = 5)
     </select>
     <select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
@@ -176,9 +166,7 @@
     <select id="selectSyntheticDrill" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
         SELECT r.type                            as plan_type,
                count(0)                          AS total,
-               sum(
-                       IF
-                           (r.STATUS = 3, 1, 0)) AS completed
+               sum(r.STATUS = 3) AS completed
         FROM core_drill_task r
         WHERE r.start_date BETWEEN #{startDate}
             AND #{endDate}