Browse Source

获取当前行政收文流程下一节点落实人列表
在当前审核节点开始的时候就要选定

大数据与最优化研究所 5 tháng trước cách đây
mục cha
commit
2b9490412a

+ 40 - 3
src/main/java/com/xjrsoft/module/oa/service/impl/OfficialDocumentReceivedServiceImpl.java

@@ -28,6 +28,7 @@ import com.xjrsoft.module.workflow.service.IWorkflowRecordService;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -35,6 +36,8 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 /**
@@ -140,13 +143,30 @@ public class OfficialDocumentReceivedServiceImpl extends MPJBaseServiceImpl<Offi
             return new ArrayList<>();
         }
 
+        // 取出分管领导姓名
+        String message = workflowRecord.getMessage();
+
+        if(StringUtils.isEmpty(message)){
+            return new ArrayList<>();
+        }
+
+        Pattern pattern = Pattern.compile("【(.*?)】");
+        Matcher matcher = pattern.matcher(message);
+
+        if (!matcher.find()) {
+            return new ArrayList<>();
+        }
+
+        String name = matcher.group(1);
+
         // 根据当前分管领导获取其负责的部门
         MPJLambdaWrapper<Post> postMPJLambdaWrapper = new MPJLambdaWrapper<>();
         postMPJLambdaWrapper
                 .select(Post::getId)
                 .innerJoin(UserPostRelation.class, UserPostRelation::getPostId, Post::getId)
-                .eq(UserPostRelation::getUserId, workflowRecord.getCreateUserId())
-                ;
+                .innerJoin(XjrUser.class, XjrUser::getId, UserPostRelation::getUserId)
+                .eq(XjrUser::getName, name)
+        ;
         List<Post> posts = postMapper.selectJoinList(Post.class, postMPJLambdaWrapper);
         List<Long> postIds = posts.stream()
                 .map(Post::getId)
@@ -203,12 +223,29 @@ public class OfficialDocumentReceivedServiceImpl extends MPJBaseServiceImpl<Offi
             return new ArrayList<>();
         }
 
+        // 取出分管领导姓名
+        String message = workflowRecord.getMessage();
+
+        if(StringUtils.isEmpty(message)){
+            return new ArrayList<>();
+        }
+
+        Pattern pattern = Pattern.compile("【(.*?)】");
+        Matcher matcher = pattern.matcher(message);
+
+        if (!matcher.find()) {
+            return new ArrayList<>();
+        }
+
+        String name = matcher.group(1);
+
         // 根据当前主任获取其负责的部门
         MPJLambdaWrapper<Post> postMPJLambdaWrapper = new MPJLambdaWrapper<>();
         postMPJLambdaWrapper
                 .select(Post::getId)
                 .innerJoin(UserPostRelation.class, UserPostRelation::getPostId, Post::getId)
-                .eq(UserPostRelation::getUserId, workflowRecord.getCreateUserId())
+                .innerJoin(XjrUser.class, XjrUser::getId, UserPostRelation::getUserId)
+                .eq(XjrUser::getName, name)
         ;
         List<Post> posts = postMapper.selectJoinList(Post.class, postMPJLambdaWrapper);
         List<Long> postIds = posts.stream()