Commit 6efaf397 authored by hanfeng's avatar hanfeng

总业绩统计

parent 75c22dd8
...@@ -173,6 +173,8 @@ public class TotalPerformanceBiz { ...@@ -173,6 +173,8 @@ public class TotalPerformanceBiz {
} }
List<String[]> achievementArray =getAchievementArrays(achievements,12); List<String[]> achievementArray =getAchievementArrays(achievements,12);
createCellData(sheet,1,generalCellStyle,achievementArray); createCellData(sheet,1,generalCellStyle,achievementArray);
//设置最后一行 //设置最后一行
int lastRowNum = sheet.getLastRowNum(); int lastRowNum = sheet.getLastRowNum();
XSSFRow rown = sheet.createRow(lastRowNum); XSSFRow rown = sheet.createRow(lastRowNum);
...@@ -308,13 +310,6 @@ public class TotalPerformanceBiz { ...@@ -308,13 +310,6 @@ public class TotalPerformanceBiz {
private void createHeader(Row row, int cellStartIndex, String[] header, CellStyle cellStyle){ private void createHeader(Row row, int cellStartIndex, String[] header, CellStyle cellStyle){
for (int i =0 ;i<header.length;i++){ for (int i =0 ;i<header.length;i++){
Cell cell = row.createCell(cellStartIndex); Cell cell = row.createCell(cellStartIndex);
//设置head填充色
CellStyle cellStyle1 = cell.getCellStyle();
cellStyle1.setFillForegroundColor(IndexedColors.TURQUOISE.getIndex());
cellStyle1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
cell.setCellStyle(cellStyle1);
cell.setCellValue(header[i]); cell.setCellValue(header[i]);
cell.setCellStyle(cellStyle); cell.setCellStyle(cellStyle);
cellStartIndex+=1; cellStartIndex+=1;
......
...@@ -86,15 +86,13 @@ public class TotalPerformanceStatementController extends CommonBaseController { ...@@ -86,15 +86,13 @@ public class TotalPerformanceStatementController extends CommonBaseController {
String name = DateTimeFormatter.ofPattern("YYYYMMddHHmmss").format(LocalDateTime.now()); String name = DateTimeFormatter.ofPattern("YYYYMMddHHmmss").format(LocalDateTime.now());
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
String filename = String.format("%s.xlsx",name);
response.setHeader("Content-Disposition","attachment;filename="+filename);
ServletOutputStream outputStream = response.getOutputStream();
if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) { if (BookkeepingTypeEnum.ENTER.getCode().equals(queryCriteria.getType())) {
String filename = String.format("%s-总业绩-入账表.xlsx",name);
response.setHeader("Content-Disposition","attachment;filename="+ new String(filename.getBytes(), "iso8859-1"));
ServletOutputStream outputStream = response.getOutputStream();
totalPerformanceBiz.exportEntry(queryCriteria, name, outputStream); totalPerformanceBiz.exportEntry(queryCriteria, name, outputStream);
}else if (BookkeepingTypeEnum.OUT.getCode().equals(queryCriteria.getType())){ }else if (BookkeepingTypeEnum.OUT.getCode().equals(queryCriteria.getType())){
String filename = String.format("%s-总业绩-出账表.xlsx",name);
response.setHeader("Content-Disposition","attachment;filename="+ new String(filename.getBytes(), "iso8859-1"));
ServletOutputStream outputStream = response.getOutputStream();
totalPerformanceBiz.exportAccount(queryCriteria, name, outputStream); totalPerformanceBiz.exportAccount(queryCriteria, name, outputStream);
}else { }else {
throw new BaseException("无相关数据"); throw new BaseException("无相关数据");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment