コード例 #1
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
  /**
   * 意见
   *
   * @return
   * @throws Exception
   */
  public String opinion() throws Exception {
    // workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId);

    // authority(workflowInstance.getProcessDefinitionId(),task.getName());

    // if(view){
    // opinions =
    // workflowInstanceManager.getOpinionsByInstanceId(workflowInstance.getProcessInstanceId(),companyId);
    // }
    if (taskId == null) {
      view = true;
    } else {
      task = taskService.getWorkflowTask(taskId);
      if (task.getActive() == 2) {
        edit = false;
      }
    }
    workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId);
    opinions = workflowInstanceManager.getOpinions(taskId, task.getCompanyId());
    if (workflowRightsManager.mustOpinionRight(BeanUtil.turnToModelTask(task))
        && (opinions == null || opinions.size() <= 0)) {
      must = true;
    } else {
      must = false;
    }
    companyId = ContextUtils.getCompanyId();
    ApiFactory.getBussinessLogService().log("流程汇编", "意见列表", ContextUtils.getSystemId("wf"));
    return "opinion";
  }
コード例 #2
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 private String preView(String operate) {
   log.debug("*** preView 方法开始");
   log.debug(
       new StringBuilder("*** Received parameter:[")
           .append("task:")
           .append(task)
           .append("]")
           .toString());
   workflowInstance = workflowInstanceManager.getWorkflowInstance(task.getProcessInstanceId());
   workflowId = task.getProcessInstanceId();
   StringBuilder builder = new StringBuilder();
   builder
       .append("<input type=\"hidden\" name=\"dataId\" value=\"")
       .append(workflowInstance.getDataId())
       .append("\"/>");
   FormView form = formViewManager.getFormView(workflowInstance.getFormId());
   formHtml =
       workflowInstanceManager.setValueForHtml(workflowInstance.getDataId(), form, form.getHtml());
   formHtml = builder.toString() + formHtml;
   if (SAVE.equals(operate)) {
     formHtml =
         workflowInstanceManager.getFormHtml(
             workflowInstance, formHtml, workflowInstance.getDataId(), true, false);
     fieldPermission = ApiFactory.getFormService().getFieldPermission(task.getId());
   } else {
     formHtml =
         workflowInstanceManager.getFormHtml(
             workflowInstance, formHtml, workflowInstance.getDataId(), false, false);
     fieldPermission = workflowRightsManager.getFieldPermission(false);
   }
   ApiFactory.getBussinessLogService().log("工作流管理", "查看已完成任务", ContextUtils.getSystemId("wf"));
   log.debug("*** preView 方法结束");
   return "view";
 }
コード例 #3
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void emailReminder(WorkflowTask task) {
   User user = userManager.getUserByLoginName(task.getTransactor());
   String msg =
       new StringBuilder("任务:")
           .append(task.getTitle())
           .append("已经生成")
           .append(((System.currentTimeMillis() - task.getCreatedTime().getTime()) / MILLI_SECOND))
           .append("天了。请尽快办理!")
           .toString();
   AsyncMailUtils.sendMail(user.getEmail(), "催办超期提醒", msg);
 }
コード例 #4
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 /**
  * 流程监控/保存更改的办理人
  *
  * @return
  * @throws Exception
  */
 public String changeTransactorSave() throws Exception {
   taskService.changeTransactor(taskId, transactor);
   task = taskService.getWorkflowTask(taskId);
   workflowId = task.getProcessInstanceId();
   workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId);
   // 更改办理人业务补偿
   taskService.changeTransactorSet(workflowInstance, transactor, task.getId());
   ApiFactory.getBussinessLogService().log("流程监控", "更改办理人", ContextUtils.getSystemId("wf"));
   this.addSuccessMessage("办理人已更改");
   return changeTransactor();
 }
コード例 #5
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void RtxInform(WorkflowTask task) {
   String msg =
       new StringBuilder("任务:")
           .append(task.getTitle())
           .append("的办理人")
           .append(task.getTransactorName())
           .append("被催办次数已经超过设置上限,请您核实情况。")
           .toString();
   if (StringUtils.isNotEmpty(task.getReminderNoticeUser())) {
     for (String userLoginName : task.getReminderNoticeUser().split(",")) {
       rtx.RtxMsgSender.sendNotify(userLoginName, "催办超期提醒", "1", msg, "", task.getCompanyId());
     }
   }
 }
