!52 【7.3.4】easyExcel版本升级、包装器优化

Merge pull request !52 from 夜星/dev-7.3.4
pull/53/MERGE
stylefeng 2023-03-28 02:54:01 +00:00 committed by Gitee
commit 6f625c2298
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 141 additions and 2 deletions

View File

@ -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.
*
* GunsAPACHE 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;
}

View File

@ -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) {

View File

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

View File

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

View File

@ -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() {

View File

@ -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>