修改规则
This commit is contained in:
+10
-6
@@ -147,8 +147,8 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
|
||||
}
|
||||
|
||||
/**
|
||||
* VOL_8000: chargeWeight = max(L*W*H/8000, weightSource).
|
||||
* weightSource RECEIVE_WEIGHT / CHARGE_WEIGHT / VOLUME_WEIGHT.
|
||||
* VOL_8000: chargeWeight = max(L*W*H/8000, volume_weight).
|
||||
* Compare dimensional weight (/8000) with 材积重, not actual weight.
|
||||
*/
|
||||
private BigDecimal resolveVol8000(TmsPriceBillRequest request, BigDecimal systemWeight)
|
||||
{
|
||||
@@ -168,12 +168,12 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
|
||||
{
|
||||
continue;
|
||||
}
|
||||
BigDecimal other = pickWeight(rule.getWeightSource(), request, systemWeight);
|
||||
if (other == null)
|
||||
BigDecimal volumeWeight = firstPositive(request.getVolumeWeight());
|
||||
if (volumeWeight == null)
|
||||
{
|
||||
return dimVol;
|
||||
}
|
||||
return other.max(dimVol).setScale(3, RoundingMode.HALF_UP);
|
||||
return volumeWeight.max(dimVol).setScale(3, RoundingMode.HALF_UP);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -535,9 +535,13 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
|
||||
{
|
||||
throw new ServiceException("规则类型不能为空");
|
||||
}
|
||||
if (RULE_TYPE_VOL_8000.equalsIgnoreCase(row.getRuleType()) && StringUtils.isEmpty(row.getWeightSource()))
|
||||
{
|
||||
row.setWeightSource(WEIGHT_SOURCE_VOLUME);
|
||||
}
|
||||
if (StringUtils.isEmpty(row.getWeightSource()))
|
||||
{
|
||||
throw new ServiceException("取值字段不能为空");
|
||||
throw new ServiceException("\u53d6\u503c\u5b57\u6bb5\u4e0d\u80fd\u4e3a\u7a7a");
|
||||
}
|
||||
if (RULE_TYPE_THREE_SIDE.equalsIgnoreCase(row.getRuleType()) && row.getSideSumMax() == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user