task-39: 补充删除/超时/重复回传/累计文件失败的资源清理测试

新增 ShopDataCrawlCleanupTest 11 个用例覆盖:单条/批量/空输入删除路径的
临时文件与累计对象回收、陈旧 RUNNING 任务超时终态化、分片重复回传的
payload 释放与终态拒绝、累计文件 CAS 冲突重试时上传对象回滚。

同时撤销上一提交误引入的按国家覆盖语义:rowsByCountry 恢复同国累积
(addAll),移除与之矛盾的 writeWorkbookLatestMemberWinsPerCountryOthersPreserved
测试,修复 task-22~26 批量合并回归(行数被覆盖削减)。
This commit is contained in:
2026-08-30 12:16:39 +08:00
parent 6b76333159
commit b806ab9384
3 changed files with 1276 additions and 40 deletions
@@ -368,11 +368,7 @@ 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.put(country, new ArrayList<>(countryResult.getItems()));
}
if (result.containsKey(country) && countryResult.getItems() != null) result.get(country).addAll(countryResult.getItems());
}
}
return result;