/**
   * 签收任务
   *
   * @return
   */
  @RequestMapping(value = "/claim/{id}")
  public String claimTask(
      @PathVariable("id") String taskId, @RequestParam("userId") String userId) {

    // 签收任务
    taskService.claim(taskId, userId);

    return "redirect:/simple/index.do";
  }
Esempio n. 2
0
 /**
  * 反签收
  *
  * @param taskId 任务id
  */
 @Override
 public void unclaim(String taskId) {
   boolean canUnclaim = false;
   // 反签收条件过滤
   List<IdentityLink> links = taskService.getIdentityLinksForTask(taskId);
   for (IdentityLink identityLink : links) {
     canUnclaim = StringUtils.equals(IdentityLinkType.CANDIDATE, identityLink.getType());
     if (canUnclaim) {
       taskService.claim(taskId, null);
       break;
     }
   }
   if (!canUnclaim) {
     throw new BusinessException(ReturnCodeConstant.UNCLAIM_TASK);
   }
 }
Esempio n. 3
0
 /**
  * 签收
  *
  * @param taskId 任务id
  */
 @Override
 public void claim(String taskId) {
   String userId = UserUtils.getUserFromSession().getNatrualkey();
   taskService.claim(taskId, userId);
 }