コード例 #1
0
  @RequestMapping(value = "/exportInStationTransfor", method = RequestMethod.GET)
  public void export(Parameter parameter, HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    logger.info("导出院内转运统计到excel");
    response.setContentType("application/msexcel;charset=UTF-8");

    String title = "院内转运统计";
    String[] headers = new String[] {"出诊分站", "转运次数", "里程", "转运耗时"};
    String[] fields = new String[] {"station", "transforTimes", "distance", "transforTime"};
    int spanCount = 1; // 需要合并的列数。从第1列开始到指定列。
    TableData td =
        ExcelUtils.createTableData(
            inStationTransforService.getData(parameter).getRows(),
            ExcelUtils.createTableHeader(headers, spanCount),
            fields);
    JsGridReportBase report = new JsGridReportBase(request, response);

    HttpSession session = request.getSession();
    SessionInfo sessionInfo = (SessionInfo) session.getAttribute("sessionInfo");
    if (null != sessionInfo) {
      report.exportToExcel(title, sessionInfo.getUser().getName(), td, parameter);
    } else {
      report.exportToExcel(title, "", td, parameter);
    }
  }
コード例 #2
0
 @RequestMapping(value = "/getInStationTransforDatas", method = RequestMethod.POST)
 public @ResponseBody Grid getData(Parameter parameter) {
   logger.info("院内转运统计");
   return inStationTransforService.getData(parameter);
 }