|
|
@@ -299,8 +299,8 @@ public class XlgzzReportAction implements IMINAction {
|
|
|
|
|
|
//******************************************抢修类工单明细******************************************//
|
|
|
String[] titleArray3 = new String[]{"客户总量(户)","平均到达现场时间(分)","工单处理平均时长(分)","到达现场超时数",
|
|
|
- "工单时长超70分钟数","客户内部故障","低压故障","非电力故障","电能质量等故障"};
|
|
|
- String[] fieldArray3 = new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13"};
|
|
|
+ "工单时长超70分钟数","故障类型#客户内部故障","故障类型#低压故障","故障类型#非电力故障","故障类型#电能质量等故障","疑似虚假回单","工单总数","万户报修率"};
|
|
|
+ String[] fieldArray3 = new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13","","","",""};
|
|
|
index = this.XlzgzCreateSheet(wb,index,"抢修类工单报表明细",titleArray3,fieldArray3,"",new ArrayList<>(),new HashMap<String,String>());
|
|
|
return wb;
|
|
|
}
|
|
|
@@ -308,7 +308,7 @@ public class XlgzzReportAction implements IMINAction {
|
|
|
XSSFSheet sheet = wb.createSheet(sheetName);
|
|
|
int rowIndex = 0;
|
|
|
String title = StringUtil.ObjectToString(map.get("title"));
|
|
|
- if(!"".equals(title)){
|
|
|
+ if(!"".equals(title)){//标题行
|
|
|
XSSFRow row0 = sheet.createRow((int) rowIndex);// 行数从0开始
|
|
|
row0.setHeightInPoints(30);//设置行的高度
|
|
|
XSSFCell celldesc = row0.createCell(0);
|
|
|
@@ -317,7 +317,7 @@ public class XlgzzReportAction implements IMINAction {
|
|
|
celldesc.setCellStyle(ExportUtils.getDescCellStyle(wb));
|
|
|
rowIndex ++;
|
|
|
}
|
|
|
- if(!"".equals(descStr)){
|
|
|
+ if(!"".equals(descStr)){//描述行
|
|
|
//添加描述行
|
|
|
XSSFRow row0 = sheet.createRow((int) rowIndex);// 行数从0开始
|
|
|
row0.setHeightInPoints(30);//设置行的高度
|
|
|
@@ -327,17 +327,33 @@ public class XlgzzReportAction implements IMINAction {
|
|
|
celldesc.setCellStyle(ExportUtils.getDescCellStyle(wb));
|
|
|
rowIndex++;
|
|
|
}
|
|
|
- if(titleArray.length > 0){
|
|
|
- // 添加标题行
|
|
|
- XSSFRow row1 = sheet.createRow((int) rowIndex);
|
|
|
- for (int i = 0; i < titleArray.length; i++) {
|
|
|
- XSSFCell titleCell = row1.createCell(i );// 0号位被序号占用,所以需+1
|
|
|
- titleCell.setCellValue(titleArray[i]);
|
|
|
- titleCell.setCellStyle(ExportUtils.getTitleCellStyle(wb));
|
|
|
- sheet.setColumnWidth(i, 30 * 256);
|
|
|
+ int manyTitle = rowIndex;
|
|
|
+ if(titleArray.length > 0){//标题行
|
|
|
+ if (titleArray != null && titleArray.length > 0){
|
|
|
+ for (int i = 0; i < titleArray.length; i++) {
|
|
|
+ for (String col : titleArray) {
|
|
|
+ String[] colTitles = col.split(ExportUtils.COLUMNS_SEPARATOR);
|
|
|
+ manyTitle = Math.max(manyTitle,colTitles.length);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //重新组装表头
|
|
|
+ titleArray = ExportUtils.autocomplete(titleArray, manyTitle);
|
|
|
+ for (int j = 0; j < manyTitle; j++) {
|
|
|
+ XSSFRow row1 = sheet.createRow((int) rowIndex);
|
|
|
+ // 表头数据填充
|
|
|
+ for(int i = 0; i < titleArray.length; i++) {
|
|
|
+ XSSFCell titleCell = row1.createCell(i );// 0号位被序号占用,所以需+1
|
|
|
+ titleCell.setCellValue(titleArray[i].split("#")[j]);
|
|
|
+ titleCell.setCellStyle(ExportUtils.getTitleCellStyle(wb));
|
|
|
+ sheet.setColumnWidth(i, 30 * 256);
|
|
|
+ }
|
|
|
+ rowIndex ++;
|
|
|
}
|
|
|
- rowIndex ++;
|
|
|
}
|
|
|
+ //合并表头
|
|
|
+ ExportUtils.titleMerge(sheet, fieldArray.length, titleArray, manyTitle);
|
|
|
+
|
|
|
//数据列
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
//创建行
|