From a644dd926597c09de3d4848186263f17c0b36ece Mon Sep 17 00:00:00 2001 From: zhenghaoyu <zhenghaoyu@superbgrace.com> Date: Fri, 22 Dec 2023 12:13:50 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=90=8C=E6=AD=A5=E6=95=B0=E6=8D=AE=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/oldproject/feign/IWayBillClient.java | 3 +++ .../pan/service/impl/PanFactoryDataServiceImpl.java | 4 ++-- .../com/logpm/oldproject/feign/WayBillClient.java | 5 +++++ .../com/logpm/oldproject/mapper/WayBillMapper.java | 2 ++ .../com/logpm/oldproject/mapper/WayBillMapper.xml | 12 ++++++++++++ .../logpm/oldproject/service/IWayBillService.java | 2 ++ .../oldproject/service/impl/WayBillServiceImpl.java | 5 +++++ .../patch/service/impl/SyncOrderInfoServiceImpl.java | 6 +++++- 8 files changed, 36 insertions(+), 3 deletions(-) diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java index 3967598b9..e204fba84 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java @@ -48,4 +48,7 @@ public interface IWayBillClient { @GetMapping(API_PREFIX + "/findAdvanceIdsByWaybillNo") List<Integer> findAdvanceIdsByWaybillNo(@RequestParam String waybillNo); + + @GetMapping(API_PREFIX + "/getByWayBillByOrderCode") + WayBillEntity getByWayBillByOrderCode(@RequestParam String orderCode); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index b43094cfe..748d5cebd 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -449,10 +449,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment()); } - WayBillEntity wayBillEntity = wayBillClient.getByWayBillByAdvanceId(advanceEntity.getId()); + WayBillEntity wayBillEntity = wayBillClient.getByWayBillByOrderCode(orderSelfNum); - if(null==wayBillEntity){ + if(Objects.isNull(wayBillEntity)){ logger.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity); return ; diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java index 88c887b6d..448b7e31f 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java @@ -61,4 +61,9 @@ public class WayBillClient implements IWayBillClient { public List<Integer> findAdvanceIdsByWaybillNo(String waybillNo) { return wayBillService.findAdvanceIdsByWaybillNo(waybillNo); } + + @Override + public WayBillEntity getByWayBillByOrderCode(String orderCode) { + return wayBillService.getByWayBillByOrderCode(orderCode); + } } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java index 201b11c07..02cbdc077 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java @@ -12,4 +12,6 @@ public interface WayBillMapper extends BaseMapper<WayBillEntity> { WayBillEntity getByWayBillByAdvanceId(@Param("advId") Integer advId); List<Integer> findAdvanceIdsByWaybillNo(@Param("waybillNo") String waybillNo); + + WayBillEntity getByWayBillByOrderCode(@Param("orderCode") String orderCode); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml index 99651a142..eb71cd18e 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml @@ -15,4 +15,16 @@ select ht_way_bill.* FROM ht_way_bill LEFT JOIN ht_advance on ht_advance.waybi and waybill_no = #{waybillNo} </select> + <select id="getByWayBillByOrderCode" resultType="com.logpm.oldproject.entity.WayBillEntity"> + SELECT + ht_way_bill.* + FROM + ht_way_bill + LEFT JOIN ht_advance ON ht_advance.waybill_no = ht_way_bill.waybill_no + WHERE + ht_advance.orderSelfNum = #{orderCode} + and ht_way_bill.`status` !=-1 + limit 1 + </select> + </mapper> diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java index d414d2620..1f72401ca 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java @@ -18,4 +18,6 @@ public interface IWayBillService { List<Integer> findAdvanceIdsByWaybillNo(String waybillNo); + + WayBillEntity getByWayBillByOrderCode(String orderCode); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java index f77833ae3..b32dd22f1 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java @@ -42,4 +42,9 @@ public class WayBillServiceImpl implements IWayBillService { public List<Integer> findAdvanceIdsByWaybillNo(String waybillNo) { return wayBillMapper.findAdvanceIdsByWaybillNo(waybillNo); } + + @Override + public WayBillEntity getByWayBillByOrderCode(String orderCode) { + return wayBillMapper.getByWayBillByOrderCode(orderCode); + } } 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 8255a4750..48a3b2466 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 @@ -1267,7 +1267,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService { total = total + entity.getTotal(); } - WayBillEntity wayBillEntity = wayBillClient.getByWayBillByAdvanceId(advanceId); + WayBillEntity wayBillEntity = wayBillClient.getByWayBillByOrderCode(orderCode); + if(Objects.isNull(wayBillEntity)){ + log.warn("#################saveOrderInfo: 运单信息为空 orderCode={}",orderCode); + throw new CustomerException(403,"运单信息为空"); + } BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId); if(Objects.isNull(basicdataWarehouseEntity)){