Browse Source

修改库存品查询

training
caoyizhong 1 year ago
parent
commit
52b1cf520c
  1. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java

25
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockWrapper.java

@ -1,11 +1,10 @@
package com.logpm.distribution.wrapper; package com.logpm.distribution.wrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionStockEntity; import com.logpm.distribution.entity.*;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.service.IDistributionDeliveryListService; import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.IDistributionStockListService; import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistrilbutionBillLadingService; import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import com.logpm.distribution.vo.DistributionStockVO; 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.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@Log4j2 @Log4j2
public class DistributionStockWrapper extends BaseEntityWrapper<DistributionStockEntity, DistributionStockVO> { public class DistributionStockWrapper extends BaseEntityWrapper<DistributionStockEntity, DistributionStockVO> {
private IDistributionStockListService stockListService = SpringUtil.getBean(IDistributionStockListService.class); private IDistributionStockListService stockListService = SpringUtil.getBean(IDistributionStockListService.class);
private IDistributionSignforService signforService = SpringUtil.getBean(IDistributionSignforService.class);
private IDistributionDeliveryListService deliveryListService = SpringUtil.getBean(IDistributionDeliveryListService.class); private IDistributionDeliveryListService deliveryListService = SpringUtil.getBean(IDistributionDeliveryListService.class);
private IDistrilbutionBillLadingService billLadingService = SpringUtil.getBean(IDistrilbutionBillLadingService.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())){ if(DistributionTypeConstant.ziti.getValue().equals(entity.getOutboundType())){
DistrilbutionBillLadingEntity byId1 = billLadingService.getById(entity.getBillLadingId()); DistrilbutionBillLadingEntity byId1 = billLadingService.getById(entity.getBillLadingId());
entity.setDeliveryListCode(byId1.getPickupBatch()); if(ObjectUtils.isNotNull(byId1)){
entity.setDeliveryListCode(byId1.getPickupBatch());
}
}else{ }else{
DistributionDeliveryListEntity byId1 = deliveryListService.getById(entity.getReservationId()); List<DistributionSignforEntity> list = signforService.list(Wrappers.<DistributionSignforEntity>query().lambda()
entity.setDeliveryListCode(byId1.getNoteNumber()); .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 = Objects.requireNonNull(BeanUtil.copy(entity,DistributionStockVO.class));
distributionStockVO.setOutboundTypeName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, entity.getOutboundType())); distributionStockVO.setOutboundTypeName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, entity.getOutboundType()));

Loading…
Cancel
Save