heheng
5 天以前 53153afbec438d582d79579390affc9b72ed3730
排序改造
已修改5个文件
60 ■■■■■ 文件已修改
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/resources/application-prod.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/ISysDeptService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysDeptServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-system/src/main/resources/mapper/system/SysDeptMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java
@@ -48,11 +48,24 @@
//    @PreAuthorize("hasAnyAuthority('system:dept:list')")
    @GetMapping("/list")
    @ApiOperation(value = "获取部门列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
    })
    public CommonResult list(SysDept dept)
    {
        List<DeptVo> depts = deptService.selectDeptList(dept);
        return CommonResult.success(depts);
    }
    @GetMapping("/pageList")
    @ApiOperation(value = "获取部门列表分页")
    public CommonResult pageList(SysDept dept)
    {
        return CommonResult.success(deptService.selectDeptPageList(dept));
    }
    @GetMapping("/treeList")
@@ -137,7 +150,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "Long", required = true, value = "公司id"),
    })
    public CommonResult initFunctionalDistribution(@RequestParam Long companyId) {
    public CommonResult initFunctionalDistribution(@RequestParam("companyId") Long companyId) {
        return CommonResult.success(deptService.initFunctionalDistribution(companyId));
    }
multi-admin/src/main/resources/application-prod.yml
@@ -81,6 +81,6 @@
minio:
  endpoint: http://106.15.95.149:9001/ #Minio服务所在地址
  bucketName: multiSystem #存储桶名称
  bucketName: multisystem #存储桶名称
  accessKey: U9JW4xOeeUQOSR4f #访问的key
  secretKey: iaqQV6twR9yDZiFAf2UYr5xZfESanZs3 #访问的秘钥
multi-system/src/main/java/com/gkhy/exam/system/service/ISysDeptService.java
@@ -2,6 +2,7 @@
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.domain.TreeSelect;
import com.gkhy.exam.common.domain.entity.SysDept;
import com.gkhy.exam.system.domain.SysFunctionalDistribution;
@@ -16,6 +17,8 @@
 */
public interface ISysDeptService
{
    CommonPage selectDeptPageList(SysDept req);
    /**
     * 查询部门管理数据
     * 
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 ;
multi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -80,7 +80,7 @@
        <if test="status != null and status != ''">
            AND d.status = #{status}
        </if>
        order by d.parent_id, d.order_num
        order by  d.order_num,d.parent_id
    </select>
@@ -102,7 +102,7 @@
        <if test="status != null and status != ''">
            AND status = #{status}
        </if>
        order by d.parent_id, d.order_num
        order by  d.order_num,d.parent_id
    </select>