fix(backlog): 品牌出口统一、join 截止与进行中任务补回
- BrandLabel 出口守卫扩到全仓 entity.setBrand,撞款/去重/品牌库统一清洗 - FutureDeadline 替换五处无界 join,回传口锁等待降为 1s - 采集/跟价/外观专利 history 补回窗口外进行中与续跑任务 - 工作台客户端版本强制单调;catch 棘轮按新增出口逐处记名
This commit is contained in:
+22
-4
@@ -113,6 +113,19 @@ class DedupeRunServiceCleanRulesTest {
|
||||
"非品牌列不参与清洗");
|
||||
}
|
||||
|
||||
/** 品牌列别名(Brand/品牌(英文))同样必须剥标签,不能只认正名「品牌」。 */
|
||||
@Test
|
||||
@DisplayName("品牌列别名也要剥标签前缀")
|
||||
void stripsBrandLabelPrefixFromBrandColumnAliases(@TempDir Path tempDir) throws Exception {
|
||||
String[] headers = {"id", "ASIN", "国家", "价格", "Brand"};
|
||||
File output = runCleanWithHeaders(tempDir, headers, List.of(
|
||||
new String[]{"1", "B0ALIAS001", "英国", "10.00", "Brand: NIKE"},
|
||||
new String[]{"2", "B0ALIAS002", "英国", "11.00", "Brands: ADIDAS"}),
|
||||
List.of("id", "ASIN", "国家", "价格", "Brand"));
|
||||
|
||||
assertEquals(List.of("NIKE", "Brands: ADIDAS"), readOutputColumn(output, 4));
|
||||
}
|
||||
|
||||
/** 纯规则单测:保留主链接开关打开时,整数行不再受子链接影响。 */
|
||||
@Test
|
||||
@DisplayName("开启保留主链接时,整数行不受子链接影响")
|
||||
@@ -181,9 +194,14 @@ class DedupeRunServiceCleanRulesTest {
|
||||
}
|
||||
|
||||
private File runClean(Path tempDir, List<String[]> rows, List<String> selectedColumns) throws Exception {
|
||||
return runCleanWithHeaders(tempDir, HEADERS, rows, selectedColumns);
|
||||
}
|
||||
|
||||
private File runCleanWithHeaders(Path tempDir, String[] headers, List<String[]> rows,
|
||||
List<String> selectedColumns) throws Exception {
|
||||
File input = tempDir.resolve("input.xlsx").toFile();
|
||||
File output = tempDir.resolve("output.xlsx").toFile();
|
||||
writeInput(input, rows);
|
||||
writeInput(input, headers, rows);
|
||||
|
||||
DedupeRunService service = new DedupeRunService(
|
||||
fileTaskMapper, fileResultMapper, storageProperties, ossStorageService, dedupeTotalDataService,
|
||||
@@ -200,12 +218,12 @@ class DedupeRunServiceCleanRulesTest {
|
||||
return output;
|
||||
}
|
||||
|
||||
private void writeInput(File file, List<String[]> rows) throws Exception {
|
||||
private void writeInput(File file, String[] headers, List<String[]> rows) throws Exception {
|
||||
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
|
||||
Sheet sheet = workbook.createSheet("variant_collection");
|
||||
Row headerRow = sheet.createRow(0);
|
||||
for (int i = 0; i < HEADERS.length; i++) {
|
||||
headerRow.createCell(i).setCellValue(HEADERS[i]);
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
headerRow.createCell(i).setCellValue(headers[i]);
|
||||
}
|
||||
for (int r = 0; r < rows.size(); r++) {
|
||||
Row row = sheet.createRow(r + 1);
|
||||
|
||||
Reference in New Issue
Block a user