提交更改

This commit is contained in:
super
2026-06-05 21:25:03 +08:00
parent 95ccb00d25
commit 8ab647c419
39 changed files with 1390 additions and 92 deletions
@@ -50,6 +50,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicReference;
@Service
@RequiredArgsConstructor
@@ -792,7 +793,7 @@ public class PriceTrackTaskService {
private Map<String, List<Map<String, String>>> parseWorkbookAsinRows(File file, List<String> countryCodes) {
Map<String, List<Map<String, String>>> out = new LinkedHashMap<>();
Map<String, Integer>[] headerIndexHolder = new Map[]{Map.of()};
AtomicReference<Map<String, Integer>> headerIndexHolder = new AtomicReference<>(Map.of());
String[] countryCodeHolder = new String[]{null};
int[] sheetCount = new int[]{0};
try {
@@ -801,7 +802,7 @@ public class PriceTrackTaskService {
public void onHeader(String sheetName, Integer sheetNo, Map<Integer, String> headerMap) {
sheetCount[0]++;
countryCodeHolder[0] = resolveCountryCode(sheetName, countryCodes, false);
headerIndexHolder[0] = buildHeaderIndex(headerMap);
headerIndexHolder.set(buildHeaderIndex(headerMap));
}
@Override
@@ -813,10 +814,11 @@ public class PriceTrackTaskService {
if (countryCode == null) {
return;
}
if (headerIndexHolder[0].isEmpty()) {
Map<String, Integer> headerIndex = headerIndexHolder.get();
if (headerIndex.isEmpty()) {
return;
}
Map<String, String> item = extractAsinRow(rowMap, headerIndexHolder[0]);
Map<String, String> item = extractAsinRow(rowMap, headerIndex);
if (!item.isEmpty()) {
out.computeIfAbsent(countryCode, key -> new ArrayList<>()).add(item);
}