Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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());
 }
Ejemplo n.º 4
0
 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());
   }
 }