fix: 人员数据治理迁移功能优化3

This commit is contained in:
2026-11-12 16:37:11 +08:00
parent 671f586737
commit 9beef68e62
3 changed files with 9 additions and 7 deletions
@@ -581,12 +581,7 @@ public class PersonApiConfigServiceImpl extends BaseServiceImpl<PersonApiConfig>
groups.add(values);
}
total += records.size();
if (singleRequest || (expectedTotal != null && total >= expectedTotal)) break;
if (records.size() < pageSize) {
Assert.isTrue(expectedTotal == null,
"接口未返回全部数据,预计 " + expectedTotal + " 条,实际返回 " + total + " 条");
break;
}
if (singleRequest || (expectedTotal != null && total >= expectedTotal) || records.size() < pageSize) break;
cursor = Math.addExact(cursor, step);
if (legacyPaging) setFieldQueryPage(config, params, cursor, pageSize);
}
@@ -594,7 +589,11 @@ public class PersonApiConfigServiceImpl extends BaseServiceImpl<PersonApiConfig>
List<String> missing = names.stream().filter(name -> !found.contains(name)).toList();
Assert.isTrue(missing.isEmpty(), "返回数据中找不到字段:" + String.join("、", missing));
}
return NutMap.NEW().addv("fields", names).addv("rows", new ArrayList<>(groups)).addv("total", total);
NutMap result = NutMap.NEW().addv("fields", names).addv("rows", new ArrayList<>(groups)).addv("total", total);
if (expectedTotal != null && total < expectedTotal) {
result.addv("warning", "接口未返回全部数据,预计 " + expectedTotal + " 条,实际返回 " + total + " 条");
}
return result;
}
private List<?> fieldQueryRecords(Object response, String listPath, Integer returnedTotal) {
@@ -445,6 +445,8 @@
<el-input v-model="fieldValueQueryInput" :disabled="fieldValueQueryLoading" clearable
placeholder="输入返回字段名,多个字段用逗号分隔,例如 xb,mz" @keyup.enter.native="queryFieldValues"></el-input>
<div v-if="fieldValueQueryResult" style="margin-top: 16px">
<el-alert v-if="fieldValueQueryResult.warning" :title="fieldValueQueryResult.warning"
type="warning" :closable="false" show-icon></el-alert>
<p>读取 {{ fieldValueQueryResult.total }} 条记录,共 {{ fieldValueQueryResult.rows.length }} 组不同值</p>
<el-table :data="fieldValueQueryResult.rows" border max-height="420" empty-text="接口没有返回数据">
<el-table-column v-for="(field, index) in fieldValueQueryResult.fields" :key="field" :label="field"
+1
View File
@@ -58,6 +58,7 @@ const persons = Array.from({ length: 240 }, (_, index) => {
gh: `MOCK${suffix}`,
bmmz: departmentCode,
bm: departmentName,
zc: ['教授', '副教授', '讲师', '助教'][index % 4],
zcszbm: departmentName,
zcszbmmz: departmentCode,
nl: String(2026 - birthYear),