mirror of https://gitee.com/xiaonuobase/snowy
【更新】BIZ模块增加用户组选择器功能,sys组织选择器优化
parent
8d680f1f27
commit
c4df65f41a
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* 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.api;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户组Api
|
||||||
|
*
|
||||||
|
* @author yubaoshan
|
||||||
|
* @date 2024/11/1 18:27:51
|
||||||
|
**/
|
||||||
|
public interface BizGroupApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户组选择器
|
||||||
|
*
|
||||||
|
* @author yubaoshan
|
||||||
|
* @date 2024/11/1 18:27:51
|
||||||
|
*/
|
||||||
|
Page<JSONObject> groupSelector(String searchKey);
|
||||||
|
}
|
|
@ -47,5 +47,5 @@ public interface SysGroupApi {
|
||||||
* @author yubaoshan
|
* @author yubaoshan
|
||||||
* @date 2025/1/12 02:36
|
* @date 2025/1/12 02:36
|
||||||
*/
|
*/
|
||||||
Page<JSONObject> groupSelector(String searchKey, int current, int size);
|
Page<JSONObject> groupSelector(String searchKey);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* 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.provider;
|
||||||
|
|
||||||
|
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.springframework.stereotype.Service;
|
||||||
|
import vip.xiaonuo.biz.api.BizGroupApi;
|
||||||
|
import vip.xiaonuo.biz.modular.group.param.BizGroupSelectorParam;
|
||||||
|
import vip.xiaonuo.biz.modular.group.service.BizGroupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户组API接口提供者
|
||||||
|
*
|
||||||
|
* @author yubaoshan
|
||||||
|
* @date 2024/12/21 01:25
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class BizGroupApiProvider implements BizGroupApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizGroupService bizGroupService;
|
||||||
|
|
||||||
|
@SuppressWarnings("ALL")
|
||||||
|
@Override
|
||||||
|
public Page<JSONObject> groupSelector(String searchKey) {
|
||||||
|
BizGroupSelectorParam bizGroupSelectorParam = new BizGroupSelectorParam();
|
||||||
|
bizGroupSelectorParam.setSearchKey(searchKey);
|
||||||
|
return BeanUtil.toBean(bizGroupService.groupSelector(bizGroupSelectorParam), Page.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,14 +26,6 @@ import lombok.Setter;
|
||||||
@Setter
|
@Setter
|
||||||
public class SysGroupSelectorParam {
|
public class SysGroupSelectorParam {
|
||||||
|
|
||||||
/** 当前页 */
|
|
||||||
@Schema(description = "当前页码")
|
|
||||||
private Integer current;
|
|
||||||
|
|
||||||
/** 每页条数 */
|
|
||||||
@Schema(description = "每页条数")
|
|
||||||
private Integer size;
|
|
||||||
|
|
||||||
/** 姓名关键词 */
|
/** 姓名关键词 */
|
||||||
@Schema(description = "姓名关键词")
|
@Schema(description = "姓名关键词")
|
||||||
private String searchKey;
|
private String searchKey;
|
||||||
|
|
|
@ -54,10 +54,8 @@ public class SysGroupApiProvider implements SysGroupApi {
|
||||||
|
|
||||||
@SuppressWarnings("ALL")
|
@SuppressWarnings("ALL")
|
||||||
@Override
|
@Override
|
||||||
public Page<JSONObject> groupSelector(String searchKey, int current, int size) {
|
public Page<JSONObject> groupSelector(String searchKey) {
|
||||||
SysGroupSelectorParam sysGroupSelectorParam = new SysGroupSelectorParam();
|
SysGroupSelectorParam sysGroupSelectorParam = new SysGroupSelectorParam();
|
||||||
sysGroupSelectorParam.setCurrent(current);
|
|
||||||
sysGroupSelectorParam.setSize(size);
|
|
||||||
sysGroupSelectorParam.setSearchKey(searchKey);
|
sysGroupSelectorParam.setSearchKey(searchKey);
|
||||||
return BeanUtil.toBean(sysGroupService.groupSelector(sysGroupSelectorParam), Page.class);
|
return BeanUtil.toBean(sysGroupService.groupSelector(sysGroupSelectorParam), Page.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,11 +185,9 @@ public class SysGroupServiceImpl extends ServiceImpl<SysGroupMapper, SysGroup> i
|
||||||
queryWrapper.lambda().select(SysGroup::getId, SysGroup::getName, SysGroup::getSortCode, SysGroup::getRemark);
|
queryWrapper.lambda().select(SysGroup::getId, SysGroup::getName, SysGroup::getSortCode, SysGroup::getRemark);
|
||||||
queryWrapper.lambda().orderByAsc(SysGroup::getSortCode);
|
queryWrapper.lambda().orderByAsc(SysGroup::getSortCode);
|
||||||
// 如果查询条件为空,则直接查询
|
// 如果查询条件为空,则直接查询
|
||||||
if (!ObjectUtil.isAllEmpty(sysGroupSelectorParam.getSearchKey())) {
|
|
||||||
if (ObjectUtil.isNotEmpty(sysGroupSelectorParam.getSearchKey())) {
|
if (ObjectUtil.isNotEmpty(sysGroupSelectorParam.getSearchKey())) {
|
||||||
queryWrapper.lambda().like(SysGroup::getName, sysGroupSelectorParam.getSearchKey());
|
queryWrapper.lambda().like(SysGroup::getName, sysGroupSelectorParam.getSearchKey());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return this.page(CommonPageRequest.defaultPage(), queryWrapper.lambda());
|
return this.page(CommonPageRequest.defaultPage(), queryWrapper.lambda());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue