Browse Source

Merge branch 'dev' into pre-production

newStockUp
zhenghaoyu 1 year ago
parent
commit
5bbe60a38a
  1. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java

23
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<DistributionStockEntity, DistributionStockVO> {
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<DistributionStoc
if(DistributionTypeConstant.ziti.getValue().equals(entity.getOutboundType())){
DistrilbutionBillLadingEntity byId1 = billLadingService.getById(entity.getBillLadingId());
if(ObjectUtils.isNotNull(byId1)){
entity.setDeliveryListCode(byId1.getPickupBatch());
}
}else{
DistributionDeliveryListEntity byId1 = deliveryListService.getById(entity.getReservationId());
entity.setDeliveryListCode(byId1.getNoteNumber());
List<DistributionSignforEntity> list = signforService.list(Wrappers.<DistributionSignforEntity>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()));

Loading…
Cancel
Save