mirror of https://gitee.com/xiaonuobase/snowy
【更新】BIZ模块增加用户组选择器功能,与sys保持一致
parent
eb47f8aa57
commit
4b770ed045
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright [2022] [https://www.xiaonuo.vip]
|
||||
*
|
||||
* Snowy采用APACHE 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;
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue