Merge branch 'test' of http://8.163.30.128:10082/java-project/baiyue-firstleg into test
This commit is contained in:
@@ -91,16 +91,25 @@ public class FbaPricingService {
|
||||
}
|
||||
}
|
||||
var measurement = measurementRepository.findLatestMeasurement(tenantId, inboundId);
|
||||
if ("OUTER".equalsIgnoreCase(volumeSource) && measurement == null) {
|
||||
throw conflict("外箱规测量批次不存在,不能生成对客费用");
|
||||
boolean actualMeasurementSource = "ACTUAL".equalsIgnoreCase(weightSource)
|
||||
|| "ACTUAL".equalsIgnoreCase(volumeSource);
|
||||
boolean outerMeasurementSource = "OUTER".equalsIgnoreCase(weightSource)
|
||||
|| "OUTER".equalsIgnoreCase(volumeSource);
|
||||
if ((actualMeasurementSource || outerMeasurementSource) && measurement == null) {
|
||||
throw conflict(actualMeasurementSource
|
||||
? "实际测量数据不存在,不能生成对客费用"
|
||||
: "外箱规测量批次不存在,不能生成对客费用");
|
||||
}
|
||||
if ("OUTER".equalsIgnoreCase(volumeSource)) {
|
||||
var outerItems = measurementRepository.listItems(tenantId, measurement.getId());
|
||||
boolean incomplete = outerItems.isEmpty() || outerItems.stream().anyMatch(item ->
|
||||
if (actualMeasurementSource || outerMeasurementSource) {
|
||||
var measurementItems = measurementRepository.listItems(tenantId, measurement.getId());
|
||||
if (actualMeasurementSource && measurementItems.isEmpty()) {
|
||||
throw conflict("实际测量明细不存在,不能生成对客费用");
|
||||
}
|
||||
boolean incomplete = outerMeasurementSource && (measurementItems.isEmpty() || measurementItems.stream().anyMatch(item ->
|
||||
item.getOuterLengthCm() == null || item.getOuterLengthCm().signum() <= 0
|
||||
|| item.getOuterWidthCm() == null || item.getOuterWidthCm().signum() <= 0
|
||||
|| item.getOuterHeightCm() == null || item.getOuterHeightCm().signum() <= 0
|
||||
|| !StringUtils.hasText(item.getCalculationRuleVersion()));
|
||||
|| !StringUtils.hasText(item.getCalculationRuleVersion())));
|
||||
if (incomplete) throw conflict("外箱规数据或绑定的计算规则不完整,不能生成对客费用");
|
||||
}
|
||||
ActivePriceBookEstimator.Estimate estimate = priceBookEstimator.estimate(new EstimateRequest(
|
||||
|
||||
Reference in New Issue
Block a user