|
@@ -81,6 +81,8 @@ public class AlbumCategoryServiceImpl extends SuperServiceImpl<AlbumCategoryMapp
|
|
|
*/
|
|
|
public IPage query(QueryFilter queryFilter) {
|
|
|
Map<String, Object> params = PageHelper.constructParams(queryFilter);
|
|
|
+ String userId = userService.queryLoginUser();
|
|
|
+ queryFilter.getParams().put("userId",userId);
|
|
|
IPage page = albumCategoryMapper.findAllAlbumCategory(queryFilter.getPage(), queryFilter.getParams(), params);
|
|
|
List<AlbumCategoryVo> records = page.getRecords();
|
|
|
Map<String, Object> param = queryFilter.getParams();
|
|
@@ -94,6 +96,8 @@ public class AlbumCategoryServiceImpl extends SuperServiceImpl<AlbumCategoryMapp
|
|
|
allAlbumCategory2.forEach(albumCategoryVo2 -> {
|
|
|
if (!childIdList.contains(albumCategoryVo2.getPkId())) {
|
|
|
albumCategoryVo2.setOperator(userService.queryUser(albumCategoryVo2.getUpdateBy()).getFullName());
|
|
|
+ albumCategoryVo2.setCreateByName(userService.queryUser(albumCategoryVo2.getCreateBy()).getFullName());
|
|
|
+ albumCategoryVo2.setMaintainerName(userService.queryUser(albumCategoryVo2.getMaintainer()).getFullName());
|
|
|
allAlbumCategory1.add(albumCategoryVo2);
|
|
|
}
|
|
|
});
|
|
@@ -118,15 +122,17 @@ public class AlbumCategoryServiceImpl extends SuperServiceImpl<AlbumCategoryMapp
|
|
|
* @param albumCategoryVoList
|
|
|
*/
|
|
|
private List<String> findChild(List<AlbumCategoryVo> albumCategoryVoList, Boolean flag) {
|
|
|
+ String userId = userService.queryLoginUser();
|
|
|
//孩子节点集合Id
|
|
|
List<String> childrenIdList = new ArrayList<>();
|
|
|
albumCategoryVoList.forEach(e -> {
|
|
|
- List<AlbumCategory> albumCategoryList = albumCategoryMapper.
|
|
|
- selectList(new LambdaQueryWrapper<AlbumCategory>().eq(AlbumCategory::getParent, e.getPkId()).orderByAsc(AlbumCategory::getSort));
|
|
|
+ List<AlbumCategory> albumCategoryList = albumCategoryMapper.findAllAlbumCategoryByParent(e.getPkId(),userId);
|
|
|
List<AlbumCategoryVo> childAlbumCategoryVoList = albumCategoryList.parallelStream().map(albumCategory -> {
|
|
|
AlbumCategoryVo albumCategoryVo = new AlbumCategoryVo();
|
|
|
BeanUtils.copyProperties(albumCategory, albumCategoryVo);
|
|
|
albumCategoryVo.setOperator(userService.queryUser(albumCategoryVo.getUpdateBy()).getFullName());
|
|
|
+ albumCategoryVo.setCreateByName(userService.queryUser(albumCategoryVo.getCreateBy()).getFullName());
|
|
|
+ albumCategoryVo.setMaintainerName(userService.queryUser(albumCategoryVo.getMaintainer()).getFullName());
|
|
|
childrenIdList.add(albumCategoryVo.getPkId());
|
|
|
return albumCategoryVo;
|
|
|
}).collect(Collectors.toList());
|
|
@@ -169,6 +175,12 @@ public class AlbumCategoryServiceImpl extends SuperServiceImpl<AlbumCategoryMapp
|
|
|
}
|
|
|
|
|
|
public String del(String ids) {
|
|
|
+ AlbumCategory albumCategory = albumCategoryMapper.selectById(ids);
|
|
|
+ //判断是否能进行修改(创建人或维护人满足一个即可修改)
|
|
|
+ String userId = userService.queryLoginUser();
|
|
|
+ if (!userId.equals(albumCategory.getCreateBy()) && !userId.equals(albumCategory.getMaintainer())){
|
|
|
+ throw new RuntimeException("您没有权限进行此操作");
|
|
|
+ }
|
|
|
List<AlbumInfo> albumInfoList = albumInfoMapper.
|
|
|
selectList(new QueryWrapper<AlbumInfo>().eq("CATEGORY_ID", ids));
|
|
|
if (CollectionUtils.isNotEmpty(albumInfoList)) {
|
|
@@ -176,7 +188,6 @@ public class AlbumCategoryServiceImpl extends SuperServiceImpl<AlbumCategoryMapp
|
|
|
albumInfoList.parallelStream().map(AlbumInfo::getName).collect(Collectors.joining(","));
|
|
|
return result;
|
|
|
}
|
|
|
- AlbumCategory albumCategory = albumCategoryMapper.selectById(ids);
|
|
|
// 查询该分类的下是否还有子分类
|
|
|
List<AlbumCategory> albumCategoryList = albumCategoryMapper.
|
|
|
selectList(new LambdaQueryWrapper<AlbumCategory>().eq(AlbumCategory::getParent, ids));
|
|
@@ -199,6 +210,11 @@ public class AlbumCategoryServiceImpl extends SuperServiceImpl<AlbumCategoryMapp
|
|
|
if (albumCategory.getSort() == null) {
|
|
|
return "排序不能为空";
|
|
|
}
|
|
|
+ //判断是否能进行修改(创建人或维护人满足一个即可修改)
|
|
|
+ String userId = userService.queryLoginUser();
|
|
|
+ if (!userId.equals(albumCategory.getCreateBy()) && !userId.equals(albumCategory.getMaintainer())){
|
|
|
+ throw new RuntimeException("您没有权限进行此操作");
|
|
|
+ }
|
|
|
if (albumCategory.getParent().isEmpty()) {
|
|
|
albumCategory.setParent("0");
|
|
|
}
|