mirror of https://gitee.com/stylefeng/roses
【7.6.0】【group】更新分组名称的渲染,便捷方法的封装
parent
76ed9e3b5a
commit
f1f50c69cd
|
@ -24,6 +24,7 @@
|
||||||
*/
|
*/
|
||||||
package cn.stylefeng.roses.kernel.group.api;
|
package cn.stylefeng.roses.kernel.group.api;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.group.api.callback.GroupNameRenderApi;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -59,4 +60,13 @@ public interface GroupConditionApi {
|
||||||
*/
|
*/
|
||||||
List<Long> getUserGroupBizIds(String groupBizCode, BaseRequest baseRequest);
|
List<Long> getUserGroupBizIds(String groupBizCode, BaseRequest baseRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将业务的数据集合渲染分组名称
|
||||||
|
*
|
||||||
|
* @param businessList 业务的数据集合
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/5/30 17:15
|
||||||
|
*/
|
||||||
|
void renderBizListGroupName(String groupBizCode, List<GroupNameRenderApi> businessList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package cn.stylefeng.roses.kernel.group.api.callback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称回显的方法
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/5/30 17:13
|
||||||
|
*/
|
||||||
|
public interface GroupNameRenderApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取被渲染数据的主键id
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/5/30 17:18
|
||||||
|
*/
|
||||||
|
Long getRenderBusinessId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置条件分组名称,供回调用
|
||||||
|
*
|
||||||
|
* @param groupName 分组名称
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/5/30 17:13
|
||||||
|
*/
|
||||||
|
void renderGroupName(String groupName);
|
||||||
|
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package cn.stylefeng.roses.kernel.group.modular.service.impl;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||||
|
import cn.stylefeng.roses.kernel.group.api.callback.GroupNameRenderApi;
|
||||||
import cn.stylefeng.roses.kernel.group.api.constants.GroupConstants;
|
import cn.stylefeng.roses.kernel.group.api.constants.GroupConstants;
|
||||||
import cn.stylefeng.roses.kernel.group.api.pojo.SysGroupDTO;
|
import cn.stylefeng.roses.kernel.group.api.pojo.SysGroupDTO;
|
||||||
import cn.stylefeng.roses.kernel.group.api.pojo.SysGroupRequest;
|
import cn.stylefeng.roses.kernel.group.api.pojo.SysGroupRequest;
|
||||||
|
@ -154,6 +155,24 @@ public class SysGroupServiceImpl extends ServiceImpl<SysGroupMapper, SysGroup> i
|
||||||
return userBizIds;
|
return userBizIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderBizListGroupName(String groupBizCode, List<GroupNameRenderApi> businessList) {
|
||||||
|
|
||||||
|
// 查询结果中有没有用户挂标签的,有的话就返回中文分组名称
|
||||||
|
SysGroupRequest sysGroupRequest = new SysGroupRequest();
|
||||||
|
sysGroupRequest.setGroupBizCode(groupBizCode);
|
||||||
|
List<SysGroupDTO> list = this.findGroupList(sysGroupRequest, true);
|
||||||
|
|
||||||
|
// 增加返回结果的分组名称
|
||||||
|
for (SysGroupDTO sysGroupDTO : list) {
|
||||||
|
for (GroupNameRenderApi item : businessList) {
|
||||||
|
if (item.getRenderBusinessId().equals(sysGroupDTO.getBusinessId())) {
|
||||||
|
item.renderGroupName(sysGroupDTO.getGroupName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回结果增加通用的两个分组名称
|
* 返回结果增加通用的两个分组名称
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue