Exemple #1
0
 /** 添加及保存操作 */
 public String save() {
   String strUserId = getRequest().getParameter("userId");
   if (StringUtils.isNotEmpty(strUserId)) {
     if (carApply.getApplyId() == null) {
       AppUser appUser = appUserService.get(new Long(strUserId));
       carApply.setDepartment(appUser.getDepartment().getDepName());
       carApply.setApprovalStatus((short) 0);
     }
   }
   carApplyService.save(carApply);
   setJsonString("{success:true}");
   return SUCCESS;
 }
 /** 显示自定义的任务信息 */
 public List<TaskInfo> getTaskInfosByUserId(String userId, PagingBean pb) {
   List<TaskImpl> list = getTasksByUserId(userId, pb);
   List<TaskInfo> taskInfoList = new ArrayList<TaskInfo>();
   for (TaskImpl taskImpl : list) {
     TaskInfo taskInfo = new TaskInfo(taskImpl);
     if (taskImpl.getAssignee() != null) {
       AppUser user = appUserService.get(new Long(taskImpl.getAssignee()));
       taskInfo.setAssignee(user.getFullname());
     }
     ProcessRun processRun = processRunService.getByPiId(taskImpl.getExecutionId());
     if (processRun != null) {
       taskInfo.setActivityName(
           processRun.getProDefinition().getName() + "--" + taskImpl.getActivityName());
     }
     // 显示任务,需要加上流程的名称
     taskInfoList.add(taskInfo);
   }
   return taskInfoList;
 }