diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java index dac415648..a27e3f7d6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java @@ -1,11 +1,10 @@ package com.logpm.distribution.wrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.logpm.distribution.entity.DistributionDeliveryListEntity; -import com.logpm.distribution.entity.DistributionStockEntity; -import com.logpm.distribution.entity.DistributionStockListEntity; -import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.distribution.entity.*; import com.logpm.distribution.service.IDistributionDeliveryListService; +import com.logpm.distribution.service.IDistributionSignforService; import com.logpm.distribution.service.IDistributionStockListService; import com.logpm.distribution.service.IDistrilbutionBillLadingService; import com.logpm.distribution.vo.DistributionStockVO; @@ -18,11 +17,13 @@ import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.SpringUtil; import org.springblade.system.cache.DictBizCache; +import java.util.List; import java.util.Objects; @Log4j2 public class DistributionStockWrapper extends BaseEntityWrapper { private IDistributionStockListService stockListService = SpringUtil.getBean(IDistributionStockListService.class); + private IDistributionSignforService signforService = SpringUtil.getBean(IDistributionSignforService.class); private IDistributionDeliveryListService deliveryListService = SpringUtil.getBean(IDistributionDeliveryListService.class); private IDistrilbutionBillLadingService billLadingService = SpringUtil.getBean(IDistrilbutionBillLadingService.class); @@ -46,10 +47,20 @@ public class DistributionStockWrapper extends BaseEntityWrapper list = signforService.list(Wrappers.query().lambda() + .eq(DistributionSignforEntity::getReservationId, entity.getReservationId()) + ); + if(ObjectUtils.isNotNull(list) && ObjectUtils.isNotNull(list.get(0))){ + DistributionDeliveryListEntity byId = deliveryListService.getById(list.get(0).getDeliveryId()); + if(ObjectUtils.isNotNull(byId)){ + entity.setDeliveryListCode(byId.getNoteNumber()); + } + } } distributionStockVO = Objects.requireNonNull(BeanUtil.copy(entity,DistributionStockVO.class)); distributionStockVO.setOutboundTypeName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, entity.getOutboundType()));