Quellcode durchsuchen

调试驾驶舱总览

jiawuxian vor 1 Jahr
Ursprung
Commit
c6244c4479

+ 4 - 1
project_data/sql/0.0.3/soc/soc.sql

@@ -1256,4 +1256,7 @@ CREATE TABLE if not exists `core_out_in_record` (
     `check_image` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '核验照片',
     PRIMARY KEY (`id`),
     KEY `index_letter_id` (`letter_id`) USING BTREE
-    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='人员出入登记表';
+    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='人员出入登记表';
+	
+-- 删除多余的表
+drop TABLE if EXISTS sys_bank_physical_defense_construction;

+ 0 - 25
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/controller/AppCockpitController.java

@@ -65,31 +65,6 @@ public class AppCockpitController extends BaseController {
     @GetMapping("/baseInfo")
     public AjaxResult baseInfo() {
         AppBaseInfoVo vo = appCockpitService.baseInfo();
-//        AppBaseInfoVo vo = new AppBaseInfoVo();
-//        vo.setSecurityFacilities(new AppBaseInfoSecurityFacilitiesVo());
-//        vo.setBanking2015(new AppGa38RateVo());
-//        vo.setOfflineATM2015(new AppGa38RateVo());
-//        vo.setBanking2021(new AppGa38RateVo());
-//        vo.setOfflineATM2021(new AppGa38RateVo());
-//
-//        vo.setBusinessStoreInfo(new HashMap<>());
-//        vo.getBusinessStoreInfo().put("一类库", 50);
-//        vo.getBusinessStoreInfo().put("二类库", 50);
-//        vo.getBusinessStoreInfo().put("三类库", 50);
-//        vo.getBusinessStoreInfo().put("四类库", 50);
-//
-//
-//        vo.setSecurityPeopleInfo(new HashMap<>());
-//        vo.getSecurityPeopleInfo().put("未配备", 40);
-//        vo.getSecurityPeopleInfo().put("已配备", 40);
-//
-//        vo.setOnlineATMPropertyRight(new HashMap<>());
-//        vo.getOnlineATMPropertyRight().put("穿墙式设备",40);
-//        vo.getOnlineATMPropertyRight().put("大堂式设备",40);
-//
-//        vo.setOfflineATMPropertyRight(new HashMap<>());
-//        vo.getOfflineATMPropertyRight().put("穿墙式设备",40);
-//        vo.getOfflineATMPropertyRight().put("大堂式设备",40);
         return success(vo);
     }
 

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/mapper/AppCockpitMapper.java

@@ -22,7 +22,7 @@ public interface AppCockpitMapper extends BaseMapper {
      * @param date
      * @return
      */
-    AppGA38InfoDto selectOrgGa38(@Param("orgPath") String orgPath, @Param("date") Date date);
+    AppGA38InfoDto selectOrgGa38(@Param("orgPath") String orgPath, @Param("date") Date date, @Param("prevMonth") Date prevMonth);
 
     /**
      * 履职本周期、上周期完成情况

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

@@ -140,21 +140,21 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         vo.getOfflineATM2015().setTotal(baseInfoDto.getOffATMCount());
         vo.getOfflineATM2015().setRate(computeRate(baseInfoDto.getOffATMCount(), baseInfoDto.getOffATMGA382015()));
 
-        vo.setBusinessStoreInfo(new HashMap<>());
+        vo.setBusinessStoreInfo(new LinkedHashMap<>());
         vo.getBusinessStoreInfo().put("一类库", baseInfoDto.getBusinessLibraryOne());
         vo.getBusinessStoreInfo().put("二类库", baseInfoDto.getBusinessLibraryTwo());
         vo.getBusinessStoreInfo().put("三类库", baseInfoDto.getBusinessLibraryThree());
         vo.getBusinessStoreInfo().put("四类库", baseInfoDto.getBusinessLibraryFour());
 
-        vo.setSecurityPeopleInfo(new HashMap<>());
+        vo.setSecurityPeopleInfo(new LinkedHashMap<>());
         vo.getSecurityPeopleInfo().put("已配备", baseInfoDto.getOrgWithSecurityCount());
         vo.getSecurityPeopleInfo().put("未配备", baseInfoDto.getBankingCount() - baseInfoDto.getOrgWithSecurityCount());
 
-        vo.setOnlineATMPropertyRight(new HashMap<>());
+        vo.setOnlineATMPropertyRight(new LinkedHashMap<>());
         vo.getOnlineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
         vo.getOnlineATMPropertyRight().put("大堂式设备", baseInfoDto.getOffATMObbyDeviceCount());
 
-        vo.setOfflineATMPropertyRight(new HashMap<>());
+        vo.setOfflineATMPropertyRight(new LinkedHashMap<>());
         vo.getOfflineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
         vo.getOfflineATMPropertyRight().put("大堂式设备", baseInfoDto.getOffATMObbyDeviceCount());
         return vo;
@@ -176,9 +176,9 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         CompletableFuture<AppOverviewVo> orgOverview = CompletableFuture.supplyAsync(() ->
                 appCockpitMapper.selectOrgOverview(org.getPath()), threadPoolTaskExecutor
         );
-        AppGA38InfoDto d1 = appCockpitMapper.selectOrgGa38(org.getPath(), currentMonth);
+
         CompletableFuture<AppGA38InfoDto> orgga38 = CompletableFuture.supplyAsync(() ->
-                appCockpitMapper.selectOrgGa38(org.getPath(), currentMonth), threadPoolTaskExecutor
+                appCockpitMapper.selectOrgGa38(org.getPath(), currentMonth, prevMonth), threadPoolTaskExecutor
         );
 
         CompletableFuture<AppOverviewTaskInfoDto> resumption = CompletableFuture.supplyAsync(() ->
@@ -198,7 +198,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         );
 
         Date currentQuarter = DateUtil.beginOfQuarter(new Date());
-        Date prevQuarter = DateUtil.beginOfMonth(new Date()).offset(DateField.MONTH, -3);
+        Date prevQuarter = DateUtil.beginOfMonth(currentQuarter).offset(DateField.MONTH, -3);
         CompletableFuture<AppOverviewTaskInfoDto> drill = CompletableFuture.supplyAsync(() ->
                 appCockpitMapper.selectOverViewDrillTaskInfo(org.getPath(), currentQuarter, prevQuarter), threadPoolTaskExecutor
         );
@@ -217,11 +217,11 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         allQueries.get(TIMEOUT, TimeUnit.SECONDS);
 
         BeanUtils.copyProperties(orgOverview.join(), vo);
-        vo.setGa38(new HashMap<>());
+        vo.setGa38(new LinkedHashMap<>());
         vo.getGa38().put("GA382021", computeGa38(orgga38.get().getTotal(), orgga38.get().getGa382021(), orgga38.get().getGa382021current(), orgga38.get().getGa382021prev()));
         vo.getGa38().put("GA382015", computeGa38(orgga38.get().getTotal(), orgga38.get().getGa382015(), orgga38.get().getGa382015current(), orgga38.get().getGa382015prev()));
 
-        vo.setTaskInfo(new HashMap<>());
+        vo.setTaskInfo(new LinkedHashMap<>());
         vo.getTaskInfo().put("日常履职", computeOverviewItem(resumption.get()));
         vo.getTaskInfo().put("网点自查", computeOverviewItem(safetyCheck.get()));
         vo.getTaskInfo().put("教育培训", computeOverviewItem(edu.get()));
@@ -247,8 +247,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticResumption(org.getPath(), range.getStartTime(), range.getEndTime());
 
         AppSyntheticResumptionVo vo = new AppSyntheticResumptionVo();
-        vo.setInfoByType(new HashMap<>());
-        vo.setRateByType(new HashMap<>());
+        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();
@@ -313,8 +313,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticSafetyCheck(org.getPath(), range.getStartTime(), range.getEndTime());
 
         AppSyntheticSafetycheckVo vo = new AppSyntheticSafetycheckVo();
-        vo.setTaskInfoByType(new HashMap<>());
-        vo.setRateByType(new HashMap<>());
+        vo.setTaskInfoByType(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());
@@ -355,8 +355,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         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 HashMap<>());
-        vo.setRateByType(new HashMap<>());
+        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());
@@ -405,21 +405,21 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 
         allQueries.get(TIMEOUT, TimeUnit.SECONDS);
 
-        AppSyntheticOtherVo vo=new AppSyntheticOtherVo();
+        AppSyntheticOtherVo vo = new AppSyntheticOtherVo();
         vo.getEdu().setShouldCompleteCount(edu.get().getTotal());
         vo.getEdu().setCompletedCount(edu.get().getCompleted());
-        vo.getEdu().setCompletedRate(computeRate(edu.get().getTotal(),edu.get().getCompleted()));
+        vo.getEdu().setCompletedRate(computeRate(edu.get().getTotal(), edu.get().getCompleted()));
 
         vo.getMonitor().setShouldCompleteCount(monitor.get().getTotal());
         vo.getMonitor().setCompletedCount(monitor.get().getCompleted());
-        vo.getMonitor().setCompletedRate(computeRate(monitor.get().getTotal(),monitor.get().getCompleted()));
+        vo.getMonitor().setCompletedRate(computeRate(monitor.get().getTotal(), monitor.get().getCompleted()));
 
         vo.getInout().setDepartment(inout.get().getDepartment());
         vo.getInout().setEmergency(inout.get().getEmergency());
         vo.getInout().setTemporary(inout.get().getTemporary());
         vo.getInout().setTotal(inout.get().getTotal());
 
-        return  vo;
+        return vo;
     }
 
     private AppOverviewItemVo computeOverviewItem(AppOverviewTaskInfoDto dto) {
@@ -428,6 +428,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
             vo.setShouldComplete(0);
             vo.setCurrentCompletedCount(0);
             vo.setCurrentCompletedRate(0F);
+            vo.setPrevCompletedRate(0F);
             vo.setCompare(0F);
 
             return vo;

+ 5 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppSyntheticQuestionVo.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 /**
@@ -24,9 +25,9 @@ public class AppSyntheticQuestionVo {
     private Map<String, Float> safetyCheck;
 
     public AppSyntheticQuestionVo(){
-        this.resumption=new HashMap<>();
-        this.rateByState=new HashMap<>();
-        this.offATMCheck=new HashMap<>();
-        this.safetyCheck=new HashMap<>();
+        this.resumption=new LinkedHashMap<>();
+        this.rateByState=new LinkedHashMap<>();
+        this.offATMCheck=new LinkedHashMap<>();
+        this.safetyCheck=new LinkedHashMap<>();
     }
 }

+ 1 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java

@@ -395,8 +395,7 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
 
     @Override
     public void updateTaskStart() {
-        LocalDate dateTime = LocalDate.now();
-        Date dateTimeNew = DateUtil.endOfDay(Date.from(dateTime.atStartOfDay(ZoneId.systemDefault()).toInstant())).setField(DateField.MILLISECOND, 0);
+        Date dateTimeNew = DateUtil.beginOfDay(new Date());
         coreMonitoringRetrievalTaskMapper.updateTaskStart(dateTimeNew);
     }
 

+ 24 - 26
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -5,11 +5,11 @@
         SELECT sum(IF(o.type = 3, 1, 0))                                                    as hangsheCount,
                sum(IF(o.type = 4, 1, 0))                                                    as bankingCount,
                sum(IF(o.type = 6, 1, 0))                                                    as centerStoreCount,
-               sum(IF(o.type = 8, 1, 0))                                                    as bankingStoreCount,
+               sum(o.type = 8 || oe.business_library=1)                                     as bankingStoreCount,
                sum(IF(o.type = 5, 1, 0))                                                    as offlineATMCount,
-               sum(IF(oe.self_service_bank is not null, 1, 0))                              as onlineATMCount,
-               sum(IF(oe.lobby_equipment is not null, oe.lobby_equipment, 0))               as lobbyDeviceCount,
-               sum(IF(oe.wall_penetrating_equipment = 4, oe.wall_penetrating_equipment, 0)) as throughwallDeviceCount
+               sum(oe.self_service_bank =1)                                                 as onlineATMCount,
+               sum(oe.lobby_equipment)               as lobbyDeviceCount,
+               sum(oe.wall_penetrating_equipment) as throughwallDeviceCount
         from sys_org o
                  LEFT JOIN sys_org_extend oe on o.id = oe.org_id
         WHERE o.deleted = 0
@@ -23,21 +23,19 @@
                sum(m.ga382021prev)    as ga382021prev,
                sum(m.ga382015)        as ga382015,
                sum(m.ga382015current) as ga382015current,
-               sum(m.ga382021prev)    as ga382021prev
+               sum(m.ga382015prev)    as ga382015prev
         from sys_org o
                  LEFT JOIN (SELECT org_id,
-                                   IF
-                                       (standard = 1, 1, 0)                                         AS ga382021,
-                                   IF
-                                       (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0)   AS ga382021current,
-                                   IF
-                                       (standard = 1, IF(date_of_compliance &lt; #{date}, 1, 0), 0) AS ga382021prev,
-                                   IF
-                                       (standard = 2, 1, 0)                                         AS ga382015,
-                                   IF
-                                       (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0)   AS ga382015current,
-                                   IF
-                                       (standard = 2, IF(date_of_compliance &lt; #{date}, 1, 0), 0) AS ga382015prev
+                                   sum(standard = 1)                                         AS ga382021,
+                                   sum(IF
+                                       (standard = 1, IF(date_of_compliance >= #{date}, 1, 0), 0))   AS ga382021current,
+                                   sum(IF
+                                       (standard = 1, IF(date_of_compliance &lt; #{date} and date_of_compliance>=#{prevMonth}, 1, 0), 0)) AS ga382021prev,
+                                   sum(standard = 2)                                         AS ga382015,
+                                   sum(IF
+                                       (standard = 2, IF(date_of_compliance >= #{date}, 1, 0), 0))   AS ga382015current,
+                                   sum(IF
+                                       (standard = 2, IF(date_of_compliance &lt; #{date} and date_of_compliance>=#{prevMonth}, 1, 0), 0)) AS ga382015prev
                             FROM sys_org_physical_defense_construction
                             WHERE type = 1
                                OR type = 3
@@ -50,7 +48,7 @@
     <select id="selectOverViewResumptionTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
         SELECT sum(if(ymd_date >= #{date}, 1, 0))                          as total,
                sum(if(ymd_date >= #{date}, (if(`status` = 3, 1, 0)), 0))   as completed,
-               sum(if(ymd_date &lt; #{date}, 1, 0))                        as prevcount,
+               sum(if(ymd_date &lt; #{date}, 1, 0))                        as prevTotal,
                sum(if(ymd_date &lt; #{date}, (if(`status` = 3, 1, 0)), 0)) as prevcompleted
         FROM core_resumption
         WHERE ymd_date >= #{prevdate}
@@ -60,7 +58,7 @@
     <select id="selectOverViewSafetyCheckTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
         SELECT sum(if(t.ymd_date >= #{date}, 1, 0))                            as total,
                sum(if(t.ymd_date >= #{date}, (if(t.`status` = 3, 1, 0)), 0))   as completed,
-               sum(if(t.ymd_date &lt; #{date}, 1, 0))                          as prevcount,
+               sum(if(t.ymd_date &lt; #{date}, 1, 0))                          as prevTotal,
                sum(if(t.ymd_date &lt; #{date}, (if(t.`status` = 3, 1, 0)), 0)) as prevcompleted
         FROM core_safety_task t
                  INNER JOIN core_safecheck_plan p on t.plan_id = p.id and p.check_type = 3
@@ -70,9 +68,9 @@
 
     <select id="selectOverViewEduTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
         SELECT sum(if(start_date >= #{date}, 1, 0))                          as total,
-               sum(if(start_date >= #{date}, (if(`status` = 4, 1, 0)), 0))   as completed,
-               sum(if(start_date &lt; #{date}, 1, 0))                        as prevcount,
-               sum(if(start_date &lt; #{date}, (if(`status` = 4, 1, 0)), 0)) as prevcompleted
+               sum(if(start_date >= #{date}, (if(`status` = 2, 1, 0)), 0))   as completed,
+               sum(if(start_date &lt; #{date}, 1, 0))                        as prevTotal,
+               sum(if(start_date &lt; #{date}, (if(`status` = 2, 1, 0)), 0)) as prevcompleted
         FROM core_edu_training_task
         WHERE start_date >= #{prevdate}
           and org_path like concat(#{orgPath}, '%')
@@ -81,7 +79,7 @@
     <select id="selectOverViewDrillTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
         SELECT sum(if(start_date >= #{date}, 1, 0))                          as total,
                sum(if(start_date >= #{date}, (if(`status` = 4, 1, 0)), 0))   as completed,
-               sum(if(start_date &lt; #{date}, 1, 0))                        as prevcount,
+               sum(if(start_date &lt; #{date}, 1, 0))                        as prevTotal,
                sum(if(start_date &lt; #{date}, (if(`status` = 4, 1, 0)), 0)) as prevcompleted
         FROM core_drill_task
         WHERE start_date >= #{prevdate}
@@ -90,9 +88,9 @@
 
     <select id="selectOverViewMonitorTaskInfo" resultType="com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto">
         SELECT sum(if(ymd_date >= #{date}, 1, 0))                          as total,
-               sum(if(ymd_date >= #{date}, (if(`status` = 3, 1, 0)), 0))   as completed,
-               sum(if(ymd_date &lt; #{date}, 1, 0))                        as prevcount,
-               sum(if(ymd_date &lt; #{date}, (if(`status` = 3, 1, 0)), 0)) as prevcompleted
+               sum(if(ymd_date >= #{date}, (if(`status` = 2, 1, 0)), 0))   as completed,
+               sum(if(ymd_date &lt; #{date}, 1, 0))                        as prevTotal,
+               sum(if(ymd_date &lt; #{date}, (if(`status` = 2, 1, 0)), 0)) as prevcompleted
         FROM core_monitoring_retrieval_task
         WHERE ymd_date >= #{prevdate}
           and org_path like concat(#{orgPath}, '%')