Browse Source

Merge branch 'V0.0.3' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.3

zhulu 1 year ago
parent
commit
fb7da697f9

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

@@ -138,8 +138,8 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-其它", response = AppSyntheticOtherVo.class)
     @GetMapping("/synthetic/other")
-    public AjaxResult syntheticOther(Date month) {
-        AppSyntheticOtherVo vo = appCockpitService.syntheticOther(month);
+    public AjaxResult syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException {
+        AppSyntheticOtherVo vo = appCockpitService.syntheticOther(date);
         return success(vo);
     }
 }

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

@@ -3,6 +3,7 @@ package com.xunmei.core.board.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.xunmei.core.board.dto.app.*;
 import com.xunmei.core.board.vo.app.AppOverviewVo;
+import com.xunmei.core.board.vo.app.AppSyntheticInOutVo;
 import org.apache.ibatis.annotations.Param;
 import  java.util.Date;
 import java.util.List;
@@ -126,4 +127,31 @@ public interface AppCockpitMapper extends BaseMapper {
      * @return
      */
     int selectOverDueQuestionCount(@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
+
+    /**
+     * 综合数据-教育培训
+     * @param orgPath
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    AppSyntheticTaskCategoryDto  selectSyntheticEdu(@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
+
+    /**
+     * 综合数据-监控调阅
+     * @param orgPath
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    AppSyntheticTaskCategoryDto  selectSyntheticMonitor(@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
+
+    /**
+     * 综合数据-出入管理
+     * @param orgPath
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    AppSyntheticInOutVo selectSyntheticInout(@Param("orgPath") String orgPath, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
 }

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/AppCockpitService.java

@@ -58,8 +58,8 @@ public interface AppCockpitService {
 
     /**
      * 综合数据-其它
-     * @param month
+     * @param date
      * @return
      */
-    AppSyntheticOtherVo syntheticOther(Date month);
+    AppSyntheticOtherVo syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException;
 }

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

@@ -346,7 +346,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     /**
      * 综合数据-预案演练
      *
-     * @param month
+     * @param date
      * @return
      */
     @Override
@@ -384,8 +384,42 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     }
 
     @Override
