فهرست منبع

APP驾驶舱增加机构id参数

jiawuxian 1 سال پیش
والد
کامیت
203dab73e7

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

@@ -45,8 +45,8 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "总览", response = AppOverviewVo.class)
     @GetMapping("/overview")
-    public AjaxResult overview() throws ExecutionException, InterruptedException, TimeoutException {
-        AppOverviewVo vo = appCockpitService.overview();
+    public AjaxResult overview(Long orgId) throws ExecutionException, InterruptedException, TimeoutException {
+        AppOverviewVo vo = appCockpitService.overview(orgId);
         return success(vo);
     }
 
@@ -66,8 +66,8 @@ public class AppCockpitController extends BaseController {
     @ApiOperation(value = "基础信息")
 //    @ApiResponse(content =@Content(schema = @Schema(implementation = AppBaseInfoVo.class)))
     @GetMapping("/baseInfo")
-    public AjaxResult baseInfo() {
-        AppBaseInfoVo vo = appCockpitService.baseInfo();
+    public AjaxResult baseInfo(Long orgId) {
+        AppBaseInfoVo vo = appCockpitService.baseInfo(orgId);
         return success(vo);
     }
 
@@ -76,8 +76,8 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-履职", response = AppSyntheticResumptionVo.class)
     @GetMapping("/synthetic/resumption")
-    public AjaxResult syntheticResumption(@NotNull @Validated Date month) {
-        AppSyntheticResumptionVo vo = appCockpitService.syntheticResumption(month);
+    public AjaxResult syntheticResumption(Date month, Long orgId) {
+        AppSyntheticResumptionVo vo = appCockpitService.syntheticResumption(orgId, month);
         return success(vo);
     }
 
@@ -86,8 +86,8 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-问题整改", response = AppSyntheticQuestionVo.class)
     @GetMapping("/synthetic/question")
-    public AjaxResult syntheticQuestion(Date month) {
-        AppSyntheticQuestionVo vo = appCockpitService.syntheticQuestion(month);
+    public AjaxResult syntheticQuestion(Date month, Long orgId) {
+        AppSyntheticQuestionVo vo = appCockpitService.syntheticQuestion(orgId, month);
         return success(vo);
     }
 
@@ -96,8 +96,8 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-安全检查", response = AppSyntheticSafetycheckVo.class)
     @GetMapping("/synthetic/safetycheck")
-    public AjaxResult syntheticSafetycheck(@RequestParam @Valid Date month) {
-        AppSyntheticSafetycheckVo vo = appCockpitService.syntheticSafetyCheck(month);
+    public AjaxResult syntheticSafetycheck(Date month, Long orgId) {
+        AppSyntheticSafetycheckVo vo = appCockpitService.syntheticSafetyCheck(orgId, month);
         return success(vo);
     }
 
@@ -116,8 +116,8 @@ public class AppCockpitController extends BaseController {
      */
     @ApiOperation(value = "综合数据-其它", response = AppSyntheticOtherVo.class)
     @GetMapping("/synthetic/other")
-    public AjaxResult syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException {
-        AppSyntheticOtherVo vo = appCockpitService.syntheticOther(date);
+    public AjaxResult syntheticOther(Date date, Long orgId) throws ExecutionException, InterruptedException, TimeoutException {
+        AppSyntheticOtherVo vo = appCockpitService.syntheticOther(orgId, date);
         return success(vo);
     }
 }

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

@@ -15,4 +15,7 @@ public class AppTaskRankingDto {
 
     @ApiModelProperty(value ="月份")
     private Date month;
+
+    @ApiModelProperty("机构id")
+    private Long orgId;
 }

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

@@ -6,11 +6,12 @@ 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;
+import java.util.Date;
 
 public interface AppCockpitService {
     /**
      * 履职排名
+     *
      * @param dto
      * @return
      */
@@ -18,36 +19,41 @@ public interface AppCockpitService {
 
     /**
      * 基础信息
+     *
      * @return
      */
-    AppBaseInfoVo baseInfo() ;
+    AppBaseInfoVo baseInfo(Long orgId);
 
     /**
      * 总览
+     *
      * @return
      */
-    AppOverviewVo overview()  throws ExecutionException, InterruptedException, TimeoutException;
+    AppOverviewVo overview(Long orgId) throws ExecutionException, InterruptedException, TimeoutException;
 
     /**
      * 综合数据-履职
+     *
      * @param month
      * @return
      */
-    AppSyntheticResumptionVo syntheticResumption(Date month);
+    AppSyntheticResumptionVo syntheticResumption(Long orgId, Date month);
 
     /**
      * 综合数据-问题整改
+     *
      * @param month
      * @return
      */
-    AppSyntheticQuestionVo syntheticQuestion(Date month);
+    AppSyntheticQuestionVo syntheticQuestion(Long orgId, Date month);
 
     /**
      * 综合数据-安全检查
+     *
      * @param month
      * @return
      */
-    AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month);
+    AppSyntheticSafetycheckVo syntheticSafetyCheck(Long orgId, Date month);
 
 //    /**
 //     * 综合数据-预案演练
@@ -58,8 +64,9 @@ public interface AppCockpitService {
 
     /**
      * 综合数据-其它
+     *
      * @param date
      * @return
      */
-    AppSyntheticOtherVo syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException;
+    AppSyntheticOtherVo syntheticOther(Long orgId, Date date) throws ExecutionException, InterruptedException, TimeoutException;
 }

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

@@ -63,7 +63,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     @Override
     public List<AppTaskRankingVo> taskRanking(AppTaskRankingDto dto) {
         DateRange range = DateUtils.getStartAndEnd(dto.getMonth(), CycleCommonEnum.MONTHLY);
-        SysOrg org = remoteOrgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
+        SysOrg org =getLoginOrg(dto.getOrgId());
         String orgPath = org.getPath();
         List<TaskStatisticVo> list = cockpitMapper.resumption(range.getStartTime(), range.getEndTime(), orgPath);
 
@@ -114,8 +114,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
      * @return
      */
     @Override
-    public AppBaseInfoVo baseInfo() {
-        SysOrg org = getLoginOrg();
+    public AppBaseInfoVo baseInfo(Long orgId) {
+        SysOrg org = getLoginOrg(orgId);
 
         AppBaseInfoVo vo = new AppBaseInfoVo();
         AppOrgBaseInfoDto baseInfoDto = appCockpitMapper.selectOrgBaseInfo(org.getPath());
@@ -166,8 +166,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
      * @return
      */
     @Override
-    public AppOverviewVo overview() throws ExecutionException, InterruptedException, TimeoutException {
-        SysOrg org = getLoginOrg();
+    public AppOverviewVo overview(Long orgId) throws ExecutionException, InterruptedException, TimeoutException {
+        SysOrg org = getLoginOrg(orgId);
         AppOverviewVo vo = new AppOverviewVo();
 
         Date currentMonth = DateUtil.beginOfMonth(new Date());
@@ -241,8 +241,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     }
 
     @Override
-    public AppSyntheticResumptionVo syntheticResumption(Date month) {
-        SysOrg org = getLoginOrg();
+    public AppSyntheticResumptionVo syntheticResumption(Long orgId, Date month) {
+        SysOrg org = getLoginOrg(orgId);
         DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
         List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticResumption(org.getPath(), range.getStartTime(), range.getEndTime());
 
@@ -273,8 +273,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     }
 
     @Override
-    public AppSyntheticQuestionVo syntheticQuestion(Date month) {
-        SysOrg org = getLoginOrg();
+    public AppSyntheticQuestionVo syntheticQuestion(Long orgId, Date month) {
+        SysOrg org = getLoginOrg(orgId);
         DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
         AppSyntheticQuestionDto questionDto = appCockpitMapper.selectSyntheticQuestion(org.getPath(), range.getStartTime(), range.getEndTime());
         int overdueCount = appCockpitMapper.selectOverDueQuestionCount(org.getPath(), range.getStartTime(), range.getEndTime());
@@ -307,8 +307,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     }
 
     @Override
-    public AppSyntheticSafetycheckVo syntheticSafetyCheck(Date month) {
-        SysOrg org = getLoginOrg();
+    public AppSyntheticSafetycheckVo syntheticSafetyCheck(Long orgId, Date month) {
+        SysOrg org = getLoginOrg(orgId);
         DateRange range = DateUtils.getStartAndEnd(month, CycleCommonEnum.MONTHLY);
         List<AppSyntheticTaskCategoryDto> taskCategoryDtos = appCockpitMapper.selectSyntheticSafetyCheck(org.getPath(), range.getStartTime(), range.getEndTime());
 
@@ -385,8 +385,8 @@ public class AppCockpitServiceImpl implements AppCockpitService {
 //    }
 
     @Override
-    public AppSyntheticOtherVo syntheticOther(Date date) throws ExecutionException, InterruptedException, TimeoutException {
-        SysOrg org = getLoginOrg();
+    public AppSyntheticOtherVo syntheticOther(Long orgId, Date date) throws ExecutionException, InterruptedException, TimeoutException {
+        SysOrg org = getLoginOrg(orgId);
         DateRange range = DateUtils.getStartAndEnd(date, CycleCommonEnum.QUARTERLY);
         CompletableFuture<AppSyntheticTaskCategoryDto> edu = CompletableFuture.supplyAsync(() ->
                 appCockpitMapper.selectSyntheticEdu(org.getPath(), range.getStartTime(), range.getEndTime()), threadPoolTaskExecutor
@@ -403,7 +403,7 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         );
 
         CompletableFuture<Void> allQueries = CompletableFuture.allOf(
-                inout, edu,drill, monitor
+                inout, edu, drill, monitor
         );
 
         allQueries.get(TIMEOUT, TimeUnit.SECONDS);
@@ -451,8 +451,11 @@ public class AppCockpitServiceImpl implements AppCockpitService {
     }
 
 
-    private SysOrg getLoginOrg() {
-        SysOrg org = remoteOrgService.selectOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
+    private SysOrg getLoginOrg(Long orgId) {
+        if (ObjectUtil.isNull(orgId)) {
+            orgId = SecurityUtils.getLoginUser().getOrgId();
+        }
+        SysOrg org = remoteOrgService.selectOrgById(orgId, SecurityConstants.INNER);
         if (ObjectUtil.isNull(org)) {
             throw new ServiceException("未获取到登录机构");
         }