コード例 #6
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 public String choiceTachePop() throws Exception {
   if (canChoiceTaches == null) {
     workflowInstance = workflowInstanceManager.getWorkflowInstance(task.getProcessInstanceId());
     canChoiceTaches = taskService.isNeedChoiceTache(task, workflowInstance).getCanChoiceTaches();
   }
   ApiFactory.getBussinessLogService().log("工作流管理", "弹出选择环节页面", ContextUtils.getSystemId("wf"));
   return "choiceUrlPop";
 }
コード例 #7
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void emailInform(WorkflowTask task) {
   if (StringUtils.isNotEmpty(task.getReminderNoticeUser())) {
     Set<String> informUserEmails = new HashSet<String>();
     User temp;
     for (String userLoginName : task.getReminderNoticeUser().split(",")) {
       temp = userManager.getUserByLoginName(userLoginName);
       if (temp != null) informUserEmails.add(temp.getEmail());
     }
     String msg =
         new StringBuilder("任务:")
             .append(task.getTitle())
             .append("的办理人")
             .append(task.getTransactorName())
             .append("被催办次数已经超过设置上限,请您核实情况。")
             .toString();
     AsyncMailUtils.sendMail(informUserEmails, "催办超期提醒", msg);
   }
 }
コード例 #8
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 /** 指定办理人 */
 @Action(value = "taskassign")
 public String assignTransactor() throws Exception {
   String to = INPUT;
   if (task.getId() == null) {
     this.addErrorMessage("非法的任务");
   } else {
     WorkflowInstance instance =
         workflowInstanceManager.getWorkflowInstance(task.getProcessInstanceId());
     CompleteTaskTipType result = taskService.isNeedAssigningTransactor(instance, task);
     if (result == null) {
       result = taskService.isSubProcessNeedChoiceTransactor(task, instance);
     }
     switch (result) {
       case OK:
         this.addSuccessMessage(result.getContent());
         to = input();
         break;
       case MESSAGE:
         this.addErrorMessage(result.getContent());
         to = INPUT;
         break;
       case RETURN_URL:
         candidates = taskService.getNextTasksCandidates(task);
         this.addErrorMessage("请选择办理人");
         to = "assign";
         break;
       case TACHE_CHOICE_URL:
         addActionMessage("请选择环节");
         canChoiceTaches = result.getCanChoiceTaches();
         to = choiceTache();
       case SINGLE_TRANSACTOR_CHOICE:
         User temp;
         for (String tran : result.getCanChoiceTransactor()) {
           temp = userManager.getUserByLoginName(tran);
           if (temp != null) canChoiceTransactor.put(tran, temp.getName());
         }
         moreTransactor = CompleteTaskTipType.SINGLE_TRANSACTOR_CHOICE.getContent().equals("true");
         to = "singleTransactorChoice";
     }
   }
   ApiFactory.getBussinessLogService().log("工作流管理", "指定办理人", ContextUtils.getSystemId("wf"));
   return to;
 }
コード例 #9
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 public String assignTransactorPop() throws Exception {
   if (task.getId() == null) {
     this.addErrorMessage("非法的任务");
   } else {
     candidates = taskService.getNextTasksCandidates(task);
     this.addErrorMessage("请选择办理人");
   }
   ApiFactory.getBussinessLogService().log("工作流管理", "弹出指定办理人", ContextUtils.getSystemId("wf"));
   return "assignPop";
 }
