package com.product.server.report.service; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONObject; import com.product.core.dao.BaseDao; import com.product.core.entity.DataTableEntity; import com.product.core.entity.FieldSetEntity; import com.product.core.entity.Report; import com.product.core.exception.BaseException; import com.product.server.report.service.idel.ListReportConfigService; @Service public class ListReportConfigServiceImple implements ListReportConfigService { @Autowired public BaseDao baseDao; public BaseDao getBaseDao() { return baseDao; } public void setBaseDao(BaseDao baseDao) { this.baseDao = baseDao; } public ListReportServer reportServerNew; public ListReportServer getReportServerNew() { return reportServerNew; } public void setReportServerNew(ListReportServer reportServerNew) { this.reportServerNew = reportServerNew; } public static Logger logger=Logger.getLogger(ListReportConfigServiceImple.class); //根据表名获取报表 public String createReportInfo(String tableUuid) throws BaseException{ //获取配置报表 FieldSetEntity felset = baseDao.getFieldSetEntity("product_sys_reoprt_config", tableUuid, false); DataTableEntity data = null; if(felset.getString("report_table_name") != null && !felset.getString("report_table_name").isEmpty()){ data = baseDao.listTable(felset.getString("report_table_name")); }else if(felset.getString("report_data_sql") != null){ data = baseDao.listTable(felset.getString("report_data_sql"), new String[]{}); } DataTableEntity fieldData = baseDao.listTable("product_sys_report_field_properties", "report_uuid = '"+tableUuid+"'", "order_number"); Report rc=new Report(); if(fieldData.getRows() > 0){ int row = fieldData.getRows(); String[] showField = new String[row];//字段名 int[][] showColspan = new int[1][row];//跨列 String[][] showTitle = new String[1][row];//字段描述 int[][] showRowspan = new int[1][row];//跨行 boolean[] showTotalField = new boolean[row];//是否总计 int[] showColWidth = new int[row];//列宽 String[] showFormat = new String[row];//字段格式 boolean[] showGroupField = new boolean[row];//是否分组 String[] url = new String[row];//穿透地址 for(int i=0;i 0){ int headerY = headerData.getRows() / fieldData.getRows();//二维数组y int[][] headerColspan = new int[headerY][fieldData.getRows()];//跨列 String[][] headerTitle = new String[headerY][fieldData.getRows()];//字段描述 int[][] headerRowspan = new int[headerY][fieldData.getRows()];//跨行 int y = 0; for(int j=0;j