diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java index 10f9825..d421e51 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java @@ -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); + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java index 210478f..5dcac28 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java @@ -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; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java index f16e421..1268dd4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java @@ -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 organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java index 666b2c0..a72be64 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java @@ -270,4 +270,7 @@ public class ProjectDTO implements Serializable { @ApiModelProperty("动态表单 json") private Map dynamicForm; + @ApiModelProperty("项目发起人") + private String sponsor; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index 121ac74..fa1ee60 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index a15c074..945a229 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -277,6 +277,9 @@ public class ProjectDetailVO { @ApiModelProperty("年度投资金额详情") private List annualAccumulateAmountList; + @ApiModelProperty("项目发起人") + private String sponsor; + private String projectTypeName; public String getProjectTypeName() { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java index 0dea701..57b0afd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java @@ -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 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 roleList = new ArrayList<>(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java index fcee3b0..73fbe30 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java @@ -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 resUserInfoListVOList = new ArrayList<>(); if (records != null && records.size() > 0) { + List employeeCodeList = records.stream().map(DingEmployeeInfo::getEmployeeCode) + .distinct().collect(Collectors.toList()); + + Map 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 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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java index a16ee03..8b189ca 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java @@ -41,7 +41,7 @@ public class ResUserInfoListVO { private List userRoleList; @ApiModelProperty("状态") - private Boolean status; + private String status; @ApiModelProperty("更新时间") private LocalDateTime updateTime;