From 53153afbec438d582d79579390affc9b72ed3730 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: Tue, 08 Jul 2025 14:28:40 +0800
Subject: [PATCH] 排序改造
---
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java
index 51fef94..990c07e 100644
--- a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java
+++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java
@@ -6,11 +6,14 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.constant.UserConstant;
import com.gkhy.exam.common.domain.TreeSelect;
import com.gkhy.exam.common.domain.entity.SysDept;
import com.gkhy.exam.common.domain.entity.SysRole;
import com.gkhy.exam.common.exception.ApiException;
+import com.gkhy.exam.common.utils.NaturalOrderComparator;
+import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.common.utils.SpringUtils;
import com.gkhy.exam.system.domain.SysDeptManage;
@@ -55,6 +58,24 @@
"7.1.1", "7.1.2", "7.1.3", "7.1.4", "7.1.5", "7.1.6","7.2", "7.3", "7.4", "7.5", "7.6","8.1","8.2","8.2.1","8.2.2", "8.2.3", "8.2.4", "8.3", "8.3.1", "8.3.2", "8.3.3", "8.3.4", "8.3.5", "8.3.6", "8.3.7", "8.3.8", "8.4",
"8.4.1", "8.4.2", "8.4.3", "8.5", "8.5.1", "8.5.2", "8.5.3", "8.5.4", "8.5.5", "8.5.6", "8.5.7", "8.6","8.7","9.1","9.1.1","9.1.2","9.1.3","9.2", "9.3","10.1"
,"10.2", "10.3"};
+
+ @Override
+ public CommonPage selectDeptPageList(SysDept req) {
+ PageUtils.startPage();
+ List<DeptVo> deptVos = deptMapper.selectDeptList(req);
+ if (ObjectUtil.isNotEmpty(deptVos)){
+ for (DeptVo deptVo : deptVos) {
+ List<CaluseVO1> caluseVO1List = deptVo.getCaluseVO1List();
+ if (ObjectUtil.isNotEmpty(caluseVO1List)){
+ caluseVO1List.sort(Comparator.comparing(CaluseVO1::getClauseNum, new NaturalOrderComparator()));
+ }
+
+ }
+ }
+ return CommonPage.restPage(deptVos);
+
+ }
+
/**
* 查询部门管理数据
*
@@ -68,7 +89,17 @@
if (dept.getCompanyId() == null){
dept.setCompanyId(SecurityUtils.getCompanyId());
}
- return deptMapper.selectDeptList(dept);
+ List<DeptVo> deptVos = deptMapper.selectDeptList(dept);
+ if (ObjectUtil.isNotEmpty(deptVos)){
+ for (DeptVo deptVo : deptVos) {
+ List<CaluseVO1> caluseVO1List = deptVo.getCaluseVO1List();
+ if (ObjectUtil.isNotEmpty(caluseVO1List)){
+ caluseVO1List.sort(Comparator.comparing(CaluseVO1::getClauseNum, new NaturalOrderComparator()));
+ }
+
+ }
+ }
+ return deptVos;
}
@Override
@@ -204,6 +235,9 @@
.eq(SysDeptResponsibility::getDelFlag, UserConstant.ENABLE)
.orderByAsc(SysDeptResponsibility::getClauseNum);
List<SysDeptResponsibility> sysDeptResponsibilities = deptResponsibilityMapper.selectList(lambdaQueryWrapper);
+ if (ObjectUtil.isNotEmpty(sysDeptResponsibilities)){
+ sysDeptResponsibilities.sort(Comparator.comparing(SysDeptResponsibility::getClauseNum, new NaturalOrderComparator()));
+ }
deptDetialVo.setSysDeptResponsibilitys(sysDeptResponsibilities);
return deptDetialVo ;
--
Gitblit v1.9.2