Compare commits

2 Commits

Author SHA1 Message Date
wuweihua 2bd417b84e Merge branch 'test' of https://git.lionquexpress.com/wuweihua/BMS into test 2026-10-28 15:25:23 +08:00
wuweihua 3652546ea4 修改计费逻辑名称 2026-10-28 15:24:59 +08:00
6 changed files with 118 additions and 24 deletions
@@ -35,15 +35,15 @@ public class OracleOrderBillMapper
req.setUpstreamRow(row);
req.setCustomerCode(firstStr(row, "CUSTOMER_CODE"));
req.setCustomerName(firstStr(row, "CUSTOMER_NAME"));
// Upstream product identity: TAB_ORDER.LINE_CODE / LINE_NAME only
// Upstream product identity: LINE_CODE / LINE_NAME (fallback PRODUCT_*).
// (BMS product_code_mapping applied later in quote / persist).
String product = firstStr(row, "LINE_CODE");
String product = firstStr(row, "LINE_CODE", "PRODUCT_CODE");
if (StringUtils.isEmpty(product))
{
product = defaultProductCode;
}
req.setProductCode(product);
req.setProductName(firstStr(row, "LINE_NAME"));
req.setProductName(firstStr(row, "LINE_NAME", "PRODUCT_NAME"));
req.setCountryCode(firstStr(row, "COUNTRY"));
String countryName = firstStr(row, "COUNTRY_NAME", "COUNTRY_EINGTH_NAME", "COUNTRY");
req.setCountryName(countryName);
@@ -1698,17 +1698,18 @@ public class BmsProductServiceImpl implements IBmsProductService
{
continue;
}
String code = cellString(row.getCell(colCode));
if (StringUtils.isEmpty(code) || code.contains("对接代码"))
String rawCode = cellString(row.getCell(colCode));
if (StringUtils.isEmpty(rawCode) || rawCode.contains("对接代码"))
{
continue;
}
if (!code.matches("(?i)^[A-Z0-9_-]+$"))
String code = normalizeImportProductCode(rawCode);
if (StringUtils.isEmpty(code))
{
continue;
}
BmsProduct p = new BmsProduct();
p.setProductCode(code.trim());
p.setProductCode(code);
p.setProductName(cellString(row.getCell(colName)));
p.setServiceLevel(cellString(row.getCell(colLevel)));
p.setCargoAttr(cellString(row.getCell(colCargo)));
@@ -1725,6 +1726,25 @@ public class BmsProductServiceImpl implements IBmsProductService
return list;
}
/**
* Strip vendor suffixes such as "WSP046(中性)" / "WSP046(中性)" -> "WSP046".
* Returns null when no leading product-code token remains.
*/
private static String normalizeImportProductCode(String raw)
{
if (StringUtils.isEmpty(raw))
{
return null;
}
String s = raw.trim().replaceAll("[\\((][^\\))]*[\\))]", "").trim();
java.util.regex.Matcher m = java.util.regex.Pattern.compile("(?i)^([A-Z0-9_-]+)").matcher(s);
if (!m.find())
{
return null;
}
return m.group(1);
}
/** Header column, or the legacy fixed offset when the title is absent. */
private static int catalogColumn(Row headerRow, String keyword, int fallback)
{
@@ -2476,8 +2496,8 @@ public class BmsProductServiceImpl implements IBmsProductService
{
continue;
}
String code = cellString(row.getCell(colCode));
if (StringUtils.isEmpty(code) || !code.matches("(?i)^[A-Z0-9_-]+$"))
String code = normalizeImportProductCode(cellString(row.getCell(colCode)));
if (StringUtils.isEmpty(code))
{
continue;
}
@@ -2487,7 +2507,7 @@ public class BmsProductServiceImpl implements IBmsProductService
continue;
}
BmsProduct p = new BmsProduct();
p.setProductCode(code.trim());
p.setProductCode(code);
p.setProductName(name.trim());
if (colService >= 0)
{
@@ -1529,17 +1529,18 @@ public class BmsRedlineProductServiceImpl implements IBmsRedlineProductService
{
continue;
}
String code = cellString(row.getCell(colCode));
if (StringUtils.isEmpty(code) || code.contains("对接代码"))
String rawCode = cellString(row.getCell(colCode));
if (StringUtils.isEmpty(rawCode) || rawCode.contains("对接代码"))
{
continue;
}
if (!code.matches("(?i)^[A-Z0-9_-]+$"))
String code = normalizeImportProductCode(rawCode);
if (StringUtils.isEmpty(code))
{
continue;
}
BmsRedlineProduct p = new BmsRedlineProduct();
p.setProductCode(code.trim());
p.setProductCode(code);
p.setProductName(cellString(row.getCell(colName)));
p.setServiceLevel(cellString(row.getCell(colLevel)));
p.setCargoAttr(cellString(row.getCell(colCargo)));
@@ -1556,6 +1557,25 @@ public class BmsRedlineProductServiceImpl implements IBmsRedlineProductService
return list;
}
/**
* Strip vendor suffixes such as "WSP046(中性)" / "WSP046(中性)" -> "WSP046".
* Returns null when no leading product-code token remains.
*/
private static String normalizeImportProductCode(String raw)
{
if (StringUtils.isEmpty(raw))
{
return null;
}
String s = raw.trim().replaceAll("[\\((][^\\))]*[\\))]", "").trim();
java.util.regex.Matcher m = java.util.regex.Pattern.compile("(?i)^([A-Z0-9_-]+)").matcher(s);
if (!m.find())
{
return null;
}
return m.group(1);
}
/** Header column, or the legacy fixed offset when the title is absent. */
private static int catalogColumn(Row headerRow, String keyword, int fallback)
{
@@ -2286,8 +2306,8 @@ public class BmsRedlineProductServiceImpl implements IBmsRedlineProductService
{
continue;
}
String code = cellString(row.getCell(colCode));
if (StringUtils.isEmpty(code) || !code.matches("(?i)^[A-Z0-9_-]+$"))
String code = normalizeImportProductCode(cellString(row.getCell(colCode)));
if (StringUtils.isEmpty(code))
{
continue;
}
@@ -2297,7 +2317,7 @@ public class BmsRedlineProductServiceImpl implements IBmsRedlineProductService
continue;
}
BmsRedlineProduct p = new BmsRedlineProduct();
p.setProductCode(code.trim());
p.setProductCode(code);
p.setProductName(name.trim());
if (colService >= 0)
{
@@ -2848,6 +2848,7 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
req.setCustomerCode(bill.getCustomerCode());
req.setCustomerName(bill.getCustomerName());
req.setProductCode(bill.getProductCode());
req.setProductName(resolveBillProductName(bill));
req.setCountryCode(bill.getCountryCode());
req.setCountryName(bill.getCountryName());
req.setDestPostcode(bill.getDestPostcode());
@@ -2880,6 +2881,44 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
return req;
}
/**
* Prefer bill.productName; when missing or equal to productCode, recover from ext LINE_NAME / PRODUCT_NAME.
*/
private String resolveBillProductName(PrcOrderBill bill)
{
if (bill == null)
{
return null;
}
String code = StringUtils.trim(bill.getProductCode());
String name = StringUtils.trim(bill.getProductName());
if (StringUtils.isNotEmpty(name) && (StringUtils.isEmpty(code) || !name.equalsIgnoreCase(code)))
{
return name;
}
if (StringUtils.isEmpty(bill.getBillId()) || orderBillExtMapper == null)
{
return StringUtils.isNotEmpty(name) ? name : null;
}
PrcOrderBillExt ext = orderBillExtMapper.selectByBillId(bill.getBillId());
if (ext == null)
{
return StringUtils.isNotEmpty(name) ? name : null;
}
String lineName = StringUtils.trim(ext.getLineName());
if (StringUtils.isNotEmpty(lineName) && (StringUtils.isEmpty(code) || !lineName.equalsIgnoreCase(code)))
{
return lineName;
}
String upstreamName = StringUtils.trim(ext.getProductName());
if (StringUtils.isNotEmpty(upstreamName)
&& (StringUtils.isEmpty(code) || !upstreamName.equalsIgnoreCase(code)))
{
return upstreamName;
}
return StringUtils.isNotEmpty(name) ? name : null;
}
private Date resolveBizDate(String bizDate)
{
@@ -473,9 +473,15 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
}
}
attemptedPriceMatch = true;
// Prefer package product name only when it is a real name (not equal to product code).
// Otherwise keep upstream LINE_NAME / catalog name (e.g. "标快鞋盒-包税(中性)").
if (setProduct != null && StringUtils.isNotEmpty(setProduct.getProductName()))
{
productName = setProduct.getProductName();
String spn = setProduct.getProductName().trim();
if (StringUtils.isEmpty(productName) || !spn.equalsIgnoreCase(productCode))
{
productName = spn;
}
}
String setType = StringUtils.isEmpty(set.getSetType()) ? TYPE_FIXED : set.getSetType();
@@ -1074,9 +1080,18 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
TmsPriceQuoteResult r = new TmsPriceQuoteResult();
r.setMatchSource(source);
r.setProductCode(productCode);
// Prefer detail name only when it is not a code placeholder; keep upstream/catalog otherwise.
if (detail != null && StringUtils.isNotEmpty(detail.getProductName()))
{
r.setProductName(detail.getProductName());
String dpn = detail.getProductName().trim();
if (StringUtils.isEmpty(productName) || !dpn.equalsIgnoreCase(productCode))
{
r.setProductName(dpn);
}
else
{
r.setProductName(productName);
}
}
else
{
+5 -5
View File
@@ -124,7 +124,7 @@
@click="openBatchFee"
>批量增加费用</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@@ -132,7 +132,7 @@
v-hasPermi="['price:billing:chargeWeightEdit']"
@click="openChargeWeightImport"
>批量修改计费重</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button
type="info"
@@ -163,14 +163,14 @@
</template>
<template #col-action="{ row }">
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
<el-button
<!-- <el-button
link
type="primary"
icon="Edit"
:disabled="row.refundStatus === 'REFUNDED'"
v-hasPermi="['price:billing:chargeWeightEdit']"
@click="openEditChargeWeight(row)"
>改计费重</el-button>
>改计费重</el-button> -->
<el-button
link
type="danger"
@@ -460,7 +460,7 @@ const columns = [
{ label: '销售员', prop: 'belongSaler', minWidth: 100, showOverflowTooltip: true },
{ label: '结算员', prop: 'settlementMan', minWidth: 100, showOverflowTooltip: true },
{ label: '客服员', prop: 'serviceMan', minWidth: 100, showOverflowTooltip: true },
{ label: '操作', prop: 'action', align: 'center', width: 240, fixed: 'right', slot: 'action', showInToolbar: false, showOverflowTooltip: false }
{ label: '操作', prop: 'action', align: 'center', width: 150, fixed: 'right', slot: 'action', showInToolbar: false, showOverflowTooltip: false }
]
const arrearsStatusOptions = [