From b720341b27da54284f844561edfad5dacf13604e Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期三, 09 七月 2025 08:50:48 +0800 Subject: [PATCH] 修改 --- multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java | 41 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 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..6b941f5 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,29 @@ "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())); + } + + } + } + int i = deptMapper.selectDeptListCount(req); + CommonPage<DeptVo> deptVoCommonPage = CommonPage.restPage(deptVos); + int totalPage = (int) Math.ceil((double) i / deptVoCommonPage.getPageSize()); + deptVoCommonPage.setTotalPage(totalPage); + deptVoCommonPage.setTotal(Long.valueOf( i)); + return deptVoCommonPage; + + } + /** * 查询部门管理数据 * @@ -68,7 +94,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 +240,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