Browse Source

12709 -【CR】【投资系统】所有流程如果申请人和部门负责人相同跳过部门负责人

hxy 2 days ago
parent
commit
bd3dd8dcc0
18 changed files with 412 additions and 48 deletions
  1. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ApprovalController.java
  2. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/DecisionController.java
  3. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/InvestigateController.java
  4. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/InvestmentOpportunityController.java
  5. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/TerminationController.java
  6. 1 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IApprovalService.java
  7. 1 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IDecisionService.java
  8. 1 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IInvestigateService.java
  9. 1 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IInvestmentOpportunityService.java
  10. 1 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/ITerminationService.java
  11. 71 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/ApprovalServiceImpl.java
  12. 81 3
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/DecisionServiceImpl.java
  13. 71 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/InvestigateServiceImpl.java
  14. 71 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/InvestmentOpportunityServiceImpl.java
  15. 66 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/TerminationServiceImpl.java
  16. 21 19
      ruoyi-ui/src/views/project/decision/audit.vue
  17. 19 10
      ruoyi-ui/src/views/project/investigate/audit.vue
  18. 2 2
      ruoyi-ui/src/views/project/investigate/detail.vue

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ApprovalController.java

@@ -281,7 +281,7 @@ public class ApprovalController extends BaseController {
     }
     @ApiOperation(value = "审批任务")
     @PutMapping(value = "/complete")
