Browse Source

修复缺陷

jiawuxian 1 year ago
parent
commit
ed02be5e15

+ 4 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/panel/service/impl/PanelServiceImpl.java

@@ -99,8 +99,9 @@ public class PanelServiceImpl implements PanelService {
 
     @Override
     public List<PanelResultVo> selectPage() throws ExecutionException, InterruptedException, TimeoutException {
+        Long userId=SecurityUtils.getUserId();
         List<Long> roles = RemoteCallHandlerExecutor.executeRemoteCall(
-                () -> roleService.getUserRoleId(SecurityUtils.getUserId(), SecurityConstants.FROM_SOURCE),
+                () -> roleService.getUserRoleId(userId, SecurityConstants.FROM_SOURCE),
                 ErrorMsgConstants.QUERY_USER_ROLE_ERROR);
 
         PanelListDto panelListDto = PanelAdapter.getMapperSelectParam(SecurityUtils.getLoginUser().getOrgId(),
@@ -147,7 +148,7 @@ public class PanelServiceImpl implements PanelService {
 
         //隐患管理
         CompletableFuture<List<PanelListVo>> questionTaskFuture = CompletableFuture.supplyAsync(() ->
-                questionService.selectCurUserTaskList(panelListDto), threadPoolTaskExecutor
+                questionService.selectCurUserTaskList(panelListDto,userId), threadPoolTaskExecutor
         );
 
         //出入审批
@@ -184,6 +185,7 @@ public class PanelServiceImpl implements PanelService {
             vo.setDataList(data);
             list.add(vo);
         }
+
         return list;
 
     }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/IQuestionService.java

@@ -77,7 +77,7 @@ public interface IQuestionService extends IService<Question> {
      * @param panelListDto
      * @return
      */
-    List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto);
+    List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto,Long userId);
 
 
     WebPanelResult selectWebIndexData(PanelListDto req);

+ 14 - 10
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java

@@ -316,7 +316,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Override
     public WebPanelResult selectWebIndexData(PanelListDto req) {
         Long confirmButton = 2353L;
-        LambdaQueryWrapper<Question> wrapper = generateCurUserTaskWrapper(req, confirmButton, null, null);
+        LambdaQueryWrapper<Question> wrapper = generateCurUserTaskWrapper(req, confirmButton, null, null, SecurityUtils.getUserId());
         int waitConfirm = 0;
         if (!wrapper.isEmptyOfWhere()) {
             waitConfirm = baseMapper.selectCount(wrapper).intValue();
@@ -339,7 +339,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
      */
     @Override
     public WebPanelResult selectWebIndexData2(PanelListDto req) {
-        LambdaQueryWrapper<Question> wrapper = generateCurUserTaskWrapper(req, null, null, 2355L);
+        LambdaQueryWrapper<Question> wrapper = generateCurUserTaskWrapper(req, null, null, 2355L, SecurityUtils.getUserId());
         int waitRectification = 0;
         if (!wrapper.isEmptyOfWhere()) {
             waitRectification = baseMapper.selectCount(wrapper).intValue();
@@ -361,14 +361,14 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
      * @return
      */
     @Override
-    public List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto) {
+    public List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto, Long userId) {
         Long confirmButton = 2353L;
         Long dissentButton = 2354L;
         Long reformButton = 2355L;
-        return selectCurUserTaskList(panelListDto, confirmButton, dissentButton, reformButton);
+        return selectCurUserTaskList(panelListDto, confirmButton, dissentButton, reformButton, userId);
     }
 
-    private LambdaQueryWrapper<Question> generateCurUserTaskWrapper(PanelListDto panelListDto, Long confirmButton, Long dissentButton, Long reformButton) {
+    private LambdaQueryWrapper<Question> generateCurUserTaskWrapper(PanelListDto panelListDto, Long confirmButton, Long dissentButton, Long reformButton, Long userId) {
         LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
         List<Long> btns = new ArrayList<>();
         if (ObjectUtil.isNotNull(confirmButton)) {
@@ -385,7 +385,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             throw new ServiceException("至少需要一个按钮权限");
         }
 
-        List<Long> ownPermission = remoteUserService.checkUserPermission(btns, SecurityUtils.getUserId(), SecurityConstants.INNER);
+        if (!ObjectUtil.equal(userId, SecurityUtils.getUserId())) {
+            log.error("用户id不一致:" + userId + "-" + SecurityUtils.getUserId());
+        }
+
+        List<Long> ownPermission = remoteUserService.checkUserPermission(btns, userId, SecurityConstants.INNER);
         if (ownPermission.contains(reformButton)) {
             wrapper.or(w -> w.eq(Question::getOrgId, panelListDto.getOrgId()).eq(Question::getReformStatus, QuestionReformEnum.Unreform.getValue()));
         }
@@ -395,15 +399,15 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         }
 
         if (ownPermission.contains(dissentButton)) {
-            wrapper.or(w -> w.eq(Question::getSubmitorId, SecurityUtils.getUserId())
+            wrapper.or(w -> w.eq(Question::getSubmitorId, userId)
                     .eq(Question::getConfirmStatus, QuestionConfirmEnum.Dissent.getValue()));
         }
-
+       
         return wrapper;
     }
 
-    private List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto, Long confirmButton, Long dissentButton, Long reformButton) {
-        LambdaQueryWrapper<Question> wrapper = generateCurUserTaskWrapper(panelListDto, confirmButton, dissentButton, reformButton);
+    private List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto, Long confirmButton, Long dissentButton, Long reformButton, Long userId) {
+        LambdaQueryWrapper<Question> wrapper = generateCurUserTaskWrapper(panelListDto, confirmButton, dissentButton, reformButton, userId);
         wrapper.orderByAsc(Question::getConfirmStatus);
         if (wrapper.isEmptyOfWhere()) {
             return new ArrayList<>();

+ 9 - 9
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppRuleItemServiceImpl.java

@@ -99,13 +99,13 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
         List<Long> pointIds = appRulePointMapper.selectPointIds(item.getId());
         if (pointIds.size() > 0) {
             List<Long> idList2 = pointDtoList.stream().map(AppRulePointDto::getId).collect(Collectors.toList());
-            pointIds= pointIds.stream().filter(p->!idList2.contains(p))
+            pointIds = pointIds.stream().filter(p -> !idList2.contains(p))
                     .collect(Collectors.toList());
-            if(CollectionUtil.isNotEmpty(pointIds)){
-                Integer isUsed= appRulePointMapper.checkIsJoinResumptionPlan(pointIds);
-                if(ObjectUtil.isNotNull(isUsed)){
+            if (CollectionUtil.isNotEmpty(pointIds)) {
+                Integer isUsed = appRulePointMapper.checkIsJoinResumptionPlan(pointIds);
+                if (ObjectUtil.isNotNull(isUsed)) {
                     throw new RuntimeException("履职内容已被履职计划使用,不能删除!");
-                }else{
+                } else {
                     appRulePointMapper.deleteBatchIds(pointIds);
                 }
             }
@@ -144,12 +144,12 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
     @Override
     public TableDataInfo pageQuery(AppRuleItemPageDto itemPageDto) {
         Page<AppRuleItemPageVo> page;
-
+        String pointName = itemPageDto.getPointName();
         page = appRuleItemMapper.pageQuery(itemPageDto.getPageDto(), itemPageDto);
 //        int order = itemPageDto() * itemPageDto.getSize();
         for (AppRuleItemPageVo vo : page.getRecords()) {
 //            vo.setOrder(++order);
-            final List<AppRulePointDetailDto> pointList = appRulePointMapper.selectDataListByItemId(vo.getId(),itemPageDto.getPointName());
+            final List<AppRulePointDetailDto> pointList = appRulePointMapper.selectDataListByItemId(vo.getId(), pointName);
             vo.setPointDtoList(pointList);
         }
 
@@ -165,7 +165,7 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
         AppRuleItemDetailDto appRuleItemDto = new AppRuleItemDetailDto();
         BeanUtils.copyProperties(appRuleItem, appRuleItemDto);
 
-        List<AppRulePointDetailDto> list = appRulePointMapper.selectDataListByItemId(id,null);
+        List<AppRulePointDetailDto> list = appRulePointMapper.selectDataListByItemId(id, null);
         appRuleItemDto.setPointDtoList(list);
         return appRuleItemDto;
     }
@@ -189,7 +189,7 @@ public class AppRuleItemServiceImpl extends ServiceImpl<AppRuleItemMapper, AppRu
     @Override
     public List<RuleTreeItem> getRuleTree(Long orgId) {
         List<RuleTreeItem> tree = new ArrayList<>();
-        R<List<SysOrgVO>> r = remoteOrgService.hangsheWholePathTree(orgId,SecurityConstants.INNER);
+        R<List<SysOrgVO>> r = remoteOrgService.hangsheWholePathTree(orgId, SecurityConstants.INNER);
         if (ObjectUtil.isNull(r) || ObjectUtil.isNull(r.getData())) {
             return tree;
         }