rowsByCountry 由同国行累加改为覆盖语义:按成员顺序累积, 后面的结果覆盖前面同名国家的行(最新任务胜出),本次未提交的 国家从旧累计对象/成员累积中保留,不再被清空。 新增回归测试:两个成员快照(英德法 + 仅德国新行)写入 workbook 后, 英国/法国保留旧行、德国被新任务覆盖、未提交国家保持空表。
This commit is contained in:
+5
-1
@@ -368,7 +368,11 @@ public class ShopDataCrawlExcelAssemblyService {
|
||||
if (item == null || Boolean.FALSE.equals(item.getSuccess()) || item.getCountryResults() == null) continue;
|
||||
for (ShopDataCrawlCountryResultDto countryResult : item.getCountryResults()) {
|
||||
String country = countryResult == null || countryResult.getCountry() == null ? "" : countryResult.getCountry().trim().toUpperCase();
|
||||
if (result.containsKey(country) && countryResult.getItems() != null) result.get(country).addAll(countryResult.getItems());
|
||||
// 同国覆盖:按成员顺序累积,后面的结果覆盖前面的同名国家行(最新任务胜出),
|
||||
// 本次未提交的国家由调用方从旧累计对象/模板保留,不在这里清空。
|
||||
if (result.containsKey(country) && countryResult.getItems() != null) {
|
||||
result.put(country, new ArrayList<>(countryResult.getItems()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user