Пример #1
0
  public String querylist() throws Exception {
    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());
    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", "");
    }
    Page page = gzdxService.getListForPage(map, pagesize, pagerow, sort, dir);
    totalpage = page.getTotalPages();
    totalrows = page.getTotalRows();
    lGzdx = page.getData();
    setTabledata(lGzdx);
    this.result = "success";
    return "success";
  }
Пример #2
0
 public String querylist() throws Exception {
   Qyyyrztj setQyyyrztj = new Qyyyrztj();
   setQyyyrztj = (Qyyyrztj) this.setClass(setQyyyrztj, null);
   Map map = new HashMap();
   map.put("dsjgdm", setQyyyrztj.getDsjgdm());
   map.put("fxjdm", setQyyyrztj.getFxjdm());
   map.put("gxdwdm", setQyyyrztj.getGxdwdm());
   map.put("dsjgbz", setQyyyrztj.getDsjgbz());
   map.put("fxjbz", setQyyyrztj.getFxjbz());
   map.put("gxdwbz", setQyyyrztj.getGxdwbz());
   map.put("hylbdm", setQyyyrztj.getHylbdm());
   map.put("qsrq", setQyyyrztj.getQsrq());
   map.put("jzrq", setQyyyrztj.getJzrq());
   ActionContext ctx = ActionContext.getContext();
   HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
   HttpSession session = request.getSession();
   User user = (User) session.getAttribute(Constants.userKey);
   String departTemp = user.getDepartment().getDepartcode();
   String DeptCode = departTemp;
   if (!setQyyyrztj.getDsjgdm().equals("")) DeptCode = setQyyyrztj.getDsjgdm();
   if (!setQyyyrztj.getFxjdm().equals("")) DeptCode = setQyyyrztj.getFxjdm();
   if (!setQyyyrztj.getGxdwdm().equals("")) DeptCode = setQyyyrztj.getGxdwdm();
   map.put("deptcode", StringUtil.trimEven0(DeptCode));
   if (DepartmentUtil.departIsZxs(departTemp)) map.put("iszxs", "1");
   Integer deptlevel = 2;
   if (!DepartmentUtil.departIsZxs(departTemp)) {
     if ("1".equals(setQyyyrztj.getGxdwbz())) {
       deptlevel = 5;
     } else if ("1".equals(setQyyyrztj.getFxjbz())) {
       deptlevel = 4;
     } else if ("1".equals(setQyyyrztj.getDsjgbz())) {
       deptlevel = 3;
     }
   } else {
     if ("1".equals(setQyyyrztj.getGxdwbz())) {
       deptlevel = 4;
     } else if ("1".equals(setQyyyrztj.getFxjbz())) {
       deptlevel = 3;
     } else if ("1".equals(setQyyyrztj.getDsjgbz())) {
       deptlevel = 2;
     }
   }
   map.put("deptlevel", deptlevel);
   Page page = qyyyrztjService.getListForPagetj(map, pagesize, pagerow, sort, dir);
   totalpage = page.getTotalPages();
   totalrows = page.getTotalRows();
   lQyyyrztj = page.getData();
   int qyzs = 0;
   int sccss = 0;
   int wsccss = 0;
   int cyrys = 0;
   int sbrs = 0;
   int xzrys = 0;
   int lzrys = 0;
   Qyyyrztj sumQyyyrztj = new Qyyyrztj();
   for (java.util.Iterator iter = lQyyyrztj.iterator(); iter.hasNext(); ) {
     Qyyyrztj oneQyyyrztj = (Qyyyrztj) iter.next();
     qyzs += oneQyyyrztj.getQyzs().intValue();
     sccss += oneQyyyrztj.getSccss().intValue();
     wsccss += oneQyyyrztj.getWsccss().intValue();
     cyrys += oneQyyyrztj.getCyrys().intValue();
     sbrs += oneQyyyrztj.getSbrs().intValue();
     xzrys += oneQyyyrztj.getXzrys().intValue();
     lzrys += oneQyyyrztj.getLzrys().intValue();
     if (oneQyyyrztj.getGxdwdm() != null && !oneQyyyrztj.getGxdwdm().equals("")) {
       oneQyyyrztj.setMxlj(
           "<a href='#' class='fontbutton' title='详细' onclick=setXxQuery('"
               + oneQyyyrztj.getGxdwdm()
               + "')>详细</a>");
     } else if (oneQyyyrztj.getFxjdm() != null && !oneQyyyrztj.getFxjdm().equals("")) {
       oneQyyyrztj.setMxlj(
           "<a href='#' class='fontbutton' title='详细' onclick=setXxQuery('"
               + oneQyyyrztj.getFxjdm()
               + "')>详细</a>");
     } else if (oneQyyyrztj.getDsjgdm() != null && !oneQyyyrztj.getDsjgdm().equals("")) {
       oneQyyyrztj.setMxlj(
           "<a href='#' class='fontbutton' title='详细' onclick=setXxQuery('"
               + oneQyyyrztj.getDsjgdm()
               + "')>详细</a>");
     }
   }
   sumQyyyrztj.setQyzs(qyzs);
   sumQyyyrztj.setSccss(sccss);
   sumQyyyrztj.setWsccss(wsccss);
   sumQyyyrztj.setCyrys(cyrys);
   sumQyyyrztj.setSbrs(sbrs);
   sumQyyyrztj.setXzrys(xzrys);
   sumQyyyrztj.setLzrys(lzrys);
   // sumQyyyrztj.setMxlj("");
   sumQyyyrztj.setDsjgmc("总计");
   if ("1".equals(setQyyyrztj.getDsjgbz())) {
     lQyyyrztj.add(sumQyyyrztj);
   }
   this.result = "success";
   return "success";
 }
Пример #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";
  }