コード例 #10
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 public String delTransactorTree() throws Exception {
   StringBuilder tempTree = new StringBuilder();
   StringBuilder tree = new StringBuilder();
   tree.append("[");
   tree.append("{\"attr\":{")
       .append(JsTreeUtil1.treeAttrBefore)
       .append("company_company-company")
       .append(JsTreeUtil1.treeAttrMiddle)
       .append("company")
       .append(JsTreeUtil1.treeAttrAfter)
       .append("},\"state\":\"open\",\"data\":\"" + ContextUtils.getCompanyName() + "\"");
   // List<String[]> currentTransactors=taskService.getActivityTaskTransactors(workflowId);
   // List<String> currentPrincipals=taskService.getActivityTaskPrincipals(workflowId);
   taskList = taskService.getActivityTasks(workflowId, ContextUtils.getCompanyId());
   int transactNum = taskList.size();
   if (transactNum > 1) {
     tempTree.append(",\"children\":");
     tempTree.append("[");
     for (WorkflowTask t : taskList) {
       if (StringUtils.isEmpty(t.getTrustorName())) {
         tempTree
             .append(
                 JsTreeUtil1.generateJsTreeNodeNew(
                     "user_" + t.getTransactorName() + "-" + t.getTransactor(),
                     "",
                     t.getTransactorName(),
                     "user"))
             .append(",");
       } else {
         tempTree
             .append(
                 JsTreeUtil1.generateJsTreeNodeNew(
                     "user_" + t.getTransactorName() + "-" + t.getTransactor(),
                     "",
                     t.getTransactorName() + "(受托于" + t.getTrustorName() + ")",
                     "user"))
             .append(",");
       }
     }
     tree.append(delComma(tempTree.toString()));
     tree.append("]");
   }
   tree.append("}");
   tree.append("]");
   renderText(tree.toString());
   return null;
 }
コード例 #11
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void rtxReminder(WorkflowTask task) {
   String msg =
       new StringBuilder("(")
           .append(new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis())))
           .append(")任务:")
           .append(task.getTitle())
           .append("已经生成")
           .append(((System.currentTimeMillis() - task.getCreatedTime().getTime()) / MILLI_SECOND))
           .append("天了。请尽快办理!")
           .toString();
   String url =
       SystemUrls.getSystemUrl(StringUtils.substring(task.getUrl(), 0, task.getUrl().indexOf('/')))
           + StringUtils.substring(task.getUrl(), task.getUrl().indexOf('/'));
   if (url.contains("?")) {
     url = url + task.getId();
   } else {
     url = url + "?taskId=" + task.getId();
   }
   User user = userManager.getUserByLoginName(task.getTransactor());
   rtx.RtxMsgSender.sendNotify(task.getTransactor(), "任务办理提醒", "1", msg, url, user.getCompanyId());
 }
コード例 #12
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void swingInform(WorkflowTask task) throws Exception {
   String msg =
       new StringBuilder("任务:")
           .append(task.getTitle())
           .append("的办理人")
           .append(task.getTransactorName())
           .append("被催办次数已经超过设置上限,请您核实情况。")
           .toString();
   if (StringUtils.isNotEmpty(task.getReminderNoticeUser())) {
     for (String userLoginName : task.getReminderNoticeUser().split(",")) {
       ApiFactory.getPortalService()
           .addMessage(
               "task",
               "系统管理员",
               ContextUtils.getLoginName(),
               userLoginName,
               "催办超期提醒",
               msg,
               "/task/message-task.htm?id=" + task.getId());
     }
   }
 }
コード例 #13
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void reminder(WorkflowTask task) throws Exception {
   String[] reminderStyles = task.getReminderStyle().split(",");
   for (String style : reminderStyles) {
     if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.EMAIL_STYLE)) {
       emailReminder(task);
     } else if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.RTX_STYLE)) {
       rtxReminder(task);
     } else if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.SMS_STYLE)) {
       smsReminder(task);
     } else if (StringUtils.trim(style).equalsIgnoreCase(CommonStrings.SWING_STYLE)) {
       swingReminder(task);
     }
   }
 }
コード例 #14
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 /*
  * 催办超出次数限制,通知相关人员
  */
 public void informSettingUser(WorkflowTask task) throws Exception {
   String[] reminderNoticeStyle = task.getReminderNoticeStyle().split(",");
   for (String style : reminderNoticeStyle) {
     if (style.equalsIgnoreCase(CommonStrings.EMAIL_STYLE)) {
       emailInform(task);
     } else if (style.equalsIgnoreCase(CommonStrings.RTX_STYLE)) {
       RtxInform(task);
     } else if (style.equalsIgnoreCase(CommonStrings.SMS_STYLE)) {
       smsInform(task);
     } else if (style.equalsIgnoreCase(CommonStrings.SWING_STYLE)) {
       swingInform(task);
     }
   }
 }
