From b66612cdbf850016cbac3393eafa519cfbe34898 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sat, 11 May 2024 11:45:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/annotations/LogpmAsync.java | 12 +++++ .../aspect/AsyncAnnotationAspect.java | 4 +- .../impl/AftersalesWorkOrderServiceImpl.java | 5 +- .../basic/aspect/AsyncAnnotationAspect.java | 4 +- .../aspect/AsyncAnnotationAspect.java | 4 +- .../aspect/AsyncAnnotationAspect.java | 20 +++++--- .../impl/DistributionAsyncServiceImpl.java | 49 ++++++++++--------- .../jinpai/aspect/AnnotationAspect.java | 4 +- .../factorydata/jinpai/job/AdvanceJob.java | 3 +- .../jinpai/mq/FactoryOrderListener.java | 3 +- .../olo/aspect/AnnotationAspect.java | 4 +- .../olo/mq/FactoryOrderListener.java | 3 +- .../suofeiya/aspect/AnnotationAspect.java | 4 +- .../suofeiya/mq/FactoryOrderListener.java | 3 +- .../zbom/aspect/AnnotationAspect.java | 4 +- .../zbom/mq/ZbomFactoryOrderListener.java | 3 +- .../LocalServerTenantIdAnnotationAspect.java | 4 +- .../service/impl/AsyncDataServiceImpl.java | 9 ++-- .../OpFailRetryPushPackageServiceImpl.java | 3 +- .../service/impl/AsyncDataServiceImpl.java | 3 +- .../aspect/AsyncAnnotationAspect.java | 4 +- .../aspect/AsyncAnnotationAspect.java | 4 +- .../service/impl/AsyncServiceImpl.java | 5 +- .../impl/CarsLoadAsyncServiceImpl.java | 19 +++---- .../impl/OpenOrderAsyncServiceImpl.java | 15 +++--- .../impl/PackageTrackLogAsyncServiceImpl.java | 5 +- .../aspect/AsyncAnnotationAspect.java | 4 +- .../service/impl/AsyncDataServiceImpl.java | 3 +- 28 files changed, 119 insertions(+), 88 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/annotations/LogpmAsync.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/annotations/LogpmAsync.java b/blade-biz-common/src/main/java/org/springblade/common/annotations/LogpmAsync.java new file mode 100644 index 000000000..e70510bbf --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/annotations/LogpmAsync.java @@ -0,0 +1,12 @@ +package org.springblade.common.annotations; + +import org.springframework.scheduling.annotation.Async; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@Async("asyncExecutor") +public @interface LogpmAsync { + String value(); +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java index 8c63fd073..c0f7f2712 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/AsyncAnnotationAspect.java @@ -36,8 +36,8 @@ public class AsyncAnnotationAspect { private final BladeRedis bladeRedis; private final Environment environment; /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index 9718ab4e6..4e5036448 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -44,6 +44,7 @@ import com.logpm.distribution.vo.DistributionDeliveryListVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictTimeoutEnum; import org.springblade.common.constant.aftersales.*; @@ -1932,7 +1933,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>> annotationValue={}",annotationValue); + + log.info("@LogpmAsync注解的值为asyncExecutor,进行数据源切换 "); - if(StringUtil.isNotBlank(annotationValue) && annotationValue.equals("asyncExecutor")){ // 在方法执行前的操作 String tenantId = AuthUtil.getTenantId(); + log.info(">> tenandId {} ",tenantId); DynamicDataSourceContextHolder.push(tenantId); // 执行原方法 @@ -41,9 +47,7 @@ public class AsyncAnnotationAspect { DynamicDataSourceContextHolder.poll(); return result; - }else{ - return joinPoint.proceed(); - } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index dc487270c..9f0e90ce0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -37,6 +37,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.DistributionTypeConstant; import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant; @@ -121,7 +122,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { // private final @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void makeSureByPackage(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { log.info("[makeSureByPackage]线程开启>>>>>>>>>>>>>>>>>>>>>>>>{}", distrilbutionloadingscanDTO); @@ -176,7 +177,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * @return */ @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Transactional(rollbackFor = Exception.class) public Boolean getSelfPickup(Long id) { DistributionParcelListEntity entity = new DistributionParcelListEntity(); @@ -192,7 +193,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * @return */ @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Transactional(rollbackFor = Exception.class) public Boolean getOrderSelfPickup(Long id) { DistributionStockArticleEntity entity = new DistributionStockArticleEntity(); @@ -202,7 +203,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Transactional(rollbackFor = Exception.class) public Boolean getInventorySelfPickup(Long id) { DistributionStockEntity distributionStock = new DistributionStockEntity(); @@ -213,7 +214,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Transactional(rollbackFor = Exception.class) public Boolean getInventoryOrderSelfPickup(Long id) { DistributionDeliveryDetailsEntity deliveryDetails = new DistributionDeliveryDetailsEntity(); @@ -241,7 +242,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * * @param id 订单ID */ - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void updateStockArticleStock(Long id) { log.debug("###查询订单备货状态"); @@ -269,7 +270,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * * @param ids 订单ID */ - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void updateParcelListReservation(List ids) { log.debug("####修改包件预约状态"); @@ -294,7 +295,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public Boolean getInventoryNumUpdate(Long id, Integer num, Integer type) { //查询 @@ -317,7 +318,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void changeOrderSignforStatus(DistributionParcelListEntity parcelListEntity) { @@ -338,7 +339,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void changeDiscussDeliveryListStatus(String barcode, Long deliveryId) { @@ -398,7 +399,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { }); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void changeMarketDeliveryListStatus(String barcode, Long deliveryId, Long reservationId) { @@ -444,7 +445,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void checkDeliverySignStatus(String barcode, Long deliveryId) { @@ -635,7 +636,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { distributionDeliveryListMapper.updateById(deliveryListEntity); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void checkDeliverySignStatusByReservation(Long deliveryId) { @@ -1441,7 +1442,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void sendFactory(DistributionParcelListEntity distributionParcelListEntity, String signingTime, Long reservationId, String reservationCode, String warehouseName, String userName) { DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distributionParcelListEntity.getStockArticleId()); log.info(">>>>>>>>>>> 签收推送 对象 {}", distributionParcelListEntity); @@ -1475,7 +1476,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Override @Transactional(rollbackFor = Exception.class) - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) { String brands = "梦天,欧派,志邦";//可追加 log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:=" + signingId + "warehouseName:=" + warehouseName + "warehouseId:=" + warehouseId); @@ -1628,7 +1629,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Transactional public void maintenanceOrderStatus(String orderCode, Long warehouseId) { distributionStockArticleService.updateOrderInfo(orderCode, warehouseId); @@ -1636,7 +1637,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Override @Transactional - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void releaseSource(Long reservationId, Long warehouseId) { String method = "##########################DistributionAsyncServiceImpl.releaseSource"; DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId); @@ -1828,7 +1829,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * @param stockupDTO */ @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void updateStockupDate(StockupDTO stockupDTO) { Integer scanType = stockupDTO.getScanType();//扫码类型 1 包件 2库存品 @@ -1957,7 +1958,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * 备货库存品备货时间回显 */ @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void updateStockupStockListDate(StockupDTO stockupDTO) { Integer scanType = stockupDTO.getScanType();//扫码类型 1 包件 2库存品 Long reservationId = stockupDTO.getReservationId();//预约ID @@ -2179,7 +2180,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { /** * 自提签收片段是否签收完全 */ - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(rollbackFor = Exception.class) public void getStockUPstate(Long billLadingId) { @@ -2265,7 +2266,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void checkStockArticleSignStatus(DistributionParcelListEntity parcelListEntity) { @@ -2322,7 +2323,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void changeOrderStatus(String barcode, Long deliveryId) { @@ -2341,7 +2342,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { distributionStockArticleService.updateById(stockArticleEntity); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void changeDeliverySignforListStatus(Long deliveryId, DistributionParcelListEntity parcelListEntity) { @@ -2465,7 +2466,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { distributionStockArticleService.updateById(stockArticleEntity); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) public void checkStockArticleLoadingStatus(DistributionParcelListEntity parcelListEntity) { diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/aspect/AnnotationAspect.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/aspect/AnnotationAspect.java index e3414918c..d7a77fc0f 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/aspect/AnnotationAspect.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/aspect/AnnotationAspect.java @@ -37,8 +37,8 @@ public class AnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object asyncAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AdvanceJob.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AdvanceJob.java index 27eb6003b..592b1f3c0 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AdvanceJob.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/job/AdvanceJob.java @@ -28,6 +28,7 @@ import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.HttpConstants; import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.common.model.IDict; @@ -116,7 +117,7 @@ public class AdvanceJob { return ReturnT.SUCCESS; } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void buildAdvance(Map> packageMap, Map deliveryMap, Map orderInfoMap) { // 新起线程构建暂存单发送mq diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java index a72ca15a7..4836e8e22 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java @@ -42,6 +42,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.HttpConstants; import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.core.redis.cache.BladeRedis; @@ -184,7 +185,7 @@ public class FactoryOrderListener { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void buildAdvance(PushOrderVO vo) { // 新起线程构建暂存单发送mq Long startWarehouseId = null; diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/aspect/AnnotationAspect.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/aspect/AnnotationAspect.java index 76f6235b2..c9b546289 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/aspect/AnnotationAspect.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/aspect/AnnotationAspect.java @@ -17,8 +17,8 @@ import java.lang.reflect.Method; public class AnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object asyncAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/FactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/FactoryOrderListener.java index b697f2d21..107b56005 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/FactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/FactoryOrderListener.java @@ -29,6 +29,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.HttpConstants; import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.core.redis.cache.BladeRedis; @@ -173,7 +174,7 @@ public class FactoryOrderListener { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void buildAdvance(List vos) { // 新起线程构建暂存单发送mq // ThreadPoolUtil.getThreadPool().submit(() -> { diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/aspect/AnnotationAspect.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/aspect/AnnotationAspect.java index 8a8b9f354..9a262a914 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/aspect/AnnotationAspect.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/aspect/AnnotationAspect.java @@ -17,8 +17,8 @@ import java.lang.reflect.Method; public class AnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object asyncAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mq/FactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mq/FactoryOrderListener.java index 9a336b699..9404ecde7 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mq/FactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mq/FactoryOrderListener.java @@ -31,6 +31,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.HttpConstants; import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.core.redis.cache.BladeRedis; @@ -150,7 +151,7 @@ public class FactoryOrderListener { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void buildAdvance(DeliveryNoteVO vo) { // 新起线程构建暂存单发送mq Long startWarehouseId = null; diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/aspect/AnnotationAspect.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/aspect/AnnotationAspect.java index 6dafedc97..3265b3946 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/aspect/AnnotationAspect.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/aspect/AnnotationAspect.java @@ -17,8 +17,8 @@ import java.lang.reflect.Method; public class AnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object asyncAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java index fd49d73cc..9ddd2a182 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java @@ -37,6 +37,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.entity.TrunklineDetailProductEntity; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.HttpConstants; import org.springblade.common.constant.PatternConstant; import org.springblade.common.constant.TenantNum; @@ -195,7 +196,7 @@ public class ZbomFactoryOrderListener { buildAdvance(zbReceiptDTO, packageCode); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void buildAdvance(ZBReceiptDTO zbReceiptDTO, Set packageCode) { // 新起线程构建暂存单发送mq Long startWarehouseId = null; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/LocalServerTenantIdAnnotationAspect.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/LocalServerTenantIdAnnotationAspect.java index 6e41c6cbb..76b675a71 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/LocalServerTenantIdAnnotationAspect.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/LocalServerTenantIdAnnotationAspect.java @@ -25,8 +25,8 @@ // // // /** -// * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 -// * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 +// * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 +// * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 // */ // // // 定义一个 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index 78eed4fca..2f17982a0 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -62,6 +62,7 @@ import com.logpm.trunkline.entity.TrunklineDetailProductEntity; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.jetbrains.annotations.Nullable; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.HttpConstants; import org.springblade.common.constant.PackagesTypeEnum; import org.springblade.common.constant.PatternConstant; @@ -141,7 +142,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { * 处理皮阿诺数据推送到汇通老库 */ @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void handlerPanDataToHt(Long id) { log.info("################handlerDataToHt: 处理皮阿诺订单数据到"); //查询需要同步的订单 @@ -336,7 +337,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { } @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void handlerPanDataToHtNew(Long id) { log.info("################handlerPanDataToHtNew: 处理皮阿诺订单数据到"); //查询需要同步的订单 @@ -520,7 +521,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void handlerMtDataToHt(Long mainId) { log.info("################handlerMtDataToHt: 处理梦天订单数据到"); //查询需要同步的订单 @@ -599,7 +600,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { } @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void handlerMtDataToHtNew(Long mainId) { log.info("################handlerMtDataToHtNew: 处理梦天订单数据到"); //查询需要同步的订单 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java index 2918146ce..2f11acf81 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java @@ -8,6 +8,7 @@ import com.logpm.factory.oupai.service.IOuPaiFactoryService; import com.logpm.factory.oupai.service.OpFailRetryPushPackageService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -31,7 +32,7 @@ public class OpFailRetryPushPackageServiceImpl implements OpFailRetryPushPackage protected final int MAX_RETRY_TIMES = 7; - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void retry(List waitData){ ArrayList completeIds = new ArrayList<>(); diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java index 643f71d33..81483d604 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java @@ -13,6 +13,7 @@ import com.logpm.patch.service.ISyncOrderInfoService; import com.logpm.patch.service.IWarehouseMappingDataService; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.exception.CustomerException; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -40,7 +41,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void syncInventoryToPlatform(SyncInventoryEntity syncInventoryEntity) { Integer pageSize = 500;//处理的每页条数 diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java index f5f0be02b..d88742f92 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/aspect/AsyncAnnotationAspect.java @@ -17,8 +17,8 @@ import java.lang.reflect.Method; public class AsyncAnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/AsyncAnnotationAspect.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/AsyncAnnotationAspect.java index e06a9efc8..f34a3b551 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/AsyncAnnotationAspect.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/AsyncAnnotationAspect.java @@ -17,8 +17,8 @@ import java.lang.reflect.Method; public class AsyncAnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java index a2db2bd8a..e9d916f24 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java @@ -5,6 +5,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.service.IAsyncService; import com.logpm.trunkline.service.ITrunklineAdvanceDetailService; import com.logpm.trunkline.service.ITrunklineAdvanceService; +import org.springblade.common.annotations.LogpmAsync; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -20,7 +21,7 @@ public class AsyncServiceImpl implements IAsyncService { @Autowired private ITrunklineAdvanceDetailService advanceDetailService; - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public CompletableFuture getResponseFromCp(List list, int queryType) { return CompletableFuture @@ -29,7 +30,7 @@ public class AsyncServiceImpl implements IAsyncService { ); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public CompletableFuture saveAdvanceEntity(List list, int queryType) { return CompletableFuture diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index c4cd092a9..d8cf20ae1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -15,6 +15,7 @@ import com.logpm.trunkline.vo.UnloadReportVO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.TenantNum; @@ -61,7 +62,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { @Autowired private RabbitTemplate rabbitTemplate; - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveLog(TrunklineCarsLoadEntity carsLoadEntity, TrunklineCarsLoadLineEntity carsLoadLineEntity, int cardLoadType,String nickName,Long userId) { String nodeName = null; @@ -171,7 +172,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { trunklineCarsLoadLogService.save(carsLoadLogEntity); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveCostShareRecord(Long loadId, TrunklineCarsLoadEntity carsLoadEntity, Long userId, String tenantId, String deptIds) { Long deptId = null; @@ -256,7 +257,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void costShareByLoadId(Long loadId,TrunklineCarsLoadEntity carsLoadEntity) { @@ -337,7 +338,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId,Long userId,Long deptId,String nickName,String tenantId,String warehouseName) { @@ -378,7 +379,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void abnormalListUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String warehouseName, Long loadScanId, String tenantId, Long userId, String nickName, Long deptId) { TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(loadScanId); @@ -413,7 +414,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void abnormalListUnloadCheckByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String warehouseName, String tenantId, Long userId, String nickName, Long deptId) { @@ -494,7 +495,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void dealwithAfterAbnormalPackage(String orderPackageCode, Long warehouseId, String warehouseName, String carsNo, Long userId, Long aLong, String nickName) { @@ -517,13 +518,13 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void savaUnloadLogBatch(List unloadLogList) { trunklineCarsUnloadLogService.savaUnloadLogBatch(unloadLogList); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void sendRabbitMessageLoadScanData(List data) { String queue = RabbitConstant.INCOMING_TO_LOAD_QUEUE; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java index 8c96245cb..3fcba9ff6 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java @@ -9,6 +9,7 @@ import com.logpm.trunkline.vo.LoadScanWaybillVO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.utils.CommonUtil; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; @@ -42,7 +43,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { @Autowired private IInComingService inComingService; - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName,Long userId,Long warehouseId,String warehouseName) { // String tenantId = AuthUtil.getTenantId(); @@ -65,7 +66,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { // DynamicDataSourceContextHolder.clear(); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity,String nickName,Long userId) { Long loadId = carsLoadLineEntity.getLoadId(); @@ -135,7 +136,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveCancelStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId) { Long loadId = carsLoadLineEntity.getLoadId(); @@ -165,7 +166,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveArriveCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId) { Long loadId = carsLoadLineEntity.getLoadId(); @@ -195,7 +196,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveCancelArriveCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId) { Long loadId = carsLoadLineEntity.getLoadId(); @@ -225,7 +226,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void saveUnloadStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId) { Long loadId = carsLoadLineEntity.getLoadId(); @@ -257,7 +258,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { } } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void incomingPackageBatch(List advanceIds, Long userId, Long deptId, String tenantId, String nickName,Integer incomingType,Long warehouseId,String warehouseName) { InComingDTO inComingDTO = new InComingDTO(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/PackageTrackLogAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/PackageTrackLogAsyncServiceImpl.java index 4533b5d49..e95a0e6d5 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/PackageTrackLogAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/PackageTrackLogAsyncServiceImpl.java @@ -6,6 +6,7 @@ import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity; import com.logpm.warehouse.feign.IWarehousePackageTrackLogClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -21,7 +22,7 @@ public class PackageTrackLogAsyncServiceImpl implements IPackageTrackLogAsyncSer private final IWarehousePackageTrackLogClient warehousePackageTrackLogClient; private final ITrunklineWaybillPackageService waybillPackageService; - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void addPackageTrackLog(String tenantId, Long userId, Long deptId, String nickName, List orderPackageCodes, Long warehouseId, String warehouseName, Integer workNode, String content) { List list = new ArrayList<>(); @@ -49,7 +50,7 @@ public class PackageTrackLogAsyncServiceImpl implements IPackageTrackLogAsyncSer waybillPackageService.updatePackageStatus(orderPackageCodes, workNode); } - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") @Override public void addBatchPackageTrackLog(List addPackageTrackLogList, List orderPackageCodes, Integer workNode) { warehousePackageTrackLogClient.addLogList(addPackageTrackLogList); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/aspect/AsyncAnnotationAspect.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/aspect/AsyncAnnotationAspect.java index 2b99cee7d..8f7dd766c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/aspect/AsyncAnnotationAspect.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/aspect/AsyncAnnotationAspect.java @@ -17,8 +17,8 @@ import java.lang.reflect.Method; public class AsyncAnnotationAspect { /** - * 定义一个切点,匹配所有带有@Async("asyncExecutor")注解的方法。 - * 注意:实际上Spring Framework自带对@Async("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 + * 定义一个切点,匹配所有带有@LogpmAsync("asyncExecutor")注解的方法。 + * 注意:实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理,直接这样配置可能会导致预期之外的行为。 */ @Around("@annotation(org.springframework.scheduling.annotation.Async)") public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java index 7b477be11..e1e8168e9 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java @@ -21,6 +21,7 @@ import com.logpm.warehouse.service.*; import com.logpm.warehouse.vo.QuestDetailVO; import com.logpm.warehouse.vo.TrayTypeDataVO; import lombok.extern.log4j.Log4j2; +import org.springblade.common.annotations.LogpmAsync; import org.springblade.common.constant.TenantNum; import org.springblade.common.exception.CustomerException; import org.springblade.core.tool.api.R; @@ -79,7 +80,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { private ISyncTaskErrorLogService syncTaskErrorLogService; @Override - @Async("asyncExecutor") + @LogpmAsync("asyncExecutor") public void syncTaskData(String questNum, Long warehouseId,String tenantId,Long userId,String nickName,Long deptId) { log.info("###############syncTaskData: 同步盘点任务数据开始 questNum={}",questNum); QueryWrapper queryWrapper = new QueryWrapper<>();