fix(brand-label): 品牌标签清洗抽公共件,六模块读写两端统一过出口
PublishBrandLabel 从 publish 私有件搬入 common/util/BrandLabel(三条守卫尺子随迁: 唯一副本、实体写出不许绕过、解析端不许重复实现),品牌列的读入与出件两端都走这一处。 读入端接上:asincache 缓存落库、invalidasin 人工黑名单(先洗再判空——键对不上是静默失效, 比脏值出件更难发现)、appearancepatent resolveBrand(两条取值分支同一个串)、collectdata 入库、shopdatacrawl copyRow/sameRow/rowDedupKey(键与值分家会让同一行跨分片重复出件)、 撞款解析与 re-baseline、dedupe 按表头名只洗品牌列。 写出端接上:publish/similarasin×2/appearancepatent/collectdata/撞款 csv+xlsx/shopdatacrawl。 rows-snapshot golden 里品牌格去掉首尾空格:正本 strip 自 2026-10-08 就含 trim, Java/Python/MySQL 三处同形,不是这次新加的行为。 门禁:后端 mvn -o test 4594 例 0 红。BrandTaskService(含四张 sheet 出件与解析端匹配) 因同仓另一路在飞改动未动,见 docs/audit/BACKLOG.md B5。
This commit is contained in:
+3
-1
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.nanri.aiimage.common.exception.BusinessException;
|
||||
import com.nanri.aiimage.common.util.BrandLabel;
|
||||
import com.nanri.aiimage.common.util.GroupResultPropagator;
|
||||
import com.nanri.aiimage.config.SimilarAsinProperties;
|
||||
import com.nanri.aiimage.config.StorageProperties;
|
||||
@@ -901,7 +902,8 @@ public class SimilarAsinResultWorkbookAssembler {
|
||||
resultRow.getPrice(),
|
||||
firstNonBlank(parsedRow.getPrice(), readValueByHeader(parsedRow, "价格", "price"))));
|
||||
row.createCell(col++).setCellValue(readValueByHeader(parsedRow, "卖家名称", "卖家名", "卖家", "店铺名称", "店铺名", "seller name", "seller_name", "seller-name", "sellername", "store name", "shop name"));
|
||||
row.createCell(col++).setCellValue(readValueByHeader(parsedRow, "品牌", "brand"));
|
||||
// 与 SheetBuilder 同口径:结果文件的品牌列必须剥掉页面复制带上的标签前缀,否则二次上传把脏值带回链路
|
||||
row.createCell(col++).setCellValue(BrandLabel.strip(readValueByHeader(parsedRow, "品牌", "brand")));
|
||||
String isStock = resultRow == null ? "" : SimilarAsinResultTextSupport.userFacingLlmCellValue(resultRow, resultRow.getIsStock());
|
||||
String similarity = resultRow == null ? "" : SimilarAsinResultTextSupport.userFacingLlmCellValue(resultRow, resultRow.getSimilarity());
|
||||
String isConform = resultRow == null ? "" : SimilarAsinResultTextSupport.userFacingLlmCellValue(resultRow, resultRow.getIsConform());
|
||||
|
||||
+3
-1
@@ -1,5 +1,6 @@
|
||||
package com.nanri.aiimage.modules.similarasin.service.support;
|
||||
|
||||
import com.nanri.aiimage.common.util.BrandLabel;
|
||||
import com.nanri.aiimage.modules.similarasin.model.vo.SimilarAsinParsedRowVo;
|
||||
import com.nanri.aiimage.modules.similarasin.util.SimilarAsinImageEmbedder;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
@@ -84,7 +85,8 @@ public final class SimilarAsinSheetBuilder {
|
||||
row.createCell(col++).setCellValue(readValueByHeader(
|
||||
parsedRow, "卖家名称", "卖家名", "卖家", "店铺名称", "店铺名", "seller name", "seller_name",
|
||||
"seller-name", "sellername", "store name", "shop name"));
|
||||
row.createCell(col).setCellValue(readValueByHeader(parsedRow, "品牌", "brand"));
|
||||
// 出件是用户的下一份上传物:品牌列带 "Brand:" 标签前缀不剥,下载再上传就把脏值送回链路(清洗出口唯 BrandLabel)
|
||||
row.createCell(col).setCellValue(BrandLabel.strip(readValueByHeader(parsedRow, "品牌", "brand")));
|
||||
row.setHeightInPoints(SimilarAsinImageEmbedder.IMAGE_ROW_HEIGHT_POINTS);
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user