From 547d68b874dc4bb51d6ac39cc0fec2c227028ef0 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期四, 07 十二月 2023 09:08:28 +0800
Subject: [PATCH] 修改

---
 zt/core/src/main/java/com/zt/modules/sys/service/SysUserService.java |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 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 3052e84..9149cc0 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;
 
@@ -60,6 +64,9 @@
     private SysParamsService paramsService;
     @Autowired
     SysMapService sysMapService;
+    @Autowired
+    private ISysOssConfigService sysOssConfigService;
+
 
 
     public List<SysUser> page(QueryFilter queryFilter) {
@@ -159,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());
@@ -171,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);
 
         // 淇濆瓨宀椾綅鐢ㄦ埛鍏崇郴
@@ -323,4 +334,25 @@
     public List<SysUser> getUsersList() {
         return baseDao.getUsersList();
     }
+
+    public String getUsersName(Long id) {
+        return baseDao.getUsersName(id);
+    }
+
+    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