-    public AjaxResult complete(@RequestBody ApprovalDto dto, HttpServletRequest request) {
+    public AjaxResult complete(@RequestBody ApprovalDto dto, HttpServletRequest request) throws Exception  {
         // 从 DTO 中拆分参数
         TProjectApproval tProjectApproval = dto.getProjectApproval();
         TProjectMeeting tProjectMeeting = dto.getProjectMeeting();

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/DecisionController.java

@@ -279,7 +279,7 @@ public class DecisionController extends BaseController {
     }
     @ApiOperation(value = "审批任务")
     @PutMapping(value = "/complete")
-    public AjaxResult complete(@RequestBody DecisionDto dto, HttpServletRequest request) {
+    public AjaxResult complete(@RequestBody DecisionDto dto, HttpServletRequest request)  throws Exception {
         // 从 DTO 中拆分参数
         TProjectDecision tProjectDecision= dto.getProjectDecision();
         TProjectMeeting tProjectMeeting = dto.getProjectMeeting();

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/InvestigateController.java

@@ -280,7 +280,7 @@ public class InvestigateController extends BaseController {
     }
     @ApiOperation(value = "审批任务")
     @PutMapping(value = "/complete")
-    public AjaxResult complete(@RequestBody InvestigateDto dto, HttpServletRequest request) {
+    public AjaxResult complete(@RequestBody InvestigateDto dto, HttpServletRequest request) throws Exception {
         // 从 DTO 中拆分参数
         TProjectInvestigate tProjectInvestigate= dto.getProjectInvestigate();
         TProjectInvestigatePerson tProjectInvestigatePerson = dto.getProjectInvestigatePerson();

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/InvestmentOpportunityController.java

@@ -266,7 +266,7 @@ public class InvestmentOpportunityController extends BaseController
 
     @ApiOperation(value = "审批任务")
     @PutMapping(value = "/complete")
-    public AjaxResult complete(@RequestBody InvestDto dto, HttpServletRequest request) {
+    public AjaxResult complete(@RequestBody InvestDto dto, HttpServletRequest request) throws Exception  {
         // 从 DTO 中拆分参数
         TProjectPool tProjectPool = dto.getProjectPool();
         TProjectReview tProjectReview = dto.getProjectReview();

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/TerminationController.java

@@ -228,7 +228,7 @@ public class TerminationController extends BaseController {
     }
     @ApiOperation(value = "审批任务")
     @PutMapping(value = "/complete")
-    public AjaxResult complete(@RequestBody TerminationDto dto, HttpServletRequest request) {
+    public AjaxResult complete(@RequestBody TerminationDto dto, HttpServletRequest request) throws Exception  {
         // 从 DTO 中拆分参数
         TProjectTermination tProjectTermination= dto.getProjectTermination();
         FlowBaseInfo flowBaseInfo= dto.getFlowBaseInfo();

+ 1 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IApprovalService.java

@@ -31,7 +31,7 @@ public interface IApprovalService
      */
 
     AjaxResult start(TProjectApproval tProjectApproval);
-    AjaxResult complete(TProjectApproval tProjectApproval, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow, HttpServletRequest request);
+    AjaxResult complete(TProjectApproval tProjectApproval, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow, HttpServletRequest request) throws Exception ;
 
     TProjectMeeting selectTProjectMeetingByProcInstId(String pInstId);
 

+ 1 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IDecisionService.java

@@ -31,7 +31,7 @@ public interface IDecisionService
      */
 
     AjaxResult start(TProjectDecision tProjectDecision);
-    AjaxResult complete(TProjectDecision tProjectDecision, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow, HttpServletRequest request);
+    AjaxResult complete(TProjectDecision tProjectDecision, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow, HttpServletRequest request) throws Exception ;
 
     TProjectMeeting selectTProjectMeetingByProcInstId(String pInstId);
 

+ 1 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IInvestigateService.java

@@ -30,7 +30,7 @@ public interface IInvestigateService
      */
 
     AjaxResult start(TProjectInvestigate tProjectInvestigate);
-    AjaxResult complete(TProjectInvestigate tProjectInvestigate, TProjectInvestigatePerson tProjectInvestigatePerson, FlowBaseInfo flow, HttpServletRequest request);
+    AjaxResult complete(TProjectInvestigate tProjectInvestigate, TProjectInvestigatePerson tProjectInvestigatePerson, FlowBaseInfo flow, HttpServletRequest request) throws Exception ;
 
     TProjectMeeting selectTProjectMeetingByProcInstId(String pInstId);
 

+ 1 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IInvestmentOpportunityService.java

@@ -29,7 +29,7 @@ public interface IInvestmentOpportunityService
     TProjectPool selectTProjectPoolByProcInstId(String pInstId);
 
     AjaxResult start(TProjectPool tProjectPool);
-    AjaxResult complete(TProjectPool tProjectPool, TProjectReview tProjectReview, FlowBaseInfo flow, HttpServletRequest request);
+    AjaxResult complete(TProjectPool tProjectPool, TProjectReview tProjectReview, FlowBaseInfo flow, HttpServletRequest request) throws Exception ;
 
 
 

+ 1 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/ITerminationService.java

@@ -30,7 +30,7 @@ public interface ITerminationService
      */
 
     AjaxResult start(TProjectTermination tProjectTermination);
-    AjaxResult complete(TProjectTermination tProjectTermination, FlowBaseInfo flow, HttpServletRequest request);
+    AjaxResult complete(TProjectTermination tProjectTermination, FlowBaseInfo flow, HttpServletRequest request) throws Exception ;
 
     TProjectMeeting selectTProjectMeetingByProcInstId(String pInstId);
 

+ 71 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/ApprovalServiceImpl.java

@@ -202,6 +202,9 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
                     tProjectPool.setProjectState("d");//项目状态-项目立项
                     tProjectPool.setProjectStatus("0");//项目机会状态-正常
                     tProjectPoolService.updateTProjectPool(tProjectPool);
+                    if(flowBaseInfo.isFlag()){
+                        getAssignee(tProjectApproval,flowBaseInfo);
+                    }
                     //todo 短信
                     //sendMessage(flowBaseInfo,"");
                     return AjaxResult.success();
@@ -220,7 +223,7 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
 
     }
     @Override
-    public AjaxResult complete(TProjectApproval tProjectApproval, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow,HttpServletRequest request){
+    public AjaxResult complete(TProjectApproval tProjectApproval, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow,HttpServletRequest request) throws Exception {
         //Task task=taskService.createTaskQuery().processInstanceId(tProjectApproval.getProcInstId()).singleResult();
         Task task = taskService.createTaskQuery().taskId(flow.getTaskId()).singleResult();
         if (Objects.isNull(task)) {
@@ -445,6 +448,9 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
             }
             tProjectApprovalService.updateTProjectApproval(tProjectApproval);
             activitiBaseInfoService.addActivitiBaseInfo(flow);
+            if(flow.isFlag()){
+                getAssignee(tProjectApproval,flow);
+            }
             // todo 短信提醒
             //sendMessage(flow,result);
         }
@@ -563,4 +569,68 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
 
         }
     }
+    /**
+     * 跳节点
+     * @param projectApproval
+     * @param flow
+     * @throws Exception
+     */
+    public void getAssignee(TProjectApproval projectApproval, FlowBaseInfo flow) throws Exception {
+        SysUser sysUser=SecurityUtils.getLoginUser().getUser();//当前登陆人
+        if (sysUser == null) {
+            sysUser=sysUserService.selectUserById(Long.parseLong(projectApproval.getCreateBy()));
+        }
+        //Task task = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).singleResult();
+        List<Task> tasks = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        Long userId=sysUser.getUserId();
+        for(int i = 0; i < tasks.size(); i++) {
+            Task task = tasks.get(i);
+            if (task == null || StringUtils.isBlank(task.getAssignee())) {
+                return;
+            }
+            Long assignee = Long.parseLong(task.getAssignee());
+            if ("deptLeader".equals(task.getTaskDefinitionKey()) && (userId.equals(assignee) || projectApproval.getCreateBy().equals(assignee))) {
+                JumpNode(projectApproval, flow);
+            }
+        }
+    }
+    public Map<String, Object> JumpNode(TProjectApproval projectApproval, FlowBaseInfo flow) throws Exception{
+        List<Task> list = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        String taskId=null;
+        Map<String, Object> rs = new HashMap<String, Object>();
+        rs.put("status",true);
+        if (list.size()>0) {
+            taskId = list.get(0).getId();
+            flow.setTaskId(taskId);
+            boolean flag = flow.isFlag();
+            //当前流程节点Id信息
+//            ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(flow.getProcInsId()).singleResult();
+//            String activitiId = execution.getActivityId();
+            Map<String, Object> formProperties = new HashMap<>();
+            formProperties.put("auditPass", flow.isFlag());
+            //投资部负责人
+            String leader=sysDeptMapper.selectDeptLeader("投资部");
+            formProperties.put("MANAGER",sysUserService.selectUserByUserName(leader).getUserId());
+            if(StringUtils.isNotBlank(projectApproval.getIsTerminate())) {//不为空代表结束流程
+                formProperties.put("whetherToEnd", true);
+            }else{
+                formProperties.put("whetherToEnd", false);
+            }
+            //当前登陆人
+            Long userId=SecurityUtils.getUserId();
+            try {
+                //表单审核
+                rs = flowService.taskComplete(taskId, flag, formProperties, userId.toString());
+            } catch (Exception e) {
+                e.printStackTrace();
+                rs.put("status", false);
+                rs.put("msg", "流程审批失败");
+            }
+            if (flow.isFlag()){
+                getAssignee(projectApproval,flow);
+            }
+
+        }
+        return rs;
+    }
 }

+ 81 - 3
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/DecisionServiceImpl.java

@@ -200,6 +200,9 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
                     tProjectPool.setProjectState("h");//项目状态-准备项目投决材料
                     tProjectPool.setProjectStatus("0");//项目机会状态-正常
                     tProjectPoolService.updateTProjectPool(tProjectPool);
+                    if(flowBaseInfo.isFlag()){
+                        getAssignee(tProjectDecision,flowBaseInfo);
+                    }
                     // todo 短信
                     //sendMessage(flowBaseInfo,"");
                     return AjaxResult.success();
@@ -218,7 +221,7 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
 
     }
     @Override
-    public AjaxResult complete(TProjectDecision tProjectDecision, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow,HttpServletRequest request){
+    public AjaxResult complete(TProjectDecision tProjectDecision, TProjectMeeting tProjectMeeting,TProjectScoring tProjectScoring, FlowBaseInfo flow,HttpServletRequest request) throws Exception {
         //Task task=taskService.createTaskQuery().processInstanceId(tProjectApproval.getProcInstId()).singleResult();
         Task task = taskService.createTaskQuery().taskId(flow.getTaskId()).singleResult();
         if (Objects.isNull(task)) {
@@ -231,7 +234,7 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
         Map<String, Object> formProperties = new HashMap<>();
         formProperties.put("auditPass", tProjectDecision.isFlag());
         //会议投决人
-        if("meeting".equals(task.getTaskDefinitionKey())) {
+        if("meeting".equals(task.getTaskDefinitionKey())&&tProjectDecision.isFlag()) {
             //立项审批人
             List<String> userIds = Arrays.asList(tProjectDecision.getParticipantsId().split(","));
             //List<String> userIds = Arrays.asList(tProjectMeeting.getParticipantsId().split(","));//会议人
@@ -270,7 +273,7 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
                         userInfo.getNickName(), "k", "5");
             }
             //发起会议
-            if ("meeting".equals(task.getTaskDefinitionKey())) {
+            if ("meeting".equals(task.getTaskDefinitionKey())&&tProjectDecision.isFlag()) {
                 tProjectMeeting.setId(IdUtils.fastSimpleUUID());
                 tProjectMeeting.setCreateBy(userInfo.getNickName());
                 tProjectMeeting.setProjectPoolId(tProjectDecision.getProjectPoolId());
@@ -403,6 +406,9 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
 
             tProjectDecisionService.updateTProjectDecision(tProjectDecision);
             activitiBaseInfoService.addActivitiBaseInfo(flow);
+            if(flow.isFlag()){
+                getAssignee(tProjectDecision,flow);
+            }
             //todo 短信
             //sendMessage(flow,result);
         }
@@ -520,4 +526,76 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
         }
     }
 
+    /**
+     * 跳节点
+     * @param projectDecision
+     * @param flow
+     * @throws Exception
+     */
+    public void getAssignee(TProjectDecision projectDecision, FlowBaseInfo flow) throws Exception {
+        SysUser sysUser=SecurityUtils.getLoginUser().getUser();//当前登陆人
+        if (sysUser == null) {
+            sysUser=sysUserService.selectUserById(Long.parseLong(projectDecision.getCreateBy()));
+        }
+        List<Task> tasks = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        Long userId=sysUser.getUserId();
+        for(int i = 0; i < tasks.size(); i++) {
+            Task task = tasks.get(i);
+            if (task == null || StringUtils.isBlank(task.getAssignee())) {
+                return;
+            }
+            Long assignee = Long.parseLong(task.getAssignee());
+            if ("deptLeader".equals(task.getTaskDefinitionKey()) && (userId.equals(assignee) || projectDecision.getCreateBy().equals(assignee))) {
+                JumpNode(projectDecision, flow);
+            }
+        }
+    }
+    public Map<String, Object> JumpNode(TProjectDecision projectDecision, FlowBaseInfo flow) throws Exception{
+        List<Task> list = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        String taskId=null;
+        Map<String, Object> rs = new HashMap<String, Object>();
+        rs.put("status",true);
+        if (list.size()>0) {
+            taskId = list.get(0).getId();
+            Task task=list.get(0);
+            flow.setTaskId(taskId);
+            boolean flag = flow.isFlag();
+            //当前流程节点Id信息
+//            ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(flow.getProcInsId()).singleResult();
+//            String activitiId = execution.getActivityId();
+            Map<String, Object> formProperties = new HashMap<>();
+            formProperties.put("auditPass", flow.isFlag());
+            //部门负责人
+            String leader=sysDeptMapper.selectDeptLeader("投资部");
+            SysUser sysUser=sysUserService.selectUserByUserName(leader);
+            formProperties.put("MANAGER",sysUser.getUserId());
+            //会议投决人
+            if("meeting".equals(task.getTaskDefinitionKey())) {
+                //立项审批人
+                List<String> userIds = Arrays.asList(projectDecision.getParticipantsId().split(","));
+                formProperties.put("decisionList", userIds);
+            }
+            if(StringUtils.isNotBlank(projectDecision.getIsTerminate())) {//不为空代表结束流程
+                formProperties.put("whetherToEnd", true);
+            }else{
+                formProperties.put("whetherToEnd", false);
+            }
+            //当前登陆人
+            Long userId=SecurityUtils.getUserId();
+            try {
+                //表单审核
+                rs = flowService.taskComplete(taskId, flag, formProperties, userId.toString());
+            } catch (Exception e) {
+                e.printStackTrace();
+                rs.put("status", false);
+                rs.put("msg", "流程审批失败");
+            }
+            if (flow.isFlag()){
+                getAssignee(projectDecision,flow);
+            }
+
+        }
+        return rs;
+    }
+
 }

+ 71 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/InvestigateServiceImpl.java

@@ -191,6 +191,9 @@ public class InvestigateServiceImpl extends FlowServiceFactory implements IInves
                     tProjectPool.setProjectState("f");//项目状态-尽职背调
                     tProjectPool.setProjectStatus("0");//项目机会状态-正常
                     tProjectPoolService.updateTProjectPool(tProjectPool);
+                    if(flowBaseInfo.isFlag()){
+                        getAssignee(tProjectInvestigate,flowBaseInfo);
+                    }
                     //todo 短信
                     //sendMessage(flowBaseInfo,"");
                     return AjaxResult.success();
@@ -209,7 +212,7 @@ public class InvestigateServiceImpl extends FlowServiceFactory implements IInves
 
     }
     @Override
-    public AjaxResult complete(TProjectInvestigate tProjectInvestigate, TProjectInvestigatePerson tProjectInvestigatePerson, FlowBaseInfo flow,HttpServletRequest request){
+    public AjaxResult complete(TProjectInvestigate tProjectInvestigate, TProjectInvestigatePerson tProjectInvestigatePerson, FlowBaseInfo flow,HttpServletRequest request) throws Exception {
         //Task task=taskService.createTaskQuery().processInstanceId(tProjectApproval.getProcInstId()).singleResult();
         Task task = taskService.createTaskQuery().taskId(flow.getTaskId()).singleResult();
         if (Objects.isNull(task)) {
@@ -370,6 +373,9 @@ public class InvestigateServiceImpl extends FlowServiceFactory implements IInves
 
             tProjectInvestigateService.updateTProjectInvestigate(tProjectInvestigate);
             activitiBaseInfoService.addActivitiBaseInfo(flow);
+            if(flow.isFlag()){
+                getAssignee(tProjectInvestigate,flow);
+            }
             // todo 短信
             //sendMessage(flow,result);
         }
@@ -486,5 +492,69 @@ public class InvestigateServiceImpl extends FlowServiceFactory implements IInves
 
         }
     }
+    /**
+     * 跳节点
+     * @param projectInvestigate
+     * @param flow
+     * @throws Exception
+     */
+    public void getAssignee(TProjectInvestigate projectInvestigate, FlowBaseInfo flow) throws Exception {
+        SysUser sysUser=SecurityUtils.getLoginUser().getUser();//当前登陆人
+        if (sysUser == null) {
+            sysUser=sysUserService.selectUserById(Long.parseLong(projectInvestigate.getCreateBy()));
+        }
+        List<Task> tasks = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        Long userId=sysUser.getUserId();
+        for(int i = 0; i < tasks.size(); i++) {
+            Task task = tasks.get(i);
+            if (task == null || StringUtils.isBlank(task.getAssignee())) {
+                return;
+            }
+            Long assignee = Long.parseLong(task.getAssignee());
+            if ("deptLeader".equals(task.getTaskDefinitionKey()) && (userId.equals(assignee) || projectInvestigate.getCreateBy().equals(assignee))) {
+                JumpNode(projectInvestigate, flow);
+            }
+        }
+    }
+    public Map<String, Object> JumpNode(TProjectInvestigate projectInvestigate, FlowBaseInfo flow) throws Exception{
+        List<Task> list = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        String taskId=null;
+        Map<String, Object> rs = new HashMap<String, Object>();
+        rs.put("status",true);
+        if (list.size()>0) {
+            taskId = list.get(0).getId();
+            flow.setTaskId(taskId);
+            boolean flag = flow.isFlag();
+            //当前流程节点Id信息
+//            ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(flow.getProcInsId()).singleResult();
+//            String activitiId = execution.getActivityId();
+            Map<String, Object> formProperties = new HashMap<>();
+            formProperties.put("auditPass", flow.isFlag());
+            //部门负责人
+            String leader=sysDeptMapper.selectDeptLeader("投资部");
+            SysUser sysUser=sysUserService.selectUserByUserName(leader);
+            formProperties.put("MANAGER",sysUser.getUserId());
+            if(StringUtils.isNotBlank(projectInvestigate.getIsTerminate())) {//不为空代表结束流程
+                formProperties.put("whetherToEnd", true);
+            }else{
+                formProperties.put("whetherToEnd", false);
+            }
+            //当前登陆人
+            Long userId=SecurityUtils.getUserId();
+            try {
+                //表单审核
+                rs = flowService.taskComplete(taskId, flag, formProperties, userId.toString());
+            } catch (Exception e) {
+                e.printStackTrace();
+                rs.put("status", false);
+                rs.put("msg", "流程审批失败");
+            }
+            if (flow.isFlag()){
+                getAssignee(projectInvestigate,flow);
+            }
+
+        }
+        return rs;
+    }
 
 }

+ 71 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/InvestmentOpportunityServiceImpl.java

@@ -217,6 +217,9 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
                     flowBaseInfo.setStatus(FlowStatusEnum.STARTED.getName());
                     flowBaseInfo.setFlag(tProjectPool.isFlag());
                     activitiBaseInfoService.addActivitiBaseInfo(flowBaseInfo);
+                    if (flowBaseInfo.isFlag()) {
+                        getAssignee(tProjectPool, flowBaseInfo);
+                    }
                     //todo 短信
                     //sendMessage(flowBaseInfo,"");
                     return AjaxResult.success();
@@ -235,7 +238,7 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
 
     }
     @Override
-    public AjaxResult complete(TProjectPool tProjectPool, TProjectReview tProjectReview, FlowBaseInfo flow,HttpServletRequest request){
+    public AjaxResult complete(TProjectPool tProjectPool, TProjectReview tProjectReview, FlowBaseInfo flow,HttpServletRequest request) throws Exception {
         Task task=taskService.createTaskQuery().processInstanceId(tProjectPool.getProcInstId()).singleResult();
         //Task task = taskService.createTaskQuery().taskId(taskVo.getId()).singleResult();
         if (Objects.isNull(task)) {
@@ -385,6 +388,9 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
 
             tProjectPoolService.updateTProjectPool(tProjectPool);
             activitiBaseInfoService.addActivitiBaseInfo(flow);
+            if(flow.isFlag()){
+                getAssignee(tProjectPool,flow);
+            }
             //todo 短信
             //sendMessage(flow,result);
         }
@@ -475,5 +481,69 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
 
         }
     }
+    /**
+     * 跳节点
+     * @param projectPool
+     * @param flow
+     * @throws Exception
+     */
+    public void getAssignee(TProjectPool projectPool, FlowBaseInfo flow) throws Exception {
+        SysUser sysUser=SecurityUtils.getLoginUser().getUser();//当前登陆人
+        if (sysUser == null) {
+            sysUser=sysUserService.selectUserById(Long.parseLong(projectPool.getCreateBy()));
+        }
+        List<Task> tasks = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        Long userId=sysUser.getUserId();
+        for(int i = 0; i < tasks.size(); i++) {
+            Task task = tasks.get(i);
+            if (task == null || StringUtils.isBlank(task.getAssignee())) {
+                return;
+            }
+            Long assignee = Long.parseLong(task.getAssignee());
+            if ("deptLeader".equals(task.getTaskDefinitionKey()) && (userId.equals(assignee) || projectPool.getCreateBy().equals(assignee))) {
+                JumpNode(projectPool, flow);
+            }
+        }
+    }
+    public Map<String, Object> JumpNode(TProjectPool projectPool, FlowBaseInfo flow) throws Exception{
+        List<Task> list = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        String taskId=null;
+        Map<String, Object> rs = new HashMap<String, Object>();
+        rs.put("status",true);
+        if (list.size()>0) {
+            taskId = list.get(0).getId();
+            flow.setTaskId(taskId);
+            boolean flag = flow.isFlag();
+            //当前流程节点Id信息
+//            ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(flow.getProcInsId()).singleResult();
+//            String activitiId = execution.getActivityId();
+            Map<String, Object> formProperties = new HashMap<>();
+            formProperties.put("auditPass", flow.isFlag());
+            //部门负责人
+            String leader=sysDeptMapper.selectDeptLeader("投资部");
+            SysUser sysUser=sysUserService.selectUserByUserName(leader);
+            formProperties.put("MANAGER",sysUser.getUserId());
+            if(StringUtils.isNotBlank(projectPool.getIsTerminate())) {//不为空代表结束流程
+                formProperties.put("whetherToEnd", true);
+            }else{
+                formProperties.put("whetherToEnd", false);
+            }
+            //当前登陆人
+            Long userId=SecurityUtils.getUserId();
+            try {
+                //表单审核
+                rs = flowService.taskComplete(taskId, flag, formProperties, userId.toString());
+            } catch (Exception e) {
+                e.printStackTrace();
+                rs.put("status", false);
+                rs.put("msg", "流程审批失败");
+            }
+            if (flow.isFlag()){
+                getAssignee(projectPool,flow);
+            }
+
+        }
+        return rs;
+    }
 
 }

+ 66 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/TerminationServiceImpl.java

@@ -181,6 +181,9 @@ public class TerminationServiceImpl extends FlowServiceFactory implements ITermi
 //                    tProjectPool.setProjectStage("8");//项目阶段-项目终止
 //                    tProjectPool.setProjectState("o");//项目状态-项目终止
                     tProjectPoolService.updateTProjectPool(tProjectPool);
+                    if(flowBaseInfo.isFlag()){
+                        getAssignee(tProjectTermination,flowBaseInfo);
+                    }
                     // todo 短信
                     //sendMessage(flowBaseInfo);
                     return AjaxResult.success();
@@ -199,7 +202,7 @@ public class TerminationServiceImpl extends FlowServiceFactory implements ITermi
 
     }
     @Override
-    public AjaxResult complete(TProjectTermination tProjectTermination, FlowBaseInfo flow,HttpServletRequest request){
+    public AjaxResult complete(TProjectTermination tProjectTermination, FlowBaseInfo flow,HttpServletRequest request) throws Exception {
         //Task task=taskService.createTaskQuery().processInstanceId(tProjectApproval.getProcInstId()).singleResult();
         Task task = taskService.createTaskQuery().taskId(flow.getTaskId()).singleResult();
         if (Objects.isNull(task)) {
@@ -270,6 +273,9 @@ public class TerminationServiceImpl extends FlowServiceFactory implements ITermi
             tProjectTermination.setUpdateTime(DateUtils.getNowDate());
             terminationMapper.updateTProjectTermination(tProjectTermination);
             activitiBaseInfoService.addActivitiBaseInfo(flow);
+            if(flow.isFlag()){
+                getAssignee(tProjectTermination,flow);
+            }
             //todo 短信
             //sendMessage(flow);
         }
@@ -379,4 +385,63 @@ public class TerminationServiceImpl extends FlowServiceFactory implements ITermi
             }
         }
     }
+    /**
+     * 跳节点
+     * @param projectTermination
+     * @param flow
+     * @throws Exception
+     */
+    public void getAssignee(TProjectTermination projectTermination, FlowBaseInfo flow) throws Exception {
+        SysUser sysUser=SecurityUtils.getLoginUser().getUser();//当前登陆人
+        if (sysUser == null) {
+            sysUser=sysUserService.selectUserById(Long.parseLong(projectTermination.getCreateBy()));
+        }
+        List<Task> tasks = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        Long userId=sysUser.getUserId();
+        for(int i = 0; i < tasks.size(); i++) {
+            Task task = tasks.get(i);
+            if (task == null || StringUtils.isBlank(task.getAssignee())) {
+                return;
+            }
+            Long assignee = Long.parseLong(task.getAssignee());
+            if ("deptLeader".equals(task.getTaskDefinitionKey()) && (userId.equals(assignee) || projectTermination.getCreateBy().equals(assignee))) {
+                JumpNode(projectTermination, flow);
+            }
+        }
+    }
+    public Map<String, Object> JumpNode(TProjectTermination projectTermination, FlowBaseInfo flow) throws Exception{
+        List<Task> list = taskService.createTaskQuery().processInstanceId(flow.getProcInsId()).list();
+        String taskId=null;
+        Map<String, Object> rs = new HashMap<String, Object>();
+        rs.put("status",true);
+        if (list.size()>0) {
+            taskId = list.get(0).getId();
+            flow.setTaskId(taskId);
+            boolean flag = flow.isFlag();
+            //当前流程节点Id信息
+//            ExecutionEntity execution = (ExecutionEntity) runtimeService.createProcessInstanceQuery().processInstanceId(flow.getProcInsId()).singleResult();
+//            String activitiId = execution.getActivityId();
+            Map<String, Object> formProperties = new HashMap<>();
+            formProperties.put("auditPass", flow.isFlag());
+            //部门负责人
+            String leader=sysDeptMapper.selectDeptLeader("投资部");
+            SysUser sysUser=sysUserService.selectUserByUserName(leader);
+            formProperties.put("MANAGER",sysUser.getUserId());
+            //当前登陆人
+            Long userId=SecurityUtils.getUserId();
+            try {
+                //表单审核
+                rs = flowService.taskComplete(taskId, flag, formProperties, userId.toString());
+            } catch (Exception e) {
+                e.printStackTrace();
+                rs.put("status", false);
+                rs.put("msg", "流程审批失败");
+            }
+            if (flow.isFlag()){
+                getAssignee(projectTermination,flow);
+            }
+
+        }
+        return rs;
+    }
 }

