Ejemplo n.º 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";
 }
Ejemplo n.º 2
0
 /**
  * 导出单个震相数据的观测报告
  *
  * @return
  */
 public String exportSingleBulletin() {
   logger.debug("导出单个震相数据时地震目录ID:{}", model.getQcId());
   model.setExpType(SeismicConstants.Bulletin_full);
   String data = "";
   logger.debug("地震目录表名:{}", model.getTableName());
   if (StringUtils.isNotBlank(model.getTableName())) {
     // 测震SCHEMA
     model.setSchema(dataSourceManager.getSeismicSchema());
     data = exportCatDao.queryForSingleBulletin(model);
   }
   // logger.debug("观测报告导出的数据:{}", data);
   String fileName = "attachment;filename=\"SINGLE_Bulletin_VLM_" + model.getQcId() + ".txt\"";
   getResponse().addHeader("Content-Disposition", fileName);
   render(getResponse(), data, "text/html");
   return null;
 }
Ejemplo n.º 3
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";
 }
Ejemplo n.º 4
0
 /**
  * 进入地震目录查询页面 根据后台配置的地震目录表名,查询该表中的地震目录数据
  *
  * @return
  */
 public String index() {
   if (StringUtils.isNotBlank(model.getTableName())) {
     QuakeCatalog czCat = czCatalogManager.queryByCltName(model.getTableName());
     if (czCat == null) {
       addActionError("您选择的地震目录在本系统中不存在.");
     } else {
       model.setTableName(czCat.getCltName());
       model.setMagTname(czCat.getMagTname());
       model.setPhaseTname(czCat.getPhaseTname());
       model.setClcName(czCat.getClcName());
       model.setClDescn(czCat.getClDescn());
       model.setDisType(czCat.getDisType());
     }
   } else {
     addActionError("请选择要查询的地震目录,进行数据查询.");
   }
   return "index";
 }
Ejemplo n.º 5
0
 /**
  * 根据数据格式(BASIC_VLM,FULL_VLM,Bulletin_VLM),导出相应数据
  *
  * @return
  */
 private String exportVlmData() {
   if (StringUtils.isNotBlank(model.getTableName())) {
     // 测震SCHEMA
     model.setSchema(dataSourceManager.getSeismicSchema());
     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);
     }
     StringBuffer buf = exportCatDao.queryForVlm(model);
     return buf.toString();
   } else {
     return "无数据或检查配置本省台网代码!";
   }
 }