|
|
|
@ -427,13 +427,13 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
|
|
|
|
|
StatisticsOrderInfoEntity orderInfoEntity = this.getOne(new QueryWrapper<StatisticsOrderInfoEntity>().lambda().eq(StatisticsOrderInfoEntity::getId, id)); |
|
|
|
|
if (ObjectUtil.isEmpty(orderInfoEntity)) { |
|
|
|
|
log.warn("#############calculateRealCost: 订单信息不存在"); |
|
|
|
|
throw new CustomerException("订单信息不存在"); |
|
|
|
|
throw new CustomerException(405, "订单信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long brandId = orderInfoEntity.getBrandId(); |
|
|
|
|
Long consigneeId = orderInfoEntity.getConsigneeId(); |
|
|
|
|
if (!ObjectUtil.isAllNotEmpty(brandId, consigneeId)) { |
|
|
|
|
log.warn("#############calculateRealCost: 品牌{} 收货单位{}", brandId, consigneeId); |
|
|
|
|
throw new CustomerException("结算单信息不完整,缺少品牌和收货单位,请联系系统管理员。"); |
|
|
|
|
throw new CustomerException(405, "结算单信息不完整,缺少品牌和收货单位,请联系系统管理员。"); |
|
|
|
|
} |
|
|
|
|
Date createTime = orderInfoEntity.getCreateTime(); |
|
|
|
|
// 根据 品牌 收货单位 开单时间 获取价格体系
|
|
|
|
@ -444,14 +444,14 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
|
|
|
|
|
.build()); |
|
|
|
|
if (ObjectUtil.isEmpty(price)) { |
|
|
|
|
log.warn("#############calculateRealCost: 未维护价格,无法计算。"); |
|
|
|
|
throw new CustomerException("未维护价格,无法计算。"); |
|
|
|
|
throw new CustomerException(405, "未维护价格,无法计算。"); |
|
|
|
|
} |
|
|
|
|
// 查询包件数据
|
|
|
|
|
List<StatisticsDistributionPackageEntity> distributionPackageEntities = distributionPackageService.list(new QueryWrapper<StatisticsDistributionPackageEntity>().lambda().eq(StatisticsDistributionPackageEntity::getOrderInfoId, id)); |
|
|
|
|
// 校验是否全部配送完成
|
|
|
|
|
if (distributionPackageEntities.stream().anyMatch(distributionPackageEntity -> distributionPackageEntity.getIsSign() == 0)) { |
|
|
|
|
log.warn("#############calculateRealCost: 订单未全部配送完成,无法计算。"); |
|
|
|
|
throw new CustomerException("订单未全部配送完成,无法计算。"); |
|
|
|
|
throw new CustomerException(405, "订单未全部配送完成,无法计算。"); |
|
|
|
|
} |
|
|
|
|
List<StatisticsWarehousePackageEntity> warehousePackageEntities = warehousePackageService.list(new QueryWrapper<StatisticsWarehousePackageEntity>().lambda().eq(StatisticsWarehousePackageEntity::getOrderInfoId, id)); |
|
|
|
|
PriceDispatchVO dispatch = price.getDispatch(); |
|
|
|
@ -460,7 +460,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
|
|
|
|
|
BasicdataPriceTemplateEntity template = price.getTemplate(); |
|
|
|
|
if (ObjectUtil.isEmpty(template)) { |
|
|
|
|
log.warn("#############calculateRealCost: 未维护模版,无法计算。"); |
|
|
|
|
throw new CustomerException("未维护模版,无法计算。"); |
|
|
|
|
throw new CustomerException(405, "未维护模版,无法计算。"); |
|
|
|
|
} |
|
|
|
|
String serviceType = template.getServiceType(); |
|
|
|
|
Integer dispatchIsMinCost = template.getDispatchIsMinCost(); |
|
|
|
|