@Transactional(propagation = Propagation.REQUIRED)
 public void updateLeaveReceipt(SLeave leave) {
   this.leaveDao.updateByPrimaryKeySelective(leave);
   // 如果是调休,需减掉对应的加班时数
   if (leave.getTypeId().intValue() == 7) {
     SOvertimeCollection userOtCollection =
         this.overtimeCollectionDao.selectByPrimaryKey(leave.getUserId());
     userOtCollection.setHoursCollection(
         userOtCollection.getHoursCollection().floatValue()
             - leave.getLeaveDays().floatValue() * 8);
     this.overtimeCollectionDao.updateByPrimaryKey(userOtCollection);
   }
   // 如果是年假,需减掉对应的请假时数
   if (leave.getTypeId().intValue() == 3) {
     SAnnualLeave sal = this.leaveDao.getAnnualLeave(leave.getUserId());
     sal.setAnnualHours(sal.getAnnualHours().intValue() - leave.getLeaveDays().intValue());
     this.leaveDao.updateAnnualLeaveHours(sal);
   }
   String instanceId = "leave." + leave.getLeaveId();
   ProcessEngine processEngine = Configuration.getProcessEngine();
   List<Task> myTaskList =
       processEngine.getTaskService().findPersonalTasks(String.valueOf(leave.getUserId()));
   for (Task task : myTaskList) {
     if (task.getExecutionId().equals(instanceId)) {
       processEngine.getTaskService().completeTask(task.getId(), "申请");
       break;
     }
   }
 }
 public void next(String userId, String taskId, Map varis) {
   Task task = processEngine.getTaskService().getTask(taskId);
   if (task.getAssignee() == null) {
     processEngine.getTaskService().takeTask(taskId, userId);
     varis.put("!" + task.getActivityName(), userId);
   }
   processEngine.getTaskService().completeTask(taskId, varis);
 }
示例#3
0
 // 禀议撤销
 @Transactional
 public void delete(String taskId) {
   Task task = taskService.getTask(taskId);
   Execution execution = executionService.findExecutionById(task.getExecutionId());
   if (execution.getProcessInstance().isActive("填写经费报销")) {
     String wCode = (String) taskService.getVariable(taskId, "wCode");
     this.delete(wipeDao.getWipe(wCode));
     taskService.completeTask(taskId, "cancel");
   }
 }
 public void nextByBusinessId(String userId, String businessId, Map varis) {
   Task e =
       (Task)
           sessionFactory
               .openSession()
               .createQuery(
                   "select t from org.jbpm.pvm.internal.task.TaskImpl t,ExecutionImpl e where e.key=:key and t.processInstance=e.processInstance")
               .setParameter("key", businessId)
               .uniqueResult();
   next(userId, e.getId(), varis);
 }
 @Override // 默认销售负责人负责的工单列表
 public String execute() throws Exception {
   List<Issue> dbIssues = new ArrayList<Issue>();
   HttpSession session = request.getSession();
   // 获取当前登录用户
   User sessionUser = (User) session.getAttribute(LicenseWorkFlowConstants.SESSION_USER);
   // 获取流程定义列表
   List<ProcessDefinition> pdList =
       issueService.getRepositoryService().createProcessDefinitionQuery().list();
   // 获取流程实例列表
   List<ProcessInstance> piList =
       issueService.getExecutionService().createProcessInstanceQuery().list();
   // 获取该用户组内的任务
   List<Task> taskList = issueService.getTaskService().findGroupTasks(sessionUser.getName());
   // 查询库中所有的工单
   dbIssues = issueService.getAllIssues();
   // 获取流程寮例历史记录列表
   List<HistoryProcessInstance> hplist =
       issueService.getHistoryService().createHistoryProcessInstanceQuery().list();
   String processDefinitionId = ""; // 流程定义标识
   if (pdList != null && pdList.size() > 0) {
     processDefinitionId = ((ProcessDefinition) (pdList.get(0))).getId();
   }
   // 遍历系统中的工单
   for (Issue issue : dbIssues) {
     // 设置工单的流程节点
     String activeName = issueService.getActiveName(issue.getProcessInstanceId());
     IssueVO issueVO = new IssueVO();
     issueVO.setWorkFlowNodeName(activeName);
     // 遍历当前登录用户的task列表
     for (Task task : taskList) {
       // 获取执行
       Execution execution =
           issueService.getExecutionService().findExecutionById(task.getExecutionId());
       ExecutionImpl execImpl = (ExecutionImpl) execution;
       // 获取执行的流程实例
       ProcessInstance processInstance = execImpl.getProcessInstance();
       if (issue.getProcessInstanceId().equals(processInstance.getId())) {
         // 显示审核链接
         issueVO.setShowAudit(true);
         // 当前工单要审核的task
         issueVO.setIssueTask(task);
         break;
       } else {
         issueVO.setShowAudit(false);
       }
     }
     LicenseWorkFlowConstants.issuePOTOVOCopier.copy(issue, issueVO, null);
     issues.add(issueVO);
   }
   return "index";
 }
 public void auditByBusinessId(Opinion opinion) {
   Task e =
       (Task)
           sessionFactory
               .openSession()
               .createQuery(
                   "select t from org.jbpm.pvm.internal.task.TaskImpl t,ExecutionImpl e where e.key=:key and t.processInstance=e.processInstance")
               .setParameter("key", opinion.getBusinessId())
               .uniqueResult();
   opinion.setTaskId(e.getId());
   opinion.setTaskName(e.getName());
   audit(opinion);
 }
