@@ -1,5 +1,6 @@ | |||||
package com.ningdatech.pmapi.common.helper; | package com.ningdatech.pmapi.common.helper; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
/** | /** | ||||
@@ -19,4 +20,6 @@ public interface UserInfoHelper { | |||||
*/ | */ | ||||
String getOrganizationCode(Long userId); | String getOrganizationCode(Long userId); | ||||
UserFullInfoDTO getUserFullInfo(Long userId); | |||||
} | } |
@@ -24,4 +24,10 @@ public class UserInfoHelperImpl implements UserInfoHelper { | |||||
return userFullInfo.getOrganizationCode(); | return userFullInfo.getOrganizationCode(); | ||||
} | } | ||||
@Override | |||||
public UserFullInfoDTO getUserFullInfo(Long userId) { | |||||
UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); | |||||
return userFullInfo; | |||||
} | |||||
} | } |
@@ -9,7 +9,6 @@ import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.stereotype.Controller; | |||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||
import org.springframework.web.bind.annotation.RequestBody; | import org.springframework.web.bind.annotation.RequestBody; | ||||
@@ -37,12 +36,6 @@ public class DingOrganizationController { | |||||
private final OrganizationManage organizationManage; | private final OrganizationManage organizationManage; | ||||
@ApiModelProperty("单位成员配置") | |||||
@PostMapping("/member/config") | |||||
public void organizationManage() { | |||||
} | |||||
@ApiModelProperty("单位列表筛选") | @ApiModelProperty("单位列表筛选") | ||||
@PostMapping("/list") | @PostMapping("/list") | ||||
public PageVo<ResOrganizationListVO> organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) { | public PageVo<ResOrganizationListVO> organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) { | ||||
@@ -270,4 +270,7 @@ public class ProjectDTO implements Serializable { | |||||
@ApiModelProperty("动态表单 json") | @ApiModelProperty("动态表单 json") | ||||
private Map<String,Object> dynamicForm; | private Map<String,Object> dynamicForm; | ||||
@ApiModelProperty("项目发起人") | |||||
private String sponsor; | |||||
} | } |
@@ -285,6 +285,9 @@ public class Project implements Serializable { | |||||
@ApiModelProperty("动态表单 json") | @ApiModelProperty("动态表单 json") | ||||
private String dynamicForm; | private String dynamicForm; | ||||
@ApiModelProperty("项目发起人") | |||||
private String sponsor; | |||||
@TableField(fill = FieldFill.INSERT) | @TableField(fill = FieldFill.INSERT) | ||||
private Long createBy; | private Long createBy; | ||||
@@ -277,6 +277,9 @@ public class ProjectDetailVO { | |||||
@ApiModelProperty("年度投资金额详情") | @ApiModelProperty("年度投资金额详情") | ||||
private List<AnnualAmountVO> annualAccumulateAmountList; | private List<AnnualAmountVO> annualAccumulateAmountList; | ||||
@ApiModelProperty("项目发起人") | |||||
private String sponsor; | |||||
private String projectTypeName; | private String projectTypeName; | ||||
public String getProjectTypeName() { | public String getProjectTypeName() { | ||||
@@ -65,7 +65,7 @@ public class UserAuthLoginManage { | |||||
*/ | */ | ||||
public UserFullInfoDTO queryUserInfoInPasswordAuth(String username) { | public UserFullInfoDTO queryUserInfoInPasswordAuth(String username) { | ||||
// TODO 目前账号密码登陆测试使用 强制用户登录 userId 1L | // TODO 目前账号密码登陆测试使用 强制用户登录 userId 1L | ||||
UserInfo userInfo = iUserInfoService.getById(1627599956383571969L); | |||||
UserInfo userInfo = iUserInfoService.getById(2L); | |||||
if (Objects.isNull(userInfo)) { | if (Objects.isNull(userInfo)) { | ||||
return null; | return null; | ||||
} | } | ||||
@@ -128,11 +128,12 @@ public class UserAuthLoginManage { | |||||
List<DingOrganization> dingOrganizationList = iDingOrganizationService | List<DingOrganization> dingOrganizationList = iDingOrganizationService | ||||
.list(Wrappers.lambdaQuery(DingOrganization.class) | .list(Wrappers.lambdaQuery(DingOrganization.class) | ||||
.eq(DingOrganization::getOrganizationCode, organizationCode)); | .eq(DingOrganization::getOrganizationCode, organizationCode)); | ||||
DingOrganization dingOrganization = dingOrganizationList.get(0); | |||||
userFullInfoDTO.setOrganizationCode(dingOrganization.getOrganizationCode()); | |||||
userFullInfoDTO.setOrganizationName(dingOrganization.getOrganizationName()); | |||||
userFullInfoDTO.setRegionCode(dingOrganization.getDivisionCode()); | |||||
if (CollectionUtil.isNotEmpty(dingOrganizationList)){ | |||||
DingOrganization dingOrganization = dingOrganizationList.get(0); | |||||
userFullInfoDTO.setOrganizationCode(dingOrganization.getOrganizationCode()); | |||||
userFullInfoDTO.setOrganizationName(dingOrganization.getOrganizationName()); | |||||
userFullInfoDTO.setRegionCode(dingOrganization.getDivisionCode()); | |||||
} | |||||
} | } | ||||
List<Role> roleList = new ArrayList<>(); | List<Role> roleList = new ArrayList<>(); | ||||
@@ -29,9 +29,8 @@ import org.springframework.stereotype.Component; | |||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.Objects; | |||||
import java.util.*; | |||||
import java.util.function.Function; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@@ -58,6 +57,18 @@ public class UserInfoManage { | |||||
long total = page.getTotal(); | long total = page.getTotal(); | ||||
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>(); | List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>(); | ||||
if (records != null && records.size() > 0) { | if (records != null && records.size() > 0) { | ||||
List<String> employeeCodeList = records.stream().map(DingEmployeeInfo::getEmployeeCode) | |||||
.distinct().collect(Collectors.toList()); | |||||
Map<String, UserInfo> employeeCodeAvailableMap = new HashMap<>(); | |||||
if (CollUtil.isNotEmpty(employeeCodeList)) { | |||||
employeeCodeAvailableMap = iUserInfoService.list(Wrappers.lambdaQuery(UserInfo.class) | |||||
.in(UserInfo::getEmployeeCode,employeeCodeList)) | |||||
.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode, Function.identity())); | |||||
} | |||||
Map<String, UserInfo> finalEmployeeCodeAvailableMap = employeeCodeAvailableMap; | |||||
resUserInfoListVOList = records.stream() | resUserInfoListVOList = records.stream() | ||||
.map(r -> { | .map(r -> { | ||||
ResUserInfoListVO resListVO = new ResUserInfoListVO(); | ResUserInfoListVO resListVO = new ResUserInfoListVO(); | ||||
@@ -65,13 +76,23 @@ public class UserInfoManage { | |||||
resListVO.setOrgName(r.getOrganizationCode()); | resListVO.setOrgName(r.getOrganizationCode()); | ||||
resListVO.setOrgCode(r.getOrganizationCode()); | resListVO.setOrgCode(r.getOrganizationCode()); | ||||
// TODO 从用户信息中获取 | // TODO 从用户信息中获取 | ||||
// resListVO.setPhoneNo(); | |||||
// 从所属组织中获取 | // 从所属组织中获取 | ||||
// resListVO.setRegionId(); | // resListVO.setRegionId(); | ||||
resListVO.setStatus(false); | |||||
UserInfo userInfo = finalEmployeeCodeAvailableMap.get(r.getEmployeeCode()); | |||||
if (Objects.nonNull(userInfo)) { | |||||
resListVO.setPhoneNo(userInfo.getMobile()); | |||||
if (StringUtils.isNotBlank(userInfo.getAvailable()) | |||||
&& UserAvailableEnum.ENABLE.name().equals(userInfo.getAvailable())) { | |||||
resListVO.setStatus(UserAvailableEnum.ENABLE.name()); | |||||
} | |||||
resListVO.setUserId(userInfo.getId()); | |||||
} else { | |||||
resListVO.setStatus(UserAvailableEnum.DISABLE.name()); | |||||
} | |||||
resListVO.setUpdateTime(r.getUpdateOn()); | resListVO.setUpdateTime(r.getUpdateOn()); | ||||
// 从用户信息中获取 | // 从用户信息中获取 | ||||
resListVO.setUserId(1L); | |||||
resListVO.setEmployeeCode(r.getEmployeeCode()); | resListVO.setEmployeeCode(r.getEmployeeCode()); | ||||
resListVO.setUserRoleList(new ArrayList<>()); | resListVO.setUserRoleList(new ArrayList<>()); | ||||
return resListVO; | return resListVO; | ||||
@@ -41,7 +41,7 @@ public class ResUserInfoListVO { | |||||
private List<Role> userRoleList; | private List<Role> userRoleList; | ||||
@ApiModelProperty("状态") | @ApiModelProperty("状态") | ||||
private Boolean status; | |||||
private String status; | |||||
@ApiModelProperty("更新时间") | @ApiModelProperty("更新时间") | ||||
private LocalDateTime updateTime; | private LocalDateTime updateTime; | ||||