wei.zhou

提交代码

...@@ -112,7 +112,10 @@ public class CustomsDataInterface { ...@@ -112,7 +112,10 @@ public class CustomsDataInterface {
112 //if(result.getSuccess()){ 112 //if(result.getSuccess()){
113 //TODO 等待校验逻辑完善后,由result.getSuccess() 判断 113 //TODO 等待校验逻辑完善后,由result.getSuccess() 判断
114 if(true){ 114 if(true){
115 - chmConsignmentService.processChmConsignment(mawb, timeStamp,appId); 115 + result = chmConsignmentService.processChmConsignment(mawb, timeStamp,appId);
116 + if(!result.getSuccess()){
117 + return result;
118 + }
116 } 119 }
117 sw.stop(); 120 sw.stop();
118 121
......
...@@ -2,6 +2,7 @@ package com.erry.iclear.dateInterface.service; ...@@ -2,6 +2,7 @@ package com.erry.iclear.dateInterface.service;
2 2
3 //import cn.hutool.core.date.DateUtil; 3 //import cn.hutool.core.date.DateUtil;
4 import com.erry.iclear.dateInterface.api.request.Mawb; 4 import com.erry.iclear.dateInterface.api.request.Mawb;
5 +import com.erry.iclear.dateInterface.api.response.ResultRS;
5 import com.erry.iclear.dateInterface.common.Constant; 6 import com.erry.iclear.dateInterface.common.Constant;
6 import com.erry.iclear.dateInterface.entity.ChmCarryPort; 7 import com.erry.iclear.dateInterface.entity.ChmCarryPort;
7 import com.erry.iclear.dateInterface.entity.ChmConsignment; 8 import com.erry.iclear.dateInterface.entity.ChmConsignment;
...@@ -244,12 +245,18 @@ public class ChmConsignmentService { ...@@ -244,12 +245,18 @@ public class ChmConsignmentService {
244 * @param mawb 245 * @param mawb
245 * @param timeStamp 246 * @param timeStamp
246 */ 247 */
247 - public void processChmConsignment(Mawb mawb, String timeStamp,String creator) { 248 + public ResultRS processChmConsignment(Mawb mawb, String timeStamp, String creator) {
249 + ResultRS result = new ResultRS(Boolean.FALSE,null,null);
248 try { 250 try {
249 Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); 251 Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp));
250 252
251 //1、将请求转换为运单 253 //1、将请求转换为运单
252 ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator); 254 ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator);
255 + if(Objects.equals(chmConsignment,null)){
256 + result.setCode("30001");
257 + result.setMsg("数据格式不正确");
258 + return result;
259 + }
253 List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); 260 List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>();
254 mawb.getMawbDetailList().forEach(detail ->{ 261 mawb.getMawbDetailList().forEach(detail ->{
255 chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment)); 262 chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment));
...@@ -316,6 +323,8 @@ public class ChmConsignmentService { ...@@ -316,6 +323,8 @@ public class ChmConsignmentService {
316 }catch (Exception e){ 323 }catch (Exception e){
317 log.error(""+e.getMessage()); 324 log.error(""+e.getMessage());
318 } 325 }
326 +
327 + return result;
319 } 328 }
320 329
321 330
......