示例#7
0
  public String lock() {
    String taskId = getRequest().getParameter("taskId");
    Task task = this.taskService.getTask(taskId);

    if ((task != null) && (task.getAssignee() == null)) {
      this.taskService.assignTask(task.getId(), ContextUtil.getCurrentUserId().toString());
      setJsonString("{success:true,hasAssigned:false}");
    } else {
      setJsonString("{success:true,hasAssigned:true}");
    }

    return "success";
  }
 public void startNext(String userId, String processDefinitonKey, String businessId, Map varis) {
   start(processDefinitonKey, businessId);
   // 要不然数据在缓存中,下面的查询查不到
   sessionFactory.getCurrentSession().flush();
   Task task =
       (Task)
           sessionFactory
               .getCurrentSession()
               .createQuery(
                   "select t from org.jbpm.pvm.internal.task.TaskImpl t,ExecutionImpl e where e.key=:key and t.processInstance=e.processInstance")
               .setParameter("key", businessId)
               .uniqueResult();
   next(userId, task.getId(), varis);
 }
示例#9
0
 /**
  * 考核结束,流程结束
  *
  * @param user
  */
 private void evaluate(UserInfo user, String planid) {
   Task task = workflowBo.getHandleTaskForId(user.getUserID(), planid);
   if (task != null && MaintenanceWorkflowBO.EVALUATE_TASK.equals(task.getName())) {
     workflowBo.completeTask(task.getId(), "end");
     ProcessHistoryBean processHistoryBean = new ProcessHistoryBean();
     processHistoryBean.initial(task, user, "", ModuleCatalog.MAINTENANCE);
     processHistoryBean.setNextOperateUserId("");
     processHistoryBean.setObjectId(planid);
     processHistoryBean.setProcessAction("测试计划考核");
     processHistoryBean.setTaskOutCome("end");
     processHistoryBO.saveProcessHistory(processHistoryBean);
   }
   System.out.println("测试计划已经考核!");
 }
示例#10
0
 // 撤回流程的界面
 public Task updWipe(Wipe wipe, Long ju1) throws Exception {
   taskList = taskService.findPersonalTasks(String.valueOf(ju1));
   if (taskList != null && !taskList.isEmpty()) {
     String wCode = null;
     for (Task task : taskList) {
       wCode = (String) taskService.getVariable(task.getId(), "wCode");
       if (wCode != null) {
         if (wCode.equals(wipe.getwCode())) {
           this.task = task;
           taskService.completeTask(task.getId(), "To主管驳回");
         }
       }
     }
   }
   return this.task;
 }
示例#11
0
 public String change() {
   HttpServletRequest request = getRequest();
   String taskId = request.getParameter("taskId");
   String userId = request.getParameter("userId");
   String curUserId = ContextUtil.getCurrentUserId().toString();
   Task task = this.taskService.getTask(taskId);
   if ((task != null) && (curUserId.equals(task.getAssignee()))) {
     this.taskService.assignTask(taskId, userId);
     String msg = request.getParameter("msg");
     if (StringUtils.isNotEmpty(msg)) {
       this.shortMessageService.save(AppUser.SYSTEM_USER, userId, msg, ShortMessage.MSG_TYPE_TASK);
     }
   }
   setJsonString("{success:true}");
   return "success";
 }
