Browse Source

1.优化干线

master
pref_mail@163.com 10 months ago
parent
commit
9d63a57f7d
  1. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/CustomMessageConverter.java
  2. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderStatusDTO.java
  3. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java
  4. 30
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  5. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java
  6. 40
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

4
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());

7
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);
}
}

9
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<Long> ids = Arrays.asList(waybillBilllByWaybillNo.getId());
List<Long> ids = Collections.singletonList(waybillBilllByWaybillNo.getId());
LambdaQueryWrapper<TrunklineWaybillPackageEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId, ids);
@ -278,7 +275,7 @@ public class AsyncServiceImpl implements IAsyncService {
Tenant tenant = changeDataBase(mallName);
List<Long> ids = Arrays.asList(trunklineAdvanceEntity.getId());
List<Long> ids = Collections.singletonList(trunklineAdvanceEntity.getId());
List<TrunklineAdvanceDetailVO> listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(ids);

30
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);
}

7
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<Trunk
BigDecimal price = BigDecimal.ZERO;
if("1".equals(chargeType)){
if(realNum > 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);
}
}

40
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -2351,11 +2351,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.address("在【" + warehouseName + "】出库")
.brand(BrandEnums.getByValue(brandName))
.node(WorkNodeEnums.INITIAL_WAREHOUSE_LOADING)
.content(Arrays.asList(PushData.builder()
.packageCode(orderPackageCode)
.orderCode(orderCode)
.warehouseName(warehouseName)
.build()))
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.orderCode(orderCode)
.warehouseName(warehouseName)
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
}catch (Exception e){
@ -3904,11 +3904,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.address("在【" + warehouseName + "】入库")
.brand(BrandEnums.getByValue(entity.getBrandName()))
.node(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE)
.content(Arrays.asList(PushData.builder()
.packageCode(entity.getOrderPackageCode())
.warehouseName(warehouseName)
.orderCode(entity.getOrderCode())
.build()))
.content(Collections.singletonList(PushData.builder()
.packageCode(entity.getOrderPackageCode())
.warehouseName(warehouseName)
.orderCode(entity.getOrderCode())
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
} catch (Exception e) {
@ -4629,11 +4629,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.address("在【" + warehouseName + "】出库")
.brand(BrandEnums.getByValue(parcelListEntity.getBrandName()))
.node(WorkNodeEnums.INITIAL_WAREHOUSE_LOADING)
.content(Arrays.asList(PushData.builder()
.packageCode(orderPackageCode)
.orderCode(orderCode)
.warehouseName(warehouseName)
.build()))
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.orderCode(orderCode)
.warehouseName(warehouseName)
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
}catch (Exception e1){
@ -6005,11 +6005,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.address("在【" + warehouseName + "】入库")
.brand(BrandEnums.getByValue(distributionParcelListEntity.getBrandName()))
.node(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE)
.content(Arrays.asList(PushData.builder()
.packageCode(orderPackageCode)
.warehouseName(warehouseName)
.orderCode(orderCode)
.build()))
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.warehouseName(warehouseName)
.orderCode(orderCode)
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
}

Loading…
Cancel
Save