From d1f8e0dcb86c8c229db2c07b5092fd38badecad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A5=E7=9D=BF?= Date: Fri, 15 Nov 2019 15:28:36 +0800 Subject: [PATCH] =?UTF-8?q?#hotfix/shareOrderServiceImpl.transformation=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E5=BC=95=E7=94=A8=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/impl/SharesOrderServiceImplTest.java | 11 +++++++++++ .../service/order/impl/SharesOrderServiceImpl.java | 11 ++++------- 2 files changed, 15 insertions(+), 7 deletions(-) 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 6fb8300..7d0a7e0 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 b10a468..3baa71a 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()); -- Gitee