perf(代码审查落地): 后端 A1-A8 与前端 C1-C8 加固,retention 清理补索引(V141)

A 组(backend-java):
- A1 载荷引用计数不再无条件回落全表 COUNT
- A2 结果行读取由 LIMIT 1 改整页
- A3 ziniao 索引缓存过期判断下推 SQL
- A4 循环子任务认领改 CAS,失败一律抛
- A5 建单事务里不碰外部 IO
- A6 连接池补网络层超时(connectTimeout/socketTimeout,env 可覆盖)
- A7 日志留现场 + 异步落盘
- A8 其余:货源图片预取、结果工作簿装配等
- V141:三条 retention DELETE 的可用索引,其中 biz_price_track_loop_run
  用 STORED 生成列承载 COALESCE 时间线(该表实测 881 行/17MB,COPY 秒级)

C 组(frontend-vue):URL 取值走 safe-url、行号取值走 row-id、
交付视频任务状态抽成 delivery-video-task-state.ts,各补用例。
This commit is contained in:
2026-10-03 12:24:16 +08:00
parent fd9aa2caa5
commit 37592a3b62
32 changed files with 1065 additions and 292 deletions
@@ -27,7 +27,7 @@ class ImageVideoArchiveServiceTest {
ImageVideoAsyncTaskMapper taskMapper = mock(ImageVideoAsyncTaskMapper.class);
OssStorageService ossStorageService = mock(OssStorageService.class);
ImageVideoArchiveService archiveService = new ImageVideoArchiveService(
taskMapper, ossStorageService, new ImageVideoProperties(), new ObjectMapper());
taskMapper, ossStorageService, new ImageVideoProperties(), new ObjectMapper(), mock(com.nanri.aiimage.common.service.DistributedJobLockService.class, org.mockito.Answers.RETURNS_MOCKS));
ImageVideoAsyncTaskEntity task = new ImageVideoAsyncTaskEntity();
task.setId(10L);
task.setTaskType(ImageVideoArchiveService.TASK_TYPE);
@@ -46,7 +46,7 @@ class ImageVideoArchiveServiceTest {
ImageVideoAsyncTaskMapper taskMapper = mock(ImageVideoAsyncTaskMapper.class);
OssStorageService ossStorageService = mock(OssStorageService.class);
ImageVideoArchiveService archiveService = new ImageVideoArchiveService(
taskMapper, ossStorageService, new ImageVideoProperties(), new ObjectMapper());
taskMapper, ossStorageService, new ImageVideoProperties(), new ObjectMapper(), mock(com.nanri.aiimage.common.service.DistributedJobLockService.class, org.mockito.Answers.RETURNS_MOCKS));
ImageVideoAsyncTaskEntity task = new ImageVideoAsyncTaskEntity();
task.setId(11L);
task.setTaskType(ImageVideoArchiveService.TASK_TYPE);
@@ -82,7 +82,8 @@ class ImageVideoArchiveServiceTest {
mock(ImageVideoAsyncTaskMapper.class),
mock(OssStorageService.class),
new ImageVideoProperties(),
objectMapper);
objectMapper,
mock(com.nanri.aiimage.common.service.DistributedJobLockService.class, org.mockito.Answers.RETURNS_MOCKS));
ImageVideoAsyncTaskEntity task = new ImageVideoAsyncTaskEntity();
task.setTaskType(ImageVideoArchiveService.TASK_TYPE);
@@ -106,7 +107,8 @@ class ImageVideoArchiveServiceTest {
mock(ImageVideoAsyncTaskMapper.class),
mock(OssStorageService.class),
new ImageVideoProperties(),
new ObjectMapper());
new ObjectMapper(),
mock(com.nanri.aiimage.common.service.DistributedJobLockService.class, org.mockito.Answers.RETURNS_MOCKS));
ImageVideoAsyncTaskEntity task = new ImageVideoAsyncTaskEntity();
task.setTaskType(ImageVideoArchiveService.TASK_TYPE);