Java Code Examples for com.ruoyi.system.domain.SysDept#getDeptId()

The following examples show how to use com.ruoyi.system.domain.SysDept#getDeptId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysDeptServiceImpl.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 修改保存部门信息
 * 
 * @param dept 部门信息
 * @return 结果
 */
@Override
@Transactional
public int updateDept(SysDept dept)
{
    SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
    SysDept oldDept = selectDeptById(dept.getDeptId());
    if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept))
    {
        String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
        String oldAncestors = oldDept.getAncestors();
        dept.setAncestors(newAncestors);
        updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
    }
    int result = deptMapper.updateDept(dept);
    if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
    {
        // 如果该部门是启用状态,则启用该部门的所有上级部门
        updateParentDeptStatus(dept);
    }
    return result;
}
 
Example 2
Source File: SysDeptServiceImpl.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 修改保存部门信息
 * 
 * @param dept 部门信息
 * @return 结果
 */
@Override
public int updateDept(SysDept dept)
{
    SysDept info = deptMapper.selectDeptById(dept.getParentId());
    if (StringUtils.isNotNull(info))
    {
        String ancestors = info.getAncestors() + "," + info.getDeptId();
        dept.setAncestors(ancestors);
        updateDeptChildren(dept.getDeptId(), ancestors);
    }
    int result = deptMapper.updateDept(dept);
    if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
    {
        // 如果该部门是启用状态,则启用该部门的所有上级部门
        updateParentDeptStatus(dept);
    }
    return result;
}
 
Example 3
Source File: SysDeptServiceImpl.java    From RuoYi with Apache License 2.0 6 votes vote down vote up
/**
 * 修改保存部门信息
 *
 * @param dept 部门信息
 * @return 结果
 */
@Override
public int updateDept(SysDept dept) {
    SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
    SysDept oldDept = selectDeptById(dept.getDeptId());
    if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(oldDept)) {
        String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
        String oldAncestors = oldDept.getAncestors();
        dept.setAncestors(newAncestors);
        updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
    }
    int result = deptMapper.updateDept(dept);
    if(UserConstants.DEPT_NORMAL.equals(dept.getStatus())){
        //如果该部门是启用状态,这启用该部门的所有上级部门
        updateParentDeptStatus(dept);
    }
    return result;
}
 
Example 4
Source File: SysDeptServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验部门名称是否唯一
 * 
 * @param dept 部门信息
 * @return 结果
 */
@Override
public String checkDeptNameUnique(SysDept dept)
{
    Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
    SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
    if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
    {
        return UserConstants.DEPT_NAME_NOT_UNIQUE;
    }
    return UserConstants.DEPT_NAME_UNIQUE;
}
 
Example 5
Source File: SysDeptServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验部门名称是否唯一
 * 
 * @param dept 部门信息
 * @return 结果
 */
@Override
public String checkDeptNameUnique(SysDept dept)
{
    Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
    SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
    if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
    {
        return UserConstants.DEPT_NAME_NOT_UNIQUE;
    }
    return UserConstants.DEPT_NAME_UNIQUE;
}