heheng
2026-03-19 680a9877fe64c40aced1f4e04ea34056fac204fc
gkhy-system/src/main/java/com/gkhy/system/service/impl/SysDeptServiceImpl.java
@@ -1,9 +1,10 @@
package com.gkhy.system.service.impl;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import com.gkhy.system.domain.vo.DeptVo;
import com.gkhy.system.mapper.SysUserDeptMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gkhy.common.annotation.DataScope;
@@ -35,6 +36,9 @@
    @Autowired
    private SysRoleMapper roleMapper;
    @Autowired
    private SysUserDeptMapper userDeptMapper;
    /**
     * 查询部门管理数据
     * 
@@ -46,6 +50,20 @@
    public List<SysDept> selectDeptList(SysDept dept)
    {
        return deptMapper.selectDeptList(dept);
    }
    /**
     * 统计安全检查数据
     * @param beginDate
     * @return
     */
    @Override
    public List<DeptVo> selectDeptData(Date beginDate) {
        if (beginDate == null){
            beginDate = new Date();
        }
        List<DeptVo> deptVos = deptMapper.selectDeptData(beginDate);
        return deptVos;
    }
    /**
@@ -290,6 +308,13 @@
    @Override
    public int deleteDeptById(Long deptId)
    {
        //对应的人员部门
        if (userDeptMapper.selectCountUserDeptByDeptId(deptId) > 0)
        {
            throw new ServiceException("该部门已绑定人员,请先换绑人员");
        }
        return deptMapper.deleteDeptById(deptId);
    }