Commit 2ac13cbf authored by 高滢's avatar 高滢

导出的顺序

parent a9657b64
...@@ -27,6 +27,7 @@ public class TTestPlanRecord{ ...@@ -27,6 +27,7 @@ public class TTestPlanRecord{
* 被检车企ID * 被检车企ID
*/ */
@ApiModelProperty("被检车企ID") @ApiModelProperty("被检车企ID")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long inspectCarCompanyId; private Long inspectCarCompanyId;
/** /**
...@@ -60,6 +61,7 @@ public class TTestPlanRecord{ ...@@ -60,6 +61,7 @@ public class TTestPlanRecord{
* 检测机构id * 检测机构id
*/ */
@ApiModelProperty("检测机构id") @ApiModelProperty("检测机构id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long testOrganizationId; private Long testOrganizationId;
/** /**
...@@ -85,6 +87,7 @@ public class TTestPlanRecord{ ...@@ -85,6 +87,7 @@ public class TTestPlanRecord{
* 标准id * 标准id
*/ */
@ApiModelProperty("标准id") @ApiModelProperty("标准id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long inspectionStandardId; private Long inspectionStandardId;
/** /**
......
...@@ -135,7 +135,7 @@ public class TestPlanRecordController extends BaseController{ ...@@ -135,7 +135,7 @@ public class TestPlanRecordController extends BaseController{
@RequestMapping(method = RequestMethod.POST, value = "/exportTo") @RequestMapping(method = RequestMethod.POST, value = "/exportTo")
public void exportPlanRecordTo(HttpServletResponse respon, @Validated @RequestBody SystemReviewExportRequest systemReviewExportRequest) throws IOException{ public void exportPlanRecordTo(HttpServletResponse respon, @Validated @RequestBody SystemReviewExportRequest systemReviewExportRequest) throws IOException{
List inspectionTtem = systemReviewExportRequest.getInspectionTtem(); List inspectionTtem = systemReviewExportRequest.getInspectionTtem();
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
Boolean isPage = true; Boolean isPage = true;
inspectionTtem.forEach(item->{ inspectionTtem.forEach(item->{
...@@ -173,7 +173,17 @@ public class TestPlanRecordController extends BaseController{ ...@@ -173,7 +173,17 @@ public class TestPlanRecordController extends BaseController{
cover.put("车辆VIN号:",systemReviewExportRequest.getCarModel()); cover.put("车辆VIN号:",systemReviewExportRequest.getCarModel());
cover.put("检测机构:",systemReviewExportRequest.getTestOrganizationName()); cover.put("检测机构:",systemReviewExportRequest.getTestOrganizationName());
cover.put("生成时间:",systemReviewExportRequest.getCreateTime()); cover.put("生成时间:",systemReviewExportRequest.getCreateTime());
ExcelMultipleSheetsUtil.excelMultipleSheets(result, "检测方案" + DateUtil.format(new Date(), "yyyyMMdd"), XLSX_SUFFIX, respon,cover);
// 自定义排序顺序
List<String> customOrder = Arrays.asList("体系审查", "车型审查", "车型检验");
Map<String, Object> resultDesc = new LinkedHashMap<>();
customOrder.forEach(key -> {
if (result.containsKey(key)) {
resultDesc.put(key, result.get(key));
}
});
ExcelMultipleSheetsUtil.excelMultipleSheets(resultDesc, "检测方案" + DateUtil.format(new Date(), "yyyyMMdd"), XLSX_SUFFIX, respon,cover);
} }
} }
...@@ -197,6 +197,9 @@ public class ExcelMultipleSheetsUtil { ...@@ -197,6 +197,9 @@ public class ExcelMultipleSheetsUtil {
// 创建数据行 // 创建数据行
Row dataRow = sheet.createRow(rowIndex); Row dataRow = sheet.createRow(rowIndex);
sheet.setColumnWidth(1, 25 * 256);
sheet.setColumnWidth(2, 25 * 256);
sheet.setColumnWidth(3, 25 * 256);
Field[] fields = data.getClass().getDeclaredFields(); Field[] fields = data.getClass().getDeclaredFields();
for (int i = 0; i < fields.length; i++) { for (int i = 0; i < fields.length; i++) {
createDataCell(dataCellStyle, fields, dataRow, i, data); createDataCell(dataCellStyle, fields, dataRow, i, data);
......
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