修改比较逻辑
This commit is contained in:
+6
-6
@@ -147,8 +147,8 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
|
||||
}
|
||||
|
||||
/**
|
||||
* VOL_8000: chargeWeight = max(L*W*H/8000, volume_weight).
|
||||
* Compare dimensional weight (/8000) with 材积重, not actual weight.
|
||||
* VOL_8000: chargeWeight = max(L*W*H/8000, receive_weight).
|
||||
* Compare dimensional weight (/8000) with 收货重.
|
||||
*/
|
||||
private BigDecimal resolveVol8000(TmsPriceBillRequest request, BigDecimal systemWeight)
|
||||
{
|
||||
@@ -168,12 +168,12 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
|
||||
{
|
||||
continue;
|
||||
}
|
||||
BigDecimal volumeWeight = firstPositive(request.getVolumeWeight());
|
||||
if (volumeWeight == null)
|
||||
BigDecimal receiveWeight = firstPositive(request.getReceiveWeight());
|
||||
if (receiveWeight == null)
|
||||
{
|
||||
return dimVol;
|
||||
}
|
||||
return volumeWeight.max(dimVol).setScale(3, RoundingMode.HALF_UP);
|
||||
return receiveWeight.max(dimVol).setScale(3, RoundingMode.HALF_UP);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
|
||||
}
|
||||
if (RULE_TYPE_VOL_8000.equalsIgnoreCase(row.getRuleType()) && StringUtils.isEmpty(row.getWeightSource()))
|
||||
{
|
||||
row.setWeightSource(WEIGHT_SOURCE_VOLUME);
|
||||
row.setWeightSource(WEIGHT_SOURCE_RECEIVE);
|
||||
}
|
||||
if (StringUtils.isEmpty(row.getWeightSource()))
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
-- VOL_8000: charge_weight = max(L*W*H/8000, volume_weight)
|
||||
-- VOL_8000: charge_weight = max(L*W*H/8000, receive_weight)
|
||||
-- customer_code column stores 对外代码 customer_code_dw (C00222/C00562/C00521/C00805)
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
|
||||
SELECT 2, N'材积重8000取大', 'VOL_8000', 'bms_biz_rule_type', '', 'success', 'N', '0', 'admin', sysdate(),
|
||||
N'计费重=max(长×宽×高/8000, 材积重)'
|
||||
N'计费重=max(长×宽×高/8000, 收货重)'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'bms_biz_rule_type' AND dict_value = 'VOL_8000');
|
||||
|
||||
INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
|
||||
@@ -14,8 +14,8 @@ FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_dict_data WHERE dict_type = 'bms_b
|
||||
|
||||
-- Seed by 对外代码 (customer_code_dw). Matcher also accepts customer_code.
|
||||
INSERT INTO biz_rule (rule_name, rule_type, product_code, country_code, customer_code, weight_min, weight_max, weight_source, side_sum_max, status, remark, create_by, create_time, del_flag)
|
||||
SELECT CONCAT(N'对外代码', v.customer_code, N' 材积重8000取大'), 'VOL_8000', NULL, NULL, v.customer_code, NULL, NULL, 'VOLUME_WEIGHT', NULL, '0',
|
||||
N'客户维度为对外代码customer_code_dw;计费重=max(长×宽×高/8000, 材积重)', 'admin', sysdate(), '0'
|
||||
SELECT CONCAT(N'对外代码', v.customer_code, N' 材积重8000取大'), 'VOL_8000', NULL, NULL, v.customer_code, NULL, NULL, 'RECEIVE_WEIGHT', NULL, '0',
|
||||
N'客户维度为对外代码customer_code_dw;计费重=max(长×宽×高/8000, 收货重)', 'admin', sysdate(), '0'
|
||||
FROM (
|
||||
SELECT 'C00222' AS customer_code UNION ALL SELECT 'C00562' UNION ALL SELECT 'C00521' UNION ALL SELECT 'C00805'
|
||||
) v
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
:closable="false"
|
||||
show-icon
|
||||
style="margin-bottom: 12px"
|
||||
title="计费重 = max(长×宽×高(cm)/8000, 材积重);无尺寸时不覆盖"
|
||||
title="计费重 = max(长×宽×高(cm)/8000, 收货重);无尺寸时不覆盖"
|
||||
/>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
|
||||
Reference in New Issue
Block a user