作者 申海龙

service 逻辑 改动 添加 if判断

@@ -107,11 +107,14 @@ public class CustomXmlHandle{ @@ -107,11 +107,14 @@ public class CustomXmlHandle{
107 if(journeyid != null){ 107 if(journeyid != null){
108 108
109 String[] flightList = journeyid.split("/"); 109 String[] flightList = journeyid.split("/");
110 - 110 + if(flightList.length > 0){
111 flightNo = flightList[0]; 111 flightNo = flightList[0];
112 flightDate = flightList[1]; 112 flightDate = flightList[1];
113 } 113 }
114 114
  115 +
  116 + }
  117 +
115 String awbA = XMLXPath.getSingleValueByPath(document,waybillMaster); 118 String awbA = XMLXPath.getSingleValueByPath(document,waybillMaster);
116 //全格式的分单 如 17212345678_ADBD 119 //全格式的分单 如 17212345678_ADBD
117 String awbH = XMLXPath.getSingleValueByPath(document,waybillSecond); 120 String awbH = XMLXPath.getSingleValueByPath(document,waybillSecond);
@@ -8,6 +8,7 @@ import com.tianbo.analysis.model.CustomReception; @@ -8,6 +8,7 @@ import com.tianbo.analysis.model.CustomReception;
8 import com.tianbo.analysis.service.ARRIVEDMASTERService; 8 import com.tianbo.analysis.service.ARRIVEDMASTERService;
9 import com.tianbo.util.Date.DateUtil; 9 import com.tianbo.util.Date.DateUtil;
10 import lombok.extern.slf4j.Slf4j; 10 import lombok.extern.slf4j.Slf4j;
  11 +import org.apache.commons.lang.StringUtils;
11 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Service; 13 import org.springframework.stereotype.Service;
13 14
@@ -45,10 +46,9 @@ public class ARRIVEDMASTERServiceImp implements ARRIVEDMASTERService { @@ -45,10 +46,9 @@ public class ARRIVEDMASTERServiceImp implements ARRIVEDMASTERService {
45 //回执内容 46 //回执内容
46 String reception = customReception.getResponseText(); 47 String reception = customReception.getResponseText();
47 String flightDateStr = customReception.getFlightDate(); 48 String flightDateStr = customReception.getFlightDate();
48 - Date flightDate = new Date();  
49 - if (flightDateStr != null){  
50 - flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);  
51 - } 49 +
  50 + if (!StringUtils.isEmpty(flightDateStr)) {
  51 + Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
52 52
53 // 设置 接收运抵分单 回执 53 // 设置 接收运抵分单 回执
54 ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY(); 54 ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY();
@@ -122,7 +122,7 @@ public class ARRIVEDMASTERServiceImp implements ARRIVEDMASTERService { @@ -122,7 +122,7 @@ public class ARRIVEDMASTERServiceImp implements ARRIVEDMASTERService {
122 122
123 return shareServiceImp.share("MT3201", customReception); 123 return shareServiceImp.share("MT3201", customReception);
124 } 124 }
125 - 125 + }
126 126
127 //未进入主分单解析 返回0 失败 127 //未进入主分单解析 返回0 失败
128 return 0; 128 return 0;
@@ -11,6 +11,7 @@ import com.tianbo.analysis.service.CoustomAnalysisService; @@ -11,6 +11,7 @@ import com.tianbo.analysis.service.CoustomAnalysisService;
11 import com.tianbo.util.Date.DateUtil; 11 import com.tianbo.util.Date.DateUtil;
12 import com.tianbo.util.Helper; 12 import com.tianbo.util.Helper;
13 import lombok.extern.slf4j.Slf4j; 13 import lombok.extern.slf4j.Slf4j;
  14 +import org.apache.commons.lang.StringUtils;
14 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.stereotype.Service; 16 import org.springframework.stereotype.Service;
16 17
@@ -42,11 +43,9 @@ public class CoustomAnalysisServiceImp implements CoustomAnalysisService { @@ -42,11 +43,9 @@ public class CoustomAnalysisServiceImp implements CoustomAnalysisService {
42 String reception = customReception.getResponseText(); 43 String reception = customReception.getResponseText();
43 String flightDateStr = customReception.getFlightDate(); 44 String flightDateStr = customReception.getFlightDate();
44 45
45 - Date flightDate = new Date();  
46 - if (flightDateStr != null){  
47 - flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);  
48 - }  
49 - 46 +// Date flightDate = new Date();
  47 + if (!StringUtils.isEmpty(flightDateStr)){
  48 + Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
50 49
51 // 设置分单回执 50 // 设置分单回执
52 Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary(); 51 Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary();
@@ -117,10 +116,9 @@ public class CoustomAnalysisServiceImp implements CoustomAnalysisService { @@ -117,10 +116,9 @@ public class CoustomAnalysisServiceImp implements CoustomAnalysisService {
117 return 0; 116 return 0;
118 } 117 }
119 }else { 118 }else {
120 -  
121 -  
122 return shareServiceImp.share("MT1201", customReception); 119 return shareServiceImp.share("MT1201", customReception);
123 } 120 }
  121 + }
124 122
125 //未进入主分单解析 返回0 失败 123 //未进入主分单解析 返回0 失败
126 return 0; 124 return 0;
@@ -6,6 +6,7 @@ import com.tianbo.analysis.model.DEPARTURESLOADING; @@ -6,6 +6,7 @@ import com.tianbo.analysis.model.DEPARTURESLOADING;
6 import com.tianbo.analysis.service.DEPARTURESLOADINGService; 6 import com.tianbo.analysis.service.DEPARTURESLOADINGService;
7 import com.tianbo.util.Date.DateUtil; 7 import com.tianbo.util.Date.DateUtil;
8 import lombok.extern.slf4j.Slf4j; 8 import lombok.extern.slf4j.Slf4j;
  9 +import org.apache.commons.lang.StringUtils;
9 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
11 12
@@ -37,11 +38,8 @@ public class DEPARTURESLOADINGServiceImp implements DEPARTURESLOADINGService{ @@ -37,11 +38,8 @@ public class DEPARTURESLOADINGServiceImp implements DEPARTURESLOADINGService{
37 //回执内容 38 //回执内容
38 String reception = customReception.getResponseText(); 39 String reception = customReception.getResponseText();
39 String flightDateStr = customReception.getFlightDate(); 40 String flightDateStr = customReception.getFlightDate();
40 - Date flightDate = new Date();  
41 - if (flightDateStr != null){  
42 - flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);  
43 - }  
44 - 41 + if (!StringUtils.isEmpty(flightDateStr)) {
  42 + Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
45 //设置主单回执、航班号、航班日期 43 //设置主单回执、航班号、航班日期
46 DEPARTURESLOADING departuresloading = new DEPARTURESLOADING(); 44 DEPARTURESLOADING departuresloading = new DEPARTURESLOADING();
47 departuresloading.setReceiption(reception); 45 departuresloading.setReceiption(reception);
@@ -85,6 +83,9 @@ public class DEPARTURESLOADINGServiceImp implements DEPARTURESLOADINGService{ @@ -85,6 +83,9 @@ public class DEPARTURESLOADINGServiceImp implements DEPARTURESLOADINGService{
85 83
86 return shareServiceImp.share("MT4201", customReception); 84 return shareServiceImp.share("MT4201", customReception);
87 } 85 }
  86 +
  87 + }
  88 +
88 //未进入主分单解析 返回0 失败 89 //未进入主分单解析 返回0 失败
89 return 0; 90 return 0;
90 } 91 }
@@ -8,6 +8,7 @@ import com.tianbo.analysis.model.PREPARESECONDARY; @@ -8,6 +8,7 @@ import com.tianbo.analysis.model.PREPARESECONDARY;
8 import com.tianbo.analysis.service.PREPAREMASTERService; 8 import com.tianbo.analysis.service.PREPAREMASTERService;
9 import com.tianbo.util.Date.DateUtil; 9 import com.tianbo.util.Date.DateUtil;
10 import lombok.extern.slf4j.Slf4j; 10 import lombok.extern.slf4j.Slf4j;
  11 +import org.apache.commons.lang.StringUtils;
11 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Service; 13 import org.springframework.stereotype.Service;
13 14
@@ -43,10 +44,8 @@ public class PREPAREMASTERServiceImp implements PREPAREMASTERService { @@ -43,10 +44,8 @@ public class PREPAREMASTERServiceImp implements PREPAREMASTERService {
43 //回执内容 44 //回执内容
44 String reception = customReception.getResponseText(); 45 String reception = customReception.getResponseText();
45 String flightDateStr = customReception.getFlightDate(); 46 String flightDateStr = customReception.getFlightDate();
46 - Date flightDate = new Date();  
47 - if (flightDateStr != null){  
48 - flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);  
49 - } 47 + if (!StringUtils.isEmpty(flightDateStr)) {
  48 + Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
50 49
51 // 设置 接收运抵分单 回执 50 // 设置 接收运抵分单 回执
52 PREPARESECONDARY preparesecondary = new PREPARESECONDARY(); 51 PREPARESECONDARY preparesecondary = new PREPARESECONDARY();
@@ -123,6 +122,8 @@ public class PREPAREMASTERServiceImp implements PREPAREMASTERService { @@ -123,6 +122,8 @@ public class PREPAREMASTERServiceImp implements PREPAREMASTERService {
123 return shareServiceImp.share("MT2201", customReception); 122 return shareServiceImp.share("MT2201", customReception);
124 } 123 }
125 124
  125 + }
  126 +
126 //未进入主分单解析 返回0 失败 127 //未进入主分单解析 返回0 失败
127 return 0; 128 return 0;
128 } 129 }
@@ -8,6 +8,7 @@ import com.tianbo.analysis.model.TALLYSECONDARY; @@ -8,6 +8,7 @@ import com.tianbo.analysis.model.TALLYSECONDARY;
8 import com.tianbo.analysis.service.TALLYMASTERService; 8 import com.tianbo.analysis.service.TALLYMASTERService;
9 import com.tianbo.util.Date.DateUtil; 9 import com.tianbo.util.Date.DateUtil;
10 import lombok.extern.slf4j.Slf4j; 10 import lombok.extern.slf4j.Slf4j;
  11 +import org.apache.commons.lang.StringUtils;
