|
@@ -729,30 +729,30 @@ public class AuthServiceImpl implements AuthService {
|
|
|
|
|
|
private ResponseJson exportData(List<AuthFormVo> authPartyList, OutputStream outputStream) {
|
|
private ResponseJson exportData(List<AuthFormVo> authPartyList, OutputStream outputStream) {
|
|
try {
|
|
try {
|
|
- HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
|
|
|
+ XSSFWorkbook workbook = new XSSFWorkbook();
|
|
// 创建机构工作表
|
|
// 创建机构工作表
|
|
- HSSFSheet authPartySheet = workbook.createSheet("授权机构");
|
|
|
|
|
|
+ XSSFSheet authPartySheet = workbook.createSheet("授权机构");
|
|
// sheet样式定义
|
|
// sheet样式定义
|
|
- HSSFCellStyle topCellStyle = this.getTopCellStyle(workbook);
|
|
|
|
- HSSFCellStyle customCellStyle = this.getCustomCellStyle(workbook);
|
|
|
|
|
|
+// HSSFCellStyle topCellStyle = this.getTopCellStyle(workbook);
|
|
|
|
+// HSSFCellStyle customCellStyle = this.getCustomCellStyle(workbook);
|
|
// 创建列头行
|
|
// 创建列头行
|
|
- HSSFRow productTopRow = authPartySheet.createRow(0);
|
|
|
|
|
|
+ XSSFRow authTopRow = authPartySheet.createRow(0);
|
|
// 添加列头单元格(5个固定列+参数列表)
|
|
// 添加列头单元格(5个固定列+参数列表)
|
|
String[] rowName = {"机构名称(必填)", "所在地区(必填)", "详细地址(必填)", "经纬度(必填)",
|
|
String[] rowName = {"机构名称(必填)", "所在地区(必填)", "详细地址(必填)", "经纬度(必填)",
|
|
"联系电话(必填)", "认证编号(选填)", "认证日期(选填)", "员工人数(必填)", "店铺备注(选填)"};
|
|
"联系电话(必填)", "认证编号(选填)", "认证日期(选填)", "员工人数(必填)", "店铺备注(选填)"};
|
|
for (int i = 0; i < rowName.length; i++) {
|
|
for (int i = 0; i < rowName.length; i++) {
|
|
- HSSFCell productTopRowCell = productTopRow.createCell(i);
|
|
|
|
- productTopRowCell.setCellType(CellType.valueOf("STRING"));
|
|
|
|
- HSSFRichTextString columnText = new HSSFRichTextString(rowName[i]);
|
|
|
|
- productTopRowCell.setCellValue(columnText);
|
|
|
|
- productTopRowCell.setCellStyle(topCellStyle);
|
|
|
|
|
|
+ XSSFCell authTopRowCell = authTopRow.createCell(i);
|
|
|
|
+ authTopRowCell.setCellType(CellType.valueOf("STRING"));
|
|
|
|
+ XSSFRichTextString columnText = new XSSFRichTextString(rowName[i]);
|
|
|
|
+ authTopRowCell.setCellValue(columnText);
|
|
|
|
+// productTopRowCell.setCellStyle(topCellStyle);
|
|
}
|
|
}
|
|
// 行索引
|
|
// 行索引
|
|
AtomicInteger authPartyRowNum = new AtomicInteger(1);
|
|
AtomicInteger authPartyRowNum = new AtomicInteger(1);
|
|
|
|
|
|
authPartyList.forEach(authParty -> {
|
|
authPartyList.forEach(authParty -> {
|
|
// 创建商品行
|
|
// 创建商品行
|
|
- HSSFRow authRow = authPartySheet.createRow(authPartyRowNum.get());
|
|
|
|
|
|
+ XSSFRow authRow = authPartySheet.createRow(authPartyRowNum.get());
|
|
// 组装商品数据
|
|
// 组装商品数据
|
|
List<String> authData = new ArrayList<>();
|
|
List<String> authData = new ArrayList<>();
|
|
authData.add(authParty.getAuthParty());
|
|
authData.add(authParty.getAuthParty());
|
|
@@ -767,14 +767,14 @@ public class AuthServiceImpl implements AuthService {
|
|
authData.add(authParty.getEmpNum().toString());
|
|
authData.add(authParty.getEmpNum().toString());
|
|
authData.add(authParty.getRemarks());
|
|
authData.add(authParty.getRemarks());
|
|
for (int j = 0; j < authData.size(); j++) {
|
|
for (int j = 0; j < authData.size(); j++) {
|
|
- HSSFCell authCell = authRow.createCell(j);
|
|
|
|
- authCell.setCellStyle(customCellStyle);
|
|
|
|
|
|
+ XSSFCell authCell = authRow.createCell(j);
|
|
|
|
+// authCell.setCellStyle(customCellStyle);
|
|
if (j == 7) {
|
|
if (j == 7) {
|
|
authCell.setCellType(CellType.NUMERIC);
|
|
authCell.setCellType(CellType.NUMERIC);
|
|
authCell.setCellValue(Integer.parseInt(authData.get(j)));
|
|
authCell.setCellValue(Integer.parseInt(authData.get(j)));
|
|
} else {
|
|
} else {
|
|
authCell.setCellType(CellType.valueOf("STRING"));
|
|
authCell.setCellType(CellType.valueOf("STRING"));
|
|
- HSSFRichTextString authCellValue = new HSSFRichTextString(authData.get(j));
|
|
|
|
|
|
+ XSSFRichTextString authCellValue = new XSSFRichTextString(authData.get(j));
|
|
authCell.setCellValue(authCellValue);
|
|
authCell.setCellValue(authCellValue);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -784,7 +784,7 @@ public class AuthServiceImpl implements AuthService {
|
|
for (int colNum = 0; colNum < rowName.length; colNum++) {
|
|
for (int colNum = 0; colNum < rowName.length; colNum++) {
|
|
int productColumnWidth = authPartySheet.getColumnWidth(colNum) / 256;
|
|
int productColumnWidth = authPartySheet.getColumnWidth(colNum) / 256;
|
|
for (int rowNum = 0; rowNum < authPartySheet.getLastRowNum(); rowNum++) {
|
|
for (int rowNum = 0; rowNum < authPartySheet.getLastRowNum(); rowNum++) {
|
|
- HSSFRow currentRow;
|
|
|
|
|
|
+ XSSFRow currentRow;
|
|
// 当前行未被使用过
|
|
// 当前行未被使用过
|
|
if (authPartySheet.getRow(rowNum) == null) {
|
|
if (authPartySheet.getRow(rowNum) == null) {
|
|
currentRow = authPartySheet.createRow(rowNum);
|
|
currentRow = authPartySheet.createRow(rowNum);
|
|
@@ -792,7 +792,7 @@ public class AuthServiceImpl implements AuthService {
|
|
currentRow = authPartySheet.getRow(rowNum);
|
|
currentRow = authPartySheet.getRow(rowNum);
|
|
}
|
|
}
|
|
if (currentRow.getCell(colNum) != null) {
|
|
if (currentRow.getCell(colNum) != null) {
|
|
- HSSFCell currentCell = currentRow.getCell(colNum);
|
|
|
|
|
|
+ XSSFCell currentCell = currentRow.getCell(colNum);
|
|
if (currentCell.getCellTypeEnum().equals(CellType.valueOf("STRING"))) {
|
|
if (currentCell.getCellTypeEnum().equals(CellType.valueOf("STRING"))) {
|
|
int length = currentCell.getStringCellValue()
|
|
int length = currentCell.getStringCellValue()
|
|
.getBytes().length;
|
|
.getBytes().length;
|