From 4b152eb21b0e0619723e8953e222490058ba0004 Mon Sep 17 00:00:00 2001 From: gulongcheng <474084054@qq.com> Date: Thu, 5 Feb 2026 10:45:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=96=87=E4=BB=B6=E5=A4=B9=E5=9C=A8=E5=89=8D=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E6=96=87=E4=BB=B6=E5=9C=A8=E5=90=8E=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdm/common/entity/enums/DirTypeEnum.java | 18 +++++++++++++++++- .../impl/DimensionTemplateServiceImpl.java | 10 +++++++++- .../impl/MinioFileIDataFileServiceImpl.java | 3 +++ .../mapper/FileMetadataInfoMapper.xml | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/sdm/common/entity/enums/DirTypeEnum.java b/common/src/main/java/com/sdm/common/entity/enums/DirTypeEnum.java index 606d4643..d73ad561 100644 --- a/common/src/main/java/com/sdm/common/entity/enums/DirTypeEnum.java +++ b/common/src/main/java/com/sdm/common/entity/enums/DirTypeEnum.java @@ -49,9 +49,25 @@ public enum DirTypeEnum { * 报告模板库 */ @Schema(description = "报告模板库文件夹", example = "8") - REPORT_TEMPLATE_DIR("reportTemplate", 8); + REPORT_TEMPLATE_DIR("reportTemplate", 8), + /* + * 机器人库 + */ + @Schema(description = "机器人库文件夹", example = "9") + ROBOT_DIR("robot", 9), + /** + * 工业设计库 + */ + @Schema(description = "工业设计库文件夹", example = "10") + INDUSTRIAL_DESIGN_DIR("industrialDesign", 10), + + /** + * 公差分析库 + */ + @Schema(description = "公差分析库文件夹", example = "11") + TOLERANCE_ANALYSIS_DIR("toleranceAnalysis", 11); String dirName; int value; diff --git a/data/src/main/java/com/sdm/data/service/impl/DimensionTemplateServiceImpl.java b/data/src/main/java/com/sdm/data/service/impl/DimensionTemplateServiceImpl.java index 12c8a3b7..83b0df56 100644 --- a/data/src/main/java/com/sdm/data/service/impl/DimensionTemplateServiceImpl.java +++ b/data/src/main/java/com/sdm/data/service/impl/DimensionTemplateServiceImpl.java @@ -360,8 +360,16 @@ public class DimensionTemplateServiceImpl extends ServiceImpl { + // 首先按dataType排序:文件夹(1)在前,文件(2)在后 + Integer dataType1 = dto1.getDataType(); + Integer dataType2 = dto2.getDataType(); + if (dataType1 != null && dataType2 != null && !dataType1.equals(dataType2)) { + return dataType1.compareTo(dataType2); // 升序:1(文件夹) < 2(文件) + } + + // dataType相同或都为null时,按创建时间倒序排序 LocalDateTime maxCreateTime1 = dto1.getMergeSameNameChildren().stream() .map(FileMetadataInfoResp::getCreateTime) .filter(Objects::nonNull) diff --git a/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java b/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java index b4bae003..d6e1e46b 100644 --- a/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java +++ b/data/src/main/java/com/sdm/data/service/impl/MinioFileIDataFileServiceImpl.java @@ -875,6 +875,9 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService { .eq(FileMetadataInfo::getIsLatest, FileIsLastEnum.YES.getValue()) // 审核完成 ,元数据修改审核中,文件修改审核中,删除文件审核中 .in(FileMetadataInfo::getApproveType,fileDatdList) + // 文件夹在前(dataType=1),文件在后(dataType=2),同类型内按名称升序 + .orderByAsc(FileMetadataInfo::getDataType) + .orderByDesc(FileMetadataInfo::getCreateTime) .list(); // 创建人赋值 setCreatorNames(list); diff --git a/data/src/main/resources/mapper/FileMetadataInfoMapper.xml b/data/src/main/resources/mapper/FileMetadataInfoMapper.xml index 2e7d4943..05a984cf 100644 --- a/data/src/main/resources/mapper/FileMetadataInfoMapper.xml +++ b/data/src/main/resources/mapper/FileMetadataInfoMapper.xml @@ -62,6 +62,6 @@ - ORDER BY updateTime DESC + ORDER BY dataType ASC, updateTime DESC \ No newline at end of file