Example #1
0
 /**
  * 显示GIS信息 根据所选查询条件,在Google map上显示震中分布图 将经纬度保留小数点后两位
  *
  * @return
  */
 public String showGis() {
   if (StringUtils.isNotBlank(model.getTableName())) {
     try {
       model.setPage(getPage());
       // 测震SCHEMA
       model.setSchema(dataSourceManager.getSeismicSchema());
       model.setSortProperty(getSortProperty());
       model.setSortDir(getSortDir());
       if (model.getStartDate() != null) {
         Date startDate = DateUtil.firstSecondOfDate(model.getStartDate());
         model.setStartDate(startDate);
       }
       if (model.getEndDate() != null) {
         Date endDate = DateUtil.lastSecondOfDate(model.getEndDate());
         model.setEndDate(endDate);
       }
       // 地震目录查询_不分页
       List<Map> list = gridCatDao.queryForGis(model);
       logger.debug("显示GIS信息时查询地震目录条数:{}", list.size());
       for (Map map : list) {
         map.put("EPI_LON", NumberFormatUtil.format(map.get("EPI_LON"), 2));
         map.put("EPI_LAT", NumberFormatUtil.format(map.get("EPI_LAT"), 2));
       }
       getRequest().setAttribute("items", list);
     } catch (Exception e) {
       logger.error("数据查询错误{}", e.getMessage());
       e.printStackTrace();
       clean();
     }
   }
   // 查找当前省份
   getRequest().setAttribute("currentProvince", provinceLatlng.getCurrentProvince());
   return "quake";
 }
Example #2
0
 /**
  * 地震目录查询返回结果 按照所选条件分页查询地震目录数据
  *
  * @return
  */
 public String list() {
   if (StringUtils.isNotBlank(model.getTableName())) {
     try {
       model.setPage(getPage());
       // 测震SCHEMA
       model.setSchema(dataSourceManager.getSeismicSchema());
       model.setSortProperty(getSortProperty());
       model.setSortDir(getSortDir());
       // limit查询,设定start和size
       int start = Page.start(getPageNo(), getPageSize());
       model.setStart(start);
       model.setSize(getPageSize());
       logger.debug("list方法,开始记录:{},pageSize:{}", start, getPageSize());
       if (model.getStartDate() != null) {
         Date startDate = DateUtil.firstSecondOfDate(model.getStartDate());
         model.setStartDate(startDate);
       }
       if (model.getEndDate() != null) {
         Date endDate = DateUtil.lastSecondOfDate(model.getEndDate());
         model.setEndDate(endDate);
       }
       // 查询地震目录
       Page page = gridCatDao.query(model);
       logger.debug("查询出的记录数:{}", page.getData().size());
       getRequest().setAttribute("items", page.getData());
       cats = page.getData(); // 供震相、Seed使用的数据
       restorePageData(page.getRows(), getPageSize());
     } catch (Exception e) {
       logger.error("数据查询错误{}", e.getMessage());
       e.printStackTrace();
       clean();
     }
   }
   return "list";
 }