...
|
...
|
@@ -30,7 +30,7 @@ import java.util.UUID; |
|
|
@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("/arrival")
|
|
|
public class ExitExcel {
|
|
|
public class ArrivalExcel {
|
|
|
|
|
|
@Value("${path.dir}")
|
|
|
private String dir;
|
...
|
...
|
@@ -58,16 +58,15 @@ public class ExitExcel { |
|
|
HSSFCellStyle cellStyle = workbook.createCellStyle();
|
|
|
// 表头
|
|
|
String[] head = {
|
|
|
"运单号",
|
|
|
"主单号",
|
|
|
"件数",
|
|
|
"重量",
|
|
|
"计费重量",
|
|
|
"体积",
|
|
|
"重量(KG)",
|
|
|
"品名",
|
|
|
"二级品类",
|
|
|
"一级品类",
|
|
|
"货物始发站",
|
|
|
"货物目的站",
|
|
|
"货物目的国家/地区",
|
|
|
"货物进口国家/地区",
|
|
|
"所属洲",
|
|
|
"航空公司",
|
|
|
"航班号",
|
...
|
...
|
@@ -75,6 +74,7 @@ public class ExitExcel { |
|
|
"航班时间",
|
|
|
"航班计划日期",
|
|
|
"航班计划时间",
|
|
|
"出港日期",
|
|
|
"航段",
|
|
|
"机号",
|
|
|
"机型",
|
...
|
...
|
@@ -94,7 +94,7 @@ public class ExitExcel { |
|
|
// 设置单元格宽度
|
|
|
// 256*width+184
|
|
|
sheet.setColumnWidth(i, 4000);
|
|
|
if (i == 14 || i == 16) {
|
|
|
if (i == 13 || i == 15) {
|
|
|
sheet.setColumnWidth(i, 6000);
|
|
|
}
|
|
|
if (i == 21 || i == 22) {
|
...
|
...
|
@@ -102,69 +102,67 @@ public class ExitExcel { |
|
|
}
|
|
|
}
|
|
|
// 设置表格内容
|
|
|
// for (Integer i = 0; i < exitInfoList.size(); i++) {
|
|
|
// row = sheet.createRow(i + 1);
|
|
|
// ResultArrivalData resultExitData = exitInfoList.get(i);
|
|
|
// // 这里是内容设置,替换则自己的数据即可
|
|
|
// String[] excelTitle = new String[27];
|
|
|
//
|
|
|
// //取出数据,运单号
|
|
|
// excelTitle[0] = resultExitData.getWaybillNoMaster();
|
|
|
// //件数
|
|
|
// excelTitle[1] = resultExitData.getTallyTotalPiece();
|
|
|
// //重量
|
|
|
// excelTitle[2] = resultExitData.getTallyTotalWeight();
|
|
|
// //计费重量
|
|
|
// excelTitle[3] = String.valueOf(resultExitData.getTotalGrossWeightMeasure());
|
|
|
// //体积
|
|
|
// excelTitle[4] = String.valueOf(resultExitData.getVolumeMeasure());
|
|
|
// //品名
|
|
|
// excelTitle[5] = resultExitData.getSdCargoName();
|
|
|
// //二级品类
|
|
|
// excelTitle[6] = resultExitData.getTwoTypeName();
|
|
|
// //一级品类
|
|
|
// excelTitle[7] = resultExitData.getTypeName();
|
|
|
// //货物目的站
|
|
|
// excelTitle[8] = resultExitData.getAimStation();
|
|
|
// //货物目的国家/地区
|
|
|
// excelTitle[9] = resultExitData.getCountry();
|
|
|
// //所属洲
|
|
|
// excelTitle[10] = resultExitData.getAreaDescChn();
|
|
|
// //航空公司
|
|
|
// excelTitle[11] = resultExitData.getAirCompany();
|
|
|
// //航班号
|
|
|
// excelTitle[12] = resultExitData.getFlightNo();
|
|
|
// //航班日期
|
|
|
// excelTitle[13] = isNullShort(resultExitData.getFlightDate());
|
|
|
// //航班时间
|
|
|
// excelTitle[14] = isNullLong(resultExitData.getFlightTime());
|
|
|
// //航班计划日期
|
|
|
// excelTitle[15] = isNullShort(resultExitData.getFlightPlanDate());
|
|
|
// //航班计划时间
|
|
|
// excelTitle[16] = isNullLong(resultExitData.getFlightPlanTime());
|
|
|
// //航段
|
|
|
// excelTitle[17] = resultExitData.getSegment();
|
|
|
// //机号
|
|
|
// excelTitle[18] = resultExitData.getCfNo();
|
|
|
// //机型
|
|
|
// excelTitle[19] = resultExitData.getCfTp();
|
|
|
// //最大业载
|
|
|
// excelTitle[20] = "";
|
|
|
// //运单发货人
|
|
|
// excelTitle[21] = resultExitData.getShipperName();
|
|
|
// //运单收货人
|
|
|
// excelTitle[22] = resultExitData.getConsigneeName();
|
|
|
// //订舱代理人(代理人全称)
|
|
|
// excelTitle[23] = resultExitData.getOrderName();
|
|
|
// //结算代理人(代理人全程)
|
|
|
// excelTitle[24] = resultExitData.getCountName();
|
|
|
// //自定义项
|
|
|
// excelTitle[25] = "";
|
|
|
//
|
|
|
// for (Integer j = 0; j < excelTitle.length; j++) {
|
|
|
// row.createCell(j).setCellValue(excelTitle[j]);
|
|
|
// }
|
|
|
// }
|
|
|
for (Integer i = 0; i < exitInfoList.size(); i++) {
|
|
|
row = sheet.createRow(i + 1);
|
|
|
ResultArrivalData resultExitData = exitInfoList.get(i);
|
|
|
// 这里是内容设置,替换则自己的数据即可
|
|
|
String[] excelTitle = new String[27];
|
|
|
//取出数据,运单号
|
|
|
excelTitle[0] = resultExitData.getWaybillNoMaster();
|
|
|
//件数
|
|
|
excelTitle[1] = resultExitData.getTotalPiece();
|
|
|
//重量
|
|
|
excelTitle[2] = resultExitData.getTotalWeight();
|
|
|
//品名
|
|
|
excelTitle[3] = resultExitData.getProductName();
|
|
|
//二级品类
|
|
|
excelTitle[4] = "";
|
|
|
//一级品类
|
|
|
excelTitle[5] = "";
|
|
|
//货物始发站
|
|
|
excelTitle[6] = resultExitData.getOriginatingStation();
|
|
|
//货物目的站
|
|
|
excelTitle[7] = resultExitData.getDestinationStation();
|
|
|
//货物目的国家/地区
|
|
|
excelTitle[8] = resultExitData.getCountry();
|
|
|
//所属洲
|
|
|
excelTitle[9] = resultExitData.getAreaDescChn();
|
|
|
//航空公司
|
|
|
excelTitle[10] = resultExitData.getAirCompany();
|
|
|
//航班号
|
|
|
excelTitle[11] = resultExitData.getFlightNo();
|
|
|
//航班日期
|
|
|
excelTitle[12] = isNullShort(resultExitData.getFlightDate());
|
|
|
//航班时间
|
|
|
excelTitle[13] = isNullLong(resultExitData.getFlightTime());
|
|
|
//航班计划日期
|
|
|
excelTitle[14] = isNullShort(resultExitData.getFlightPlanDate());
|
|
|
//航班计划时间
|
|
|
excelTitle[15] = isNullLong(resultExitData.getFlightPlanTime());
|
|
|
//出港日期
|
|
|
excelTitle[16] = isNullShort(resultExitData.getArrivalDate());
|
|
|
//航段
|
|
|
excelTitle[17] = resultExitData.getSegment();
|
|
|
//机号
|
|
|
excelTitle[18] = resultExitData.getCfNo();
|
|
|
//机型
|
|
|
excelTitle[19] = resultExitData.getCfTp();
|
|
|
//最大业载
|
|
|
excelTitle[20] = "";
|
|
|
//运单发货人
|
|
|
excelTitle[21] = resultExitData.getShipperName();
|
|
|
//运单收货人
|
|
|
excelTitle[22] = resultExitData.getConsigneeName();
|
|
|
//订舱代理人(代理人全称)
|
|
|
excelTitle[23] = resultExitData.getOrderName();
|
|
|
//结算代理人(代理人全程)
|
|
|
excelTitle[24] = resultExitData.getCountName();
|
|
|
//自定义项
|
|
|
excelTitle[25] = "";
|
|
|
for (Integer j = 0; j < excelTitle.length; j++) {
|
|
|
row.createCell(j).setCellValue(excelTitle[j]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String file_name = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
// 设置文件名
|
...
|
...
|
|