コード例 #1
0
  /**
   * 保存工作组添加用户
   *
   * @return
   * @throws Exception
   */
  @Action("work-group-workgroupAddUser")
  public String workgroupAddUser() throws Exception {
    if (StringUtils.isNotEmpty(ids)) {
      userIds = new ArrayList<Long>();
      User user = userManager.getUserById(ContextUtils.getUserId());
      if ("ALLCOMPANYID".equals(ids)) { // 全公司
        userIds.add(0l);
      } else {
        if (roleManager.hasSystemAdminRole(user)) {
          for (String str : ids.split(",")) {
            userIds.add(Long.valueOf(str));
          }
        } else if (roleManager.hasBranchAdminRole(user)) {
          userIds = ApiFactory.getAcsService().getTreeUserIds(ids);
        }
      }

      String addUsers = workGroupManager.workgroupAddUser(workGroupId, userIds, 0);

      if (StringUtils.isNotEmpty(addUsers))
        ApiFactory.getBussinessLogService()
            .log("工作组管理", "工作组添加人员:" + addUsers, ContextUtils.getSystemId("acs"));
    }
    this.renderText("ok");
    return null;
  }
コード例 #2
0
  // 移交任务
  @Action("transfer-task-tree")
  public String transferTaskTree() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name =
        getText("workflow.doing")
            + "("
            + taskService.getTransferTaskNum(ContextUtils.getUserId(), false)
            + ")";
    ZTreeNode root =
        new ZTreeNode("TRANSFER_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name =
        getText("workflow.complete")
            + "("
            + taskService.getTransferTaskNum(ContextUtils.getUserId(), true)
            + ")";
    root = new ZTreeNode("TRANSFER_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));
    return null;
  }
コード例 #3
0
  // 我委托的流程
  @Action("tree-delegateMonitor")
  public String delegateMonitor() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name =
        getText("workflow.doing")
            + "("
            + taskService.getDelegateTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), false)
            + ")";
    ZTreeNode root = new ZTreeNode("DEL_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name =
        getText("workflow.complete")
            + "("
            + taskService.getDelegateTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), true)
            + ")";
    root = new ZTreeNode("DEL_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));
    return null;
  }
コード例 #4
0
 /**
  * 工作组用户列表
  *
  * @return
  * @throws Exception
  */
 @Action("work-group-getUserByWorkGroup")
 public String getUserByWorkGroup() throws Exception {
   containBranches = departmentManager.containBranches();
   if (userPage.getPageSize() <= 1) {
     User user = userManager.getUserById(ContextUtils.getUserId());
     if (!roleManager.hasSystemAdminRole(user) && roleManager.hasBranchAdminRole(user)) {
       List<BranchAuthority> branchesList =
           branchAuthorityManager.getBranchByUser(ContextUtils.getUserId());
       for (BranchAuthority branches : branchesList) {
         if (StringUtils.isNotEmpty(manageBranchesIds)) {
           manageBranchesIds += ",";
         }
         manageBranchesIds += branches.getBranchesId();
       }
     }
     return "work-group-users";
   } else {
     if (workGroupId != null) {
       userPage = userInfoManager.queryUsersByWorkGroup(userPage, workGroupId);
     }
     renderHtml(PageUtils.pageToJson(userPage));
     return null;
   }
 }
コード例 #5
0
  // 我受托的流程
  @Action("tree-superviseAsTrusteeTree")
  public String superviseAsTrusteeTree() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name =
        getText("workflow.doing")
            + "("
            + taskService.getTrusteeTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), false)
            + ")";
    ZTreeNode root =
        new ZTreeNode("TRUSTEE_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name =
        getText("workflow.complete")
            + "("
            + taskService.getTrusteeTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), true)
            + ")";
    root = new ZTreeNode("TRUSTEE_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));

    //		StringBuilder tree = new StringBuilder("[ ");
    //		tree.append(JsTreeUtils.generateJsTreeNodeDefault("TRUSTEE_ING", null,
    //				getText("workflow.doing") + "(" +
    //				taskService.getTrusteeTasksNum(getCompanyId(), getCurrentUser(),ContextUtils.getUserId(),
    // false) + ")" )).append(",");
    //		tree.append(JsTreeUtils.generateJsTreeNodeDefault("TRUSTEE_END", null,
    //				getText("workflow.complete") + "(" +
    //				taskService.getTrusteeTasksNum(getCompanyId(), getCurrentUser(),
    // ContextUtils.getUserId(),true) + ")" ));
    //
    //	tree.append(" ]");
    return null;
  }