diff --git a/kas-admin/src/test/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImplTest.java b/kas-admin/src/test/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImplTest.java index 6fb830073df6875ad13038636b2458d959d294e5..7d0a7e068c84e5f8d88bb0bd4a83e8af4804b10a 100644 --- a/kas-admin/src/test/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImplTest.java +++ b/kas-admin/src/test/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImplTest.java @@ -26,6 +26,9 @@ public class SharesOrderServiceImplTest { @Autowired SharesOrderServiceImpl impl; + @Autowired + OrderOtdServiceImpl orderService; + @Autowired VJmcKasFlowInfoMapper infoMapper; @@ -48,4 +51,12 @@ public class SharesOrderServiceImplTest { System.out.println(lsts.size()); assertTrue(!CollectionUtils.isEmpty(lsts)); } + + @Test + public void shouldNotNeedUpdate() { + EntityWrapper sqlCondition = new EntityWrapper<>(); + Wrapper eq = sqlCondition.eq("sys_order_no", "0171902004"); + List lsts = orderService.selectList(eq); + assertTrue("OK", impl.isNotRequireUpdate(lsts)); + } } diff --git a/kas-service/src/main/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImpl.java b/kas-service/src/main/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImpl.java index b10a468c8094432d2306c9ebf921d761720d0851..3baa71ae5f84ba031e37972ac86a8a5afb887765 100644 --- a/kas-service/src/main/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImpl.java +++ b/kas-service/src/main/java/com/unlcn/ils/kas/service/order/impl/SharesOrderServiceImpl.java @@ -411,7 +411,7 @@ public class SharesOrderServiceImpl implements SharesOrderService { } /* - * @author:罗必量 保存在途轨迹明细,同时更新主表的最新位置,最新在途时间,预计运抵时间 + * @author:罗必量 保存在途轨迹明细 */ @Transactional(propagation = Propagation.SUPPORTS) @Override @@ -544,10 +544,9 @@ public class SharesOrderServiceImpl implements SharesOrderService { System.out.println("订单号:" + dn); OrderOtd orderOtd = null; + orderOtd = new OrderOtd(); if (!CollectionUtils.isEmpty(orderOtdList) && !StringUtils.isEmpty(orderOtdList.get(0))) { - orderOtd = orderOtdList.get(0); - } else { - orderOtd = new OrderOtd(); + BeanUtils.copyProperties(orderOtdList.get(0), orderOtd); } BeanUtils.copyProperties(orderOtdLog, orderOtd); @@ -1544,13 +1543,10 @@ public class SharesOrderServiceImpl implements SharesOrderService { String executWay = saveOrderInfo(orderOtdLog, orderOtdLogDetailList); if (executWay.equals("insert")) { insertNum++; - pushOrderLog.setInsertNum(insertNum); } else if (executWay.equals("update")) { updateNum++; - pushOrderLog.setUpdateNum(updateNum); } else if ("ignore".equalsIgnoreCase(executWay)) { ignoreNum++; - pushOrderLog.setIgnoreNum(ignoreNum); } executNum++; } catch (Exception e) { @@ -1573,6 +1569,7 @@ public class SharesOrderServiceImpl implements SharesOrderService { pushOrderLog.setAbnormalNum(abnormalNum); pushOrderLog.setUpdateNum(updateNum); pushOrderLog.setInsertNum(insertNum); + pushOrderLog.setIgnoreNum(ignoreNum); // 完成时间 pushOrderLog.setFinshExecutTime(new Date());