A2-A4-A9 完善报销码值与查重回归
这个提交包含在:
@@ -209,6 +209,47 @@ function scanRawBusinessIdentifiers(file, source) {
|
||||
}
|
||||
}
|
||||
|
||||
function scanReimbursementRawCodeDisplay(file, source) {
|
||||
const normalized = toPosix(path.relative(rootDir, file));
|
||||
if (normalized !== "client/src/pages/ReimbursementDetailPage.tsx") {
|
||||
return;
|
||||
}
|
||||
|
||||
const patterns = [
|
||||
{
|
||||
regex: /状态:\{detail\.status\}/g,
|
||||
message: "PC 报销详情不应直接展示报销状态码,应显示中文业务状态。",
|
||||
},
|
||||
{
|
||||
regex: /\{item\.status\}/g,
|
||||
message: "PC 报销详情不应直接展示发票状态码,应显示中文业务状态。",
|
||||
},
|
||||
{
|
||||
regex: /expenseType\?\.code/g,
|
||||
message: "普通报销详情不应展示费用类型 code,应显示中文费用类型名。",
|
||||
},
|
||||
{
|
||||
regex: /expenseType\?\.name\s*\?\?\s*item\.expenseTypeId/g,
|
||||
message: "普通报销详情不应在费用类型缺失时回退展示内部费用类型 ID。",
|
||||
},
|
||||
];
|
||||
|
||||
for (const pattern of patterns) {
|
||||
let match = pattern.regex.exec(source);
|
||||
while (match) {
|
||||
addFinding({
|
||||
rule: "business.no_raw_reimbursement_codes",
|
||||
severity: "error",
|
||||
file,
|
||||
line: lineNumber(source, match.index),
|
||||
message: pattern.message,
|
||||
evidence: match[0],
|
||||
});
|
||||
match = pattern.regex.exec(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function extractStringList(source, name) {
|
||||
const assignment = new RegExp(`const\\s+${name}\\s*=\\s*\\[([\\s\\S]*?)\\];`, "m").exec(source);
|
||||
if (!assignment) {
|
||||
@@ -255,6 +296,7 @@ function scanFile(file) {
|
||||
scanNativeFileInputs(file, source);
|
||||
scanMobileCapturePdfInputs(file, source);
|
||||
scanRawBusinessIdentifiers(file, source);
|
||||
scanReimbursementRawCodeDisplay(file, source);
|
||||
scanNavigationTitleCoverage(file, source);
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户