예제 #1
0
 // 岗位级别联动菜单
 public String getStates() throws Exception {
   try {
     String code = getRequest().getParameter("code");
     Dictvalue dictvalue = dictvalueManager.findByCode(code);
     List list = new ArrayList(dictvalue.getDictvalues());
     JsonConfig cfg = new JsonConfig();
     cfg.setJsonPropertyFilter(
         new PropertyFilter() {
           public boolean apply(Object source, String name, Object value) {
             if (name.equals("code") || name.equals("value")) {
               return false;
             } else {
               return true;
             }
           }
         });
     String ss = JSONArray.fromObject(list, cfg).toString();
     StringBuffer returnstr = new StringBuffer("");
     returnstr.append(ss);
     super.renderHtmlUTF(returnstr.toString());
   } catch (Exception e) {
     e.printStackTrace();
   }
   return null;
 }
예제 #2
0
  /**
   * 进入新增页面
   *
   * @return
   */
  public String create() {
    // getRequest().setAttribute(DEPTS, deptManager.findAll());
    getRequest().setAttribute(DEPTS, organizationManager.findAllByDf());
    // 性别
    this.sexMap = dicUtil.getDicList("DICT_SEX");
    //		Dictitem item = dictitemManager.findByCode("post"); // 获取所有的岗位及岗位级别
    List stations = dictvalueManager.findByItemCode("post"); // 获取所有的一级岗位

    getRequest().setAttribute("stations", stations);
    getRequest().setAttribute("clientId", "userImage"); // 调用外部上传头像程序所必须的目录名
    return CREATE_JSP;
  }