| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.system.service.ISysUserDeptService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @date 2024-08-29 |
| | | */ |
| | | @Service |
| | | public class SysUserDeptServiceImpl implements ISysUserDeptService |
| | | { |
| | | public class SysUserDeptServiceImpl implements ISysUserDeptService { |
| | | @Autowired |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | /** |
| | | * 查询【请填写功能名称】 |
| | |
| | | * @return 【请填写功能名称】 |
| | | */ |
| | | @Override |
| | | public SysUserDept selectSysUserDeptById(Long id) |
| | | { |
| | | public SysUserDept selectSysUserDeptById(Long id) { |
| | | return sysUserDeptMapper.selectSysUserDeptById(id); |
| | | } |
| | | |
| | |
| | | * @return 【请填写功能名称】 |
| | | */ |
| | | @Override |
| | | public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept) |
| | | { |
| | | public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept) { |
| | | return sysUserDeptMapper.selectSysUserDeptList(sysUserDept); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertSysUserDept(SysUserDept sysUserDept) |
| | | { |
| | | public int insertSysUserDept(SysUserDept sysUserDept) { |
| | | sysUserDept.setCreateTime(new Date()); |
| | | sysUserDept.setUpdateTime(new Date()); |
| | | //根据code查询deptName |
| | | SysDept dept = new SysDept(); |
| | | dept.setDeptCode(sysUserDept.getDeptCode()); |
| | | List<SysDept> sysDepts = sysDeptMapper.selectDeptList(dept); |
| | | if (CollectionUtils.isNotEmpty(sysDepts)) |
| | | sysUserDept.setDeptName(sysDepts.get(0).getDeptName()); |
| | | return sysUserDeptMapper.insertSysUserDept(sysUserDept); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateSysUserDept(SysUserDept sysUserDept) |
| | | { |
| | | public int updateSysUserDept(SysUserDept sysUserDept) { |
| | | sysUserDept.setUpdateTime(new Date()); |
| | | return sysUserDeptMapper.updateSysUserDept(sysUserDept); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSysUserDeptByIds(Long[] ids) |
| | | { |
| | | public int deleteSysUserDeptByIds(Long[] ids) { |
| | | return sysUserDeptMapper.deleteSysUserDeptByIds(ids); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSysUserDeptById(Long id) |
| | | { |
| | | public int deleteSysUserDeptById(Long id) { |
| | | return sysUserDeptMapper.deleteSysUserDeptById(id); |
| | | } |
| | | } |