Compare commits

...

19 Commits

Author SHA1 Message Date
176yunxuan
5075426bcf 查询逻辑更改
Some checks failed
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head There was a failure building this commit
2024-03-15 17:07:30 +08:00
fb9820be31 Upload
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-15 17:06:29 +08:00
176yunxuan
0de184db59 Merge branch 'feature'
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
# Conflicts:
#	src/main/java/com/jsl/oa/dao/ProjectDAO.java
2024-03-14 21:45:10 +08:00
3bde291f0f 权限处理
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-14 18:45:17 +08:00
176yunxuan
e0df2dcc4e Merge branch 'feature'
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-14 11:42:52 +08:00
176yunxuan
df52d05759 状态查询修改
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-13 13:48:41 +08:00
176yunxuan
820a46c9ef Merge branch 'feature'
# Conflicts:
#	src/main/java/com/jsl/oa/dao/ProjectDAO.java
2024-03-13 13:39:22 +08:00
63667c527f 取消Token校验
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-13 10:26:02 +08:00
1b7c65e817 Tag信息获取
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-12 21:10:35 +08:00
01173e9cfc Merge branch 'feature'
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-12 21:05:39 +08:00
xiangZr-hhh
acd699e912 projectDao修正
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-12 17:09:21 +08:00
xiangZr-hhh
eb5095f4a8 Merge remote-tracking branch 'origin/feature'
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-12 14:29:18 +08:00
860b109ebf Upload
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-12 13:07:11 +08:00
65c06e8eef Merge remote-tracking branch 'origin/feature' 2024-03-12 13:04:54 +08:00
96fdab94f7
Merge branch 'feature'
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-03-11 16:20:32 +08:00
88ed6e0ca9
patch: 角色内容检查
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-02-14 22:16:23 +08:00
3b0aee6db4
patch: 漏洞补丁
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-02-14 21:52:35 +08:00
264ac569b6
patch: 漏洞补丁
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-02-05 20:59:01 +08:00
f0fcfba065
patch: 添加id内容
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
2024-02-04 00:54:28 +08:00
12 changed files with 101 additions and 48 deletions

View File

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

View File

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

View File

