fix(分类): 其他类别文件查看失败问题修复

This commit is contained in:
MAC 2021-12-27 22:24:28 +08:00
parent c66c553315
commit 77a8acaef3
6 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,6 @@ import com.qiwenshare.file.api.IUserService;
import com.qiwenshare.file.config.security.user.JwtUser;
import com.qiwenshare.file.domain.FileBean;
import com.qiwenshare.file.domain.FileModel;
import com.qiwenshare.file.domain.UserBean;
import com.qiwenshare.file.domain.UserFile;
import com.qiwenshare.file.dto.file.CreateOfficeFileDTO;
import com.qiwenshare.file.dto.file.EditOfficeFileDTO;

View File

@ -70,6 +70,8 @@ public class OperationLogBean {
*/
private String logLevel;
private Integer platform;
}

View File

@ -28,6 +28,6 @@ public interface UserFileMapper extends BaseMapper<UserFile> {
@Param("newFilePath") String newfilePath,
@Param("userId") long userId);
IPage<FileListVo> selectPageVo(Page<?> page, @Param("userFile") UserFile userFile, @Param("extendNameList") List<String> extendNameList);
IPage<FileListVo> selectPageVo(Page<?> page, @Param("userFile") UserFile userFile, @Param("fileTypeId") Integer fileTypeId);
Long selectStorageSizeByUserId(@Param("userId") Long userId);
}

View File

@ -154,13 +154,9 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> impl
public IPage<FileListVo> getFileByFileType(Integer fileTypeId, Long currentPage, Long pageCount, long userId) {
Page<FileListVo> page = new Page<>(currentPage, pageCount);
List<String> extendNameList = fileTypeMapper.selectExtendNameByFileType(fileTypeId);
if (extendNameList != null && extendNameList.isEmpty()) {
return page;
}
UserFile userFile = new UserFile();
userFile.setUserId(userId);
return userFileMapper.selectPageVo(page, userFile, extendNameList);
return userFileMapper.selectPageVo(page, userFile, fileTypeId);
}
@Override

View File

@ -152,7 +152,6 @@ public class UserService extends ServiceImpl<UserMapper, UserBean> implements IU
authorities.add(simpleGrantedAuthority);
}
// List<SimpleGrantedAuthority> authorities = roleList.stream().map(Role::getRoleName).map(SimpleGrantedAuthority::new).collect(Collectors.toList());
JwtUser jwtUser = new JwtUser(user.getUserId(), user.getUsername(), user.getPassword(),
user.getAvailable(), authorities);
return jwtUser;

View File

@ -17,11 +17,15 @@
left join image on a.fileId = image.fileId
left join file on file.fileId = a.fileId
<where>
<if test="extendNameList != null and extendNameList.size() > 0">
extendName in
<foreach collection="extendNameList" open="(" close=")" separator="," item="extendName" >
#{extendName}
</foreach>
<if test="fileTypeId != null">
<choose>
<when test="fileTypeId != 5">
extendName in (select fileExtendName from fileclassification where fileTypeId = #{fileTypeId})
</when>
<otherwise>
extendName not in (select fileExtendName from fileclassification where fileTypeId in (1, 2, 3, 4))
</otherwise>
</choose>
</if>
<if test="userFile.userId != null">
and a.userId = #{userFile.userId}