fix: 调整批量行标识校验顺序
This commit is contained in:
@@ -75,10 +75,17 @@ public class SubPackageRelationServiceImpl implements SubPackageRelationService
|
||||
failures.add(buildFailure(null, rowIndex, REQUIRED_FIELD_MISSING, "缺失字段:item"));
|
||||
continue;
|
||||
}
|
||||
List<String> missingFields = new ArrayList<>();
|
||||
if (!StringUtils.hasText(item.getClientKey())) {
|
||||
missingFields.add("clientKey");
|
||||
failures.add(buildFailure(item.getClientKey(), rowIndex, REQUIRED_FIELD_MISSING,
|
||||
"缺失字段:clientKey"));
|
||||
continue;
|
||||
}
|
||||
if (clientKeyCounts.get(item.getClientKey()) > 1) {
|
||||
failures.add(buildFailure(item.getClientKey(), rowIndex, DUPLICATE_CLIENT_KEY,
|
||||
"前端行标识 clientKey 重复"));
|
||||
continue;
|
||||
}
|
||||
List<String> missingFields = new ArrayList<>();
|
||||
if (!StringUtils.hasText(item.getPackageBoxSn())) {
|
||||
missingFields.add("packageBoxSn");
|
||||
}
|
||||
@@ -102,11 +109,6 @@ public class SubPackageRelationServiceImpl implements SubPackageRelationService
|
||||
"缺失字段:" + String.join("、", missingFields)));
|
||||
continue;
|
||||
}
|
||||
if (clientKeyCounts.get(item.getClientKey()) > 1) {
|
||||
failures.add(buildFailure(item.getClientKey(), rowIndex, DUPLICATE_CLIENT_KEY,
|
||||
"前端行标识 clientKey 重复"));
|
||||
continue;
|
||||
}
|
||||
validItems.add(new BatchItemContext(item, rowIndex));
|
||||
}
|
||||
if (CollUtil.isEmpty(validItems)) {
|
||||
|
||||
Reference in New Issue
Block a user