【7.6.0】【group】更新分组名称的渲染,便捷方法的封装

dev-7.6.0-hang
fengshuonan 2023-05-30 17:19:57 +08:00
parent 76ed9e3b5a
commit f1f50c69cd
3 changed files with 57 additions and 0 deletions

View File

@ -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);
} }

View File

@ -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);
}

View File

@ -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());
}
}
}
}
/** /**
* *
* *