fix: 导出链接走下载端点;文件记录切到 core 库

This commit is contained in:
2026-10-31 02:42:41 +08:00
parent 8953fc3088
commit 47b55bad04
4 changed files with 16 additions and 6 deletions
@@ -169,12 +169,19 @@ class ApprovalCompletionDraftIT {
@Test
void rejectsSubmitWhenArchivistRoleMissing() throws Exception {
grantDepartmentLeader(organizationId, TENANT);
long instanceId = createCompletion(reporter, organizationId, TENANT, "缺收文员");
uploadAttachment(instanceId, reporter, organizationId, "image/png");
int tenant = 10023;
Integer orgId = data.createOrganization("缺收文员部门" + data.uniqueSuffix(), 136, tenant);
ApprovalTestData.TestUser submitter =
data.createUser("缺收文员报送人" + data.uniqueSuffix(), orgId, tenant);
ApprovalTestData.TestRole leaderRole =
data.createRole(data.leaderRoleCode(orgId), "部门负责人", tenant);
ApprovalTestData.TestUser leader = data.createUser("缺收文员负责人" + data.uniqueSuffix(), orgId, tenant);
data.bindTenant(leader.userId, leaderRole.roleId, tenant);
long instanceId = createCompletion(submitter, orgId, tenant, "缺收文员");
uploadAttachment(instanceId, submitter, orgId, tenant, "image/png");
mockMvc.perform(authed(post("/api/approval/instance/" + instanceId + "/submit"),
reporter, organizationId, TENANT, SUBMIT))
submitter, orgId, tenant, SUBMIT))
.andExpect(jsonPath("$.code").value(1))
.andExpect(jsonPath("$.message").value(org.hamcrest.Matchers.containsString("收文员角色缺配")));
@@ -172,7 +172,7 @@ class ApprovalExportIT {
assertThat(node.path("id").asInt()).isPositive();
String name = node.path("name").asText();
assertThat(name).startsWith("excel/审批单据-").endsWith(".xlsx");
assertThat(node.path("url").asText()).contains("/file/excel/审批单据-");
assertThat(node.path("url").asText()).contains("/file/download/excel/审批单据-");
File file = new File(node.path("path").asText());
assertThat(file).exists();
exportedFiles.add(file.toPath());