fix(backlog): 品牌出口统一、join 截止与进行中任务补回

- BrandLabel 出口守卫扩到全仓 entity.setBrand,撞款/去重/品牌库统一清洗
- FutureDeadline 替换五处无界 join,回传口锁等待降为 1s
- 采集/跟价/外观专利 history 补回窗口外进行中与续跑任务
- 工作台客户端版本强制单调;catch 棘轮按新增出口逐处记名
This commit is contained in:
2026-10-25 13:27:46 +08:00
parent 1dd9e66d21
commit 5928072c6a
30 changed files with 558 additions and 75 deletions
@@ -9,6 +9,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
@@ -91,6 +92,53 @@ class BrandLabelTest {
.isEmpty();
}
/**
* 品牌列不只是 publish 一处在写:所有实体出口都要经过 BrandLabel。两处身份键例外
* (复核队列与无效 ASIN 表的 brand 是匹配键,改值会重键历史行),必须点名而非静默跳过。
*/
@Test
void everyEntityBrandWriteGoesThroughOutletOrIsAnIdentityKey() throws IOException {
Set<String> identityKeyFiles = Set.of(
"CollectDataBrandRecheckService.java",
"CollectDataInvalidAsinBatchWriter.java");
List<String> offenders = new ArrayList<>();
List<String> written = new ArrayList<>();
for (Path file : mainSources()) {
if (file.getFileName().toString().equals(OUTLET_CLASS)) {
continue;
}
String[] lines = read(file).split("\r?\n", -1);
for (int i = 0; i < lines.length; i++) {
String line = lines[i].trim();
if (line.startsWith("//") || line.startsWith("*") || line.startsWith("/*")) {
continue;
}
if (!line.matches("^entity\\.setBrand\\(.*\\);")) {
continue;
}
written.add(file.getFileName() + ":" + (i + 1));
if (line.contains("BrandLabel.strip(")
|| identityKeyFiles.contains(file.getFileName().toString())
|| hasStripInPrecedingLines(lines, i)) {
continue;
}
offenders.add(file.getFileName() + ":" + (i + 1) + " " + line);
}
}
assertThat(written).as("全仓 entity.setBrand 写入点应被扫到").isNotEmpty();
assertThat(offenders).as("绕过 BrandLabel.strip 的实体品牌写入点").isEmpty();
}
/** strip 可能先赋给局部变量再写出(如 InvalidAsinDataService),允许向上看一小段。 */
private static boolean hasStripInPrecedingLines(String[] lines, int index) {
for (int i = Math.max(0, index - 6); i < index; i++) {
if (lines[i].contains("BrandLabel.strip(")) {
return true;
}
}
return false;
}
@Test
void labelRegexLivesInExactlyOneMainSource() throws IOException {
List<String> carriers = new ArrayList<>();