feat: add import data quality center
This commit is contained in:
1 parent
0552b3e424
commit
b51b1868c0
33 files changed
+12824
-12
No files matched your search
@@ -219,6 +219,18 @@ VAPID 密钥;私钥、SMTP 密码不得写入 `appsettings.json` 或提交到
|
||||
还要求站点使用 HTTPS。这里的 Web Push 面向浏览器/PWA;Capacitor 原生 Android/iOS
|
||||
推送仍需各平台的 FCM/APNs 凭据与原生插件,不能把浏览器验收视为原生推送验收。
|
||||
|
||||
### 导入与数据质量中心
|
||||
|
||||
校级、院级教务管理员可从“组织与权限 → 导入与数据质量”查看 Excel 导入批次和
|
||||
当前权限范围内的数据质量扫描。基础数据、课程、教师/学生档案、用户与权限四类导入
|
||||
会先执行完整预检,展示预计新增/更新数量,确认后才在原子事务中正式写入;考勤、成绩、
|
||||
实验成绩、其他考试、体测、宿舍、校园钱包和学费等既有导入也统一记录批次结果。
|
||||
|
||||
批次记录只保存文件名、大小和 SHA-256 指纹,不保存包含个人信息的原始 Excel;失败批次
|
||||
可下载逐行错误文件。通用回滚默认关闭,因为部分导入会更新既有正式数据、账号角色或密码,
|
||||
没有逐字段快照时自动反向写入并不安全。需要纠正时应修复源数据后重新预检导入,正式业务
|
||||
的撤销继续使用各模块已有的审核、归档或更正流程。
|
||||
|
||||
## MySQL 8.4 生产部署
|
||||
|
||||
非 Development 环境只允许使用 MySQL。构建发布包与数据库配置相互独立:
|
||||
|
||||
@@ -504,6 +504,7 @@ public sealed class AttendanceController(
|
||||
|
||||
[HttpPost("sheets/{id:guid}/import")]
|
||||
[Authorize(Roles = AttendanceRoles)]
|
||||
[TrackExcelImport("attendance", "sheet", "id")]
|
||||
public async Task<ActionResult> Import(
|
||||
Guid id,
|
||||
IFormFile file,
|
||||
|
||||
@@ -75,11 +75,13 @@ public sealed class BaseDataExcelController(AppDbContext db, IAppCache cache) :
|
||||
}
|
||||
|
||||
[HttpPost("{kind}/import")]
|
||||
[TrackExcelImport("base-data", "catalog", "kind")]
|
||||
[RequestSizeLimit(10 * 1024 * 1024)]
|
||||
public async Task<ActionResult<ExcelImportResult>> Import(
|
||||
string kind,
|
||||
IFormFile file,
|
||||
CancellationToken cancellationToken)
|
||||
CancellationToken cancellationToken,
|
||||
bool validateOnly = false)
|
||||
{
|
||||
if (!TryGetHeaders(kind, out var headers)) return NotFound();
|
||||
IReadOnlyList<ExcelRow> rows;
|
||||
@@ -132,6 +134,12 @@ public sealed class BaseDataExcelController(AppDbContext db, IAppCache cache) :
|
||||
}
|
||||
|
||||
await db.SaveChangesAsync(cancellationToken);
|
||||
if (validateOnly)
|
||||
{
|
||||
await transaction.RollbackAsync(cancellationToken);
|
||||
db.ChangeTracker.Clear();
|
||||
return Ok(result with { Preview = true });
|
||||
}
|
||||
await transaction.CommitAsync(cancellationToken);
|
||||
await cache.RemoveByTagAsync(
|
||||
AppCacheTags.BaseData,
|
||||
|
||||
Loaded 3 of 33 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user