コード例 #15
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void swingReminder(WorkflowTask task) throws Exception {
   if (StringUtils.isNotEmpty(task.getTransactor())) {
     String msg =
         new StringBuilder("(")
             .append(
                 new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis())))
             .append(")任务:")
             .append(task.getTitle())
             .append("已经生成")
             .append(
                 ((System.currentTimeMillis() - task.getCreatedTime().getTime()) / MILLI_SECOND))
             .append("天了。请尽快办理!")
             .toString();
     ApiFactory.getPortalService()
         .addMessage(
             "task",
             "系统管理员",
             ContextUtils.getLoginName(),
             task.getTransactor(),
             "待办任务催办提醒",
             msg,
             "/task/message-task.htm?id=" + task.getId());
   }
 }
コード例 #16
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public boolean neetReminder(WorkflowTask task) {
   return (task.getLastReminderTime() == null
           && ((System.currentTimeMillis() - task.getCreatedTime().getTime())
               > task.getDuedate() * MILLI_SECOND)
           && (!isHolidayDate()))
       || (task.getLastReminderTime() != null
           && ((System.currentTimeMillis() - task.getLastReminderTime().getTime())
               > task.getRepeat() * MILLI_SECOND)
           && (!isHolidayDate()));
 }
コード例 #17
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 /** 处理任务 */
 @Override
 public String input() throws Exception {
   log.debug("*** input 处理任务方法开始");
   log.debug(
       new StringBuilder("*** Received parameter:[")
           .append("task:")
           .append(task)
           .append("]")
           .toString());
   taskService.updateTaskIsRead(task);
   workflowId = task.getProcessInstanceId();
   workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId);
   opinions = workflowInstanceManager.getOpinions(taskId, task.getCompanyId());
   if (workflowRightsManager.mustOpinionRight(BeanUtil.turnToModelTask(task))
       && (opinions == null || opinions.size() <= 0)) {
     must = true;
   }
   StringBuilder builder = new StringBuilder();
   builder
       .append("<input type=\"hidden\" name=\"dataId\" value=\"")
       .append(workflowInstance.getDataId())
       .append("\"/>");
   formHtml =
       workflowInstanceManager.getHtml(
           workflowInstance.getProcessDefinitionId(),
           workflowInstance.getFormId(),
           workflowInstance.getDataId(),
           task.getName());
   formHtml = builder.toString() + formHtml;
   if (TaskState.COMPLETED.getIndex().equals(task.getActive())
       || TaskState.CANCELLED.getIndex().equals(task.getActive())) {
     // 列表控件控制
     formHtml =
         workflowInstanceManager.getFormHtml(
             workflowInstance, formHtml, workflowInstance.getDataId(), false, false);
     fieldPermission = workflowRightsManager.getFieldPermission(false);
   } else if (TaskState.WAIT_CHOICE_TACHE.getIndex().equals(task.getActive())) {
     canChoiceTaches = taskService.isNeedChoiceTache(task, workflowInstance).getCanChoiceTaches();
     return choiceTache();
   } else {
     // 列表控件控制
     formHtml =
         workflowInstanceManager.getFormHtml(
             workflowInstance, formHtml, workflowInstance.getDataId(), true, false);
     fieldPermission = ApiFactory.getFormService().getFieldPermission(task.getId());
   }
   ApiFactory.getBussinessLogService().log("工作流管理", "任务办理页面", ContextUtils.getSystemId("wf"));
   log.debug("*** input 处理任务方法结束");
   return INPUT;
 }
コード例 #18
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 public String saveChoicePop() throws Exception {
   CompleteTaskTipType completeTaskTipType =
       taskService.completeTacheChoice(taskId, transitionName);
   String to = "";
   switch (completeTaskTipType) {
     case OK:
       to = "OK:" + completeTaskTipType.getContent();
       break;
     case MESSAGE:
       to = "MS:" + completeTaskTipType.getContent();
       break;
     case RETURN_URL:
       String url = completeTaskTipType.getContent();
       if (url.equals(TaskService.DEFAULT_URL)) url = url + "?taskId=" + task.getId();
       to = "RU:" + url;
       break;
     case TACHE_CHOICE_URL:
       to = "TC:" + completeTaskTipType.getContent();
       break;
   }
   ApiFactory.getBussinessLogService().log("工作流管理", "完成选择环节任务", ContextUtils.getSystemId("wf"));
   this.renderText(to);
   return null;
 }
