From 9d63a57f7d69e80931a4219fb798c7752588d1f5 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 13 Jun 2024 17:41:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E5=B9=B2=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/CustomMessageConverter.java | 4 +- .../logpm/trunkline/dto/OrderStatusDTO.java | 7 +--- .../service/impl/AsyncServiceImpl.java | 9 ++--- .../service/impl/InComingServiceImpl.java | 30 +++++++------- ...TrunklineBillladingWaybillServiceImpl.java | 7 ++-- .../impl/TrunklineCarsLoadServiceImpl.java | 40 +++++++++---------- 6 files changed, 46 insertions(+), 51 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java index 5d1f1035d..1612b391d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java @@ -113,7 +113,7 @@ public class CustomMessageConverter extends AllowedListDeserializingMessageConve messageProperties.setContentType("application/x-java-serialized-object"); } - HttpHeaders headers = (HttpHeaders) ThreadLocalUtil.get("bladeContext"); + HttpHeaders headers = ThreadLocalUtil.get("bladeContext"); if (headers != null && !headers.isEmpty()) { headers.forEach((key, values) -> { values.forEach((value) -> { @@ -130,7 +130,7 @@ public class CustomMessageConverter extends AllowedListDeserializingMessageConve messageProperties.setHeader("bladeUser", JSONUtil.toJsonStr(bladeUser)); if (bytes != null) { - messageProperties.setContentLength((long) bytes.length); + messageProperties.setContentLength(bytes.length); return new Message(bytes, messageProperties); } else { throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports String, byte[] and Serializable payloads, received: " + object.getClass().getName()); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java index 44f8983f3..387b8056f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java @@ -104,11 +104,8 @@ public class OrderStatusDTO implements Serializable { if(StringUtil.isBlank(status)){ return false; } - if(StringUtil.isBlank(distributionContactId)){ - return false; - } - return true; - } + return !StringUtil.isBlank(distributionContactId); + } } 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 307dbc42f..c8d92067b 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 @@ -23,10 +23,7 @@ import org.springblade.system.feign.ISysClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; @@ -203,7 +200,7 @@ public class AsyncServiceImpl implements IAsyncService { } - List ids = Arrays.asList(waybillBilllByWaybillNo.getId()); + List ids = Collections.singletonList(waybillBilllByWaybillNo.getId()); LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId, ids); @@ -278,7 +275,7 @@ public class AsyncServiceImpl implements IAsyncService { Tenant tenant = changeDataBase(mallName); - List ids = Arrays.asList(trunklineAdvanceEntity.getId()); + List ids = Collections.singletonList(trunklineAdvanceEntity.getId()); List listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(ids); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index 34413aec0..4230b6fce 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -170,11 +170,11 @@ public class InComingServiceImpl implements IInComingService { .address("在【" + warehouseName + "】入库") .brand(BrandEnums.getByValue(advanceDetailEntity.getBrand())) .node(WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY) - .content(Arrays.asList(PushData.builder() - .packageCode(packageCode) - .warehouseName(warehouseName) - .orderCode(advanceDetailEntity.getOrderCode()) - .build())) + .content(Collections.singletonList(PushData.builder() + .packageCode(packageCode) + .warehouseName(warehouseName) + .orderCode(advanceDetailEntity.getOrderCode()) + .build())) .build(); factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg); } catch (Exception e) { @@ -348,11 +348,11 @@ public class InComingServiceImpl implements IInComingService { .address("在【" + finalWarehouseName + "】入库") .brand(BrandEnums.getByValue(advanceDetailEntity.getBrand())) .node(WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY) - .content(Arrays.asList(PushData.builder() - .packageCode(advanceDetailEntity.getOrderPackageCode()) - .orderCode(advanceDetailEntity.getOrderCode()) - .warehouseName(finalWarehouseName) - .build())) + .content(Collections.singletonList(PushData.builder() + .packageCode(advanceDetailEntity.getOrderPackageCode()) + .orderCode(advanceDetailEntity.getOrderCode()) + .warehouseName(finalWarehouseName) + .build())) .build(); factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg); } else if (tenant.getTenantType() == 2) { @@ -514,11 +514,11 @@ public class InComingServiceImpl implements IInComingService { .address("在【" + warehouseName + "】入库") .brand(BrandEnums.getByValue(advanceDetailEntity.getBrand())) .node(WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY) - .content(Arrays.asList(PushData.builder() - .packageCode(advanceDetailEntity.getOrderPackageCode()) - .orderCode(advanceDetailEntity.getOrderCode()) - .warehouseName(warehouseName) - .build())) + .content(Collections.singletonList(PushData.builder() + .packageCode(advanceDetailEntity.getOrderPackageCode()) + .orderCode(advanceDetailEntity.getOrderCode()) + .warehouseName(warehouseName) + .build())) .build(); factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java index 8752a7b96..0b5f19aef 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java @@ -14,6 +14,7 @@ import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.List; @Slf4j @@ -76,16 +77,16 @@ public class TrunklineBillladingWaybillServiceImpl extends BaseServiceImpl 0){ - price = totalFee.divide(new BigDecimal(realNum),2,BigDecimal.ROUND_UP); + price = totalFee.divide(new BigDecimal(realNum),2, RoundingMode.UP); } }else if ("2".equals(chargeType)){ if(realWeight.compareTo(BigDecimal.ZERO) > 0){ - price = totalFee.divide(realWeight,4,BigDecimal.ROUND_UP); + price = totalFee.divide(realWeight,4, RoundingMode.UP); } }else if("3".equals(chargeType)){ if(realVolume.compareTo(BigDecimal.ZERO) > 0){ - price = totalFee.divide(realVolume,4,BigDecimal.ROUND_UP); + price = totalFee.divide(realVolume,4, RoundingMode.UP); } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index e8c7fb0df..80d8be2bd 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -2351,11 +2351,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl