fix:78587
This commit is contained in:
+6
@@ -63,4 +63,10 @@ public interface ILawsNewsFeedService extends IService<LawsNewsFeed> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
LawsNewsFeed queryById(String id, String type);
|
LawsNewsFeed queryById(String id, String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否拥有查看权限
|
||||||
|
* @param lawsNewsFeed
|
||||||
|
*/
|
||||||
|
void isHaveQueryAuth(LawsNewsFeed lawsNewsFeed);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -204,7 +204,8 @@ public class LawsNewsFeedServiceImpl extends ServiceImpl<LawsNewsFeedMapper, Law
|
|||||||
* @Date: 2023/11/27 9:34
|
* @Date: 2023/11/27 9:34
|
||||||
* @Description: 是否拥有查看权限
|
* @Description: 是否拥有查看权限
|
||||||
**/
|
**/
|
||||||
private void isHaveQueryAuth(LawsNewsFeed lawsNewsFeed) {
|
@Override
|
||||||
|
public void isHaveQueryAuth(LawsNewsFeed lawsNewsFeed) {
|
||||||
String userId = CurrentUserUtil.getId();
|
String userId = CurrentUserUtil.getId();
|
||||||
String roles = CurrentUserUtil.getRoles();
|
String roles = CurrentUserUtil.getRoles();
|
||||||
// 如果是编辑者,直接返回
|
// 如果是编辑者,直接返回
|
||||||
|
|||||||
+6
@@ -16,6 +16,7 @@ import com.jero.modules.personal.service.ILawsBrowsingHistoryService;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@@ -102,6 +104,10 @@ public class LawsBrowsingHistoryController extends JeroController<LawsBrowsingHi
|
|||||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||||
}
|
}
|
||||||
|
List<LawsBrowsingHistory> listLawsBrowsingHistory = lawsBrowsingHistoryService.listByIds(Arrays.asList(map.get("ids").split(",")));
|
||||||
|
if(CollectionUtils.isEmpty(listLawsBrowsingHistory)){
|
||||||
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
|
}
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
LambdaQueryWrapper<LawsBrowsingHistory> queryLawsBrowsingHistory = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsBrowsingHistory> queryLawsBrowsingHistory = new LambdaQueryWrapper<>();
|
||||||
queryLawsBrowsingHistory.ne(LawsBrowsingHistory::getBrowsingUserId,sysUser.getId());
|
queryLawsBrowsingHistory.ne(LawsBrowsingHistory::getBrowsingUserId,sysUser.getId());
|
||||||
|
|||||||
+6
-1
@@ -33,9 +33,10 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 标准收藏
|
* @Description: 标准收藏
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-09-07
|
* @Date: 2023-09-07
|
||||||
@@ -210,6 +211,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||||
}
|
}
|
||||||
|
LawsStandardCollection lawsStandardCollection = lawsStandardCollectionService.getById(map.get("id"));
|
||||||
|
if(Objects.isNull(lawsStandardCollection)){
|
||||||
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
|
}
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
LambdaQueryWrapper<LawsStandardCollection> queryLawsStandardCollection = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsStandardCollection> queryLawsStandardCollection = new LambdaQueryWrapper<>();
|
||||||
queryLawsStandardCollection.eq(LawsStandardCollection::getId,map.get("id"));
|
queryLawsStandardCollection.eq(LawsStandardCollection::getId,map.get("id"));
|
||||||
|
|||||||
+1
@@ -260,6 +260,7 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
String recipientId = lawsStandardSharing.getRecipientId();
|
String recipientId = lawsStandardSharing.getRecipientId();
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
LawsNewsFeed lawsNewsFeed = lawsNewsFeedService.getById(lawsStandardSharing.getStandardId());
|
LawsNewsFeed lawsNewsFeed = lawsNewsFeedService.getById(lawsStandardSharing.getStandardId());
|
||||||
|
lawsNewsFeedService.isHaveQueryAuth(lawsNewsFeed);
|
||||||
if (0 == lawsNewsFeed.getReleaseStatus()) {
|
if (0 == lawsNewsFeed.getReleaseStatus()) {
|
||||||
throw new JeroBootException("未发布的消息不能进行分享");
|
throw new JeroBootException("未发布的消息不能进行分享");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user