CMM 1 year ago
parent
commit
7fbf615d4a
9 changed files with 53 additions and 20 deletions
  1. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java
  2. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java
  3. +0
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  5. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  6. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  7. +7
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java
  8. +27
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.common.helper;

import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import org.springframework.stereotype.Component;

/**
@@ -19,4 +20,6 @@ public interface UserInfoHelper {
*/
String getOrganizationCode(Long userId);

UserFullInfoDTO getUserFullInfo(Long userId);

}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java View File

@@ -24,4 +24,10 @@ public class UserInfoHelperImpl implements UserInfoHelper {

return userFullInfo.getOrganizationCode();
}

@Override
public UserFullInfoDTO getUserFullInfo(Long userId) {
UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId);
return userFullInfo;
}
}

+ 0
- 7
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java View File

@@ -9,7 +9,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -37,12 +36,6 @@ public class DingOrganizationController {

private final OrganizationManage organizationManage;

@ApiModelProperty("单位成员配置")
@PostMapping("/member/config")
public void organizationManage() {

}

@ApiModelProperty("单位列表筛选")
@PostMapping("/list")
public PageVo<ResOrganizationListVO> organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) {


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java View File

@@ -270,4 +270,7 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("动态表单 json")
private Map<String,Object> dynamicForm;

@ApiModelProperty("项目发起人")
private String sponsor;

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java View File

@@ -285,6 +285,9 @@ public class Project implements Serializable {
@ApiModelProperty("动态表单 json")
private String dynamicForm;

@ApiModelProperty("项目发起人")
private String sponsor;

@TableField(fill = FieldFill.INSERT)
private Long createBy;



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java View File

@@ -277,6 +277,9 @@ public class ProjectDetailVO {
@ApiModelProperty("年度投资金额详情")
private List<AnnualAmountVO> annualAccumulateAmountList;

@ApiModelProperty("项目发起人")
private String sponsor;

private String projectTypeName;

public String getProjectTypeName() {


+ 7
- 6
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java View File

@@ -65,7 +65,7 @@ public class UserAuthLoginManage {
*/
public UserFullInfoDTO queryUserInfoInPasswordAuth(String username) {
// TODO 目前账号密码登陆测试使用 强制用户登录 userId 1L
UserInfo userInfo = iUserInfoService.getById(1627599956383571969L);
UserInfo userInfo = iUserInfoService.getById(2L);
if (Objects.isNull(userInfo)) {
return null;
}
@@ -128,11 +128,12 @@ public class UserAuthLoginManage {
List<DingOrganization> dingOrganizationList = iDingOrganizationService
.list(Wrappers.lambdaQuery(DingOrganization.class)
.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<>();


+ 27
- 6
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -29,9 +29,8 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

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;

/**
@@ -58,6 +57,18 @@ public class UserInfoManage {
long total = page.getTotal();
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>();
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()
.map(r -> {
ResUserInfoListVO resListVO = new ResUserInfoListVO();
@@ -65,13 +76,23 @@ public class UserInfoManage {
resListVO.setOrgName(r.getOrganizationCode());
resListVO.setOrgCode(r.getOrganizationCode());
// TODO 从用户信息中获取
// resListVO.setPhoneNo();
// 从所属组织中获取
// 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.setUserId(1L);
resListVO.setEmployeeCode(r.getEmployeeCode());
resListVO.setUserRoleList(new ArrayList<>());
return resListVO;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java View File

@@ -41,7 +41,7 @@ public class ResUserInfoListVO {
private List<Role> userRoleList;

@ApiModelProperty("状态")
private Boolean status;
private String status;

@ApiModelProperty("更新时间")
private LocalDateTime updateTime;


Loading…
Cancel
Save