From e804834847917948f45691ab87ad8ec26ca3749d Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 12 Dec 2023 10:22:10 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=8C=87=E5=AE=9A=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=BA=E5=B7=B2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/logpm/oldproject/feign/IOrderClient.java | 4 ++++ .../java/com/logpm/oldproject/feign/OrderClient.java | 5 +++++ .../java/com/logpm/oldproject/mapper/OrderMapper.java | 2 ++ .../java/com/logpm/oldproject/mapper/OrderMapper.xml | 10 +++++++--- .../com/logpm/oldproject/service/IOrderService.java | 2 ++ .../oldproject/service/impl/OrderServiceImpl.java | 5 +++++ .../logpm/patch/jobhandle/SyncOrderInfoToPlatform.java | 2 +- .../com/logpm/patch/service/ISyncOrderInfoService.java | 2 +- .../patch/service/impl/SyncOrderInfoServiceImpl.java | 6 +++++- 9 files changed, 32 insertions(+), 6 deletions(-) diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java index 874bfee69..5c9d49529 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java @@ -61,5 +61,9 @@ public interface IOrderClient { @GetMapping(API_PREFIX + "/getTotalCountByInventory") Integer getTotalCountByInventory(@RequestParam String param, @RequestParam Integer oldWarehouseId); + @GetMapping(API_PREFIX + "/findOrderCodeListByPageWithInventoryId") List findOrderCodeListByPageWithInventoryId(@RequestParam String param, @RequestParam Integer oldWarehouseId, @RequestParam Integer pageNum, @RequestParam Integer pageSize); + + @GetMapping(API_PREFIX + "/updateStatusWithTableName") + void updateStatusWithTableName(@RequestParam int isUpdate, @RequestParam String orderCode, @RequestParam String tableName); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderClient.java index 41a094e2a..139bcac9b 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderClient.java @@ -81,4 +81,9 @@ public class OrderClient implements IOrderClient { public List findOrderCodeListByPageWithInventoryId(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) { return orderService.findOrderCodeListByPageWithInventoryId(param,oldWarehouseId,pageNum,pageSize); } + + @Override + public void updateStatusWithTableName(int isUpdate, String orderCode, String tableName) { + orderService.updateStatusWithTableName(isUpdate,orderCode,tableName); + } } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.java index a7a10772c..e1129adfe 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.java @@ -43,4 +43,6 @@ public interface OrderMapper extends BaseMapper { Integer getTotalCountByInventory(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId); List findOrderCodeListByPageWithInventoryId(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize); + + void updateStatusWithTableName(@Param("isUpdate") int isUpdate, @Param("orderCode") String orderCode, @Param("tableName") String tableName); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml index a0bfc6053..d504acb05 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml @@ -77,8 +77,6 @@ `i`.`update_time` DESC - - - findOrderCodeListByPage + + + update ${tableName} + set is_update = #{isUpdate} + where order_code = #{orderCode} + + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderService.java index 1ee963a0a..2c2459d1f 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderService.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderService.java @@ -23,4 +23,6 @@ public interface IOrderService { Integer getTotalCountByInventory(String param, Integer oldWarehouseId); List findOrderCodeListByPageWithInventoryId(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize); + + void updateStatusWithTableName(int isUpdate, String orderCode, String tableName); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderServiceImpl.java index 3b41d15c1..fa327456e 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderServiceImpl.java @@ -68,4 +68,9 @@ public class OrderServiceImpl implements IOrderService { public List findOrderCodeListByPageWithInventoryId(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) { return orderMapper.findOrderCodeListByPageWithInventoryId(param,oldWarehouseId,pageNum,pageSize); } + + @Override + public void updateStatusWithTableName(int isUpdate, String orderCode, String tableName) { + orderMapper.updateStatusWithTableName(isUpdate,orderCode,tableName); + } } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java index c46af7473..bfb6ed9f9 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java @@ -133,7 +133,7 @@ public class SyncOrderInfoToPlatform { try{ List orderCodeList = orderClient.findOrderCodeListByPage(param,oldWarehouseId,j,pageSize,tableName); - syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId); + syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId,tableName); log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size()); one.setCurrentPage(j+1); diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java index e5d2150c4..cb63a28c3 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java @@ -3,7 +3,7 @@ package com.logpm.patch.service; import java.util.List; public interface ISyncOrderInfoService { - void handleData(List orderCodeList,Integer oldWarehouseId,Long newWarehouseId); + void handleData(List orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName); void handleDataZero(List orderCodeList, Integer oldWarehouseId, Long newWarehouseId); diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java index 2712006a4..c2235e090 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java @@ -84,7 +84,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService { @Transactional(rollbackFor = Exception.class) @Override - public void handleData(List orderCodeList,Integer oldWarehouseId,Long newWarehouseId) { + public void handleData(List orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName) { log.info("#############handleData: 处理订单开始"); for (String orderCode:orderCodeList){ log.info("#############handleData: 当前处理orderCode={}的订单 ",orderCode); @@ -105,10 +105,14 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService { saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId); + orderClient.updateStatusWithTableName(1,orderCode,tableName); + }catch (CustomerException e){ log.error("同步订单"+orderCode+"失败: "+e.message,e); + orderClient.updateStatusWithTableName(2,orderCode,tableName); }catch (Exception e){ log.error("同步订单"+orderCode+"失败",e); + orderClient.updateStatusWithTableName(2,orderCode,tableName); } // }