文件管理名称查询 - 共享文件bug
This commit is contained in:
parent
875d62f3c1
commit
ea8aa1851a
@ -1,17 +1,14 @@
|
|||||||
package com.qiwenshare.file.api;
|
package com.qiwenshare.file.api;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.qiwenshare.file.domain.RecoveryFile;
|
|
||||||
import com.qiwenshare.file.domain.Share;
|
import com.qiwenshare.file.domain.Share;
|
||||||
import com.qiwenshare.file.domain.ShareFile;
|
|
||||||
import com.qiwenshare.file.dto.sharefile.ShareListDTO;
|
import com.qiwenshare.file.dto.sharefile.ShareListDTO;
|
||||||
import com.qiwenshare.file.vo.share.ShareFileListVO;
|
|
||||||
import com.qiwenshare.file.vo.share.ShareListVO;
|
import com.qiwenshare.file.vo.share.ShareListVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface IShareService extends IService<Share> {
|
public interface IShareService extends IService<Share> {
|
||||||
List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId);
|
List<ShareListVO> selectShareList(ShareListDTO shareListDTO, String userId, Integer type);
|
||||||
|
|
||||||
int selectShareListTotalCount(ShareListDTO shareListDTO, String userId);
|
int selectShareListTotalCount(ShareListDTO shareListDTO, String userId);
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ public class ShareController {
|
|||||||
public RestResult<ShareListVO> shareList(ShareListDTO shareListDTO) {
|
public RestResult<ShareListVO> shareList(ShareListDTO shareListDTO) {
|
||||||
JwtUser sessionUserBean = SessionUtil.getSession();
|
JwtUser sessionUserBean = SessionUtil.getSession();
|
||||||
shareListDTO.setSharedFlag(0);
|
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());
|
int total = shareService.selectShareListTotalCount(shareListDTO, sessionUserBean.getUserId());
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public class ShareController {
|
|||||||
public RestResult<ShareListVO> getShareList(ShareListDTO shareListDTO) {
|
public RestResult<ShareListVO> getShareList(ShareListDTO shareListDTO) {
|
||||||
// JwtUser sessionUserBean = SessionUtil.getSession();
|
// JwtUser sessionUserBean = SessionUtil.getSession();
|
||||||
shareListDTO.setSharedFlag(1);
|
shareListDTO.setSharedFlag(1);
|
||||||
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, null);
|
List<ShareListVO> shareList = shareService.selectShareList(shareListDTO, null, 2);
|
||||||
int total = shareService.selectShareListTotalCount(shareListDTO, null);
|
int total = shareService.selectShareListTotalCount(shareListDTO, null);
|
||||||
return RestResult.success().dataList(shareList, total);
|
return RestResult.success().dataList(shareList, total);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface ShareMapper extends BaseMapper<Share> {
|
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);
|
int selectShareListTotalCount(String shareFilePath, String shareBatchNum, String userId);
|
||||||
}
|
}
|
||||||
|
@ -12,21 +12,22 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor=Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public class ShareService extends ServiceImpl<ShareMapper, Share> implements IShareService {
|
public class ShareService extends ServiceImpl<ShareMapper, Share> implements IShareService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
ShareMapper shareMapper;
|
ShareMapper shareMapper;
|
||||||
|
|
||||||
@Override
|
@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();
|
Long beginCount = (shareListDTO.getCurrentPage() - 1) * shareListDTO.getPageCount();
|
||||||
return shareMapper.selectShareList(shareListDTO.getShareFilePath(),
|
return shareMapper.selectShareList(shareListDTO.getShareFilePath(),
|
||||||
shareListDTO.getSharedFlag(),
|
shareListDTO.getSharedFlag(),
|
||||||
shareListDTO.getShareBatchNum(),
|
shareListDTO.getShareBatchNum(),
|
||||||
beginCount, shareListDTO.getPageCount(), userId);
|
beginCount, shareListDTO.getPageCount(), userId, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,13 +13,19 @@
|
|||||||
LEFT JOIN file d ON d.fileId = c.fileId
|
LEFT JOIN file d ON d.fileId = c.fileId
|
||||||
left join user as e on c.userId = e.userId
|
left join user as e on c.userId = e.userId
|
||||||
WHERE shareFilePath = #{shareFilePath}
|
WHERE shareFilePath = #{shareFilePath}
|
||||||
and a.shareType = 3
|
and c.userFileId is not null
|
||||||
<if test="shareBatchNum != null">
|
<if test="shareBatchNum != null">
|
||||||
AND a.shareBatchNum = #{shareBatchNum}
|
AND a.shareBatchNum = #{shareBatchNum}
|
||||||
</if>
|
</if>
|
||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
AND c.userId = #{userId}
|
AND c.userId = #{userId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="type == 1">
|
||||||
|
and a.shareType != 3
|
||||||
|
</if>
|
||||||
|
<if test="type == 2">
|
||||||
|
and a.shareType = 3
|
||||||
|
</if>
|
||||||
order BY shareTime desc
|
order BY shareTime desc
|
||||||
limit #{beginCount}, #{pageCount}
|
limit #{beginCount}, #{pageCount}
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user