コード例 #19
0
ファイル: TimerUtils.java プロジェクト: songfj/5.2.1.RC
 public void reminder(List<WorkflowTask> tasks) {
   try {
     for (WorkflowTask task : tasks) {
       if (neetReminder(task)) {
         if (task.getReminderLimitTimes() != 0
             && task.getReminderLimitTimes().equals(task.getAlreadyReminderTimes())) {
           if (StringUtils.isNotEmpty(task.getReminderNoticeStyle())) {
             informSettingUser(task);
           }
         }
         if (task.getReminderLimitTimes() == 0
             || task.getReminderLimitTimes() > task.getAlreadyReminderTimes()) {
           if (StringUtils.isNotEmpty(task.getReminderStyle())) {
             reminder(task);
           }
           task.setLastReminderTime(new Date(System.currentTimeMillis()));
           task.setAlreadyReminderTimes(task.getAlreadyReminderTimes() + 1);
         }
       }
     }
     taskService.saveTasks(tasks);
   } catch (Exception e) {
     log.error("定时催办异常:" + e.getMessage());
   }
 }
コード例 #20
0
ファイル: TaskAction.java プロジェクト: songfj/5.2.1.RC
 /** 保存任务 */
 @Override
 public String save() throws Exception {
   log.debug("*** save 办理任务方法开始");
   log.debug(
       new StringBuilder("*** Received parameter:[")
           .append("task:")
           .append(task)
           .append("]")
           .toString());
   ApiFactory.getBussinessLogService().log("工作流管理", "保存任务", ContextUtils.getSystemId("wf"));
   // 如果为分发环节,指定被分发人
   if (TaskProcessingMode.TYPE_DISTRIBUTE.toString().equals(task.getProcessingMode().toString())) {
     return "distribute";
   }
   // 如果为交办环节,指定被交办人
   if (task.getActive() == 0
       && TaskProcessingMode.TYPE_ASSIGN.toString().equals(task.getProcessingMode().toString())) {
     moreTransactor = true;
     workflowInstanceManager.saveData(task, null);
     return "assignTree";
   }
   // 如果已经办理但没有指定办理人
   if (task.getActive() == 1 && task.getProcessingMode() != TaskProcessingMode.TYPE_ASSIGN) {
     return assignTransactor();
   }
   String to = "";
   try {
     CompleteTaskTipType result =
         taskService.completeWorkflowTaskAndSaveData(
             task,
             transact,
             TaskSetting.getTaskSettingInstance()
                 .setTransitionName(transitionName)
                 .setAssignmentTransactors(newTransactor));
     switch (result) {
       case OK:
         this.addSuccessMessage(result.getContent());
         to = input();
         break;
       case MESSAGE:
         this.addErrorMessage(result.getContent());
         to = INPUT;
         break;
       case RETURN_URL:
         to = assignTransactor();
         break;
       case TACHE_CHOICE_URL:
         addActionMessage("请选择环节");
         canChoiceTaches = result.getCanChoiceTaches();
         to = choiceTache();
         break;
       case SINGLE_TRANSACTOR_CHOICE:
         User temp;
         for (String tran : result.getCanChoiceTransactor()) {
           temp = userManager.getUserByLoginName(tran);
           if (temp != null) canChoiceTransactor.put(tran, temp.getName());
         }
         moreTransactor = CompleteTaskTipType.SINGLE_TRANSACTOR_CHOICE.getContent().equals("true");
         to = "singleTransactorChoice";
     }
   } catch (TransactorAssignmentException e) {
     nullAssignmentException = "下一环节没有办理人,请指定!";
     return "assignmentTree";
   } catch (DecisionException de) {
     transitionNames = de.getTransitionNames();
     messageTip = de.getMessage();
     messageTip = getText(messageTip);
     return input();
   }
   return to;
 }