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)){