示例#12
0
 // 驳回
 public void reject(String taskId) {
   task = taskService.getTask(taskId);
   Set<String> set = taskService.getVariableNames(taskId);
   map = taskService.getVariables(taskId, set);
   map.put("reject", task.getAssignee()); // 驳回人
   taskService.setVariables(task.getId(), map);
   execution = executionService.findExecutionById(task.getExecutionId());
   if (execution.getProcessInstance().isActive("部门主管审批")) { // 部门主管不批准
     taskService.completeTask(taskId, "To主管驳回");
   } else if (execution.getProcessInstance().isActive("项目经理审批")) { // 项目经理不批准
     taskService.completeTask(taskId, "To项目经理驳回");
   } else if (execution.getProcessInstance().isActive("三级合议")) { // 总经理不批准的过程
     taskService.completeTask(taskId, "To三级驳回");
   } else if (execution.getProcessInstance().isActive("四级合议")) { // 四级议论
     taskService.completeTask(taskId, "To四级驳回");
   } else if (execution.getProcessInstance().isActive("最终决裁")) { // 五级审批
     taskService.completeTask(taskId, "To最终驳回");
   } else {
     taskService.completeTask(taskId);
   }
 }
示例#13
0
 // 根据当前用户取得驳回报销列表
 @Transactional(readOnly = true)
 public List<WipeTask> getRejectTasks(Long userId) {
   taskList = taskService.findPersonalTasks(String.valueOf(ActionUtil.getCurLoginInfo().getId()));
   List<WipeTask> list = null;
   if (taskList != null && !taskList.isEmpty()) {
     String wCode = null;
     list = new ArrayList<WipeTask>(taskList.size());
     WipeTask wipeTask = null;
     for (Task task : taskList) {
       if (task.getName().equalsIgnoreCase("填写经费报销")) {
         wipeTask = new WipeTask();
         wipeTask.setTask(task);
         wCode = (String) taskService.getVariable(task.getId(), "wCode");
         if (wCode != null) {
           wipeTask.setWipe(wipeDao.getWipe(wCode));
           list.add(wipeTask);
         }
       }
     }
   }
   return list;
 }
示例#14
0
 // 监测流程是否可以修改(如果相同的人批两次可能就会出问题。还没测试两个人是否会有问题。)
 public Task checkUpd(Wipe wipe) throws Exception {
   List<Judge> judgeList = judgeManager.selJudgeByCode(wipe.getId());
   Integer size = 0;
   if (judgeList != null) {
     size = judgeList.size();
   }
   this.task = null;
   taskList =
       taskService.findPersonalTasks(String.valueOf(wipe.getJudgeSet().get(0).getUser().getId()));
   if (taskList != null && !taskList.isEmpty()) {
     String wCode = null;
     for (Task task : taskList) {
       wCode = (String) taskService.getVariable(task.getId(), "wCode");
       if (wCode != null) {
         if (wCode.equals(wipe.getwCode()) && size < 1) // 还需要一个条件判断,审批人数必须小于=0;
         {
           this.task = task;
         }
       }
     }
   }
   return this.task;
 }
示例#15
0
  // 查询某个人的待办任务。
  public List<WipeTask> weiShenPiList() throws Exception {
    taskList = taskService.findPersonalTasks(String.valueOf(ActionUtil.getCurLoginInfo().getId()));
    List<WipeTask> list = null;
    if (taskList != null && !taskList.isEmpty()) {
      String wCode = null;
      list = new ArrayList<WipeTask>(taskList.size());
      WipeTask wipeTask = null;
      for (Task task : taskList) {

        if (task.getName().equalsIgnoreCase("填写经费报销")) continue;

        wipeTask = new WipeTask();
        wipeTask.setTask(task);
        wCode = (String) taskService.getVariable(task.getId(), "wCode");
        if (wCode != null) {
          if (wipeDao.getWipe(wCode) != null) {
            wipeTask.setWipe(wipeDao.getWipe(wCode));
            list.add(wipeTask);
          }
        }
      }
    }
    return list;
  }
