【更新】BIZ模块增加用户组选择器功能,与sys保持一致

pull/286/head
xuyuxiang 2025-09-21 13:50:38 +08:00 committed by 就是那个锅
parent eb47f8aa57
commit 4b770ed045
3 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/*
* Copyright [2022] [https://www.xiaonuo.vip]
*
* SnowyAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Snowy
* 3.使使
* 4. https://www.xiaonuo.vip
* 5.xiaonuobase@qq.com
* 6.Snowy https://www.xiaonuo.vip
*/
package vip.xiaonuo.biz.modular.group.param;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
/**
*
*
* @author yubaoshan
* @date 2025/1/12 02:36
**/
@Getter
@Setter
public class BizGroupSelectorParam {
/** 当前页 */
@Schema(description = "当前页码")
private Integer current;
/** 每页条数 */
@Schema(description = "每页条数")
private Integer size;
/** 姓名关键词 */
@Schema(description = "姓名关键词")
private String searchKey;
}

View File

@ -108,4 +108,12 @@ public interface BizGroupService extends IService<BizGroup> {
* @date 2024/12/21 01:25
*/
void grantUser(BizGroupGrantUserParam bizGroupGrantUserParam);
/**
*
*
* @author yubaoshan
* @date 2024/12/21 01:25
*/
Page<BizGroup> groupSelector(BizGroupSelectorParam bizGroupSelectorParam);
}

View File

@ -177,4 +177,19 @@ public class BizGroupServiceImpl extends ServiceImpl<BizGroupMapper, BizGroup> i
public void grantUser(BizGroupGrantUserParam bizGroupGrantUserParam) {
sysGroupApi.grantUser(bizGroupGrantUserParam.getId(), bizGroupGrantUserParam.getGrantInfoList());
}
@Override
public Page<BizGroup> groupSelector(BizGroupSelectorParam bizGroupSelectorParam) {
QueryWrapper<BizGroup> queryWrapper = new QueryWrapper<BizGroup>().checkSqlInjection();
// 只查询部分字段排掉extJson
queryWrapper.lambda().select(BizGroup::getId, BizGroup::getName, BizGroup::getSortCode, BizGroup::getRemark);
queryWrapper.lambda().orderByAsc(BizGroup::getSortCode);
// 如果查询条件为空,则直接查询
if (!ObjectUtil.isAllEmpty(bizGroupSelectorParam.getSearchKey())) {
if (ObjectUtil.isNotEmpty(bizGroupSelectorParam.getSearchKey())) {
queryWrapper.lambda().like(BizGroup::getName, bizGroupSelectorParam.getSearchKey());
}
}
return this.page(CommonPageRequest.defaultPage(), queryWrapper.lambda());
}
}