mirror of https://gitee.com/stylefeng/roses
commit
6f625c2298
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.rule.pojo.response;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 返回基类,返回参数可继承此类
|
||||
* <p>
|
||||
* 可以用于封装通用返回包装器
|
||||
* <p>
|
||||
*
|
||||
* @author yxx
|
||||
* @date 2023/03/28 18:08
|
||||
*/
|
||||
@Data
|
||||
public class BaseResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ChineseDescription("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ChineseDescription("创建人")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
@ChineseDescription("创建人姓名")
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ChineseDescription("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ChineseDescription("更新人")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 更新人姓名
|
||||
*/
|
||||
@ChineseDescription("更新人姓名")
|
||||
private Long updateUserName;
|
||||
|
||||
}
|
|
@ -202,13 +202,14 @@ public class WrapperAop {
|
|||
private Map<String, Object> wrapPureObject(Object originModel, Class<? extends BaseWrapper<?>>[] baseWrapperClasses) {
|
||||
|
||||
// 首先将原始的对象转化为map
|
||||
Map<String, Object> originMap = BeanUtil.beanToMap(originModel);
|
||||
Map<String, Object> originMap = null;
|
||||
|
||||
// 经过多个包装类填充属性
|
||||
try {
|
||||
for (Class<? extends BaseWrapper<?>> baseWrapperClass : baseWrapperClasses) {
|
||||
BaseWrapper baseWrapper = baseWrapperClass.newInstance();
|
||||
Map<String, Object> incrementFieldsMap = baseWrapper.doWrap(originModel);
|
||||
originMap = BeanUtil.beanToMap(originModel);
|
||||
originMap.putAll(incrementFieldsMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -27,6 +27,7 @@ package cn.stylefeng.roses.kernel.system.modular.organization.controller;
|
|||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.BusinessLog;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.ResBizTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.tree.ztree.ZTreeNode;
|
||||
|
@ -37,6 +38,7 @@ import cn.stylefeng.roses.kernel.system.api.enums.OrgTypeEnum;
|
|||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.HrOrganizationDTO;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.HrOrganizationRequest;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.OrganizationTreeNode;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.user.request.SysUserRequest;
|
||||
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrganization;
|
||||
import cn.stylefeng.roses.kernel.system.modular.organization.service.HrOrganizationService;
|
||||
import cn.stylefeng.roses.kernel.system.modular.organization.wrapper.OrgExpandWrapper;
|
||||
|
@ -254,4 +256,16 @@ public class HrOrganizationController {
|
|||
return new SuccessResponseData<>(orgDetailList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织下拉列表,可以根据组织名称搜索
|
||||
*
|
||||
* @param request 请求参数
|
||||
* @return 返回组织信息
|
||||
* @author yxx
|
||||
* @date 2023/03/05 09:49
|
||||
*/
|
||||
@GetResource(name = "组织机构_选择器", path = "/hrOrganization/selector",requiredPermission = false)
|
||||
public ResponseData<List<SimpleDict>> selector(HrOrganizationRequest request) {
|
||||
return new SuccessResponseData<>(hrOrganizationService.selector(request));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
package cn.stylefeng.roses.kernel.system.modular.organization.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
||||
import cn.stylefeng.roses.kernel.rule.tree.ztree.ZTreeNode;
|
||||
import cn.stylefeng.roses.kernel.system.api.OrganizationServiceApi;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.HrOrganizationRequest;
|
||||
|
@ -140,4 +141,10 @@ public interface HrOrganizationService extends IService<HrOrganization>, Organiz
|
|||
*/
|
||||
Set<Long> findAllLevelParentIdsByOrganizations(Set<Long> organizationIds);
|
||||
|
||||
/**
|
||||
* 组织机构选择器
|
||||
* @param request 请求参数
|
||||
* @return 选择列表
|
||||
*/
|
||||
List<SimpleDict> selector(HrOrganizationRequest request);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import cn.stylefeng.roses.kernel.rule.constants.SymbolConstant;
|
|||
import cn.stylefeng.roses.kernel.rule.constants.TreeConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
|
||||
import cn.stylefeng.roses.kernel.rule.tree.factory.DefaultTreeBuildFactory;
|
||||
import cn.stylefeng.roses.kernel.rule.tree.ztree.ZTreeNode;
|
||||
import cn.stylefeng.roses.kernel.system.api.RoleDataScopeServiceApi;
|
||||
|
@ -313,6 +314,37 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
|||
return allLevelParentIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SimpleDict> selector(HrOrganizationRequest request) {
|
||||
LambdaQueryWrapper<HrOrganization> queryWrapper = new LambdaQueryWrapper<>();
|
||||
String orgName = request.getOrgName();
|
||||
String orgCode = request.getOrgCode();
|
||||
Long orgId = request.getOrgId();
|
||||
|
||||
// 查询未删除状态的
|
||||
queryWrapper.eq(HrOrganization::getDelFlag, YesOrNotEnum.N.getCode());
|
||||
// 拼接组织机构名称条件
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(orgName), HrOrganization::getOrgName, orgName);
|
||||
// 拼接组织机构编码条件
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(orgCode), HrOrganization::getOrgCode, orgCode);
|
||||
// 拼接机构id查询条件
|
||||
queryWrapper.eq(ObjectUtil.isNotEmpty(orgId), HrOrganization::getOrgId, orgId);
|
||||
|
||||
queryWrapper.select(HrOrganization::getOrgId, HrOrganization::getOrgCode, HrOrganization::getOrgName);
|
||||
List<HrOrganization> list = this.list(queryWrapper);
|
||||
|
||||
ArrayList<SimpleDict> results = new ArrayList<>();
|
||||
for (HrOrganization org : list) {
|
||||
SimpleDict simpleDict = new SimpleDict();
|
||||
simpleDict.setId(org.getOrgId());
|
||||
simpleDict.setName(org.getOrgName());
|
||||
simpleDict.setCode(org.getOrgCode());
|
||||
results.add(simpleDict);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HrOrganizationDTO> orgList() {
|
||||
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -152,7 +152,7 @@
|
|||
<aliyun.java.sdk.core>3.0.0</aliyun.java.sdk.core>
|
||||
<aliyun.java.sdk.dm>3.1.0</aliyun.java.sdk.dm>
|
||||
<activation.version>1.1.1</activation.version>
|
||||
<easy.excel.version>2.2.6</easy.excel.version>
|
||||
<easy.excel.version>3.2.1</easy.excel.version>
|
||||
<pinyin4j.version>2.5.0</pinyin4j.version>
|
||||
<openfeign.version>2.2.6.RELEASE</openfeign.version>
|
||||
<seata.all.version>1.3.0</seata.all.version>
|
||||
|
|
Loading…
Reference in New Issue