示例#16
0
  // 审核待办任务
  @Transactional
  public Wipe confirm(String taskId, String topJudge, Wipe wipe) {

    task = taskService.getTask(taskId);
    execution = executionService.findExecutionById(task.getExecutionId());
    if (execution.getProcessInstance().isActive("部门主管审批")) { // 部门主管审批
      taskService.completeTask(taskId, "To"); // To二级决裁
    } else if (execution.getProcessInstance().isActive("项目经理审批")) { // 项目经理审批
      String variable = (String) taskService.getVariable(taskId, "sanJiUser");
      if (variable == null || "".equals(variable)) {
        taskService.completeTask(taskId, "To项目经理不批准");
        wipe.setState((short) 1);
      } else {
        taskService.completeTask(taskId, "To三级合议");
      }
    } else if (execution.getProcessInstance().isActive("三级合议")) { // 总经理审批的过程
      taskService.completeTask(taskId, "To四级合议");
    } else if (execution.getProcessInstance().isActive("四级合议")) { // 四级议论
      if (topJudge != null) {
        //				if (topJudge.equals("1"))
        //				{
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("topUser", topJudge);
        taskService.setVariables(taskId, variables);
        taskService.completeTask(taskId, "To最终决裁"); // 这里还要根据经理是否需要老板决裁。
        wipe.setTopJudge(topJudge);
        wipe.setState((short) 1);
        //				}
        //				else if (topJudge.equals("0"))
        //				{
        //					wipe.setState((short) 1);
        //					taskService.completeTask(taskId, "To四级不批准");
        //				}
      } else taskService.completeTask(taskId, "To最终决裁");
    } else if (execution.getProcessInstance().isActive("最终决裁")) {
      wipe.setState((short) 1);
      // 五级审批
      taskService.completeTask(taskId, "To流程结束");
    } else {
      taskService.completeTask(taskId);
    }

    this.save(wipe);
    return wipe;
  }