-    public AppSyntheticOtherVo syntheticOther(Date month) {
-        return new AppSyntheticOtherVo();
+    public AppSyntheticOtherVo syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException {
+        SysOrg org = getLoginOrg();
+        DateRange range = DateUtils.getStartAndEnd(date, CycleCommonEnum.QUARTERLY);
+        CompletableFuture<AppSyntheticTaskCategoryDto> edu = CompletableFuture.supplyAsync(() ->
+                appCockpitMapper.selectSyntheticEdu(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
+        );
+        CompletableFuture<AppSyntheticTaskCategoryDto> monitor = CompletableFuture.supplyAsync(() ->
+                appCockpitMapper.selectSyntheticMonitor(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
+        );
+
+        CompletableFuture<AppSyntheticInOutVo> inout = CompletableFuture.supplyAsync(() ->
+                appCockpitMapper.selectSyntheticInout(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
+        );
+
+        CompletableFuture<Void> allQueries = CompletableFuture.allOf(
+                inout, edu, monitor
+        );
+
+
+        allQueries.get(TIMEOUT, TimeUnit.SECONDS);
+
+        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.getMonitor().setShouldCompleteCount(monitor.get().getTotal());
+        vo.getMonitor().setCompletedCount(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;
     }
 
     private AppOverviewItemVo computeOverviewItem(AppOverviewTaskInfoDto dto) {

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppSyntheticOtherVo.java

@@ -14,4 +14,10 @@ public class AppSyntheticOtherVo {
     private AppSyntheticTaskInfoVo monitor;
     @ApiModelProperty("出入管理")
     private AppSyntheticInOutVo inout;
+
+    public  AppSyntheticOtherVo(){
+        this.edu=new AppSyntheticTaskInfoVo();
+        this.monitor=new AppSyntheticTaskInfoVo();
+        this.inout=new AppSyntheticInOutVo();
+    }
 }

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

@@ -1,11 +1,15 @@
 package com.xunmei.core.board.vo.app;
 
 import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 @Data
 @Builder
+@NoArgsConstructor
+@AllArgsConstructor
 /**
  * 综合数据-任务完成情况
  */

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -242,6 +242,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         for (AppPlan ap :
                 appPlans) {
 //修改计划状态为停用
+            ap.setBuildTaskNow(0);
             ap.setPlanStatus(2);
             baseMapper.updateById(ap);
 
@@ -252,6 +253,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         //设置下发状态为未下发
         plan.setDistribute("0");
         plan.setPlanStatus(2);
+        plan.setBuildTaskNow(0);
         baseMapper.updateById(plan);
 
         if (ObjectUtil.notEqual(plan.getTaskHasCompleted(), 1)) {

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -232,6 +232,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         for (CoreSafecheckPlan ap :
                 appPlans) {
 //修改计划状态为停用
+            ap.setBuildTaskNow(false);
             ap.setPlanStatus(2L);
             baseMapper.updateById(ap);
 
@@ -251,6 +252,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         }
         //设置下发状态为未下发
         plan.setDistribute("0");
+        plan.setBuildTaskNow(false);
         plan.setPlanStatus(2L);
         baseMapper.updateById(plan);
 

+ 42 - 18
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -106,27 +106,27 @@
     </select>
 
     <select id="selectOrgBaseInfo" resultType="com.xunmei.core.board.dto.app.AppOrgBaseInfoDto">
-        SELECT count(0)                                                                                            as total,
-               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,
+        SELECT count(0)                                              as total,
+               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,
+                      0))                                            as bankingObbyDeviceCount,
                sum(if(o.type = 4 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
-                      0))                                                                                          as bankingWallDeviceCount,
+                      0))                                            as bankingWallDeviceCount,
                sum(if(o.type = 5 and oe.lobby_equipment is not null, oe.lobby_equipment,
-                      0))                                                                                          as offATMObbyDeviceCount,
+                      0))                                            as offATMObbyDeviceCount,
                sum(if(o.type = 5 and oe.wall_penetrating_equipment is not null, oe.wall_penetrating_equipment,
-                      0))                                                                                          as offATMWallDeviceCount
+                      0))                                            as offATMWallDeviceCount
         FROM sys_org o
                  LEFT JOIN (SELECT org_id,
                                    IF
@@ -162,7 +162,7 @@
         GROUP BY p.plan_type
     </select>
     <select id="selectSyntheticSafetyCheck" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
-        SELECT p.check_type as plan_type,
+        SELECT p.check_type                      as plan_type,
                count(0)                          AS total,
                sum(
                        IF
@@ -240,4 +240,28 @@
           and reform_status != 11
           and confirm_status != 3
     </select>
+    <select id="selectSyntheticEdu" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
+        SELECT count(0) as total, sum(`status` = 2) as completed
+        from core_edu_training_task
+        where start_date BETWEEN #{startDate} and #{endDate}
+          AND org_path LIKE CONCAT(#{orgPath}, '%')
+    </select>
+    <select id="selectSyntheticInout" resultType="com.xunmei.core.board.vo.app.AppSyntheticInOutVo">
+        SELECT COUNT(*)        as total,
+               sum(l.type = 1) as department,
+               sum(l.type = 2) as temporary,
+               sum(l.type = 3) as emergency
+        FROM core_out_in_record r
+                 INNER JOIN core_introduce_letter l ON r.letter_id = l.id
+                 INNER JOIN sys_org o ON r.org_id = o.id
+        where arrival_time >= #{startDate}
+          AND arrival_time &lt;= #{endDate}
+          and o.path LIKE CONCAT(#{orgPath}, '%')
+    </select>
+    <select id="selectSyntheticMonitor" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
+        SELECT count(0) as total, sum(`status` = 2) as completed
+        from core_monitoring_retrieval_task
+        where ymd_date BETWEEN '2023-11-1' and '2023-11-30'
+          and org_path LIKE CONCAT(#{orgPath}, '%')
+    </select>
 </mapper>