+ 21 - 19
ruoyi-ui/src/views/project/decision/audit.vue

@@ -1845,31 +1845,33 @@ export default {
     /** 用户审批任务 */
     taskComplete(flag,isTerminate) {
       let allValid = true;
-      if(this.formTJApply.taskDefKey==="meeting") {//发起会议节点
-        this.formTJApply.listFile = this.fileListTJApply;
-        this.meetingForm.listFile = this.fileList;
-        if (!this.formTJApply.participants) {
-          this.$modal.msgError("请选择立项审批人!");
-          return;
-        }
-        if (this.formTJApply.needMeeting==='1') {
-          this.$refs["meetingForm"].validate((valid) => {
+      if(flag) {
+        if (this.formTJApply.taskDefKey === "meeting") {//发起会议节点
+          this.formTJApply.listFile = this.fileListTJApply;
+          this.meetingForm.listFile = this.fileList;
+          if (!this.formTJApply.participants) {
+            this.$modal.msgError("请选择立项审批人!");
+            return;
+          }
+          if (this.formTJApply.needMeeting === '1') {
+            this.$refs["meetingForm"].validate((valid) => {
+              if (!valid) {
+                allValid = false;
+                return;
+              }
+            })
+          }
+        } else if (this.formTJApply.taskDefKey === "decision") {//会议投决
+          this.$refs["scoreForm"].validate((valid) => {
             if (!valid) {
               allValid = false;
+              // 4. 评审表校验失败:切换标签 + 提示
+              this.activeTab = 'review'; // 切换到评审表标签
+              this.$message.error('项目投决评估评审表未填写完整,请检查!');
               return;
             }
           })
         }
-      }else if(this.formTJApply.taskDefKey==="decision"){//会议投决
-        this.$refs["scoreForm"].validate((valid) => {
-          if (!valid) {
-            allValid = false;
-            // 4. 评审表校验失败:切换标签 + 提示
-            this.activeTab = 'review'; // 切换到评审表标签
-            this.$message.error('项目投决评估评审表未填写完整,请检查!');
-            return;
-          }
-        })
       }
       if (!flag&&!this.flowBaseInfo.comment) {
         this.$modal.msgError("请输入审批意见!");

+ 19 - 10
ruoyi-ui/src/views/project/investigate/audit.vue

@@ -198,7 +198,7 @@
                 </el-form-item>
               </el-form>
             </el-tab-pane>
-            <el-tab-pane label="项目投决评估评审汇总表"  v-if="dueForm.taskDefKey==='confirm'||dueForm.taskDefKey=='president'" name="review">
+<!--            <el-tab-pane label="项目投决评估评审汇总表"  v-if="dueForm.taskDefKey==='confirm'||dueForm.taskDefKey=='president'" name="review">
               <div v-if="dueAllPeportList.length > 0">
                 <el-form
                   v-for="(item, index) in dueAllPeportList"
@@ -217,7 +217,7 @@
                       @getFileList="getreportFileList"
                     ></fileItem>
                   </el-form-item>
-<!--                  <el-form-item label="备注" class="special-el-form-item">
+&lt;!&ndash;                  <el-form-item label="备注" class="special-el-form-item">
                     <el-input
                       disabled
                       rows="4"
@@ -225,7 +225,7 @@
                       v-model="item.remark"
                       placeholder="请输入备注"
                     />
-                  </el-form-item>-->
+                  </el-form-item>&ndash;&gt;
                   <el-divider></el-divider>
                 </el-form>
               </div>
@@ -236,7 +236,7 @@
               >
                 暂无数据
               </div>
-            </el-tab-pane>
+            </el-tab-pane>-->
           </el-tabs>
         </div>
         <div v-show="activeName === '1'">
@@ -477,13 +477,22 @@ export default {
             if(response.data.taskDefKey==='president') {
               this.$refs.financeFileItem.handleButton();
               this.$refs.legalFileItem.handleButton();
+              //财务评估报告
+              this.$refs.financeFileItem.fileList = [];
+              this.$refs.financeFileItem.getListFileBusinessId(that.dueForm.id, "14");
+              //法务评估报告
+              this.$refs.legalFileItem.fileList = [];
+              this.$refs.legalFileItem.getListFileBusinessId(that.dueForm.id, "15");
+            }
+            if(response.data.taskDefKey==='approve') {
+              if (this.user.dept.deptName.indexOf('财务')>-1) {
+                this.$refs.assessFileItem.fileList = [];
+                this.$refs.assessFileItem.getListFileBusinessId(that.dueForm.id, "14");
+              }else{
+                this.$refs.assessFileItem.fileList = [];
+                this.$refs.assessFileItem.getListFileBusinessId(that.dueForm.id, "15");
+              }
             }
-            //项目行研报告
-            this.$refs.financeFileItem.fileList = [];
-            this.$refs.financeFileItem.getListFileBusinessId(that.dueForm.id, "14");
-            //项目技术报告
-            this.$refs.legalFileItem.fileList = [];
-            this.$refs.legalFileItem.getListFileBusinessId(that.dueForm.id, "15");
             //其他
             this.$refs.otherFileItem.handleButton();
             this.$refs.otherFileItem.fileList = [];

+ 2 - 2
ruoyi-ui/src/views/project/investigate/detail.vue

@@ -340,11 +340,11 @@ export default {
             this.$refs.fileItems1.handleButton();
             this.$refs.fileItems1.listFile = [];
             this.$refs.fileItems1.getListFileBusinessId(that.dueForm.id,"11");
-            //项目行研报告
+            //财务评估报告
             this.$refs.financeFileItem.handleButton();
             this.$refs.financeFileItem.fileList = [];
             this.$refs.financeFileItem.getListFileBusinessId(that.dueForm.id, "14");
-            //项目技术报告
+            //法务评估报告
             this.$refs.legalFileItem.handleButton();
             this.$refs.legalFileItem.fileList = [];
             this.$refs.legalFileItem.getListFileBusinessId(that.dueForm.id, "15");