From 3855159d964e8ba24ea48d262e863c70e472b17d Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Tue, 12 Oct 2021 15:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.1.5=E3=80=91copy=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BF=BD=E7=95=A5=E6=A0=BC=E5=BC=8F=E8=BD=AC?= =?UTF-8?q?=E5=8C=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modular/user/service/impl/SysUserServiceImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel-s-system/system-business-user/src/main/java/cn/stylefeng/roses/kernel/system/modular/user/service/impl/SysUserServiceImpl.java b/kernel-s-system/system-business-user/src/main/java/cn/stylefeng/roses/kernel/system/modular/user/service/impl/SysUserServiceImpl.java index 2db6b7991..2140532a0 100644 --- a/kernel-s-system/system-business-user/src/main/java/cn/stylefeng/roses/kernel/system/modular/user/service/impl/SysUserServiceImpl.java +++ b/kernel-s-system/system-business-user/src/main/java/cn/stylefeng/roses/kernel/system/modular/user/service/impl/SysUserServiceImpl.java @@ -25,6 +25,7 @@ package cn.stylefeng.roses.kernel.system.modular.user.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; @@ -150,7 +151,7 @@ public class SysUserServiceImpl extends ServiceImpl impl // 请求bean转为实体,填充一些基本属性 SysUser sysUser = new SysUser(); - BeanUtil.copyProperties(sysUserRequest, sysUser); + BeanUtil.copyProperties(sysUserRequest, sysUser, CopyOptions.create().ignoreError()); SysUserCreateFactory.fillAddSysUser(sysUser); // 设置用户默认头像 @@ -215,7 +216,7 @@ public class SysUserServiceImpl extends ServiceImpl impl // 转化为实体 SysUser sysUser = this.querySysUser(sysUserRequest); - BeanUtil.copyProperties(sysUserRequest, sysUser); + BeanUtil.copyProperties(sysUserRequest, sysUser, CopyOptions.create().ignoreError()); // 填充基础参数 SysUserCreateFactory.fillEditSysUser(sysUser); @@ -378,7 +379,7 @@ public class SysUserServiceImpl extends ServiceImpl impl // 获取用户基本信息 SysUser sysUser = this.querySysUser(sysUserRequest); - BeanUtil.copyProperties(sysUser, sysUserResponse); + BeanUtil.copyProperties(sysUser, sysUserResponse, CopyOptions.create().ignoreError()); // 获取用户组织绑定信息 SysUserOrgDTO userOrgInfo = sysUserOrgService.getUserOrgByUserId(sysUser.getUserId()); @@ -768,7 +769,7 @@ public class SysUserServiceImpl extends ServiceImpl impl SysUserDTO sysUserDTO = sysUserCacheOperatorApi.get(userIdKey); if (sysUserDTO != null) { SysUser tempUser = new SysUser(); - BeanUtil.copyProperties(sysUserDTO, tempUser); + BeanUtil.copyProperties(sysUserDTO, tempUser, CopyOptions.create().ignoreError()); return tempUser; } @@ -779,7 +780,7 @@ public class SysUserServiceImpl extends ServiceImpl impl // 放入缓存 SysUserDTO sysUserDTOCache = new SysUserDTO(); - BeanUtil.copyProperties(sysUser, sysUserDTOCache); + BeanUtil.copyProperties(sysUser, sysUserDTOCache, CopyOptions.create().ignoreError()); sysUserCacheOperatorApi.put(userIdKey, sysUserDTOCache); return sysUser;