Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
CMM 1 year ago
parent
commit
73faa69d94
11 changed files with 94 additions and 20 deletions
  1. +14
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertReviewController.java
  2. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  3. +22
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java
  4. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertReviewDetailVO.java
  5. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java
  6. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  7. +13
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java
  8. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java
  9. +6
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  10. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  11. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java

+ 14
- 5
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertReviewController.java View File

@@ -48,17 +48,26 @@ public class ExpertReviewController {
return expertReviewManage.getExpertReviewDetail(userId, projectId);
}

@GetMapping("/listForGroupLeader/{projectId}/{meetingId}/{userId}")
@GetMapping("/listForGroupLeader/{projectId}/{meetingId}")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "专家ID"),
@ApiImplicitParam(name = "projectId", value = "项目ID"),
@ApiImplicitParam(name = "meetingId", value = "会议ID")
})
@ApiOperation("查看组员评审意见")
public List<ExpertReviewDetailVO> listForGroupLeader(@PathVariable Long userId,
@PathVariable Long meetingId,
public List<ExpertReviewDetailVO> listForGroupLeader(@PathVariable Long meetingId,
@PathVariable Long projectId) {
return expertReviewManage.listForGroupLeader(projectId, meetingId, userId);
return expertReviewManage.listReviews(projectId, meetingId, true);
}

@GetMapping("/list/{projectId}/{meetingId}")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectId", value = "项目ID"),
@ApiImplicitParam(name = "meetingId", value = "会议ID")
})
@ApiOperation("查看项目某次会议的所有评审意见")
public List<ExpertReviewDetailVO> list(@PathVariable Long meetingId,
@PathVariable Long projectId) {
return expertReviewManage.listReviews(projectId, meetingId, false);
}

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.expert.manage;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
@@ -23,8 +24,13 @@ import com.ningdatech.pmapi.expert.service.ExpertInfoService;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import com.ningdatech.pmapi.sys.model.entity.Role;
import com.ningdatech.pmapi.sys.model.entity.UserRole;
import com.ningdatech.pmapi.sys.service.IRoleService;
import com.ningdatech.pmapi.sys.service.IUserRoleService;
import com.ningdatech.pmapi.user.constant.UserAvailableEnum;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
@@ -55,6 +61,8 @@ public class ExpertManage {
private final ExpertUserInfoAssembler expertUserInfoAssembler;
private final IUserInfoService iUserInfoService;
private final ExpertMetaApplyManage expertMetaApplyManage;
private final IUserRoleService iUserRoleService;
private final IRoleService iRoleService;


/**
@@ -108,6 +116,19 @@ public class ExpertManage {
applyResult.setAuditOpinion("同意");
applyResult.setApplyResult(true);
expertMetaApplyManage.metaApplyResult(applyResult);

// 增加用户专家角色
Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name()));
UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class)
.eq(UserRole::getRoleId, expertRole.getId()).eq(UserRole::getUserId,userId));
if (Objects.isNull(expertUserRole)) {
expertUserRole = new UserRole();
expertUserRole.setUserId(userId);
expertUserRole.setRoleId(expertRole.getId());
expertUserRole.setCreateBy(-1L);
expertUserRole.setCreateOn(LocalDateTime.now());
iUserRoleService.save(expertUserRole);
}
}




+ 22
- 4
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java View File

@@ -6,18 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.cache.lock.DistributedLock;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO;
import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq;
import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO;
import com.ningdatech.pmapi.expert.service.IExpertReviewService;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.AGREED;

@@ -36,6 +40,7 @@ public class ExpertReviewManage {
private final IExpertReviewService expertReviewService;
private final DistributedLock distributedLock;
private final IMeetingExpertService meetingExpertService;
private final FileService fileService;

private static final String EXPERT_REVIEW_KEY = "expert_review:";

@@ -113,14 +118,27 @@ public class ExpertReviewManage {
return buildExpertReviewDetail(reviews.get(0));
}

public List<ExpertReviewDetailVO> listForGroupLeader(Long projectId, Long meetingId, Long userId) {
public List<ExpertReviewDetailVO> listReviews(Long projectId, Long meetingId, boolean onlyTeamMember) {
LambdaQueryWrapper<ExpertReview> query = Wrappers.lambdaQuery(ExpertReview.class);
query.eq(ExpertReview::getProjectId, projectId);
query.eq(ExpertReview::getMeetingId, meetingId);
query.eq(ExpertReview::getIsFinal, Boolean.FALSE);
query.eq(onlyTeamMember, ExpertReview::getIsFinal, Boolean.FALSE);
query.orderByDesc(ExpertReview::getCreateOn);
List<ExpertReview> reviews = expertReviewService.list(query);
return CollUtils.convert(reviews, this::buildExpertReviewDetail);
if (reviews.isEmpty()) {
return Collections.emptyList();
}
List<Long> attachFileIds = CollUtils.fieldList(reviews, ExpertReview::getAttachFileId);
Map<Long, AttachFileVo> fileMap = new HashMap<>(attachFileIds.size());
if (attachFileIds.size() > 0) {
List<AttachFileVo> files = fileService.getByIds(attachFileIds);
files.forEach(w -> fileMap.put(w.getFileId(), w));
}
return CollUtils.convert(reviews, w -> {
ExpertReviewDetailVO reviewDetail = buildExpertReviewDetail(w);
reviewDetail.setAttachFile(fileMap.get(w.getAttachFileId()));
return reviewDetail;
});
}

}

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertReviewDetailVO.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.expert.model.vo;

import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateOptionDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
@@ -40,6 +41,9 @@ public class ExpertReviewDetailVO {
@ApiModelProperty("附件ID")
private Long attachFileId;

@ApiModelProperty("附件详情")
private AttachFileVo attachFile;

@ApiModelProperty("评审结果:1 通过、2 需复核、3 不通过")
private Integer reviewResult;



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingReviewProjectDTO.java View File

@@ -31,4 +31,7 @@ public class MeetingReviewProjectDTO {
@ApiModelProperty("申报单位")
private String buildOrg;

@ApiModelProperty("评审结果")
private String reviewResult;

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -415,6 +415,7 @@ public class MeetingManage {
if (meeting.getIsInnerProject()) {
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId);
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId));
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId);
List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> {
MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO();
mrp.setBuildOrg(w.getBuildOrgName());
@@ -422,6 +423,10 @@ public class MeetingManage {
mrp.setProjectType(w.getProjectType().toString());
mrp.setProjectYear(w.getProjectYear());
mrp.setDeclareAmount(w.getDeclareAmount());
ExpertReview review = reviewMap.get(w.getId());
if (review != null) {
mrp.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue());
}
return mrp;
});
detail.setProjects(convert);


+ 13
- 3
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java View File

@@ -109,16 +109,26 @@ public class OrganizationManage {

public List<KeyTreeVO> treeRubbishVOList(ReqSynthesizePO request) {
String organizationCode = request.getOrganizationCode();
String organizationName = request.getOrganizationName();

List<DingOrganization> dingOrganizationList = new ArrayList<>();
List<String> organizationCodeList = new ArrayList<>();
if (StrUtils.isBlank(organizationCode)) {
if (StringUtils.isNotBlank(organizationName)) {
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.like(DingOrganization::getOrganizationName, organizationName));
if (dingOrganizationList.size() == 0) {
return new ArrayList<>();
}
} else if (StrUtils.isBlank(organizationCode)) {
organizationCodeList = dingOrganizationProperties.getDeptVisibleScopes();
} else {
organizationCodeList = CollectionUtil.toList(organizationCode);
}
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.in(DingOrganization::getOrganizationCode, organizationCodeList));

if (CollectionUtil.isEmpty(dingOrganizationList)) {
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.in(DingOrganization::getOrganizationCode, organizationCodeList));
}

List<KeyTreeVO> orgKeyTreeVOList = dingOrganizationList.stream().map(r -> {
KeyTreeVO keyTreeVO = new KeyTreeVO();


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java View File

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

import javax.validation.constraints.NotBlank;

/**
* @author liuxinxin
* @date 2023/3/28 上午10:11
@@ -20,4 +18,7 @@ public class ReqSynthesizePO {

@ApiModelProperty("是否需要组织成员列表")
private Boolean needMember = false;

@ApiModelProperty("单位名称")
private String organizationName;
}

+ 6
- 5
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -6,6 +6,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import javax.servlet.http.HttpServletResponse;

@@ -181,15 +182,15 @@ public class TodoCenterManage {
List<ProcessTaskVo> todoList = processTaskService.getUserTodoList(req);
//有退回待办的
List<ProcessTaskVo> backList = processTaskService.getBackTodoList(req);
todoList.addAll(backList);
todoList.stream().sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime).reversed());

if (CollUtil.isEmpty(todoList)) {
List<ProcessTaskVo> list = Stream.concat(todoList.stream(),backList.stream()).collect(Collectors.toList());
list.stream().filter(Objects::nonNull).sorted(Comparator.comparing(ProcessTaskVo::getTaskCreateTime).reversed());

if (CollUtil.isEmpty(list)) {
return PageVo.empty();
}

todoList = todoList.stream().filter(Objects::nonNull).collect(Collectors.toList());
List<ProcessTaskVo> userTodoList = todoList.stream()
List<ProcessTaskVo> userTodoList = list.stream()
.skip((long) (pageNumber - 1) * pageSize)
.limit(pageSize)
.collect(Collectors.toList());


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -408,5 +408,4 @@ public class UserInfoManage {
}
return resUserDetailVO;
}

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java View File

@@ -65,6 +65,9 @@ public class UserInfoServiceImpl extends ServiceImpl<NdUserInfoMapper, UserInfo>

@Override
public Map<String, ProcessInstanceUserDto> getUserMapByEmployeeCode(Set<String> staterUsers) {
if(CollUtil.isEmpty(staterUsers)){
return Collections.emptyMap();
}
List<UserInfo> userInfos = userInfoMapper.selectList(Wrappers.lambdaQuery(UserInfo.class)
.in(UserInfo::getEmployeeCode,staterUsers));
if(CollUtil.isEmpty(userInfos)){


Loading…
Cancel
Save