diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index 484658927..3d0cc5062 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -28,8 +28,10 @@ import com.google.zxing.WriterException; import com.logpm.basic.entity.BasicMaterialEntity; import com.logpm.basic.feign.IBasicMaterialClient; import com.logpm.basicdata.entity.BasicdataClientEntity; +import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataClientClient; +import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionParcelListDTO; import com.logpm.distribution.dto.app.StockupDTO; @@ -60,14 +62,14 @@ import com.logpm.distribution.vo.PackageStockupVO; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient; +import com.logpm.warehouse.entity.WarehouseConfigEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity; -import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; -import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; -import com.logpm.warehouse.feign.IWarehouseWaybillClient; +import com.logpm.warehouse.feign.*; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.WorkNodeEnums; +import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.order.OrderStockupStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; @@ -126,6 +128,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId()); + BasicdataGoodsAllocationEntity defaultGoodsAllocation; + Integer isAutoWarehouse; + if (!Objects.isNull(warehouseConfig)){ + if (!Objects.isNull(warehouseConfig.getIsAutoWarehouse())){ + //查询备货库位 + isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0; + if (isAutoWarehouse == Integer.parseInt(IsOrNoConstant.yes.getValue())){ + defaultGoodsAllocation = allocationClient.findDefaultGoodsAllocation(myCurrentWarehouse.getId()); + } else { + defaultGoodsAllocation = null; + } + } else { + defaultGoodsAllocation = null; + isAutoWarehouse = 0; + } + } else { + defaultGoodsAllocation = null; + isAutoWarehouse = 0; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); String s = String.valueOf(o); if (s.contains(",")) { String[] split = s.split(","); @@ -541,33 +571,6 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl packageIds = new ArrayList<>(); v.forEach(i -> { - //查询有没有打托数据 - -// //查询包件有没有物料 -// List list = distributionParcelDetailsService.list(Wrappers.query().lambda() -// .eq(DistributionParcelDetailsEntity::getParcelListId, i.getId()) -// ); -// if (!list.isEmpty()) { -// //有 -// list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded)) -// .forEach((kk, vv) -> { -// DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); -// BeanUtil.copyProperties(vv.get(0), parcelListEntity); -// parcelListEntity.setQuantity(sum); -// parcelListEntity.setMaterialName(vv.get(0).getName()); -// parcelListEntity.setMaterialCode(vv.get(0).getEncoded()); -// parcelListEntity.setMaterialUnit(vv.get(0).getUnit()); -// // 添加库存品信息 -// //查询在库订单信息 -// DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId()); -// if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) { -// throw new ServiceException("订单的客户数据异常,无法转换!!"); -// } -// addStockList(distributionStockArticleEntity, parcelListEntity, 1); -// }); -// } - - DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); BeanUtil.copyProperties(i, parcelListEntity); @@ -594,6 +597,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl parcelListEntities = this.list(Wrappers.query().lambda() -// .eq(DistributionParcelListEntity::getStockArticleId, oo) -// .eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) -// ); -// int sum = parcelListEntities.stream().filter(p -> "1".equals(p.getConditions())).mapToInt(DistributionParcelListEntity::getQuantity).sum(); -// distributionStockArticleEntity.setHandQuantity(sum); -// distributionStockArticleEntity.setIncomingNum(sum); - distributionStockArticleMapper.updateById(distributionStockArticleEntity); } });