Ver Fonte

实现APP驾驶舱

jiawuxian há 1 ano atrás
pai
commit
7899312e6d

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

@@ -5,34 +5,30 @@ import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.core.board.dto.app.AppTaskRankingDto;
 import com.xunmei.core.board.service.AppCockpitService;
-import com.xunmei.core.board.service.CockpitService;
 import com.xunmei.core.board.vo.app.*;
-import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
-
+import java.util.Date;
 /**
  * 驾驶舱
  *
  * @author xunmei
  * @date 2023-09-06
  */
-@Api(tags = {"驾驶舱"})
+@ApiOperation(value = "APP驾驶舱")
 @RestController
 @RequestMapping("/cockpit/app")
 //@RequiresPermissions("core:cockpit")
 public class AppCockpitController extends BaseController {
     @Resource
-    AppCockpitService cockpitService;
+    AppCockpitService appCockpitService;
 
     /**
      * 履职排名
@@ -40,7 +36,7 @@ public class AppCockpitController extends BaseController {
     @ApiOperation(value = "履职排名")
     @GetMapping("/ranking/resumption")
     public AjaxResult taskRanking(AppTaskRankingDto dto) {
-        List<AppTaskRankingVo> rankingVos = cockpitService.taskRanking(dto);
+        List<AppTaskRankingVo> rankingVos = appCockpitService.taskRanking(dto);
         return success(rankingVos);
     }
 
@@ -51,7 +47,7 @@ public class AppCockpitController extends BaseController {
     @ApiOperation(value = "基础信息")
     @GetMapping("/baseInfo")
     public AjaxResult baseInfo() {
-        AppBaseInfoVo vo=cockpitService.baseInfo();
+        AppBaseInfoVo vo= appCockpitService.baseInfo();
 //        AppBaseInfoVo vo = new AppBaseInfoVo();
 //        vo.setSecurityFacilities(new AppBaseInfoSecurityFacilitiesVo());
 //        vo.setBanking2015(new AppGa38RateVo());
@@ -86,8 +82,47 @@ public class AppCockpitController extends BaseController {
     @ApiOperation(value = "总览")
     @GetMapping("/overview")
     public AjaxResult overview()   throws ExecutionException, InterruptedException, TimeoutException {
-        AppOverviewVo vo = cockpitService.overview();
+        AppOverviewVo vo = appCockpitService.overview();
+        return success(vo);
+    }
+
+    /**
+     * 综合数据-履职
+     */
+    @ApiOperation(value = "综合数据-履职")
+    @GetMapping("/synthetic/resumption")
+    public AjaxResult syntheticResumption(Date month) {
+        AppSyntheticResumptionVo vo = appCockpitService.syntheticResumption(month);
+        return success(vo);
+    }
+
+    /**
+     * 综合数据-问题整改
+     */
+    @ApiOperation(value = "综合数据-问题整改")
+    @GetMapping("/synthetic/question")
+    public AjaxResult syntheticQuestion(Date month) {
+        AppSyntheticQuestionVo vo = appCockpitService.syntheticQuestion(month);
+        return success(vo);
+    }
+
+    /**
+     * 综合数据-安全检查
+     */
+    @ApiOperation(value = "综合数据-安全检查")
+    @GetMapping("/synthetic/safethcheck")
+    public AjaxResult syntheticSafetycheck(Date month) {
+        AppSyntheticSafetycheckVo vo = appCockpitService.syntheticSafetyCheck(month);
+        return success(vo);
+    }
 
+    /**
+     * 综合数据-安全检查
+     */
+    @ApiOperation(value = "综合数据-其它")
+    @GetMapping("/synthetic/other")
+    public AjaxResult syntheticOther(Date month) {
+        AppSyntheticOtherVo vo = appCockpitService.syntheticOther(month);
         return success(vo);
     }
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/controller/WebCockpitController.java

@@ -17,7 +17,7 @@ import javax.annotation.Resource;
  * @author xunmei
  * @date 2023-09-06
  */
-@Api(tags = {"驾驶舱"})
+@ApiOperation(value = "驾驶舱")
 @RestController
 @RequestMapping("/cockpit")
 //@RequiresPermissions("core:cockpit")

+ 15 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/dto/app/AppSyntheticTaskCategoryDto.java

@@ -0,0 +1,15 @@
+package com.xunmei.core.board.dto.app;
+
+import lombok.Data;
+
+/**
+ * APP综合数据,任务分类的完成信息
+ */
+@Data
+public class AppSyntheticTaskCategoryDto {
+    private String planType;
+
+    private int total;
+
+    private int completed;
+}

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/dto/app/AppTaskRankingDto.java

@@ -10,9 +10,9 @@ import lombok.Data;
  */
 @Data
 public class AppTaskRankingDto {
-    @ApiModelProperty("0:升序,1:降序")
-    public  int desc;
+    @ApiModelProperty(value = "0:升序,1:降序")
+    private Integer desc = 1;
 
-    @ApiModelProperty("月份")
-    public Date month;
+    @ApiModelProperty(value ="月份")
+    private Date month;
 }

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

@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.xunmei.core.board.dto.app.AppGA38InfoDto;
 import com.xunmei.core.board.dto.app.AppOrgBaseInfoDto;
 import com.xunmei.core.board.dto.app.AppOverviewTaskInfoDto;
+import com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto;
 import com.xunmei.core.board.vo.app.AppOverviewVo;
 import org.apache.ibatis.annotations.Param;
 import  java.util.Date;
+import java.util.List;
 
 public interface AppCockpitMapper extends BaseMapper {
     /**
@@ -83,4 +85,6 @@ public interface AppCockpitMapper extends BaseMapper {
      * @return
      */
     AppOrgBaseInfoDto selectOrgBaseInfo(@Param("orgPath") String orgPath);
+
+    List<AppSyntheticTaskCategoryDto> selectSyntheticResumption (@Param("orgPath") String orgPath,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
 }

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

@@ -1,13 +1,12 @@
 package com.xunmei.core.board.service;
 
 import com.xunmei.core.board.dto.app.AppTaskRankingDto;
-import com.xunmei.core.board.vo.app.AppBaseInfoVo;
-import com.xunmei.core.board.vo.app.AppOverviewVo;
-import com.xunmei.core.board.vo.app.AppTaskRankingVo;
+import com.xunmei.core.board.vo.app.*;
 
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
+import  java.util.Date;
 
 public interface AppCockpitService {
     /**
@@ -28,4 +27,32 @@ public interface AppCockpitService {
      * @return
      */
     AppOverviewVo overview()  throws ExecutionException, InterruptedException, TimeoutException;
+
+    /**
+     * 综合数据-履职
+     * @param month
+     * @return
+     */
+    AppSyntheticResumptionVo syntheticResumption(Date month);
+
+    /**
+     * 综合数据-问题整改
+     * @param month
+     * @return
+     */
+    AppSyntheticQuestionVo syntheticQuestion(Date month);
+
+    /**
+     * 综合数据-安全检查
+     * @param month
+     * @return
+     */
+    AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month);
+
+    /**
+     * 综合数据-其它
+     * @param month
+     * @return
+     */
+    AppSyntheticOtherVo syntheticOther(Date month);
 }

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

@@ -54,6 +54,12 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     @Qualifier(ThreadPoolConfig.SOC_EXECUTOR)
     private ThreadPoolTaskExecutor threadPoolTaskExecutor;
 
+    /**
+     * 履职排名
+     *
+     * @param dto
+     * @return
+     */
     @Override
     public List<AppTaskRankingVo> taskRanking(AppTaskRankingDto dto) {
         DateRange range = DateUtils.getStartAndEnd(dto.getMonth(), CycleCommonEnum.MONTHLY);
@@ -102,18 +108,23 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         return r;
     }
 
+    /**
+     * 基础信息
+     *
+     * @return
+     */
     @Override
     public AppBaseInfoVo baseInfo() {
         SysOrg org = remoteOrgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
         if (ObjectUtil.isNull(org)) {
-           throw new ServiceException("登录机构不存在");
+            throw new ServiceException("登录机构不存在");
         }
 
         AppBaseInfoVo vo = new AppBaseInfoVo();
-        AppOrgBaseInfoDto baseInfoDto=appCockpitMapper.selectOrgBaseInfo(org.getPath());
+        AppOrgBaseInfoDto baseInfoDto = appCockpitMapper.selectOrgBaseInfo(org.getPath());
         vo.setSecurityFacilities(new AppBaseInfoSecurityFacilitiesVo());
-        vo.getSecurityFacilities().setGa382015(baseInfoDto.getBankingGA382015()+baseInfoDto.getOffATMGA382015());
-        vo.getSecurityFacilities().setGa382021(baseInfoDto.getBankingGA382021()+baseInfoDto.getOffATMGA382021());
+        vo.getSecurityFacilities().setGa382015(baseInfoDto.getBankingGA382015() + baseInfoDto.getOffATMGA382015());
+        vo.getSecurityFacilities().setGa382021(baseInfoDto.getBankingGA382021() + baseInfoDto.getOffATMGA382021());
         vo.getSecurityFacilities().setGa38Unreached(baseInfoDto.getUnreachedCount());
 
         vo.setBanking2021(new AppGa38RateVo());
@@ -133,23 +144,23 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         vo.getOfflineATM2015().setRate(computeRate(baseInfoDto.getOffATMCount(), baseInfoDto.getOffATMGA382015()));
 
         vo.setBusinessStoreInfo(new HashMap<>());
-        vo.getBusinessStoreInfo().put("一类库",baseInfoDto.getBusinessLibraryOne());
-        vo.getBusinessStoreInfo().put("二类库",baseInfoDto.getBusinessLibraryTwo());
-        vo.getBusinessStoreInfo().put("三类库",baseInfoDto.getBusinessLibraryThree());
-        vo.getBusinessStoreInfo().put("四类库",baseInfoDto.getBusinessLibraryFour());
+        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.getSecurityPeopleInfo().put("已配备", baseInfoDto.getOrgWithSecurityCount());
-        vo.getSecurityPeopleInfo().put("未配备",baseInfoDto.getBankingCount()-baseInfoDto.getOrgWithSecurityCount());
+        vo.getSecurityPeopleInfo().put("未配备", baseInfoDto.getBankingCount() - baseInfoDto.getOrgWithSecurityCount());
 
         vo.setOnlineATMPropertyRight(new HashMap<>());
-        vo.getOnlineATMPropertyRight().put("穿墙式设备",baseInfoDto.getOffATMWallDeviceCount());
-        vo.getOnlineATMPropertyRight().put("大堂式设备",baseInfoDto.getOffATMObbyDeviceCount());
+        vo.getOnlineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
+        vo.getOnlineATMPropertyRight().put("大堂式设备", baseInfoDto.getOffATMObbyDeviceCount());
 
         vo.setOfflineATMPropertyRight(new HashMap<>());
-        vo.getOfflineATMPropertyRight().put("穿墙式设备",baseInfoDto.getOffATMWallDeviceCount());
-        vo.getOfflineATMPropertyRight().put("大堂式设备",baseInfoDto.getOffATMObbyDeviceCount());
-        return  vo;
+        vo.getOfflineATMPropertyRight().put("穿墙式设备", baseInfoDto.getOffATMWallDeviceCount());
+        vo.getOfflineATMPropertyRight().put("大堂式设备", baseInfoDto.getOffATMObbyDeviceCount());
+        return vo;
     }
 
     /**
@@ -235,21 +246,41 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         return vo;
     }
 
+    @Override
+    public AppSyntheticResumptionVo syntheticResumption(Date month) {
+        return new AppSyntheticResumptionVo();
+    }
+
+    @Override
+    public AppSyntheticQuestionVo syntheticQuestion(Date month) {
+        return new AppSyntheticQuestionVo();
+    }
+
+    @Override
+    public AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month) {
+        return new AppSyntheticSafetycheckVo();
+    }
+
+    @Override
+    public AppSyntheticOtherVo syntheticOther(Date month) {
+        return new AppSyntheticOtherVo();
+    }
+
     private AppOverviewItemVo computeOverviewItem(AppOverviewTaskInfoDto dto) {
 
         AppOverviewItemVo vo = new AppOverviewItemVo();
-        if(ObjectUtil.isNull(dto)){
+        if (ObjectUtil.isNull(dto)) {
             vo.setShouldComplete(0);
             vo.setCurrentCompletedCount(0);
             vo.setCurrentCompletedRate(0F);
             vo.setCompare(0F);
-            
-            return  vo;
+
+            return vo;
         }
         vo.setCurrentCompletedCount(dto.getCompleted());
         vo.setShouldComplete(dto.getTotal());
-        vo.setCurrentCompletedRate(computeRate(dto.getTotal(),dto.getCompleted()));
-        float prevRate =computeRate(dto.getPrevTotal(),dto.getPrevCompleted());
+        vo.setCurrentCompletedRate(computeRate(dto.getTotal(), dto.getCompleted()));
+        float prevRate = computeRate(dto.getPrevTotal(), dto.getPrevCompleted());
         vo.setPrevCompletedRate(prevRate);
         vo.setCompare(vo.getCurrentCompletedRate() - prevRate);
 
@@ -266,7 +297,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
      */
     private AppOverviewItemVo computeGa38(int total, int completed, int currentCompleted, int prevCompleted) {
         AppOverviewItemVo vo = new AppOverviewItemVo();
-        vo.setCurrentCompletedRate(computeRate(total,completed));
+        vo.setCurrentCompletedRate(computeRate(total, completed));
         vo.setCompare(((float) currentCompleted) - prevCompleted);
         vo.setCurrentCompletedCount(currentCompleted);
         return vo;
@@ -274,15 +305,16 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 
     /**
      * 计算比例
+     *
      * @param total
      * @param divisor
      * @return
      */
-    private float computeRate(Integer total,Integer divisor){
+    private float computeRate(Integer total, Integer divisor) {
         if (ObjectUtil.equal(total, 0) || ObjectUtil.isNull(total)) {
             return 1F;
         } else if (ObjectUtil.equal(divisor, 0) || ObjectUtil.isNull(divisor)) {
-            return  0F;
+            return 0F;
         } else {
             return (divisor.floatValue() / total.floatValue());
         }

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

@@ -145,4 +145,22 @@
                     o.type = 4
                 OR o.type = 5)
     </select>
+    <select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">
+        SELECT
+            p.plan_type,
+            count( 0 ) AS total,
+            sum(
+                    IF
+                        ( r.STATUS = 3, 1, 0 )) AS completed,
+            sum( r.exception_count ) AS exceptionCount
+        FROM
+            core_resumption r
+                INNER JOIN core_resumption_plan p ON r.plan_id = p.id
+        WHERE
+            r.ymd_date BETWEEN #{startDate}
+                AND #{endDate}
+          AND r.org_path LIKE CONCAT( #{orgPath}, '%' )
+        GROUP BY
+            p.plan_type
+    </select>
 </mapper>