From da4cb0bcbb9c35105afe449b31b3e2b03828d5d2 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期三, 06 十二月 2023 11:32:29 +0800 Subject: [PATCH] 6 --- zt/core/src/main/java/com/zt/modules/sys/service/SysUserService.java | 41 +++++++++++++++++++++++++++++++++++------ 1 files changed, 35 insertions(+), 6 deletions(-) diff --git a/zt/core/src/main/java/com/zt/modules/sys/service/SysUserService.java b/zt/core/src/main/java/com/zt/modules/sys/service/SysUserService.java index e3de51f..f97e69e 100644 --- a/zt/core/src/main/java/com/zt/modules/sys/service/SysUserService.java +++ b/zt/core/src/main/java/com/zt/modules/sys/service/SysUserService.java @@ -21,11 +21,14 @@ import com.zt.common.utils.TreeUtils; import com.zt.core.context.User; import com.zt.core.context.UserContext; +import com.zt.core.oss.service.ISysOssConfigService; +import com.zt.core.oss.service.ISysOssService; import com.zt.core.security.BCryptPasswordEncoder; import com.zt.core.security.Md5Utils; import com.zt.core.sys.model.SysDept; import com.zt.core.sys.model.SysUser; import com.zt.core.sys.service.ISysUserService; +import com.zt.life.sys.dto.OssDto; import com.zt.modules.sys.dao.SysUserDao; import com.zt.modules.sys.dto.RoleDto; import com.zt.modules.sys.dto.UserTreeDto; @@ -34,6 +37,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -58,9 +62,11 @@ private SysDeptService sysDeptService; @Autowired private SysParamsService paramsService; - @Autowired SysMapService sysMapService; + @Autowired + private ISysOssConfigService sysOssConfigService; + public List<SysUser> page(QueryFilter queryFilter) { @@ -69,7 +75,6 @@ if (!user.isSuperAdmin()) { queryFilter.addParam("deptIds", sysDeptService.getWithDescendantIds(user.getDeptId())); } - // 鏌ヨ return queryFilter.getPageList(baseDao.getList(queryFilter.getParams())); } @@ -80,7 +85,6 @@ if (!user.isSuperAdmin()) { queryFilter.addParam("deptIds", sysDeptService.getWithDescendantIds(user.getDeptId())); } - return baseDao.getList(queryFilter.getParams()); } @@ -123,9 +127,9 @@ @Override @Cacheable(value = Constant.Cache.USER, key = "'id:' + #id") public SysUser get(Long id) { - SysUser entity = baseDao.getEntity(id); - return entity; - //return super.get(id); +/* SysUser entity = baseDao.getEntity(id); + return entity;*/ + return super.get(id); } /** @@ -162,6 +166,8 @@ entity.setCompanyId(sysDeptService.getCompanyIdByDeptId(entity.getDeptId())); // 淇濆瓨鐢ㄦ埛 + sysOssConfigService.updateOss(entity.getId(), entity.getFiles()); + sysOssConfigService.updateOss(entity.getId(), entity.getFiles2()); super.insert(entity); sysPostUserService.saveOrUpdate(entity.getId(), entity.getPostIdList()); @@ -174,6 +180,8 @@ public void update(SysUser entity) { // 鏇存柊鐢ㄦ埛 entity.setCompanyId(sysDeptService.getCompanyIdByDeptId(entity.getDeptId())); + sysOssConfigService.updateOss(entity.getId(), entity.getFiles()); + sysOssConfigService.updateOss(entity.getId(), entity.getFiles2()); super.update(entity); // 淇濆瓨宀椾綅鐢ㄦ埛鍏崇郴 @@ -326,4 +334,25 @@ public List<SysUser> getUsersList() { return baseDao.getUsersList(); } + + public String getUsersName(Long id) { + return baseDao.getUsersName(); + } + + public SysUser getUserInfo(Long id) { + SysUser data = super.get(id); + if (data != null) { + OssDto ossDto= sysOssConfigService.getOssByBusiType(data.getId() , "users_avatar"); + if (ossDto != null) { + data.setFiles(ossDto); + } + OssDto ossDto2= sysOssConfigService.getOssByBusiType(data.getId() , "users_sign"); + if (ossDto2 != null) { + data.setFiles2(ossDto2); + } + } + return data; + } + + } -- Gitblit v1.9.1