11 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Service; 13 import org.springframework.stereotype.Service;
13 14
@@ -45,11 +46,9 @@ public class TALLYMASTERServiceImp implements TALLYMASTERService{ @@ -45,11 +46,9 @@ public class TALLYMASTERServiceImp implements TALLYMASTERService{
45 //回执内容 46 //回执内容
46 String reception = customReception.getResponseText(); 47 String reception = customReception.getResponseText();
47 String flightDateStr = customReception.getFlightDate(); 48 String flightDateStr = customReception.getFlightDate();
48 - Date flightDate = new Date();  
49 - if (flightDateStr != null){  
50 - flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);  
51 - }  
52 49
  50 + if (!StringUtils.isEmpty(flightDateStr)) {
  51 + Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
53 // 设置 进出港理货 回执 52 // 设置 进出港理货 回执
54 TALLYSECONDARY tallysecondary = new TALLYSECONDARY(); 53 TALLYSECONDARY tallysecondary = new TALLYSECONDARY();
55 tallysecondary.setReceiptinformation(reception); 54 tallysecondary.setReceiptinformation(reception);
@@ -121,6 +120,7 @@ public class TALLYMASTERServiceImp implements TALLYMASTERService{ @@ -121,6 +120,7 @@ public class TALLYMASTERServiceImp implements TALLYMASTERService{
121 120
122 return shareServiceImp.share("MT5202", customReception); 121 return shareServiceImp.share("MT5202", customReception);
123 } 122 }
  123 + }
124 124
125 //未进入主分单解析 返回0 失败 125 //未进入主分单解析 返回0 失败
126 return 0; 126 return 0;
@@ -251,14 +251,17 @@ @@ -251,14 +251,17 @@
251 UPDATE TALLYMASTER 251 UPDATE TALLYMASTER
252 SET RECEIPTINFORMATION= #{receiptinformation,jdbcType=VARCHAR} 252 SET RECEIPTINFORMATION= #{receiptinformation,jdbcType=VARCHAR}
253 WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} 253 WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
254 - AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR} 254 + AND FLIGHTNO = #{flghtno, jdbcType=VARCHAR}
  255 + AND FLIGHTDATE = #{flightdate, jdbcType=TIMESTAMP}
255 </update> 256 </update>
256 257
257 - <select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.TALLYMASTER" resultType="com.tianbo.analysis.model.TALLYMASTER"> 258 + <select id="selectAutoIdByAwb" parameterType="com.tianbo.analysis.model.TALLYMASTER" resultType="com.tianbo.analysis.model.TALLYMASTER">
258 SELECT AUTOID 259 SELECT AUTOID
259 FROM TALLYMASTER 260 FROM TALLYMASTER
260 WHERE 261 WHERE
261 - WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR} 262 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  263 + AND FLIGHTNO = #{flghtno, jdbcType=VARCHAR}
  264 + AND FLIGHTDATE = #{flightdate, jdbcType=TIMESTAMP}
262 </select> 265 </select>
263 266
264 </mapper> 267 </mapper>