Browse Source

Merge branch 'master' of http://139.196.39.194:9021/chenc/cd-work-flow-service

jihs 3 years ago
parent
commit
feb836798f

+ 2 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/entity/ProcessNodeVo.java

@@ -23,6 +23,8 @@ public class ProcessNodeVo {
     private List<Department> departments;
     /**选操作人的部门负责人*/
     private Boolean chooseDepHeader = false;
+    /**上级部门负责人*/
+    private Boolean headSuperiorDepartment = false;
     /**选操作人*/
     private Boolean chooseSponsor = false;
     /**节点展开 前端所需*/

+ 12 - 9
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java

@@ -102,13 +102,16 @@ public class ActBusinessController {
     public void submit(ActBusiness act,ProcessNodeVo node){
         //获取审核人
         String assignees="";
-        for(LoginUser l: node.getUsers()){
-            if(assignees.equals("")){
-                assignees=l.getUsername();
-            }else{
-                assignees=assignees+","+l.getUsername();
+        if(node.getUsers()!=null){
+            for(LoginUser l: node.getUsers()){
+                if(assignees.equals("")){
+                    assignees=l.getUsername();
+                }else{
+                    assignees=assignees+","+l.getUsername();
+                }
             }
         }
+
         act.setAssignees(assignees);
         //优先级
         act.setPriority(0);
@@ -208,9 +211,9 @@ public class ActBusinessController {
 
         for(String id : ids.split(",")){
             ActBusiness actBusiness = actBusinessService.getById(id);
-            if(actBusiness.getStatus()!=0){
-                return Result.error("删除失败, 仅能删除草稿状态的申请");
-            }
+//            if(actBusiness.getStatus()!=0){
+//                return Result.error("删除失败, 仅能删除草稿状态的申请");
+//            }
             // 删除关联业务表
             actBusinessService.deleteBusiness(actBusiness.getTableName(), actBusiness.getTableId());
             actBusinessService.removeById(id);
@@ -279,7 +282,7 @@ public class ActBusinessController {
                 e.setRouteName(actProcess.getRouteName());
                 e.setProcessName(actProcess.getName());
             }
-            if("1".equals(e.getStatus())){
+            if(e.getStatus()==1){
                 // 关联当前任务
                 List<Task> taskList = taskService.createTaskQuery().processInstanceId(e.getProcInstId()).list();
                 if(taskList!=null&&taskList.size()==1){

+ 10 - 1
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActivitiProcessController.java

@@ -272,6 +272,8 @@ public class ActivitiProcessController {
                     node.setDepartments(actNodeService.findDepartmentByNodeId(element.getId()));
                     // 是否设置发起人部门负责人
                     node.setChooseDepHeader(actNodeService.hasChooseDepHeader(element.getId()));
+                    // 是否上级部门负责人
+                    node.setHeadSuperiorDepartment(actNodeService.hasChooseDepHeader2(element.getId()));
                     // 是否设置发起人
                     node.setChooseSponsor(actNodeService.hasChooseSponsor(element.getId()));
                     //设置关联表单
@@ -306,7 +308,7 @@ public class ActivitiProcessController {
      * @return
      */
     @RequestMapping(value = "/editNodeUser", method = RequestMethod.POST)
-    public Result editNodeUser(String nodeId, String userIds, String roleIds, String departmentIds, Boolean chooseDepHeader, Boolean chooseSponsor,String tbTableInfoId){
+    public Result editNodeUser(String nodeId, String userIds, String roleIds, String departmentIds,Boolean headSuperiorDepartment, Boolean chooseDepHeader, Boolean chooseSponsor,String tbTableInfoId){
 
         // 删除其关联权限
         actNodeService.deleteByNodeId(nodeId);
@@ -344,6 +346,13 @@ public class ActivitiProcessController {
             actNode.setType(4);
             actNodeService.save(actNode);
         }
+        if(headSuperiorDepartment!=null&&headSuperiorDepartment){
+            ActNode actNode = new ActNode();
+            actNode.setTbTableInfoId(tbTableInfoId);
+            actNode.setNodeId(nodeId);
+            actNode.setType(5);
+            actNodeService.save(actNode);
+        }
         if(chooseSponsor!=null&&chooseSponsor){
             ActNode actNode = new ActNode();
             actNode.setTbTableInfoId(tbTableInfoId);