wei.zhou

提交代码

......@@ -112,7 +112,10 @@ public class CustomsDataInterface {
//if(result.getSuccess()){
//TODO 等待校验逻辑完善后,由result.getSuccess() 判断
if(true){
chmConsignmentService.processChmConsignment(mawb, timeStamp,appId);
result = chmConsignmentService.processChmConsignment(mawb, timeStamp,appId);
if(!result.getSuccess()){
return result;
}
}
sw.stop();
......
......@@ -2,6 +2,7 @@ package com.erry.iclear.dateInterface.service;
//import cn.hutool.core.date.DateUtil;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.erry.iclear.dateInterface.api.response.ResultRS;
import com.erry.iclear.dateInterface.common.Constant;
import com.erry.iclear.dateInterface.entity.ChmCarryPort;
import com.erry.iclear.dateInterface.entity.ChmConsignment;
......@@ -244,12 +245,18 @@ public class ChmConsignmentService {
* @param mawb
* @param timeStamp
*/
public void processChmConsignment(Mawb mawb, String timeStamp,String creator) {
public ResultRS processChmConsignment(Mawb mawb, String timeStamp, String creator) {
ResultRS result = new ResultRS(Boolean.FALSE,null,null);
try {
Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp));
//1、将请求转换为运单
ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator);
if(Objects.equals(chmConsignment,null)){
result.setCode("30001");
result.setMsg("数据格式不正确");
return result;
}
List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>();
mawb.getMawbDetailList().forEach(detail ->{
chmConsignmentDetailList.add(chmConsignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment));
......@@ -316,6 +323,8 @@ public class ChmConsignmentService {
}catch (Exception e){
log.error(""+e.getMessage());
}
return result;
}
......