Esempio n. 1
0
  // 完成任务
  @Expose
  public void completeTask(String taskId, String opinion) {
    long id = Long.valueOf(taskId);

    try {
      if (StringUtils.isNotEmpty(opinion)) {
        // 审批意见
        TaskOpinion taskOpinion = new TaskOpinion(opinion);
        // 开始任务
        taskClient.start(Long.valueOf(taskId));
        taskClient.complete(Long.valueOf(taskId), taskOpinion);

      } else {
        // 开始任务
        taskClient.start(Long.valueOf(taskId));
        taskClient.complete(Long.valueOf(taskId));
      }
    } catch (Exception e) {
      taskClient.rollback(id, "分公司计划员");
    }
  }
Esempio n. 2
0
 // 撤回上一节点
 @Expose
 public String withdrawTask(String taskId, String opinion) {
   long taskId_ = Long.valueOf(taskId);
   try {
     if (StringUtils.isNotEmpty(opinion)) {
       // 审批意见
       TaskOpinion taskOpinion = new TaskOpinion(opinion);
       if (taskService.canWithdraw(taskId_)) {
         taskService.withdraw(taskId_, taskOpinion);
         return null;
       }
     } else {
       if (taskService.canWithdraw(taskId_)) {
         taskService.withdraw(taskId_);
         return null;
       }
     }
   } catch (Exception e) {
     taskClient.rollback(taskId_, "分公司计划员");
   }
   return "当前任务不可撤回";
 }