@ -39,7 +39,7 @@ public class InfoDAO {
log.info("\t\t> 从 MySQL 获取数据");
String getCarouselSql = infoMapper.getCarousel();
CarouselDO getCarousel = null;
if (getCarouselSql != null && !getCarouselSql.equals("{}")) {
if (getCarouselSql != null && !"{}".equals(getCarouselSql)) {
getCarousel = gson.fromJson(getCarouselSql, CarouselDO.class);
}
if (getCarousel == null) {
@ -54,13 +54,17 @@ public class InfoDAO {
}
// 获取排序
sortCarousel(getCarousel);
// 添加id
for (int i = 0; i < getCarousel.getData().size(); i++) {
getCarousel.getData().get(i).setId(i + 1);
}
return getCarousel;
}
private void sortCarousel(CarouselDO getCarousel) {
for (int i = 0; i < getCarousel.getData().size(); i++) {
for (int j = 0; j < getCarousel.getData().size(); j++) {
if (getCarousel.getOrder().equals("desc")) {
if ("desc".equals(getCarousel.getOrder())) {
if (getCarousel.getData().get(i).getDisplayOrder() > getCarousel.getData().get(j).getDisplayOrder()) {
Collections.swap(getCarousel.getData(), i, j);
}
@ -84,6 +88,10 @@ public class InfoDAO {
public boolean setCarousel(CarouselDO carouselDO) {
log.info("\t> 执行 DAO 层 InfoDAO.setCarousel 方法");
sortCarousel(carouselDO);
// 添加id
for (int i = 0; i < carouselDO.getData().size(); i++) {
carouselDO.getData().get(i).setId(i + 1);
}
String setCarouselSql = gson.toJson(carouselDO);
log.info("\t\t> 从 MySQL 获取数据");
return infoMapper.setCarousel(setCarouselSql);

View File

@ -128,12 +128,16 @@ public class ProjectDAO {
public List<ProjectDO> get(Long userId,Integer listAll,List<String> tags,List<Integer> isFinish) {
log.info("\t> 执行 DAO 层 ProjectDAO.get 方法");
log.info("\t\t> 从 MySQL 获取数据");
if(tags != null && !tags.isEmpty()){
log.info("tags");
return projectMapper.getByTags(userId,tags,isFinish);
}
if(isFinish != null && !isFinish.isEmpty()){
log.info("finish");
return projectMapper.getByIsfinish(userId,isFinish);
}
if(tags != null && !tags.isEmpty()){
return projectMapper.getByTags(userId,tags);
}
if(listAll == 0) {
return projectMapper.get(userId);
}else {
@ -144,12 +148,14 @@ public class ProjectDAO {
public List<ProjectDO> workget(Long userId, Integer listAll, List<String> tags, List<Integer> isFinish, Integer is) {
log.info("\t> 执行 DAO 层 ProjectDAO.workget 方法");
log.info("\t\t> 从 MySQL 获取数据");
if(tags != null && !tags.isEmpty()){
return projectMapper.workgetByTags(userId,tags,is,isFinish);
}
if(isFinish != null && !isFinish.isEmpty()){
return projectMapper.workgetByIsfinish(userId,isFinish,is);
}
if(tags != null && !tags.isEmpty()){
return projectMapper.workgetByTags(userId,tags,is);
}
if(listAll == 0) {
return projectMapper.workget(userId,is);
}else {
@ -220,12 +226,14 @@ public class ProjectDAO {
public List<ProjectDO> tget(Integer id,List<Integer> isFinish,List<String> tags) {
log.info("DAO层");
if(tags != null && !tags.isEmpty()){
return projectMapper.tgetBytags(tags,isFinish);
}
if(isFinish != null && !isFinish.isEmpty()){
return projectMapper.tgetByIsfinish(isFinish);
}
if(tags != null && !tags.isEmpty()){
return projectMapper.tgetBytags(tags);
}
return projectMapper.tget(id);
}

View File

@ -52,7 +52,7 @@ public interface ProjectMapper {
//@Select("select * from organize_oa.oa_project where is_finish=#{isFinish} and is_delete=false and principal_id=#{userId}")
List<ProjectDO>getByIsfinish(Long userId,List<Integer> isFinish);
List<ProjectDO>getByTags(Long userId,List<String> tags);
List<ProjectDO>getByTags(Long userId,List<String> tags,List<Integer> isFinish);
@Select("select * from organize_oa.oa_project where is_delete=false and status=1 and principal_id=#{userId}")
List<ProjectDO> get(Long userId);
@ -88,7 +88,7 @@ public interface ProjectMapper {
//@Select("select * from organize_oa.oa_project_work where is_finish=#{isFinish} and is_delete=false and principal_id =#{userId}")
List<ProjectDO> workgetByIsfinish(Long userId, List<Integer> isFinish, Integer is);
List<ProjectDO> workgetByTags(Long userId, List<String> tags, Integer is);
List<ProjectDO> workgetByTags(Long userId, List<String> tags, Integer is,List<Integer> isFinish);
//@Select("select * from organize_oa.oa_project where id in(select project_id from " +
//"organize_oa.oa_project_work where is_delete=false and status =1 and principal_id=#{userId} and type=0)")
@ -102,5 +102,5 @@ public interface ProjectMapper {
List<ProjectDO> tgetByIsfinish(List<Integer> isFinish);
List<ProjectDO> tgetBytags(List<String> tags);
List<ProjectDO> tgetBytags(List<String> tags,List<Integer> isFinish);
}

View File

@ -12,7 +12,7 @@ public interface RoleMapper {
@Insert("insert into organize_oa.oa_role_user (uid, rid) VALUE (#{uid},#{rid})")
void roleAddUser(Long uid, Long rid);
@Select("INSERT INTO organize_oa.oa_role (role_name,display_name) VALUES (#{roleName}, ${display_name})")
@Select("INSERT INTO organize_oa.oa_role (role_name,display_name) VALUES (#{roleName}, #{displayName})")
void roleAdd(RoleDO roleDO);
@Delete("delete from organize_oa.oa_role_user where uid=#{uid}")

View File

@ -15,7 +15,7 @@ import java.sql.Timestamp;
*/
@Data
public class TagProjectDO {
private String id;
private Long id;
private String name;
private Long pid;
private Timestamp createdAt;

View File

@ -22,6 +22,7 @@ public class CarouselDO {
@Data
@Accessors(chain = true)
public static class DataDO {
private Integer id;
private Integer displayOrder;
private String image;
private String title;

View File

@ -48,7 +48,7 @@ public class AuthServiceImpl implements AuthService {
@Override
public BaseResponse authRegister(@NotNull UserRegisterVO userRegisterVO) {
log.info("\t> 执行 Service 层 AuthService.userEdit 方法");
log.info("\t> 执行 Service 层 AuthService.authRegister 方法");
// 检查用户说是否存在
UserDO getUserByUsername = userMapper.getUserInfoByUsername(userRegisterVO.getUsername());
// 用户名已存在
@ -75,8 +75,8 @@ public class AuthServiceImpl implements AuthService {
if (userMapper.insertUser(userDO)) {
userDO.setPassword(null);
//默认角色为学生
UserDO userDO1 = userMapper.getUserByUserNum(userDO.getUsername());
roleDAO.addRoleUser(userDO1.getId(), 2L);
UserDO getUserDO = userMapper.getUserInfoByUsername(userDO.getUsername());
roleDAO.addRoleUser(getUserDO.getId(), 2L);
return ResultUtil.success("注册成功", userDO);
} else {
return ResultUtil.error(ErrorCode.DATABASE_INSERT_ERROR);

View File

@ -64,13 +64,14 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public BaseResponse tget(Integer id, List<String> tags, List<Integer> isFinish) {
log.info("\t> 执行 Service 层 ProjectService.tget 方法");
//根据状态查询
if (isFinish != null && !isFinish.isEmpty()) {
//根据标签查询
if (tags != null && !tags.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.tget(id,isFinish,tags);
return ResultUtil.success(projectDOList);
}
//根据标签查询
if (tags != null && !tags.isEmpty()) {
//根据状态查询
if (isFinish != null && !isFinish.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.tget(id,isFinish,tags);
return ResultUtil.success(projectDOList);
}
@ -245,17 +246,19 @@ public class ProjectServiceImpl implements ProjectService {
//获取用户
Long userId = Processing.getAuthHeaderToUserId(request);
//根据状态查询
if (isFinish != null && !isFinish.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.get(userId, listAll, tags, isFinish);
return ResultUtil.success(projectDOList);
}
//根据标签查询
if (tags != null && !tags.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.get(userId, listAll, tags, isFinish);
return ResultUtil.success(projectDOList);
}
//根据状态查询
if (isFinish != null && !isFinish.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.get(userId, listAll, tags, isFinish);
return ResultUtil.success(projectDOList);
}
//判断是否是老师(项目负责人)
if (listAll != null && Processing.checkUserIsTeacher(request, roleMapper)) {
List<ProjectDO> projectDOList = projectDAO.get(userId, listAll, tags, isFinish);
@ -274,17 +277,20 @@ public class ProjectServiceImpl implements ProjectService {
//获取用户
Long userId = Processing.getAuthHeaderToUserId(request);
//根据状态查询
if (isFinish != null && !isFinish.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.workget(userId, listAll, tags, isFinish,is);
return ResultUtil.success(projectDOList);
}
//根据标签查询
if (tags != null && !tags.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.workget(userId, listAll, tags, isFinish,is);
return ResultUtil.success(projectDOList);
}
//根据状态查询
if (isFinish != null && !isFinish.isEmpty()) {
List<ProjectDO> projectDOList = projectDAO.workget(userId, listAll, tags, isFinish,is);
return ResultUtil.success(projectDOList);
}
//判断是否是老师(项目负责人)
if (listAll != null && Processing.checkUserIsTeacher(request, roleMapper)) {
List<ProjectDO> projectDOList = projectDAO.workget(userId, listAll, tags, isFinish,is);

View File

@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.regex.Pattern;
@ -25,12 +26,12 @@ import java.util.regex.Pattern;
* <hr/>
* 用于权限服务层的实现类,实现权限的增删改查,以及用户权限的获取
*
* @since v1.1.0
* @author xiao_lfeng | 176yunxuan | xiangZr-hhh
* @version v1.1.0
* @see com.jsl.oa.services.RoleService
* @see com.jsl.oa.dao.RoleDAO
* @see com.jsl.oa.dao.UserDAO
* @author xiao_lfeng | 176yunxuan | xiangZr-hhh
* @since v1.1.0
*/
@Slf4j
@Service
@ -171,8 +172,10 @@ public class RoleServiceImpl implements RoleService {
String roleName = roleAddVO.getName();
RoleDO roleDO = new RoleDO();
if (!roleDAO.isExistRoleByRoleName(roleName)) {
Processing.copyProperties(roleAddVO, roleDO);
roleDO.setRoleName(roleAddVO.getName());
roleDO
.setRoleName(roleAddVO.getName())
.setDisplayName(roleAddVO.getDisplayName())
.setCreatedAt(new Timestamp(System.currentTimeMillis()));
} else {
return ResultUtil.error(ErrorCode.ROLE_NAME_REPEAT);
}

View File

@ -48,12 +48,22 @@
</update>
<select id="getByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and status=1 and
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="json_extract(tags,'$.tags')like concat('%',"
close=",'%')">
#{tag}
</foreach>
<if test="tags != null">
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and status=1 and
<if test="isFinish != null and isFinish.size() > 0">
is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=") and">
#{Finish}
</foreach>
</if>
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="(json_extract(tags,'$.tags')like concat('%',"
close=",'%'))">
#{tag}
</foreach>
</if>
</select>
<select id="getByIsfinish" resultType="com.jsl.oa.model.doData.ProjectDO">
@ -71,8 +81,14 @@
(principal_id = #{userId} and is_delete=false) or
</if>
id in(select project_id from organize_oa.oa_project_work
where is_delete=false and (principal_id=#{userId} ) and project_id in(
select id from organize_oa.oa_project where
where is_delete=false and (principal_id=#{userId} ) and
<if test="isFinish != null and isFinish.size() > 0">
is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=") and">
#{Finish}
</foreach>
</if>
project_id in(select id from organize_oa.oa_project where
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="json_extract(tags,'$.tags')like concat('%',"
close=",'%')))">
@ -115,9 +131,16 @@
<select id="tgetBytags" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false and status=1 and
<if test="isFinish != null and isFinish.size() > 0">
is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=") and">
#{Finish}
</foreach>
</if>
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="json_extract(tags,'$.tags')like concat('%',"
close=",'%')">
open="(json_extract(tags,'$.tags')like concat('%',"
close=",'%'))">
#{tag}
</foreach>
</select>