|
|
@ -56,7 +56,6 @@ public class DeptInfoServiceImpl extends BaseServiceImpl<DeptInfoDao, DeptInfoEn |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<DeptInfoDTO> page(Map<String, Object> params) { |
|
|
|
params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); |
|
|
|
IPage<DeptInfoDTO> page = getPage(params); |
|
|
|
List<DeptInfoDTO> list = baseDao.selectListDeptInfoPage(params); |
|
|
|
return new PageData<>(list, page.getTotal()); |
|
|
@ -90,9 +89,10 @@ public class DeptInfoServiceImpl extends BaseServiceImpl<DeptInfoDao, DeptInfoEn |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result save(DeptInfoDTO dto) { |
|
|
|
DeptInfoEntity entity = ConvertUtils.sourceToTarget(dto, DeptInfoEntity.class); |
|
|
|
entity.setDeptName(entity.getDeptName().trim()); |
|
|
|
// 模块不能重复添加
|
|
|
|
int deptIdCount = baseDao.getDeptIdCount(entity.getDeptId()); |
|
|
|
if (deptIdCount > 0) { |
|
|
|
int deptNameCount = baseDao.getDeptNameCount(entity.getDeptName()); |
|
|
|
if (deptNameCount > 0) { |
|
|
|
return new Result().error("该部门已存在,不可重复新增"); |
|
|
|
} |
|
|
|
insert(entity); |
|
|
|