作者 王勇

完成基本查询业务

@@ -10,7 +10,7 @@ import java.util.List; @@ -10,7 +10,7 @@ import java.util.List;
10 10
11 /** 11 /**
12 * @author 子诚 12 * @author 子诚
13 - * Description: 13 + * Description:获取新舱单服务的相关信息
14 * 时间:2020/5/20 14:58 14 * 时间:2020/5/20 14:58
15 */ 15 */
16 16
@@ -39,7 +39,7 @@ public class CgoNmsController { @@ -39,7 +39,7 @@ public class CgoNmsController {
39 * @param flightDate 航班日期 39 * @param flightDate 航班日期
40 * @return {@link ResultExitData} 40 * @return {@link ResultExitData}
41 */ 41 */
42 - @GetMapping("/getData") 42 + @GetMapping("/getInfo")
43 public List<ResultExitData> getData( 43 public List<ResultExitData> getData(
44 @RequestParam(value = "flightDate", required = false) Date flightDate, 44 @RequestParam(value = "flightDate", required = false) Date flightDate,
45 @RequestParam(value = "flightNo", required = false) String flightNo) { 45 @RequestParam(value = "flightNo", required = false) String flightNo) {
@@ -57,34 +57,21 @@ public class CgoNmsController { @@ -57,34 +57,21 @@ public class CgoNmsController {
57 */ 57 */
58 58
59 List<ResultExitData> resultList = resultExitDataService.getResultExitDataInfo(resultExitData); 59 List<ResultExitData> resultList = resultExitDataService.getResultExitDataInfo(resultExitData);
  60 + //取出resultList的长度,不必每次都判断
  61 +
60 //遍历获取出所有需要的信息 62 //遍历获取出所有需要的信息
61 - for (int i = 0; i < resultList.size(); i++) { 63 + for (int i = 0, resultSize = resultList.size(); i < resultSize; i++) {
62 ResultExitData result = resultList.get(i); 64 ResultExitData result = resultList.get(i);
63 //设置航班 65 //设置航班
64 result.setSegment(result.getOriginatingStation() + " — " + result.getDestinationStation()); 66 result.setSegment(result.getOriginatingStation() + " — " + result.getDestinationStation());
  67 + //设置承运人二字码
  68 + result.setCarrier(result.getFlightNo().substring(0, 2));
65 69
66 /** 70 /**
67 - * 2.根据 理货信息 中的运单号,获取预配表中的相应数据  
68 - *  
69 - * 承运人二字码  
70 - * 发货人名称  
71 - * 收货人名称  
72 - */  
73 - System.out.println(result.getWaybillNoMaster());  
74 - PrepareMaster pm = prepareMasterService.getPrepareMasterInfo(result.getWaybillNoMaster());  
75 -  
76 - //发货人名称  
77 - result.setShipperName(pm.getShipperName());  
78 - //收货人名称  
79 - result.setConsigneeName(pm.getConsigneeName());  
80 - //承运人二字码  
81 - result.setCarrier(pm.getCarrier());  
82 - /**  
83 * 3.根据 理货信息 中的目的站代码,获取 新舱单机场代码表 中的相应数据 71 * 3.根据 理货信息 中的目的站代码,获取 新舱单机场代码表 中的相应数据
84 * 72 *
85 * 机场所属城市代码 73 * 机场所属城市代码
86 */ 74 */
87 - System.out.println(result.getDestinationStation());  
88 BasAirport ba = basAirportService.getBasAirportInfo(result.getDestinationStation()); 75 BasAirport ba = basAirportService.getBasAirportInfo(result.getDestinationStation());
89 76
90 /** 77 /**
@@ -94,10 +81,7 @@ public class CgoNmsController { @@ -94,10 +81,7 @@ public class CgoNmsController {
94 * 区域id 81 * 区域id
95 * 国家代码 82 * 国家代码
96 */ 83 */
97 - System.out.println(ba.getCityId());  
98 TbAirportCode ta = tbAirportCodeService.getTbAirportCodeInfo(ba.getCityId()); 84 TbAirportCode ta = tbAirportCodeService.getTbAirportCodeInfo(ba.getCityId());
99 - // 航班目的城市代码  
100 - result.setCityCode(ta.getCityCode());  
101 // 所属国家 85 // 所属国家
102 result.setCountry(ta.getCountry()); 86 result.setCountry(ta.getCountry());
103 87
@@ -108,12 +92,29 @@ public class CgoNmsController { @@ -108,12 +92,29 @@ public class CgoNmsController {
108 * 国际国内标识;1,国外;2,国内 92 * 国际国内标识;1,国外;2,国内
109 * 区域描述,中文 93 * 区域描述,中文
110 */ 94 */
111 - System.out.println(ta.getArea());  
112 BasArea basArea = basAreaService.getBasAreaInfo(ta.getArea()); 95 BasArea basArea = basAreaService.getBasAreaInfo(ta.getArea());
113 //航班目的区域,中文描述,所属洲 96 //航班目的区域,中文描述,所属洲
114 result.setAreaDescChn(basArea.getAreaDescChn()); 97 result.setAreaDescChn(basArea.getAreaDescChn());
  98 +
  99 + /**
  100 + * 6.根据 理货信息 中的运单号,获取预配表中的相应数据
  101 + *
  102 + * 承运人二字码
  103 + * 发货人名称
  104 + * 收货人名称
  105 + * 航班目的站
  106 + */
  107 + List<PrepareMaster> pm = prepareMasterService.getPrepareMasterInfo(result.getWaybillNoMaster());
  108 + if (pm == null) {
  109 + continue;
  110 + }
  111 + //发货人名称
  112 + result.setShipperName(pm.get(0).getShipperName());
  113 + //收货人名称
  114 + result.setConsigneeName(pm.get(0).getConsigneeName());
  115 + //获取目的货物目的站
  116 + result.setAimStation(pm.get(0).getDestinationStation());
115 } 117 }
116 return resultList; 118 return resultList;
117 } 119 }
118 -  
119 } 120 }
@@ -42,12 +42,6 @@ public class ResultExitData implements Serializable { @@ -42,12 +42,6 @@ public class ResultExitData implements Serializable {
42 private Date flightDate; 42 private Date flightDate;
43 43
44 /** 44 /**
45 - * 航班时间  
46 - */  
47 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")  
48 - private Date dischargeDate;  
49 -  
50 - /**  
51 * 航段 45 * 航段
52 */ 46 */
53 private String segment; 47 private String segment;
@@ -88,9 +82,9 @@ public class ResultExitData implements Serializable { @@ -88,9 +82,9 @@ public class ResultExitData implements Serializable {
88 private String consigneeName; 82 private String consigneeName;
89 83
90 /** 84 /**
91 - * 航班目的城市代码 85 + * 货物目的站
92 */ 86 */
93 - private String cityCode; 87 + private String aimStation;
94 /** 88 /**
95 * 国家代码 89 * 国家代码
96 */ 90 */
@@ -101,44 +95,46 @@ public class ResultExitData implements Serializable { @@ -101,44 +95,46 @@ public class ResultExitData implements Serializable {
101 */ 95 */
102 private String areaDescChn; 96 private String areaDescChn;
103 97
104 - private String tcdName;  
105 -  
106 - private String tcdTypeCode;  
107 -  
108 - private String tallType;  
109 -  
110 - private String oName;  
111 -  
112 - private String fdName;  
113 -  
114 - private String totalWeight;  
115 -  
116 - private String totalGrossWeightMeasureuc;  
117 -  
118 - private String totalPiece;  
119 -  
120 - private String grossWeightMeasureuc;  
121 -  
122 - private Date loadStartTime;  
123 -  
124 - private Date loadEndTime;  
125 -  
126 - private String status;  
127 -  
128 - private String customsCode;  
129 -  
130 - private String productName;  
131 -  
132 - private String receiptInformation;  
133 -  
134 - private Date createDate;  
135 -  
136 - private String dealFlag;  
137 -  
138 - private String billTallyFlag;  
139 -  
140 - private Date dealTime;  
141 -  
142 - private String transportSplitDescription; 98 +// private String tcdName;
  99 +//
  100 +// private String tcdTypeCode;
  101 +//
  102 +// private String tallType;
  103 +//
  104 +// private String oName;
  105 +//
  106 +// private String fdName;
  107 +//
  108 +// private String totalWeight;
  109 +//
  110 +// private String totalGrossWeightMeasureuc;
  111 +//
  112 +// private String totalPiece;
  113 +//
  114 +// private String grossWeightMeasureuc;
  115 +//
  116 +// private Date loadStartTime;
  117 +//
  118 +// private Date loadEndTime;
  119 +//
  120 +// private String status;
  121 +//
  122 +// private String customsCode;
  123 +//
  124 +// private String productName;
  125 +//
  126 +// private String receiptInformation;
  127 +//
  128 +// private Date createDate;
  129 +//
  130 +// private String dealFlag;
  131 +//
  132 +// private String billTallyFlag;
  133 +//
  134 +// private Date dealTime;
  135 +//
  136 +// private Date dischargeDate;
  137 +//
  138 +// private String transportSplitDescription;
143 139
144 } 140 }
@@ -2,6 +2,8 @@ package com.sunyo.wlpt.cgonms.provide.mapper; @@ -2,6 +2,8 @@ package com.sunyo.wlpt.cgonms.provide.mapper;
2 2
3 import com.sunyo.wlpt.cgonms.provide.domain.PrepareMaster; 3 import com.sunyo.wlpt.cgonms.provide.domain.PrepareMaster;
4 4
  5 +import java.util.List;
  6 +
5 /** 7 /**
6 * @author 子诚 8 * @author 子诚
7 * Description: 9 * Description:
@@ -14,5 +16,5 @@ public interface PrepareMasterMapper { @@ -14,5 +16,5 @@ public interface PrepareMasterMapper {
14 * @param waybillNoMaster 运单号 16 * @param waybillNoMaster 运单号
15 * @return {@link PrepareMaster} 17 * @return {@link PrepareMaster}
16 */ 18 */
17 - PrepareMaster getPrepareMasterInfo(String waybillNoMaster); 19 + List<PrepareMaster> getPrepareMasterInfo(String waybillNoMaster);
18 } 20 }
@@ -2,6 +2,8 @@ package com.sunyo.wlpt.cgonms.provide.service; @@ -2,6 +2,8 @@ package com.sunyo.wlpt.cgonms.provide.service;
2 2
3 import com.sunyo.wlpt.cgonms.provide.domain.PrepareMaster; 3 import com.sunyo.wlpt.cgonms.provide.domain.PrepareMaster;
4 4
  5 +import java.util.List;
  6 +
5 /** 7 /**
6 * @author 子诚 8 * @author 子诚
7 * Description: 9 * Description:
@@ -15,5 +17,5 @@ public interface PrepareMasterService { @@ -15,5 +17,5 @@ public interface PrepareMasterService {
15 * @param waybillNoMaster 运单号 17 * @param waybillNoMaster 运单号
16 * @return {@link PrepareMaster} 18 * @return {@link PrepareMaster}
17 */ 19 */
18 - PrepareMaster getPrepareMasterInfo(String waybillNoMaster); 20 + List<PrepareMaster> getPrepareMasterInfo(String waybillNoMaster);
19 } 21 }
@@ -5,6 +5,9 @@ import org.springframework.stereotype.Service; @@ -5,6 +5,9 @@ import org.springframework.stereotype.Service;
5 import javax.annotation.Resource; 5 import javax.annotation.Resource;
6 import com.sunyo.wlpt.cgonms.provide.mapper.PrepareMasterMapper; 6 import com.sunyo.wlpt.cgonms.provide.mapper.PrepareMasterMapper;
7 import com.sunyo.wlpt.cgonms.provide.service.PrepareMasterService; 7 import com.sunyo.wlpt.cgonms.provide.service.PrepareMasterService;
  8 +
  9 +import java.util.List;
  10 +
8 /** 11 /**
9 * @author 子诚 12 * @author 子诚
10 * Description: 13 * Description:
@@ -17,7 +20,7 @@ public class PrepareMasterServiceImpl implements PrepareMasterService{ @@ -17,7 +20,7 @@ public class PrepareMasterServiceImpl implements PrepareMasterService{
17 private PrepareMasterMapper prepareMasterMapper; 20 private PrepareMasterMapper prepareMasterMapper;
18 21
19 @Override 22 @Override
20 - public PrepareMaster getPrepareMasterInfo(String waybillNoMaster) { 23 + public List<PrepareMaster> getPrepareMasterInfo(String waybillNoMaster) {
21 return prepareMasterMapper.getPrepareMasterInfo(waybillNoMaster); 24 return prepareMasterMapper.getPrepareMasterInfo(waybillNoMaster);
22 } 25 }
23 } 26 }
@@ -6,34 +6,36 @@ @@ -6,34 +6,36 @@
6 <!--@Table TALLYMASTER--> 6 <!--@Table TALLYMASTER-->
7 <result column="AUTOID" jdbcType="VARCHAR" property="autoId"/> 7 <result column="AUTOID" jdbcType="VARCHAR" property="autoId"/>
8 <result column="WAYBILLNOMASTER" jdbcType="VARCHAR" property="waybillNoMaster"/> 8 <result column="WAYBILLNOMASTER" jdbcType="VARCHAR" property="waybillNoMaster"/>
9 - <result column="TCD_NAME" jdbcType="VARCHAR" property="tcdName"/>  
10 - <result column="TCD_TYPECODE" jdbcType="VARCHAR" property="tcdTypeCode"/>  
11 - <result column="TALLTYPE" jdbcType="VARCHAR" property="tallType"/>  
12 <result column="FLIGHTNO" jdbcType="VARCHAR" property="flightNo"/> 9 <result column="FLIGHTNO" jdbcType="VARCHAR" property="flightNo"/>
13 <result column="FLIGHTDATE" jdbcType="TIMESTAMP" property="flightDate"/> 10 <result column="FLIGHTDATE" jdbcType="TIMESTAMP" property="flightDate"/>
14 <result column="SEGMENT" jdbcType="VARCHAR" property="segment"/> 11 <result column="SEGMENT" jdbcType="VARCHAR" property="segment"/>
15 <result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingStation"/> 12 <result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingStation"/>
16 - <result column="O_NAME" jdbcType="VARCHAR" property="oName"/>  
17 <result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationStation"/> 13 <result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationStation"/>
18 - <result column="FD_NAME" jdbcType="VARCHAR" property="fdName"/>  
19 - <result column="TOTALWEIGHT" jdbcType="VARCHAR" property="totalWeight"/>  
20 - <result column="TOTALGROSSWEIGHTMEASUREUC" jdbcType="VARCHAR" property="totalGrossWeightMeasureuc"/>  
21 - <result column="TOTALPIECE" jdbcType="VARCHAR" property="totalPiece"/>  
22 <result column="TALLYTOTALPIECE" jdbcType="VARCHAR" property="tallyTotalPiece"/> 14 <result column="TALLYTOTALPIECE" jdbcType="VARCHAR" property="tallyTotalPiece"/>
23 <result column="TALLYTOTALWEIGHT" jdbcType="VARCHAR" property="tallyTotalWeight"/> 15 <result column="TALLYTOTALWEIGHT" jdbcType="VARCHAR" property="tallyTotalWeight"/>
24 - <result column="GROSSWEIGHTMEASUREUC" jdbcType="VARCHAR" property="grossWeightMeasureuc"/>  
25 - <result column="LOADSTARTTIME" jdbcType="TIMESTAMP" property="loadStartTime"/>  
26 - <result column="LOADENDTIME" jdbcType="TIMESTAMP" property="loadEndTime"/>  
27 - <result column="STATUS" jdbcType="VARCHAR" property="status"/>  
28 - <result column="CUSTOMSCODE" jdbcType="VARCHAR" property="customsCode"/>  
29 - <result column="PRODUCTNAME" jdbcType="VARCHAR" property="productName"/>  
30 - <result column="DISCHARGEDATE" jdbcType="TIMESTAMP" property="dischargeDate"/>  
31 - <result column="RECEIPTINFORMATION" jdbcType="VARCHAR" property="receiptInformation"/>  
32 - <result column="CREATEDATE" jdbcType="TIMESTAMP" property="createDate"/>  
33 - <result column="DEAL_FLAG" jdbcType="VARCHAR" property="dealFlag"/>  
34 - <result column="BILL_TALLY_FLAG" jdbcType="VARCHAR" property="billTallyFlag"/>  
35 - <result column="DEAL_TIME" jdbcType="TIMESTAMP" property="dealTime"/>  
36 - <result column="TRANSPORTSPLITDESCRIPTION" jdbcType="VARCHAR" property="transportSplitDescription"/> 16 +
  17 +<!-- <result column="O_NAME" jdbcType="VARCHAR" property="oName"/>-->
  18 +<!-- <result column="TCD_NAME" jdbcType="VARCHAR" property="tcdName"/>-->
  19 +<!-- <result column="TCD_TYPECODE" jdbcType="VARCHAR" property="tcdTypeCode"/>-->
  20 +<!-- <result column="TALLTYPE" jdbcType="VARCHAR" property="tallType"/>-->
  21 +<!-- <result column="FD_NAME" jdbcType="VARCHAR" property="fdName"/>-->
  22 +<!-- <result column="TOTALWEIGHT" jdbcType="VARCHAR" property="totalWeight"/>-->
  23 +<!-- <result column="TOTALGROSSWEIGHTMEASUREUC" jdbcType="VARCHAR" property="totalGrossWeightMeasureuc"/>-->
  24 +<!-- <result column="TOTALPIECE" jdbcType="VARCHAR" property="totalPiece"/>-->
  25 +<!-- <result column="GROSSWEIGHTMEASUREUC" jdbcType="VARCHAR" property="grossWeightMeasureuc"/>-->
  26 +<!-- <result column="LOADSTARTTIME" jdbcType="TIMESTAMP" property="loadStartTime"/>-->
  27 +<!-- <result column="LOADENDTIME" jdbcType="TIMESTAMP" property="loadEndTime"/>-->
  28 +<!-- <result column="STATUS" jdbcType="VARCHAR" property="status"/>-->
  29 +<!-- <result column="CUSTOMSCODE" jdbcType="VARCHAR" property="customsCode"/>-->
  30 +<!-- <result column="PRODUCTNAME" jdbcType="VARCHAR" property="productName"/>-->
  31 +<!-- <result column="DISCHARGEDATE" jdbcType="TIMESTAMP" property="dischargeDate"/>-->
  32 +<!-- <result column="RECEIPTINFORMATION" jdbcType="VARCHAR" property="receiptInformation"/>-->
  33 +<!-- <result column="CREATEDATE" jdbcType="TIMESTAMP" property="createDate"/>-->
  34 +<!-- <result column="DEAL_FLAG" jdbcType="VARCHAR" property="dealFlag"/>-->
  35 +<!-- <result column="BILL_TALLY_FLAG" jdbcType="VARCHAR" property="billTallyFlag"/>-->
  36 +<!-- <result column="DEAL_TIME" jdbcType="TIMESTAMP" property="dealTime"/>-->
  37 +<!-- <result column="TRANSPORTSPLITDESCRIPTION" jdbcType="VARCHAR" property="transportSplitDescription"/>-->
  38 +
37 </resultMap> 39 </resultMap>
38 <sql id="Base_Column_List"> 40 <sql id="Base_Column_List">
39 <!--@mbg.generated--> 41 <!--@mbg.generated-->