修复相册管理器bug

This commit is contained in:
TinyAnts 2022-08-09 10:14:48 +08:00
parent ba0432b2b1
commit cc4ba32145
2 changed files with 20 additions and 16 deletions

View File

@ -70,6 +70,10 @@ public class AlbumController {
}
List<Integer> ids = ArrayUtil.objectToListAsInt(params.get("ids"));
if (ids.size() <= 0) {
return AjaxResult.failed("请至少选择一个文件");
}
iAlbumService.albumMove(ids, Integer.parseInt(params.get("cid").toString()));
return AjaxResult.success();
}

View File

@ -41,7 +41,7 @@ public class AlbumServiceImpl implements IAlbumService {
AlbumCateMapper albumCateMapper;
/**
* 文件列表
* 相册文件列表
*
* @author fzr
* @param pageParam 分页参数
@ -55,10 +55,10 @@ public class AlbumServiceImpl implements IAlbumService {
QueryWrapper<Album> queryWrapper = new QueryWrapper<>();
queryWrapper.select(Album.class, info->
!info.getColumn().equals("type") &&
!info.getColumn().equals("aid") &&
!info.getColumn().equals("uid") &&
!info.getColumn().equals("is_delete") &&
!info.getColumn().equals("delete_time"))
!info.getColumn().equals("aid") &&
!info.getColumn().equals("uid") &&
!info.getColumn().equals("is_delete") &&
!info.getColumn().equals("delete_time"))
.eq("is_delete", 0)
.orderByDesc("id");
@ -67,8 +67,8 @@ public class AlbumServiceImpl implements IAlbumService {
}
albumMapper.setSearch(queryWrapper, params, new String[]{
"like:keyword:str",
"=:type:int"
"=:type:int",
"like:keyword@name:str"
});
IPage<Album> iPage = albumMapper.selectPage(new Page<>(page, limit), queryWrapper);
@ -89,7 +89,7 @@ public class AlbumServiceImpl implements IAlbumService {
}
/**
* 文件重命名
* 相册文件重命名
*
* @author fzr
* @param id 文件ID
@ -110,7 +110,7 @@ public class AlbumServiceImpl implements IAlbumService {
}
/**
* 文件移动
* 相册文件移动
*
* @author fzr
* @param ids 文件ID
@ -139,7 +139,7 @@ public class AlbumServiceImpl implements IAlbumService {
}
/**
* 文件新增
* 相册文件新增
*
* @author fzr
* @param params 文件信息参数
@ -147,9 +147,9 @@ public class AlbumServiceImpl implements IAlbumService {
@Override
public Integer albumAdd(Map<String, String> params) {
Album album = new Album();
album.setCid(Integer.parseInt(params.get("cid") == null ? "0" : params.get("cid")));
album.setAid(Integer.parseInt(params.get("aid") == null ? "0" : params.get("aid")));
album.setUid(Integer.parseInt(params.get("uid") == null ? "0" : params.get("uid")));
album.setCid(Integer.parseInt(params.get("cid") == null ? "0" : params.get("cid")));
album.setAid(Integer.parseInt(params.get("aid") == null ? "0" : params.get("aid")));
album.setUid(Integer.parseInt(params.get("uid") == null ? "0" : params.get("uid")));
album.setType(Integer.parseInt(params.get("type")));
album.setName(params.get("name"));
album.setExt(params.get("ext"));
@ -162,7 +162,7 @@ public class AlbumServiceImpl implements IAlbumService {
}
/**
* 文件删除
* 相册文件删除
*
* @author fzr
* @param ids 文件ID
@ -184,7 +184,7 @@ public class AlbumServiceImpl implements IAlbumService {
}
/**
* 分类列表
* 相册分类列表
*
* @param params 搜索参数
* @return JSONArray
@ -198,7 +198,7 @@ public class AlbumServiceImpl implements IAlbumService {
.eq("is_delete", 0)
.orderByDesc("id");
long type = Integer.parseInt(params.getOrDefault("type", "0"));
long type = Integer.parseInt(params.getOrDefault("type", "0"));
String keyword = params.getOrDefault("keyword", "");
if (type > 0) {
queryWrapper.eq("type", type);