示例#17
0
  // 不批准
  public void dissent(String taskId) {
    task = taskService.getTask(taskId);
    execution = executionService.findExecutionById(task.getExecutionId());

    if (execution.getProcessInstance().isActive("部门主管审批")) { // 部门主管不批准
      taskService.completeTask(taskId, "To主管不批准");
    } else if (execution.getProcessInstance().isActive("项目经理审批")) { // 项目经理不批准
      taskService.completeTask(taskId, "To项目经理不批准");
    } else if (execution.getProcessInstance().isActive("三级合议")) { // 总经理审批的过程
      taskService.completeTask(taskId, "To三级不批准");
    } else if (execution.getProcessInstance().isActive("四级合议")) { // 四级议论
      taskService.completeTask(taskId, "To四级不批准");
    } else if (execution.getProcessInstance().isActive("最终决裁")) { // 五级审批
      taskService.completeTask(taskId, "To最终驳回");
    } else {
      taskService.completeTask(taskId);
    }
  }
  @Transactional(propagation = Propagation.REQUIRED)
  public void addLeaveReceipt(SLeave leave, SUser loginUser) {
    if (leave.getLeaveId() == null) {
      if (leave.getStatus().intValue() == 2) {
        leave.setUserId(loginUser.getUserId());
        Integer leaveId = this.leaveDao.insert(leave);
      } else {
        leave.setUserId(loginUser.getUserId());
        leave.setLeaveTime(new Date());
        //				leave.setStatus(0);
        leave.setLeaveCode(NormalFun.getNextCode(Constants.LEAVE_PREFIX, leaveDao.getMaxCode()));
        Integer leaveId = this.leaveDao.insert(leave);
        // 如果是调休,需减掉对应的加班时数
        if (leave.getTypeId().intValue() == 7) {
          SOvertimeCollection userOtCollection =
              this.overtimeCollectionDao.selectByPrimaryKey(loginUser.getUserId());
          userOtCollection.setHoursCollection(
              userOtCollection.getHoursCollection().floatValue()
                  - leave.getLeaveDays().floatValue());
          this.overtimeCollectionDao.updateByPrimaryKey(userOtCollection);
        }
        // 如果是年假,需减掉对应的请假时数
        if (leave.getTypeId().intValue() == 3) {
          SAnnualLeave sal = this.leaveDao.getAnnualLeave(loginUser.getUserId());
          sal.setAnnualHours(sal.getAnnualHours().intValue() - leave.getLeaveDays().intValue());
          this.leaveDao.updateAnnualLeaveHours(sal);
        }

        SDepartment dept = this.departmentDao.getSDepartmentById(loginUser.getDepartmentId());
        ProcessEngine processEngine = Configuration.getProcessEngine();
        Map<String, Object> instanceVariables = new HashMap<String, Object>();
        instanceVariables.put("userName", loginUser.getUserName());
        instanceVariables.put("userId", String.valueOf(loginUser.getUserId()));
        instanceVariables.put("typeName", "休假单");
        instanceVariables.put("deptName", dept.getName());

        instanceVariables.put("leaveDays", leave.getLeaveDays());
        SPosition sp = positionDao.selectByPrimaryKey(loginUser.getPositionOrgId());
        instanceVariables.put("orgPosition", sp.getName());

        // 启动流程实例
        ProcessInstance processInstance =
            processEngine
                .getExecutionService()
                .startProcessInstanceByKey("leave", instanceVariables, String.valueOf(leaveId));
        //				processEngine.getExecutionService().setVariables(processInstance.getId(),
        // instanceVariables);

        List<Task> myTaskList =
            processEngine.getTaskService().findPersonalTasks(String.valueOf(loginUser.getUserId()));
        for (Task task : myTaskList) {
          if (task.getExecutionId().equals(processInstance.getId())) {
            // processEngine.getTaskService().setVariables(task.getId(), instanceVariables);
            processEngine.getTaskService().completeTask(task.getId(), "申请");
            break;
          }
        }
      }
    } else {
      if (leave.getStatus().intValue() == 2) {
        this.leaveDao.updateByPrimaryKeySelective(leave);
      } else {
        leave.setLeaveTime(new Date());
        leave.setLeaveCode(NormalFun.getNextCode(Constants.LEAVE_PREFIX, leaveDao.getMaxCode()));
        this.leaveDao.updateByPrimaryKeySelective(leave);
        // 如果是调休,需减掉对应的加班时数
        if (leave.getTypeId().intValue() == 7) {
          SOvertimeCollection userOtCollection =
              this.overtimeCollectionDao.selectByPrimaryKey(loginUser.getUserId());
          userOtCollection.setHoursCollection(
              userOtCollection.getHoursCollection().floatValue()
                  - leave.getLeaveDays().floatValue());
          this.overtimeCollectionDao.updateByPrimaryKey(userOtCollection);
        }
        // 如果是年假,需减掉对应的请假时数
        if (leave.getTypeId().intValue() == 3) {
          SAnnualLeave sal = this.leaveDao.getAnnualLeave(loginUser.getUserId());
          sal.setAnnualHours(sal.getAnnualHours().intValue() - leave.getLeaveDays().intValue());
          this.leaveDao.updateAnnualLeaveHours(sal);
        }

        SDepartment dept = this.departmentDao.getSDepartmentById(loginUser.getDepartmentId());
        ProcessEngine processEngine = Configuration.getProcessEngine();
        Map<String, Object> instanceVariables = new HashMap<String, Object>();
        instanceVariables.put("userName", loginUser.getUserName());
        instanceVariables.put("userId", String.valueOf(loginUser.getUserId()));
        instanceVariables.put("typeName", "休假单");
        instanceVariables.put("deptName", dept.getName());

        instanceVariables.put("leaveDays", leave.getLeaveDays());
        SPosition sp = positionDao.selectByPrimaryKey(loginUser.getPositionOrgId());
        instanceVariables.put("orgPosition", sp.getName());

        // 启动流程实例
        ProcessInstance processInstance =
            processEngine
                .getExecutionService()
                .startProcessInstanceByKey(
                    "leave", instanceVariables, String.valueOf(leave.getLeaveId()));
        //				processEngine.getExecutionService().setVariables(processInstance.getId(),
        // instanceVariables);

        List<Task> myTaskList =
            processEngine.getTaskService().findPersonalTasks(String.valueOf(loginUser.getUserId()));
        for (Task task : myTaskList) {
          if (task.getExecutionId().equals(processInstance.getId())) {
            // processEngine.getTaskService().setVariables(task.getId(), instanceVariables);
            processEngine.getTaskService().completeTask(task.getId(), "申请");
            break;
          }
        }
      }
    }
  }
