Browse Source

修复待评审项目列表

tags/24080901
WendyYang 1 year ago
parent
commit
9e1ba38d44
4 changed files with 58 additions and 43 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml
  2. +8
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserRole.java
  3. +44
    -39
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  4. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/UserRoleVO.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml View File

@@ -102,7 +102,7 @@
from nd_project np inner join meeting_inner_project mip on mip.project_id = np.id
inner join meeting m on m.id = mip.meeting_id
inner join meeting_expert me on m.id = me.meeting_id
where m.is_inner_project = true
where m.is_inner_project = true and m.status != 3 and me.status = 3
<if test="p.reviewed != null">
and if(me.is_headman,<include refid="reviewedByHeadman"/>,<include refid="reviewedByNotHeadman"/>)
</if>


+ 8
- 3
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserRole.java View File

@@ -1,13 +1,12 @@
package com.ningdatech.pmapi.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* <p>
@@ -33,4 +32,10 @@ public class UserRole implements Serializable {
@ApiModelProperty("角色 ID")
private Long roleId;

@TableField(fill = FieldFill.INSERT)
private LocalDateTime createOn;

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

}

+ 44
- 39
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -83,59 +83,63 @@ public class UserInfoManage {
Page<DingEmployeeInfo> page = iDingEmployeeInfoService.page(new Page<>(reqUserInfoListPO.getPageNumber(), reqUserInfoListPO.getPageSize()), wrapper);
List<DingEmployeeInfo> records = page.getRecords();
long total = page.getTotal();
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>();
List<ResUserInfoListVO> result = 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<>();
Map<String, UserInfo> employeeCodeAvailableMap = new HashMap<>(16);
if (CollUtil.isNotEmpty(employeeCodeList)) {
employeeCodeAvailableMap = iUserInfoService.list(Wrappers.lambdaQuery(UserInfo.class)
.in(UserInfo::getEmployeeCode, employeeCodeList))
.in(UserInfo::getEmployeeCode, employeeCodeList))
.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode, Function.identity()));
}
List<String> orgCodeList = records.stream()
.filter(r -> StringUtils.isNotBlank(r.getOrganizationCode()))
.map(DingEmployeeInfo::getOrganizationCode).distinct()
.map(DingEmployeeInfo::getOrganizationCode)
.filter(StringUtils::isNotBlank).distinct()
.collect(Collectors.toList());
Map<String, DingOrganization> orgMap = iDingOrganizationService.getOrgMap(orgCodeList);

Map<String, UserInfo> finalEmployeeCodeAvailableMap = employeeCodeAvailableMap;
resUserInfoListVOList = records.stream()
.map(r -> {
ResUserInfoListVO resListVO = new ResUserInfoListVO();
resListVO.setName(r.getEmployeeName());
String organizationCode = r.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && orgMap.containsKey(organizationCode)) {
resListVO.setOrgName(orgMap.get(organizationCode).getOrganizationName());
resListVO.setOrgCode(organizationCode);
String regionCode = orgMap.get(organizationCode).getDivisionCode();
resListVO.setRegionCode(regionCode);
if (Objects.nonNull(regionCode)) {
resListVO.setRegionName(regionCacheHelper.getDisplayName(regionCode, RegionConst.RL_COUNTY));
}
}
// TODO 从用户信息中获取
// 从所属组织中获取
// resListVO.setRegionId();
UserInfo userInfo = finalEmployeeCodeAvailableMap.get(r.getEmployeeCode());
// 装配用户状态 及 userId
userStatusAssembler(resListVO, userInfo);

if (Objects.isNull(userInfo)) {
resListVO.setUpdateTime(r.getUpdateOn());
} else {
resListVO.setUpdateTime(userInfo.getUpdateOn());
}
// 从用户信息中获取
resListVO.setEmployeeCode(r.getEmployeeCode());
resListVO.setUserRoleList(getUserRoleVOList(resListVO.getUserId()));
return resListVO;
}).collect(Collectors.toList());
records.forEach(r -> {
ResUserInfoListVO resListVO = new ResUserInfoListVO();
resListVO.setName(r.getEmployeeName());
String organizationCode = r.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && orgMap.containsKey(organizationCode)) {
resListVO.setOrgName(orgMap.get(organizationCode).getOrganizationName());
resListVO.setOrgCode(organizationCode);
String regionCode = orgMap.get(organizationCode).getDivisionCode();
resListVO.setRegionCode(regionCode);
if (Objects.nonNull(regionCode)) {
resListVO.setRegionName(regionCacheHelper.getDisplayName(regionCode, RegionConst.RL_COUNTY));
}
}
// TODO 从用户信息中获取
// 从所属组织中获取
// resListVO.setRegionId();
UserInfo userInfo = finalEmployeeCodeAvailableMap.get(r.getEmployeeCode());
// 装配用户状态 及 userId
userStatusAssembler(resListVO, userInfo);

if (Objects.isNull(userInfo)) {
resListVO.setUpdateTime(r.getUpdateOn());
} else {
resListVO.setUpdateTime(userInfo.getUpdateOn());
}
// 从用户信息中获取
resListVO.setEmployeeCode(r.getEmployeeCode());
List<UserRoleVO> userRoles = getUserRoleVOList(resListVO.getUserId());
resListVO.setUserRoleList(userRoles);
LocalDateTime roleModifyTime;
if ((roleModifyTime = userRoles.get(userRoles.size() - 1).getCreateOn()).isAfter(resListVO.getUpdateTime())
&& CollUtil.isNotEmpty(userRoles)) {
resListVO.setUpdateTime(roleModifyTime);
}
result.add(resListVO);
});
}

pageVo.setTotal(total);
pageVo.setRecords(resUserInfoListVOList);
pageVo.setRecords(result);
return pageVo;
}

@@ -172,7 +176,7 @@ public class UserInfoManage {

// TODO 这里过滤的非浙政钉用户的专家 后续需要增加补充逻辑
return iUserInfoService.list(Wrappers.lambdaQuery(UserInfo.class)
.in(UserInfo::getId, compliantUserIdList))
.in(UserInfo::getId, compliantUserIdList))
.stream().filter(r -> StringUtils.isNotBlank(r.getEmployeeCode()))
.map(UserInfo::getEmployeeCode).collect(Collectors.toList());

@@ -214,6 +218,7 @@ public class UserInfoManage {
UserRoleVO userRoleVO = new UserRoleVO();
userRoleVO.setId(r.getId());
userRoleVO.setName(r.getName());
userRoleVO.setCreateOn(r.getCreateOn());
return userRoleVO;
}).collect(Collectors.toList());
}


+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/UserRoleVO.java View File

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
* @author liuxinxin
* @date 2023/2/15 下午5:47
@@ -22,4 +24,7 @@ public class UserRoleVO {

@ApiModelProperty(value = "角色code")
private String code;

private transient LocalDateTime createOn;

}

Loading…
Cancel
Save