|
@@ -2,6 +2,7 @@ package org.springblade.business.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -10,15 +11,19 @@ import lombok.AllArgsConstructor;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springblade.business.entity.DefaultProject;
|
|
import org.springblade.business.entity.DefaultProject;
|
|
import org.springblade.business.service.IDefaultProjectService;
|
|
import org.springblade.business.service.IDefaultProjectService;
|
|
|
|
+import org.springblade.business.vo.UserVO;
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
import org.springblade.manager.entity.ProjectInfo;
|
|
import org.springblade.manager.entity.ProjectInfo;
|
|
|
|
+import org.springblade.manager.entity.SignPfxFile;
|
|
import org.springblade.manager.feign.ContractClient;
|
|
import org.springblade.manager.feign.ContractClient;
|
|
import org.springblade.manager.feign.ProjectAssignmentUserClient;
|
|
import org.springblade.manager.feign.ProjectAssignmentUserClient;
|
|
import org.springblade.manager.feign.ProjectClient;
|
|
import org.springblade.manager.feign.ProjectClient;
|
|
|
|
+import org.springblade.manager.feign.SignPfxClient;
|
|
import org.springblade.manager.vo.ContractInfoVO;
|
|
import org.springblade.manager.vo.ContractInfoVO;
|
|
import org.springblade.manager.vo.ProjectInfoVO;
|
|
import org.springblade.manager.vo.ProjectInfoVO;
|
|
import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.feign.ISysClient;
|
|
@@ -51,13 +56,15 @@ public class UserViewProjectContractController {
|
|
|
|
|
|
private final ISysClient sysClient;
|
|
private final ISysClient sysClient;
|
|
|
|
|
|
|
|
+ private final SignPfxClient signPfxClient;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取用户信息
|
|
* 获取用户信息
|
|
*/
|
|
*/
|
|
@PostMapping("/queryCurrentUserData")
|
|
@PostMapping("/queryCurrentUserData")
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperation(value = "获取用户信息")
|
|
@ApiOperation(value = "获取用户信息")
|
|
- public R<User> queryCurrentUserData(){
|
|
|
|
|
|
+ public R<UserVO> queryCurrentUserData(){
|
|
User user = this.userClient.userInfoById(AuthUtil.getUserId()).getData();
|
|
User user = this.userClient.userInfoById(AuthUtil.getUserId()).getData();
|
|
if(user != null){
|
|
if(user != null){
|
|
//获取部门
|
|
//获取部门
|
|
@@ -65,8 +72,25 @@ public class UserViewProjectContractController {
|
|
if(deptNames != null && deptNames.size() > 0){
|
|
if(deptNames != null && deptNames.size() > 0){
|
|
user.setDeptId(String.join(",", deptNames));
|
|
user.setDeptId(String.join(",", deptNames));
|
|
}
|
|
}
|
|
|
|
+ //数据对拷
|
|
|
|
+ UserVO userVO = new UserVO();
|
|
|
|
+ BeanUtil.copyProperties(user, userVO);
|
|
|
|
+
|
|
|
|
+ //获取个人签字文件
|
|
|
|
+ List<SignPfxFile> pfxFiles = this.signPfxClient.querySignPfxByUserIdOrContractId(user.getId().toString(), "");
|
|
|
|
+ if(pfxFiles != null && pfxFiles.size() > 0){
|
|
|
|
+ userVO.setSignatureUrl(pfxFiles.get(0).getSignatureFileUrl());
|
|
|
|
+ }
|
|
|
|
+ //获取角色信息
|
|
|
|
+ if(StringUtils.isNotEmpty(userVO.getRoleId())){
|
|
|
|
+ List<String> roleNames = this.sysClient.getRoleNames(userVO.getRoleId()).getData();
|
|
|
|
+ if(roleNames != null && roleNames.size() > 0){
|
|
|
|
+ userVO.setRoleName(String.join(",", roleNames));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return R.data(userVO);
|
|
}
|
|
}
|
|
- return R.data(user);
|
|
|
|
|
|
+ return R.data(300, null, "未找到数据");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|