Beispiel #1
0
 /**
  * 取得全局变量
  *
  * @param String key
  * @return String value
  */
 public String queryQjbl(String key) throws Exception {
   Globalpar globalpar = new Globalpar();
   globalpar.setGlobalparcode(key);
   List list = CacheManager.getCacheGlobalpar(globalpar);
   String value = "0";
   if (list != null && list.size() > 0) {
     value = (((Globalpar) list.get(0)).getGlobalparvalue()).toString();
   }
   return value;
 }
Beispiel #2
0
 /**
  * 是否生成账号标志
  *
  * @param String key 行业类别+gwbh
  * @return String value
  */
 public String sczhFlag(String key, String gwbh) throws Exception {
   Globalpar globalpar = new Globalpar();
   globalpar.setGlobalparcode(key + "gwbh");
   List list = CacheManager.getCacheGlobalpar(globalpar);
   String value = "0";
   if (list != null && list.size() > 0) {
     value = (((Globalpar) list.get(0)).getGlobalparvalue()).toString();
     String[] gwbhs = value.split(",");
     for (int i = 0; i < gwbhs.length; i++)
       if (gwbhs[i].equals(gwbh)) {
         return "1";
       }
   }
   return "0";
 }
Beispiel #3
0
  public String queryForExport() {
    ActionContext ctx = ActionContext.getContext();
    HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
    HttpSession session = request.getSession();
    session.removeAttribute("gzdxExportResult");
    // User user= (User)session.getAttribute(Constants.userKey);
    Globalpar glo = this.getCacheGlobalpar("exportmaxrows");
    String maxRows = glo.getGlobalparvalue();
    try {
      Gzdx setGzdx = new Gzdx();
      gzdx = (Gzdx) this.setClass(setGzdx, null);
      Map map = new HashMap();
      //			map.put("xm", gzdx.getXm());
      //			map.put("xb", gzdx.getXb());
      //			map.put("zjhm", gzdx.getZjhm());
      //			map.put("csrq", gzdx.getCsrq());
      //			map.put("csrq2", gzdx.getCsrq2());
      //			map.put("mzdm", gzdx.getMzdm());
      //			map.put("hjdxzqhdm", gzdx.getHjdxzqhdm());
      //			//如果选择了姓名拼音的同音查询,则需要得到姓名的拼音
      //			if("1".equals(gzdx.getTyCheck())){
      //				map.put("xmpy", PinYinUtil.getHanyuPingYin(gzdx.getXm()));
      //				map.put("xm", "");
      //			}
      map.put("xm", gzdx.getXm());
      map.put("xb", gzdx.getXb());
      map.put("zjhm", gzdx.getZjhm());
      map.put("csrq", gzdx.getCsrq());
      map.put("csrq2", gzdx.getCsrq2());
      map.put("mzdm", gzdx.getMzdm());
      map.put("hjdxzqhdm", gzdx.getHjdxzqhdm());
      map.put("hylbdm", gzdx.getHylbdm());
      User user = (User) this.getRequest().getSession().getAttribute(Constants.userKey);
      if (user != null) {
        String dqdwbm = user.getDepartment().getDepartcode();
        int level = user.getDepartment().getDepartlevel().intValue();
        if (level >= 3) map.put("tbdabm", StringUtil.trimEven0(dqdwbm) + "%");
        map.put("dqdwbm", dqdwbm);
      }

      // 如果查询菜单是注销管理,则应该要加一个默认条件为未注销
      if ("cancel".equals(gzdx.getFlag())) {
        map.put("zxbz", "0");
      }
      // 如果选择了姓名拼音的同音查询,则需要得到姓名的拼音
      if ("1".equals(gzdx.getTyCheck())) {
        map.put("xmpy", PinYinUtil.getHanyuPingYin(gzdx.getXm()));
        map.put("xm", "");
      }
      map.put("endRow", maxRows);
      // Excel输出
      lGzdx = gzdxService.getListExportGzdx(map, sort, dir);
      // ///cache 替换
      List lPro = new ArrayList();
      lPro.add("xm");
      lPro.add("zjhm");
      lPro.add("xb");
      lPro.add("csrq");
      lPro.add("minzu");
      lPro.add("whcd");
      lPro.add("hjdxzqh");
      lPro.add("hjdxz");
      List lcache = new ArrayList();
      /*List lcache_mz = this.getDictItemCacheList("minzu", "dm_mz", "0"); //民族替换  "0"为不加列  "1"替换列
      lcache.add(lcache_mz);
      List lcache_xb = this.getDictItemCacheList("xingbie", "dm_xb", "0"); // 性别  "0"为不加列  "1"替换列
      lcache.add(lcache_xb);*/
      Gzdx getGzdx = new Gzdx();
      lGzdx = this.getResultCache(getGzdx.getClass().getName(), lPro, lGzdx, lcache);
      session.setAttribute("gzdxExportResult", lGzdx);
      this.result = "success";
    } catch (IOException e) {
      e.printStackTrace();
      this.result = e.getMessage();
    } catch (Exception e) {
      e.printStackTrace();
      this.result = e.getMessage();
    }
    return "success";
  }