/**
  * 展业计划列表
  *
  * @param space
  * @param page
  * @param rows
  * @param request
  * @param session
  * @return
  */
 @RequestMapping("spaceList")
 public @ResponseBody Pagination spaceList(
     Space space, String page, String rows, HttpServletRequest request, HttpSession session) {
   Pagination pagination = new Pagination();
   if (!StringUtils.isBlank(page)) {
     pagination.setPage(Integer.valueOf(page));
   }
   if (!StringUtils.isBlank(rows)) {
     pagination.setPageSize(Integer.valueOf(rows));
   }
   return spaceService.spaceList(pagination, space, page, rows, request, session);
 }
 /**
  * 模糊查询
  *
  * @param fuzzyValue 模糊查询条件
  * @param page 第几页
  * @param rows 每页显示行数
  * @param accountType 账户类型
  * @return 分公司财务信息分页列表
  */
 @RequestMapping(value = "searchFuzzy")
 public @ResponseBody Pagination searchFuzzy(
     String fuzzyValue, String page, String rows, String accountType) {
   Pagination pagination = new Pagination();
   if (!StringUtils.isBlank(rows)) {
     pagination.setPageSize(Integer.valueOf(rows));
   }
   if (!StringUtils.isBlank(page)) {
     pagination.setPage(Integer.valueOf(page));
   }
   return accountInfoService.selectFuzzy(fuzzyValue, pagination, accountType);
 }
  @RequestMapping(value = "queryAccountInformationChangeList")
  public @ResponseBody Pagination queryAccountInformationChangeList(
      @RequestParam(required = false) String page,
      @RequestParam(required = false) String rows,
      HttpSession session,
      String paramJsonMap,
      String sort,
      String order) {
    Pagination pagination = new Pagination();
    if (!StringUtils.isBlank(page)) {
      pagination.setPage(Integer.valueOf(page));
    }
    if (!StringUtils.isBlank(rows)) {
      pagination.setPageSize(Integer.valueOf(rows));
    }
    // 添加权限查询
    List<String> authList = SpringSecurityUtils.getAuthList(session);
    String sqlsid = "";
    if (authList.size() > 0) {
      for (String e : authList) {
        if (sqlsid != null) {
          sqlsid = sqlsid + "'" + e + "'" + ",";
        } else {
          sqlsid = "'" + e + "'" + ",";
        }
      }
      sqlsid = sqlsid.substring(0, sqlsid.length() - 1);
    }

    System.out.println(sqlsid);
    System.out.println(sqlsid);
    System.out.println(sqlsid);
    System.out.println(sqlsid);
    Map<String, String> pramMap = new HashMap<String, String>();

    pramMap.put("authList", sqlsid);
    pramMap.put("sort", sort);
    pramMap.put("order", order);

    if (!"".equals(paramJsonMap) && paramJsonMap != null) {
      Map<String, String> temp = JsonUtil.getObject(paramJsonMap);
      String businessNumber = temp.get("businessNumber");
      String name = temp.get("name");
      pramMap.put("businessNumber", businessNumber);
      pramMap.put("name", name);
    }

    pagination = modifyCatdAppService.queryAccountInformationChangeList(pagination, pramMap);

    return pagination;
  }
 @RequestMapping("downloadExcel")
 public void downloadExcel(
     HttpServletResponse response,
     Pagination pagination,
     Space space,
     String page,
     String rows,
     HttpServletRequest request,
     HttpSession session)
     throws Exception {
   // response.setContentType("application/msexcel;charset=UTF-8");
   pagination.setPageSize(0);
   pagination = spaceService.downloadExcel(pagination, space, page, rows, request, session);
   List list = pagination.getRows(); // 获取数据
   if (CommonUtil.isNotEmpty(list)) {
     String title = "执行计划列表";
     String[] hearders =
         new String[] {
           "大区名字", "分中心", "所属营业部", "计划展业日期", "计划展业时间", "计划展业地点", "人员规划", "预计客户咨询量", "展业状态",
           "实际展业日期", "实际展业时间", "实际展业地点", "实际参与人员", "实际客户量", "提供照片数量"
         }; // 表头数组
     String[] fields =
         new String[] {
           "REGIONNAME",
           "CITYDEPARTMENTNAME",
           "AREADEPARTMENTNAME",
           "SPACEDATE",
           "SPACETIME",
           "SPACEPLACE",
           "PERSONPLANNING",
           "CUSTOMERCONSULTCOUNT",
           "SAPCETEXT",
           "SPACEDATEREALITY",
           "SPACETIMEREALITY",
           "SPACEPLACEREALITY",
           "PARTICIPANTSREALITY",
           "CUSTOMERCONSULTCOUNTREALITY",
           "PHOTOCOUNT"
         }; // 对象属性数组
     TableData td =
         ExcelUtils.createTableData(list, ExcelUtils.createTableHeader(hearders), fields);
     // JsGridReportBase report = new JsGridReportBase(request, response);
     jsGridReportBaseXLSXService.jsGridReportBaseXLSXService(request, response);
     jsGridReportBaseXLSXService.exportToExcel(
         title, SpringSecurityUtils.getCurrentUserName(), td);
   } else {
     String title = "执行计划列表";
     String[] hearders =
         new String[] {
           "大区名字", "分中心", "所属营业部", "计划展业日期", "计划展业日期", "计划展业时间", "计划展业地点", "人员规划", "预计客户咨询量",
           "展业状态", "实际展业日期", "实际展业时间", "实际展业地点", "实际参与人员", "实际客户量", "提供照片数量"
         }; // 表头数组
     Space cu = new Space();
     list.add(cu);
     String[] fields = new String[] {}; // 对象属性数组
     TableData td =
         ExcelUtils.createTableData(list, ExcelUtils.createTableHeader(hearders), fields);
     /* JsGridReportBase report = new JsGridReportBase(request, response);
     report.exportToExcel(title, SpringSecurityUtils.getCurrentUserName(), td);*/
     jsGridReportBaseXLSXService.jsGridReportBaseXLSXService(request, response);
     jsGridReportBaseXLSXService.exportToExcel(
         title, SpringSecurityUtils.getCurrentUserName(), td);
   }
 }