游客查询
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit

This commit is contained in:
176yunxuan 2024-03-11 22:08:10 +08:00
parent ce123e1858
commit 6e4f22170d
8 changed files with 40 additions and 7 deletions

View File

@ -76,7 +76,7 @@ public class AuthControllerAspect {
"&& !execution(* com.jsl.oa.controllers.CustomController.*(..)) " + "&& !execution(* com.jsl.oa.controllers.CustomController.*(..)) " +
"&& !execution(* com.jsl.oa.controllers.InfoController.infoGetHeaderImage(..)) " + "&& !execution(* com.jsl.oa.controllers.InfoController.infoGetHeaderImage(..)) " +
"&& !execution(* com.jsl.oa.controllers.InfoController.infoGetHeaderUser(..))" + "&& !execution(* com.jsl.oa.controllers.InfoController.infoGetHeaderUser(..))" +
"&& !execution(* com.jsl.oa.controllers.ProjectController.projectGet(..))") "&& !execution(* com.jsl.oa.controllers.ProjectController.projectGetCustom(..))")
public Object tokenControllerAround(ProceedingJoinPoint pjp) throws Throwable { public Object tokenControllerAround(ProceedingJoinPoint pjp) throws Throwable {
// 获取 HttpServletRequest 对象 // 获取 HttpServletRequest 对象
HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();

View File

@ -63,7 +63,9 @@ public class ShiroConfiguration {
filterChainDefinitionMap.put("/info/header-user/get", "anon"); // 信息接口允许匿名访问 filterChainDefinitionMap.put("/info/header-user/get", "anon"); // 信息接口允许匿名访问
filterChainDefinitionMap.put("/project/header/get", "anon"); // 信息接口允许匿名访问 filterChainDefinitionMap.put("/project/header/get", "anon"); // 信息接口允许匿名访问
filterChainDefinitionMap.put("/project/get", "anon"); // 信息接口允许匿名访问 filterChainDefinitionMap.put("/project/get", "anon"); // 信息接口允许匿名访问
filterChainDefinitionMap.put("/project/get/custom", "anon"); // 游客获取项目允许匿名访问
filterChainDefinitionMap.put("/**/**", "authc"); // 其他接口一律拦截(需要Token) filterChainDefinitionMap.put("/**/**", "authc"); // 其他接口一律拦截(需要Token)
return filterChainDefinitionMap; return filterChainDefinitionMap;
} }
} }

View File

@ -42,7 +42,18 @@ public class ProjectController {
} }
/** /**
* 全部项目的信息获取(打开项目页) * 游客获取项目
* @return
*/
@GetMapping("/project/get/custom")
public BaseResponse projectGetCustom(@RequestParam(required = false) Integer id){
log.info("请求接口[GET]: /project/all/get");
return projectService.tget(id);
}
/**
* 我负责的界面的获取项目
* *
* @return * @return
*/ */

View File

@ -9,6 +9,7 @@ import com.jsl.oa.model.doData.ProjectWorkDO;
import com.jsl.oa.model.doData.info.ProjectShowDO; import com.jsl.oa.model.doData.info.ProjectShowDO;
import com.jsl.oa.model.voData.ProjectInfoVO; import com.jsl.oa.model.voData.ProjectInfoVO;
import com.jsl.oa.model.voData.ProjectWorkVO; import com.jsl.oa.model.voData.ProjectWorkVO;
import com.jsl.oa.utils.BaseResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -198,5 +199,8 @@ public class ProjectDAO {
} }
public List<ProjectDO> tget(Integer id) {
log.info("DAO层");
return projectMapper.tget(id);
}
} }

View File

@ -50,15 +50,15 @@ public interface ProjectMapper {
//@Select("select * from organize_oa.oa_project where json_extract(tags,'$.tags')" + //@Select("select * from organize_oa.oa_project where json_extract(tags,'$.tags')" +
//"like concat('%',#{tags},'%')") //"like concat('%',#{tags},'%')")
@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false") @Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false and principal_id=#{userId}")
List<ProjectDO>getByIsfinish(Long userId,Integer isFinish); List<ProjectDO>getByIsfinish(Long userId,Integer isFinish);
List<ProjectDO>getByTags(Long userId,List<String> tags); List<ProjectDO>getByTags(Long userId,List<String> tags);
@Select("select * from organize_oa.oa_project where is_delete=false and status=1") @Select("select * from organize_oa.oa_project where is_delete=false and status=1 and principal_id=#{userId}")
List<ProjectDO> get(Long userId); List<ProjectDO> get(Long userId);
@Select("select * from organize_oa.oa_project where status =1 and is_delete =true") @Select("select * from organize_oa.oa_project where status =1 and is_delete =true and principal_id=#{userId}")
List<ProjectDO> get1(Long userId); List<ProjectDO> get1(Long userId);
@Select("select * from organize_oa.oa_project where name=#{name}") @Select("select * from organize_oa.oa_project where name=#{name}")
@ -96,5 +96,6 @@ public interface ProjectMapper {
@Select("select * from organize_oa.oa_project_work where is_delete =true and status=1 and principal_id=#{userId}") @Select("select * from organize_oa.oa_project_work where is_delete =true and status=1 and principal_id=#{userId}")
List<ProjectWorkDO> workget1(Long userId); List<ProjectWorkDO> workget1(Long userId);
//@Select("select * from organize_oa.oa_project where is_delete=false and status=1")
List<ProjectDO> tget(Integer id);
} }

View File

@ -42,4 +42,6 @@ public interface ProjectService {
BaseResponse workget(Integer listAll, HttpServletRequest request, List<String> tags, Integer isFinish); BaseResponse workget(Integer listAll, HttpServletRequest request, List<String> tags, Integer isFinish);
BaseResponse projecWorktAdd(HttpServletRequest request, ProjectWorkVO projectWorkVO); BaseResponse projecWorktAdd(HttpServletRequest request, ProjectWorkVO projectWorkVO);
BaseResponse tget(Integer id);
} }

View File

@ -64,6 +64,13 @@ public class ProjectServiceImpl implements ProjectService {
return ResultUtil.success("添加成功"); return ResultUtil.success("添加成功");
} }
@Override
public BaseResponse tget(Integer id) {
log.info("\t> 执行 Service 层 ProjectService.tget 方法");
List<ProjectDO> projectDOList = projectDAO.tget(id);
return ResultUtil.success(projectDOList);
}
@Override @Override
@CheckUserHasPermission("project.edit") @CheckUserHasPermission("project.edit")
public BaseResponse projectEdit(HttpServletRequest request, @NotNull ProjectInfoVO projectEdit) { public BaseResponse projectEdit(HttpServletRequest request, @NotNull ProjectInfoVO projectEdit) {

View File

@ -64,5 +64,11 @@
#{tag} #{tag}
</foreach> </foreach>
</select> </select>
<select id="tget" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false
<if test="id != null">
and id=#{id}
</if>
</select>
</mapper> </mapper>