| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | private SysParamsService paramsService; |
| | | @Autowired |
| | | SysMapService sysMapService; |
| | | @Autowired |
| | | private ISysOssConfigService sysOssConfigService; |
| | | |
| | | |
| | | |
| | | public List<SysUser> page(QueryFilter queryFilter) { |
| | |
| | | |
| | | 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()); |
| | |
| | | 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); |
| | | |
| | | // 保存岗位用户关系 |
| | |
| | | return num; |
| | | } |
| | | |
| | | public List<SysUser> getUsersList() { |
| | | return baseDao.getUsersList(); |
| | | public List<SysUser> getUsersList(String type, String deptId) { |
| | | List<SysUser> list = baseDao.getUsersList(type,deptId); |
| | | return list; |
| | | } |
| | | |
| | | public String getUsersName(String id) { |
| | | return baseDao.getUsersName(id); |
| | | } |
| | | |
| | | public String getNames(String ids) { |
| | | String[] NamesData = ids.split(","); |
| | | List<String> nameList =new ArrayList<>(); |
| | | for (String item : NamesData) { |
| | | nameList.add(this.getUsersName(item)); |
| | | } |
| | | String names = String.join(", ", nameList); |
| | | return names; |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |