feat: 项目需求管理
This commit is contained in:
@@ -13,7 +13,12 @@
|
||||
package org.nl.sys.modular.group.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.sys.core.GroupUserVo;
|
||||
import org.nl.sys.modular.group.entity.SysGroup;
|
||||
import org.nl.sys.modular.group.param.SysGroupIdUserParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户组Mapper接口
|
||||
@@ -22,4 +27,5 @@ import org.nl.sys.modular.group.entity.SysGroup;
|
||||
* @date 2024/12/21 01:25
|
||||
**/
|
||||
public interface SysGroupMapper extends BaseMapper<SysGroup> {
|
||||
List<GroupUserVo> getAllUserInfoByGroupId(@Param("param") SysGroupIdUserParam param);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,13 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.sys.modular.group.mapper.SysGroupMapper">
|
||||
|
||||
<select id="getAllUserInfoByGroupId" resultType="org.nl.sys.core.GroupUserVo">
|
||||
SELECT su.ID AS userId,
|
||||
su.`NAME` AS name
|
||||
FROM `sys_user` su
|
||||
WHERE su.ID IN (SELECT OBJECT_ID
|
||||
FROM `sys_relation` sr
|
||||
WHERE sr.TARGET_ID = #{param.groupId}
|
||||
AND sr.CATEGORY = #{param.category})
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.sys.modular.group.param;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/11/11
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class SysGroupIdUserParam {
|
||||
/**
|
||||
* 用户组id
|
||||
*/
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
private String category;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.nl.sys.core.GroupUserVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.nl.sys.modular.group.service.SysGroupService;
|
||||
import org.nl.sys.api.SysGroupApi;
|
||||
@@ -61,4 +62,9 @@ public class SysGroupApiProvider implements SysGroupApi {
|
||||
sysGroupSelectorParam.setSearchKey(searchKey);
|
||||
return BeanUtil.toBean(sysGroupService.groupSelector(sysGroupSelectorParam), Page.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GroupUserVo> getAllUserInfoByGroupId(String groupId) {
|
||||
return sysGroupService.getAllUserInfoByGroupId(groupId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.nl.sys.modular.group.service;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.sys.core.GroupUserVo;
|
||||
import org.nl.sys.modular.group.entity.SysGroup;
|
||||
import org.nl.sys.modular.group.param.*;
|
||||
import org.nl.sys.modular.group.param.*;
|
||||
@@ -117,4 +118,11 @@ public interface SysGroupService extends IService<SysGroup> {
|
||||
* @date 2024/12/21 01:25
|
||||
*/
|
||||
Page<SysGroup> groupSelector(SysGroupSelectorParam sysGroupSelectorParam);
|
||||
|
||||
/**
|
||||
* 根据用户组id获取用户
|
||||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<GroupUserVo> getAllUserInfoByGroupId(String groupId);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.nl.sys.core.GroupUserVo;
|
||||
import org.nl.sys.modular.group.param.*;
|
||||
import org.nl.sys.modular.relation.entity.SysRelation;
|
||||
import org.nl.sys.modular.relation.enums.SysRelationCategoryEnum;
|
||||
@@ -187,4 +188,10 @@ public class SysGroupServiceImpl extends ServiceImpl<SysGroupMapper, SysGroup> i
|
||||
}
|
||||
return this.page(CommonPageRequest.defaultPage(), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GroupUserVo> getAllUserInfoByGroupId(String groupId) {
|
||||
SysGroupIdUserParam param = SysGroupIdUserParam.builder().groupId(groupId).category(SysRelationCategoryEnum.SYS_USER_HAS_GROUP.getValue()).build();
|
||||
return this.baseMapper.getAllUserInfoByGroupId(param);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user