文件管理名称查询 - 共享文件bug

This commit is contained in:
aikai 2024-09-19 17:11:17 +08:00
parent 875d62f3c1
commit ea8aa1851a
5 changed files with 17 additions and 13 deletions

View File

@ -1,17 +1,14 @@
package com.qiwenshare.file.api;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qiwenshare.file.domain.RecoveryFile;
import com.qiwenshare.file.domain.Share;
import com.qiwenshare.file.domain.ShareFile;
import com.qiwenshare.file.dto.sharefile.ShareListDTO;
import com.qiwenshare.file.vo.share.ShareFileListVO;
import com.qiwenshare.file.vo.share.ShareListVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface IShareService extends IService<Share> {
List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId);
public interface IShareService extends IService<Share> {
List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId, Integer type);
int selectShareListTotalCount(ShareListDTO shareListDTO, String userId);
}

View File

@ -171,7 +171,7 @@ public class ShareController {
public RestResult<ShareListVO> shareList(ShareListDTO shareListDTO) {
JwtUser sessionUserBean = SessionUtil.getSession();
shareListDTO.setSharedFlag(0);
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, sessionUserBean.getUserId());
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, sessionUserBean.getUserId(), 1);
int total = shareService.selectShareListTotalCount(shareListDTO, sessionUserBean.getUserId());
@ -185,7 +185,7 @@ public class ShareController {
public RestResult<ShareListVO> getShareList(ShareListDTO shareListDTO) {
// JwtUser sessionUserBean = SessionUtil.getSession();
shareListDTO.setSharedFlag(1);
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, null);
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, null, 2);
int total = shareService.selectShareListTotalCount(shareListDTO, null);
return RestResult.success().dataList(shareList, total);
}

View File

@ -8,7 +8,7 @@ import java.util.List;
public interface ShareMapper extends BaseMapper<Share> {
List<ShareListVO> selectShareList(String shareFilePath, Integer sharedFlag, String shareBatchNum, Long beginCount, Long pageCount, String userId);
List<ShareListVO> selectShareList(String shareFilePath, Integer sharedFlag, String shareBatchNum, Long beginCount, Long pageCount, String userId, Integer type);
int selectShareListTotalCount(String shareFilePath, String shareBatchNum, String userId);
}

View File

@ -12,21 +12,22 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor=Exception.class)
@Transactional(rollbackFor = Exception.class)
public class ShareService extends ServiceImpl<ShareMapper, Share> implements IShareService {
@Resource
ShareMapper shareMapper;
@Override
public List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId) {
public List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId, Integer type) {
Long beginCount = (shareListDTO.getCurrentPage() - 1) * shareListDTO.getPageCount();
return shareMapper.selectShareList(shareListDTO.getShareFilePath(),
shareListDTO.getSharedFlag(),
shareListDTO.getShareBatchNum(),
beginCount, shareListDTO.getPageCount(), userId);
beginCount, shareListDTO.getPageCount(), userId, type);
}
@Override

View File

@ -13,13 +13,19 @@
LEFT JOIN file d ON d.fileId = c.fileId
left join user as e on c.userId = e.userId
WHERE shareFilePath = #{shareFilePath}
and a.shareType = 3
and c.userFileId is not null
<if test="shareBatchNum != null">
AND a.shareBatchNum = #{shareBatchNum}
</if>
<if test="userId != null">
AND c.userId = #{userId}
</if>
<if test="type == 1">
and a.shareType != 3
</if>
<if test="type == 2">
and a.shareType = 3
</if>
order BY shareTime desc
limit #{beginCount}, #{pageCount}
</select>