|
|
|
@ -49,6 +49,7 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.order.OrderReservationStatusConstant; |
|
|
|
|
import org.springblade.common.constant.order.OrderStatusConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; |
|
|
|
@ -129,7 +130,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient; |
|
|
|
|
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient; |
|
|
|
|
private final IDistributionReservationPackageService distributionReservationPackageService; |
|
|
|
|
private final IDistributionReservationStockarticleService distributionReservationStockarticleService; |
|
|
|
|
private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService; |
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
private final IDistributionLoadscanService distributionLoadscanService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionStockArticleVO> selectDistributionStockArticlePage(IPage<DistributionStockArticleVO> page, DistributionStockArticleVO distributionStockArticle) { |
|
|
|
@ -1627,6 +1631,99 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param type |
|
|
|
|
* @param code |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R getdeliveryInfo(Integer type, String code) { |
|
|
|
|
String method = "#####################DistributionStockArticleServiceImpl.getdeliveryInfo"; |
|
|
|
|
Integer a =0; |
|
|
|
|
Integer b =0; |
|
|
|
|
DeliveryOrderInfoVO deliveryOrderInfoVO = new DeliveryOrderInfoVO(); |
|
|
|
|
switch (type){ |
|
|
|
|
//运单
|
|
|
|
|
case 1: |
|
|
|
|
List<Long> ids = baseMapper.getOrderListByWaybill(code); |
|
|
|
|
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda() |
|
|
|
|
.in(DistributionReservationStockarticleEntity::getStockArticleId, ids) |
|
|
|
|
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(reservationStockarticleEntityList)){ |
|
|
|
|
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) { |
|
|
|
|
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())){ |
|
|
|
|
//查询包件数量
|
|
|
|
|
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()) |
|
|
|
|
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(packageEntityList)){ |
|
|
|
|
a += packageEntityList.size(); |
|
|
|
|
} |
|
|
|
|
}else if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.yes.getValue())){ |
|
|
|
|
//查询零担配送数量
|
|
|
|
|
List<DistributionReservationZeroPackageEntity> zeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()) |
|
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(zeroPackageEntityList)){ |
|
|
|
|
a += zeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error(method+"配送订单无类型"); |
|
|
|
|
return R.fail("数据错误!!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<DistributionLoadscanEntity> list = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.in(DistributionLoadscanEntity::getOrderId, ids) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(list)){ |
|
|
|
|
b = list.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); |
|
|
|
|
} |
|
|
|
|
deliveryOrderInfoVO.setDeliveryNum(a); |
|
|
|
|
deliveryOrderInfoVO.setSigningNum(b); |
|
|
|
|
return R.data(deliveryOrderInfoVO); |
|
|
|
|
case 2: |
|
|
|
|
DistributionStockArticleEntity one = this.getOne(Wrappers.<DistributionStockArticleEntity>query().lambda() |
|
|
|
|
.eq(DistributionStockArticleEntity::getOrderCode, code) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(one)){ |
|
|
|
|
if (one.getIsZero().equals(IsOrNoConstant.no.getValue())){ |
|
|
|
|
//查询包件数量
|
|
|
|
|
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationPackageEntity::getStockArticleId, one.getId()) |
|
|
|
|
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(packageEntityList)){ |
|
|
|
|
a += packageEntityList.size(); |
|
|
|
|
} |
|
|
|
|
}else if (one.getIsZero().equals(IsOrNoConstant.yes.getValue())){ |
|
|
|
|
//查询零担配送数量
|
|
|
|
|
List<DistributionReservationZeroPackageEntity> zeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, one.getId()) |
|
|
|
|
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(zeroPackageEntityList)){ |
|
|
|
|
a += zeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error(method+"配送订单无类型"); |
|
|
|
|
return R.fail("数据错误!!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//订单
|
|
|
|
|
deliveryOrderInfoVO.setDeliveryNum(a); |
|
|
|
|
deliveryOrderInfoVO.setSigningNum(b); |
|
|
|
|
return R.data(deliveryOrderInfoVO); |
|
|
|
|
default: |
|
|
|
|
log.error(method+"缺少参数type"); |
|
|
|
|
return R.fail("查无此信息"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) { |
|
|
|
|