|
@@ -15,6 +15,7 @@ import com.caimei.service.auth.UploadService;
|
|
|
import com.caimei.utils.Base64Util;
|
|
|
import com.caimei.utils.ExcelOperateUtil;
|
|
|
import com.caimei.utils.ImageUtils;
|
|
|
+import com.caimei.utils.PoiUtils;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.github.tobato.fastdfs.service.FastFileStorageClient;
|
|
@@ -513,7 +514,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
response.setHeader("Access-Control-Allow-Credentials", "true");
|
|
|
response.setHeader("Content-disposition",
|
|
|
"attachment; filename="+fileName);
|
|
|
-// response.setContentType("application/vnd.ms-excel");
|
|
|
+// response.setContentType("application/vnd.ms-excel"); -- xls
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
return exportData(authPartyList, outputStream);
|
|
|
} catch (Exception e) {
|
|
@@ -733,8 +734,8 @@ public class AuthServiceImpl implements AuthService {
|
|
|
// 创建机构工作表
|
|
|
XSSFSheet authPartySheet = workbook.createSheet("授权机构");
|
|
|
// sheet样式定义
|
|
|
-// HSSFCellStyle topCellStyle = this.getTopCellStyle(workbook);
|
|
|
-// HSSFCellStyle customCellStyle = this.getCustomCellStyle(workbook);
|
|
|
+ XSSFCellStyle topCellStyle = PoiUtils.getXSSFTopCellStyle(workbook);
|
|
|
+ XSSFCellStyle customCellStyle = PoiUtils.getXSSFCustomCellStyle(workbook);
|
|
|
// 创建列头行
|
|
|
XSSFRow authTopRow = authPartySheet.createRow(0);
|
|
|
// 添加列头单元格(5个固定列+参数列表)
|
|
@@ -745,7 +746,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
authTopRowCell.setCellType(CellType.valueOf("STRING"));
|
|
|
XSSFRichTextString columnText = new XSSFRichTextString(rowName[i]);
|
|
|
authTopRowCell.setCellValue(columnText);
|
|
|
-// productTopRowCell.setCellStyle(topCellStyle);
|
|
|
+ authTopRowCell.setCellStyle(topCellStyle);
|
|
|
}
|
|
|
// 行索引
|
|
|
AtomicInteger authPartyRowNum = new AtomicInteger(1);
|
|
@@ -768,7 +769,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
authData.add(authParty.getRemarks());
|
|
|
for (int j = 0; j < authData.size(); j++) {
|
|
|
XSSFCell authCell = authRow.createCell(j);
|
|
|
-// authCell.setCellStyle(customCellStyle);
|
|
|
+ authCell.setCellStyle(customCellStyle);
|
|
|
if (j == 7) {
|
|
|
authCell.setCellType(CellType.NUMERIC);
|
|
|
authCell.setCellValue(Integer.parseInt(authData.get(j)));
|
|
@@ -811,7 +812,7 @@ public class AuthServiceImpl implements AuthService {
|
|
|
e.printStackTrace();
|
|
|
return ResponseJson.error("导出失败");
|
|
|
}
|
|
|
- return ResponseJson.success("导出成功");
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
private String uploadImage(String filePath) throws IOException {
|