示例#19
0
  // 添加wipe的方法
  @Transactional
  public Wipe saveWipe(Wipe wipe, List<WipeItem> itemList, List<WipeItemDetail> detailList) {
    Map<String, Object> variables = new HashMap<String, Object>();
    Integer type = wipe.getWType(); // 0部内,1部外。
    String yiji = String.valueOf(wipe.getJudgeSet().get(0).getUser().getId());
    String erji = String.valueOf(wipe.getJudgeSet().get(1).getUser().getId());
    String sanji = null, siji = null, wuji = null;
    if (type == 1) {
      if (wipe.getJudgeSet().get(2).getUser() == null) {
        sanji = null;
      } else {
        sanji = String.valueOf(wipe.getJudgeSet().get(2).getUser().getId());
      }
      if (wipe.getJudgeSet().get(3).getUser() == null) {
        siji = null;
      } else {
        siji = String.valueOf(wipe.getJudgeSet().get(3).getUser().getId());
      }
      if (wipe.getJudgeSet().get(4).getUser() == null) {
        wuji = null;
      } else {
        wuji = String.valueOf(wipe.getJudgeSet().get(4).getUser().getId());
      }
    }
    variables.put("wCode", wipe.getwCode()); // 把禀议编号存储在变量中。
    variables.put("deptUser", yiji);
    variables.put("projUser", erji);
    variables.put("sanJiUser", sanji);
    variables.put("manager", siji);
    variables.put("topUser", wuji);
    variables.put("fillUser", String.valueOf(ActionUtil.getCurLoginInfo().getId()));
    executionService.startProcessInstanceByKey("jingfeibaoxiao", variables);
    taskList = taskService.findPersonalTasks(String.valueOf(ActionUtil.getCurLoginInfo().getId()));
    task = taskList.get(taskList.size() - 1);
    taskService.completeTask(task.getId());
    execution = executionService.findExecutionById(task.getExecutionId());
    wipe.getJudgeSet().get(0).setWipe(wipe);
    wipe.getJudgeSet().get(1).setWipe(wipe);

    // 全公司
    if (type == 1) {
      if (wipe.getJudgeSet().get(2) == null) {
        wipe.getJudgeSet().set(2, null);
      } else {
        wipe.getJudgeSet().get(2).setWipe(wipe);
      }
      if (wipe.getJudgeSet().get(3) == null) {
        wipe.getJudgeSet().set(3, null);
      } else {
        wipe.getJudgeSet().get(3).setWipe(wipe);
      }
      if (wipe.getJudgeSet().get(4) == null) {
        wipe.getJudgeSet().set(4, null);
      } else {
        wipe.getJudgeSet().get(4).setWipe(wipe);
      }
    }

    wipe.setPId(execution.getProcessInstance().getId()); // 获得流程实例ID;

    this.save(wipe);
    if (itemList != null && itemList.size() != 0) {
      for (WipeItem wipeItem : itemList) {
        wipeItem.setWipe(wipe);
        if (detailList != null && detailList.size() != 0) {
          for (WipeItemDetail wipeItemDetail : detailList) {
            if (wipeItem.getiItem().equals(wipeItemDetail.getWipeItem().getiItem())) {
              wipeItemDetail.setWipeItem(wipeItem);
              wipeItemDetailService.save(wipeItemDetail);
            }
          }
        }

        wipeItemService.save(wipeItem);
      }
    }
    return wipe;
  }
