作者 王勇

初始化进港服务,新舱单

... ... @@ -189,7 +189,7 @@ public class NmsController {
*
* 机场所属城市代码
*/
BasAirport ba = basAirportService.getBasAirportInfo(result.getDestinationStation());
BasAirport ba = basAirportService.getBasAirportInfo(result.getOriginatingStation());
/**
* 4.根据 新舱单机场代码表 中的 机场所属城市代码 ,获取 天博——机场代码表 的相应数据
... ... @@ -215,31 +215,34 @@ public class NmsController {
result.setAreaDescChn(basArea.getAreaDescChn());
// 6.根据 理货信息 中的运单号,获取预配表中的相应数据
List<PrepareMaster> pm = prepareMasterService.getPrepareMasterInfo(result.getWaybillNoMaster());
if (pm != null && pm.size() > 0) {
//发货人名称
result.setShipperName(pm.get(0).getShipperName());
//收货人名称
result.setConsigneeName(pm.get(0).getConsigneeName());
//获取目的货物目的站
result.setAimStation(pm.get(0).getDestinationStation());
}
// List<PrepareMaster> pm = prepareMasterService.getPrepareMasterInfo(result.getWaybillNoMaster());
// if (pm != null && pm.size() > 0) {
// //发货人名称
// result.setShipperName(pm.get(0).getShipperName());
// //收货人名称
// result.setConsigneeName(pm.get(0).getConsigneeName());
// //获取目的货物目的站
// result.setAimStation(pm.get(0).getDestinationStation());
// //获取货物起始站
// result.setStartStation(pm.get(0).getOriginatingStation());
// }
/**
* 获取代理人的相关数据
*
ResultArrivalData asmInfo = new ResultArrivalData();
asmInfo = getCgoAsmFeign.getInfo(result.getWaybillNoMaster());
//设置结算代理人
result.setCountName(asmInfo.getCountName());
//设置订舱代理人
result.setOrderName(asmInfo.getOrderName());
//设置品名
result.setSdCargoName(asmInfo.getSdCargoName());
//设置二级类名称
result.setTwoTypeName(asmInfo.getTwoTypeName());
//设置一级类名称
result.setTypeName(asmInfo.getTypeName());
*/
ResultArrivalData asmInfo = new ResultArrivalData();
asmInfo = getCgoAsmFeign.getInfo(result.getWaybillNoMaster());
//设置结算代理人
result.setCountName(asmInfo.getCountName());
//设置订舱代理人
result.setOrderName(asmInfo.getOrderName());
//设置品名
result.setSdCargoName(asmInfo.getSdCargoName());
//设置二级类名称
result.setTwoTypeName(asmInfo.getTwoTypeName());
//设置一级类名称
result.setTypeName(asmInfo.getTypeName());
/**
* 获取运输工具的对应数据
... ...
... ... @@ -17,6 +17,7 @@ import java.io.Serializable;
public class PrepareMaster implements Serializable {
private static final long serialVersionUID = 7073373008863847070L;
/**
* 发货人名称
*/
... ... @@ -31,11 +32,16 @@ public class PrepareMaster implements Serializable {
* 运单号
*/
private String waybillNoMaster;
/**
* 航班目的站,货物目的站
*/
private String destinationStation;
/**
* 货物起始站
*/
private String originatingStation;
/**
* id
... ... @@ -58,10 +64,7 @@ public class PrepareMaster implements Serializable {
// */
// private Date flightDate;
//
// /**
// * 航班起始站
// */
// private String originatingStation;
//
//
//
... ...
... ... @@ -72,6 +72,11 @@ public class ResultArrivalData implements Serializable {
private String carrier;
/**
* 品名
*/
private String productName;
/**
* 11.发货人名称
*/
private String shipperName;
... ... @@ -87,6 +92,10 @@ public class ResultArrivalData implements Serializable {
private String aimStation;
/**
* 13.货物始发站
*/
private String startStation;
/**
* 14.国家代码
*/
private String country;
... ... @@ -106,6 +115,8 @@ public class ResultArrivalData implements Serializable {
*/
private String countName;
/**
* 代理人服务
* 18.品名
... ...
... ... @@ -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("-", "");
// 设置文件名
... ...
... ... @@ -28,7 +28,7 @@ public class DownExcel {
ResultJson result = new ResultJson();
//获取当前服务器的ip地址
String ip = InetAddress.getLocalHost().getHostAddress();
String address = "http://" + ip + ":" + port + "/exit/";
String address = "http://" + ip + ":" + port + "/arrival/";
result.setCode("200");
result.setMsg(address);
return result;
... ...
... ... @@ -7,11 +7,12 @@
<result column="CONSIGNEENAME" jdbcType="VARCHAR" property="consigneeName"/>
<result column="SHIPPERNAME" jdbcType="VARCHAR" property="shipperName"/>
<result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationStation"/>
<result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingStation"/>
<result column="WAYBILLNOMASTER" jdbcType="VARCHAR" property="waybillNoMaster"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
CONSIGNEENAME,SHIPPERNAME,DESTINATIONSTATION,WAYBILLNOMASTER
CONSIGNEENAME,SHIPPERNAME,ORIGINATINGSTATION,DESTINATIONSTATION,WAYBILLNOMASTER
</sql>
<select id="getPrepareMasterInfo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
... ...
... ... @@ -10,13 +10,16 @@
<result column="FLIGHT_DATE" jdbcType="TIMESTAMP" property="flightDate"/>
<result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingStation"/>
<result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationStation"/>
<result column="TOTALPIECE" jdbcType="VARCHAR" property="totalPiece"/>
<result column="TOTALWEIGHT" jdbcType="VARCHAR" property="totalWeight"/>
<result column="MANIFESTTOTALPIECE" jdbcType="VARCHAR" property="totalPiece"/>
<result column="MANIFESTTOTALWEIGHT" jdbcType="VARCHAR" property="totalWeight"/>
<result column="SHIPPERNAME" jdbcType="VARCHAR" property="shipperName"/>
<result column="CONSIGNEENAME" jdbcType="VARCHAR" property="consigneeName"/>
<result column="PRODUCTNAME" jdbcType="VARCHAR" property="productName"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHT_DATE, ORIGINATINGSTATION, DESTINATIONSTATION,
TOTALPIECE, TOTALWEIGHT
MANIFESTTOTALPIECE, MANIFESTTOTALWEIGHT,SHIPPERNAME,CONSIGNEENAME,PRODUCTNAME
</sql>
<select id="getResultArrivalDataInfo" parameterType="com.sunyo.wlpt.cgonms.arrival.domain.ResultArrivalData"
resultMap="BaseResultMap">
... ...