修改比较逻辑

This commit is contained in:
wuweihua
2026-11-10 18:10:10 +08:00
parent 2e5ab2bfc1
commit fca999c384
3 changed files with 11 additions and 11 deletions
@@ -147,8 +147,8 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
} }
/** /**
* VOL_8000: chargeWeight = max(L*W*H/8000, volume_weight). * VOL_8000: chargeWeight = max(L*W*H/8000, receive_weight).
* Compare dimensional weight (/8000) with 材积重, not actual weight. * Compare dimensional weight (/8000) with 收货重.
*/ */
private BigDecimal resolveVol8000(TmsPriceBillRequest request, BigDecimal systemWeight) private BigDecimal resolveVol8000(TmsPriceBillRequest request, BigDecimal systemWeight)
{ {
@@ -168,12 +168,12 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
{ {
continue; continue;
} }
BigDecimal volumeWeight = firstPositive(request.getVolumeWeight()); BigDecimal receiveWeight = firstPositive(request.getReceiveWeight());
if (volumeWeight == null) if (receiveWeight == null)
{ {
return dimVol; return dimVol;
} }
return volumeWeight.max(dimVol).setScale(3, RoundingMode.HALF_UP); return receiveWeight.max(dimVol).setScale(3, RoundingMode.HALF_UP);
} }
return null; return null;
} }
@@ -537,7 +537,7 @@ public class BmsBizRuleServiceImpl implements IBmsBizRuleService
} }
if (RULE_TYPE_VOL_8000.equalsIgnoreCase(row.getRuleType()) && StringUtils.isEmpty(row.getWeightSource())) 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())) if (StringUtils.isEmpty(row.getWeightSource()))
{ {
+4 -4
View File
@@ -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) -- customer_code column stores 对外代码 customer_code_dw (C00222/C00562/C00521/C00805)
SET NAMES utf8mb4; 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) 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(), 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'); 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) 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. -- 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) 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', 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' N'客户维度为对外代码customer_code_dw;计费重=max(长×宽×高/8000, 收货重)', 'admin', sysdate(), '0'
FROM ( FROM (
SELECT 'C00222' AS customer_code UNION ALL SELECT 'C00562' UNION ALL SELECT 'C00521' UNION ALL SELECT 'C00805' SELECT 'C00222' AS customer_code UNION ALL SELECT 'C00562' UNION ALL SELECT 'C00521' UNION ALL SELECT 'C00805'
) v ) v
@@ -110,7 +110,7 @@
:closable="false" :closable="false"
show-icon show-icon
style="margin-bottom: 12px" style="margin-bottom: 12px"
title="计费重 = max(长×宽×高(cm)/8000, 材积重);无尺寸时不覆盖" title="计费重 = max(长×宽×高(cm)/8000, 收货重);无尺寸时不覆盖"
/> />
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">