细节调整

This commit is contained in:
陈超
2022-08-09 14:04:59 +08:00
parent 10071af599
commit 17fbda2d47
2 changed files with 5 additions and 4 deletions

View File

@@ -14,7 +14,7 @@
<select id="selectDeptListName" resultType="Dept"> <select id="selectDeptListName" resultType="Dept">
SELECT `Id` deptId, `Name` deptName SELECT `Id` deptId, `Name` deptName
FROM sys_dept FROM sys_dept
WHERE Id IN WHERE State = 1 AND Id IN
<foreach item="item" collection="deptIndexes" open="(" separator="," close=")"> <foreach item="item" collection="deptIndexes" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>

View File

@@ -43,8 +43,10 @@ public class DeptMapServiceImpl implements DeptMapService {
for (DeptMap dept: deptMaps) { for (DeptMap dept: deptMaps) {
DeptConfigVO configVO = new DeptConfigVO(); DeptConfigVO configVO = new DeptConfigVO();
BeanUtils.copyProperties(dept, configVO); BeanUtils.copyProperties(dept, configVO);
configVO.setDeptName( List<Dept> deptData = deptList.stream().filter(item -> item.getDeptId().equals(configVO.getDeptId())).collect(Collectors.toList());
deptList.stream().filter(item -> item.getDeptId().equals(configVO.getDeptId())).collect(Collectors.toList()).get(0).getDeptName()); if (!CollectionUtils.isEmpty(deptData)) {
configVO.setDeptName(deptData.get(0).getDeptName());
}
deptConfigVOS.add(configVO); deptConfigVOS.add(configVO);
} }
return deptConfigVOS; return deptConfigVOS;
@@ -96,7 +98,6 @@ public class DeptMapServiceImpl implements DeptMapService {
} else { } else {
throw new BusinessException(CommonResponseEnum.DEPT_BINDED); throw new BusinessException(CommonResponseEnum.DEPT_BINDED);
} }
} }
@Override @Override