wei.zhou

提交代码

...@@ -248,6 +248,7 @@ public class ChmConsignmentService { ...@@ -248,6 +248,7 @@ public class ChmConsignmentService {
248 try { 248 try {
249 Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); 249 Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp));
250 250
251 + //1、将请求转换为运单
251 ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator); 252 ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator);
252 List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); 253 List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>();
253 mawb.getMawbDetailList().forEach(detail ->{ 254 mawb.getMawbDetailList().forEach(detail ->{
...@@ -256,8 +257,11 @@ public class ChmConsignmentService { ...@@ -256,8 +257,11 @@ public class ChmConsignmentService {
256 chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); 257 chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList);
257 258
258 259
259 - //校验 7天+运单 ,如果有数据并且 还未报关就更新,如果数据就插入 260 + //2、校验 7天+运单 ,如果有数据并且 还未报关就更新,如果数据就插入
260 ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(mawb.getBillNo(), DateUtils.addDate(DateUtils.getCurrentDate(),-7)); 261 ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(mawb.getBillNo(), DateUtils.addDate(DateUtils.getCurrentDate(),-7));
262 +
263 +
264 + //3、新增或更新
261 //新增:如果没有就插入 265 //新增:如果没有就插入
262 if (Objects.equals(chmConsignmentDB,null)){ 266 if (Objects.equals(chmConsignmentDB,null)){
263 log.info("新增主单"+ mawb.getBillNo()); 267 log.info("新增主单"+ mawb.getBillNo());
...@@ -298,9 +302,8 @@ public class ChmConsignmentService { ...@@ -298,9 +302,8 @@ public class ChmConsignmentService {
298 chmConsignmentDB.setChmConsignmentDetailList(null); 302 chmConsignmentDB.setChmConsignmentDetailList(null);
299 } 303 }
300 304
301 -
302 -
303 chmConsignment.setId(chmConsignmentDB.getId()); 305 chmConsignment.setId(chmConsignmentDB.getId());
306 + chmConsignment.setCreateTime(chmConsignmentDB.getCreateTime());
304 chmConsignment.setUpdateTime(pushTime); 307 chmConsignment.setUpdateTime(pushTime);
305 ChmConsignment updateResult = this.saveChmConsignment(chmConsignment); 308 ChmConsignment updateResult = this.saveChmConsignment(chmConsignment);
306 if(!Objects.equals(updateResult,null)){ 309 if(!Objects.equals(updateResult,null)){
......