示例#20
0
  // 撤回流程的操作
  @Transactional
  public void upd(
      Wipe wipe,
      String isCom,
      Long ju1,
      List<WipeItem> itemList,
      List<WipeItemDetail> detailList,
      String itemString,
      String detailString)
      throws Exception {
    judgeManager.del(wipe.getId());
    wipe.setwUser(userManager.get(wipe.getwUser().getId()));
    List<Judge> judgeSet = wipe.getJudgeSet();
    for (Judge judge : judgeSet) {
      if (judge.getUser().getId() == null) judge.setUser(null);
      else judge.setUser(userManager.get(judge.getUser().getId()));
    }
    wipe.setJudgeSet(judgeSet);
    wipe.setState((short) 0);

    if ("false".equals(isCom) && ju1 != null) updWipe(wipe, ju1);

    Map<String, Object> variables = new HashMap<String, Object>();
    Integer type = wipe.getWType(); // 0部内,1部外。
    String yiji = String.valueOf(wipe.getJudgeSet().get(0).getUser().getId());
    String erji = String.valueOf(wipe.getJudgeSet().get(1).getUser().getId());
    String sanji = null, siji = null, wuji = null;
    if (type == 1) {
      if (wipe.getJudgeSet().get(2).getUser() == null) {
        sanji = null;
      } else {
        sanji = String.valueOf(wipe.getJudgeSet().get(2).getUser().getId());
      }
      if (wipe.getJudgeSet().get(3).getUser() == null) {
        siji = null;
      } else {
        siji = String.valueOf(wipe.getJudgeSet().get(3).getUser().getId());
      }
      if (wipe.getJudgeSet().get(4).getUser() == null) {
        wuji = null;
      } else {
        wuji = String.valueOf(wipe.getJudgeSet().get(4).getUser().getId());
      }
    }
    variables.put("wCode", wipe.getwCode()); // 把禀议编号存储在变量中。
    variables.put("deptUser", yiji);
    variables.put("projUser", erji);
    variables.put("sanJiUser", sanji);
    variables.put("manager", siji);
    variables.put("topUser", wuji);
    variables.put("fillUser", String.valueOf(ActionUtil.getCurLoginInfo().getId()));

    wipe.getJudgeSet().get(0).setWipe(wipe);
    wipe.getJudgeSet().get(1).setWipe(wipe);

    // 全公司
    if (type == 1) {
      if (wipe.getJudgeSet().get(2) == null) {
        wipe.getJudgeSet().set(2, null);
      } else {
        wipe.getJudgeSet().get(2).setWipe(wipe);
      }
      if (wipe.getJudgeSet().get(3) == null) {
        wipe.getJudgeSet().set(3, null);
      } else {
        wipe.getJudgeSet().get(3).setWipe(wipe);
      }
      if (wipe.getJudgeSet().get(4) == null) {
        wipe.getJudgeSet().set(4, null);
      } else {
        wipe.getJudgeSet().get(4).setWipe(wipe);
      }
    }

    taskList = taskService.findPersonalTasks(String.valueOf(wipe.getwUser().getId()));
    if (taskList != null && !taskList.isEmpty()) {
      String wCode = null;
      for (Task task : taskList) {
        wCode = (String) taskService.getVariable(task.getId(), "wCode");
        if (wCode != null) {
          if (wCode.equals(wipe.getwCode())) {
            taskService.setVariables(task.getId(), variables);
            taskService.completeTask(task.getId());
          }
        }
      }
    }
    wipeDao.mery(wipe);

    String[] itemIds = itemString.split(",");
    String[] detailIds = detailString.split(",");

    for (int d = 0; d < detailIds.length; d++) {
      if (!detailIds[d].equals("")) wipeItemDetailService.delete(Long.parseLong(detailIds[d]));
    }
    for (int i = 0; i < itemIds.length; i++) {
      if (!itemIds[i].equals("")) wipeItemService.delete(Long.parseLong(itemIds[i]));
    }
    if (itemList != null && itemList.size() != 0) {
      for (WipeItem wipeItem : itemList) {
        wipeItem.setWipe(wipe); // 这里有错误,为什么为空。
        if (wipeItem.getId() == null || "".equals(wipeItem.getId())) wipeItemService.save(wipeItem);
        else wipeItemService.merge(wipeItem);
        if (detailList != null && detailList.size() != 0) {
          for (WipeItemDetail wipeItemDetail : detailList) {
            if (wipeItem.getiItem().equals(wipeItemDetail.getWipeItem().getiItem())) {
              wipeItemDetail.setWipeItem(wipeItem);
              if (wipeItemDetail.getId() == null || "".equals(wipeItemDetail.getId()))
                wipeItemDetailService.save(wipeItemDetail);
              else wipeItemDetailService.merge(wipeItemDetail);
            }
          }
        }
      }
    }
  }
 public String getBusinessIdByTaskId(String taskId) {
   Task task = processEngine.getTaskService().getTask(taskId);
   Execution execution =
       processEngine.getExecutionService().findExecutionById(task.getExecutionId());
   return execution.getKey();
 }