Преглед на файлове

Merge remote-tracking branch 'origin/master'

master
CMM преди 1 година
родител
ревизия
60615dba49
променени са 47 файла, в които са добавени 1722 реда и са изтрити 12 реда
  1. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  2. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java
  3. +86
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java
  4. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java
  5. +27
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/CodeUtil.java
  6. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java
  7. +73
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java
  8. +72
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java
  9. +485
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java
  10. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.java
  11. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.xml
  12. +17
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.java
  13. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.xml
  14. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.java
  15. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.xml
  16. +17
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.java
  17. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.xml
  18. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalProjectDTO.java
  19. +71
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java
  20. +66
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java
  21. +43
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalProjectGroupSaveDTO.java
  22. +58
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java
  23. +40
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java
  24. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java
  25. +49
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java
  26. +27
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java
  27. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java
  28. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectGroupVO.java
  29. +51
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java
  30. +60
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java
  31. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalApplicationService.java
  32. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectGroupService.java
  33. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectService.java
  34. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalService.java
  35. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalApplicationServiceImpl.java
  36. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectGroupServiceImpl.java
  37. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectServiceImpl.java
  38. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalServiceImpl.java
  39. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  40. +40
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  41. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java
  42. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java
  43. +32
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApplicationListReq.java
  44. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectApplicationVO.java
  45. +0
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java
  46. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java
  47. +9
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java Целия файл

@@ -28,7 +28,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
"com.ningdatech.pmapi.sms.controller",
"com.ningdatech.pmapi.workbench.controller",
"com.ningdatech.pmapi.ding.controller",
"com.ningdatech.pmapi.filemanage.controller"
"com.ningdatech.pmapi.filemanage.controller",
"com.ningdatech.pmapi.performance.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {



+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java Целия файл

@@ -3,6 +3,9 @@ package com.ningdatech.pmapi.common.helper;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;

import java.util.Collection;
import java.util.List;

/**
* @author liuxinxin
* @date 2023/2/10 下午4:38
@@ -23,6 +26,8 @@ public interface UserInfoHelper {

UserFullInfoDTO getUserFullInfo(UserInfo userInfo);

List<UserFullInfoDTO> getUserFullInfos(List<UserInfo> userInfos);

String getUserName(Long userId);

/**
@@ -34,6 +39,8 @@ public interface UserInfoHelper {

UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode);

List<UserFullInfoDTO> getUserFullInfoByEmployeeCodes(Collection<String> employeeCodes);

/**
* 获取用户任职所在单位code
*


+ 86
- 3
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java Целия файл

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
@@ -21,10 +22,9 @@ import com.ningdatech.pmapi.user.service.IUserInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* @author liuxinxin
@@ -127,6 +127,83 @@ public class UserInfoHelperImpl implements UserInfoHelper {
return userFullInfo;
}

/**
* 批量查询 这里 会没有角色
* @param userInfos
* @return
*/
@Override
public List<UserFullInfoDTO> getUserFullInfos(List<UserInfo> userInfos) {
List<UserFullInfoDTO> res = Lists.newArrayList();

if(CollUtil.isEmpty(userInfos)){
return res;
}

Map<String,UserInfo> userMap = userInfos.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode,e->e));

// 获取浙政钉雇员信息 组织信息
List<String> employeeCodes = userInfos.stream().map(UserInfo::getEmployeeCode).collect(Collectors.toList());
if (CollUtil.isNotEmpty(employeeCodes)) {
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService
.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.in(DingEmployeeInfo::getEmployeeCode, employeeCodes)
.eq(DingEmployeeInfo::getMainJob, "true"));

if(CollUtil.isEmpty(dingEmployeeInfoList)){
return res;
}

// 装配用户任职所在单位
List<String> empPosUnitCodes = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getEmpPosUnitCode).collect(Collectors.toList());
List<String> orgCodes = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getOrganizationCode).collect(Collectors.toList());
List<String> allOrgCodes = Stream.concat(empPosUnitCodes.stream(),orgCodes.stream()).collect(Collectors.toList());
if (CollUtil.isEmpty(allOrgCodes)) {
return res;
}
List<DingOrganization> dingOrganizations = iDingOrganizationService.listByCodes(allOrgCodes);
if (CollUtil.isEmpty(dingOrganizations)) {
return res;
}
Map<String,DingOrganization> orgMap = dingOrganizations.stream().collect(Collectors.toMap(DingOrganization::getOrganizationCode,d -> d));

res = dingEmployeeInfoList.stream().map(e -> {
UserFullInfoDTO userFullInfo = new UserFullInfoDTO();
if(orgMap.containsKey(e.getEmpPosUnitCode())){
DingOrganization organization = orgMap.get(e.getEmpPosUnitCode());
userFullInfo.setEmpPosUnitCode(e.getEmpPosUnitCode());
userFullInfo.setEmpPosUnitName(organization.getOrganizationName());
userFullInfo.setRegionCode(organization.getDivisionCode());
}
if(orgMap.containsKey(e.getOrganizationCode())){
DingOrganization organization = orgMap.get(e.getOrganizationCode());
userFullInfo.setOrganizationCode(organization.getOrganizationCode());
userFullInfo.setOrganizationName(organization.getOrganizationName());
// 测试使用
userFullInfo.setRegionLevel(3);
}

if(userMap.containsKey(e.getEmployeeCode())){
UserInfo userInfo = userMap.get(e.getEmployeeCode());
// 装配返回
userFullInfo.setUserId(userInfo.getId());
userFullInfo.setIdentifier(userInfo.getRealName());
userFullInfo.setRealName(userInfo.getRealName());
userFullInfo.setEmployeeCode(e.getEmployeeCode());
userFullInfo.setUsername(userInfo.getRealName());
userFullInfo.setMobile(userInfo.getMobile());
userFullInfo.setAccountId(userInfo.getAccountId());
String available = userInfo.getAvailable();
if (StringUtils.isNotBlank(available)) {
userFullInfo.setAvailable(UserAvailableEnum.valueOf(available));
}
}
return userFullInfo;
}).collect(Collectors.toList());
}
return res;
}

@Override
public String getUserName(Long userId) {
UserFullInfoDTO userFullInfo = getUserFullInfo(userId);
@@ -154,6 +231,12 @@ public class UserInfoHelperImpl implements UserInfoHelper {
}

@Override
public List<UserFullInfoDTO> getUserFullInfoByEmployeeCodes(Collection<String> employeeCodes) {
List<UserInfo> userInfos = userInfoService.getUserInfoByEmployeeCodes(employeeCodes);
return getUserFullInfos(userInfos);
}

@Override
public String getUserEmpPosUnitCode(Long userId) {
UserFullInfoDTO userFullInfo = getUserFullInfo(userId);
return userFullInfo.getEmpPosUnitCode();


+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java Целия файл

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.common.util;

import cn.hutool.core.util.StrUtil;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.NumberUtils;

@@ -109,4 +110,10 @@ public class BizUtils {
return strings.stream().map(w -> "'" + w + "'").collect(Collectors.joining(StrPool.COMMA, StrPool.LEFT_BRACKET, StrPool.RIGHT_BRACKET));
}

public static String getProjectTypeName(Integer projectType) {
if (Objects.nonNull(projectType)) {
return ProjectTypeEnum.getDesc(projectType);
}
return StringUtils.EMPTY;
}
}

+ 27
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/util/CodeUtil.java Целия файл

@@ -0,0 +1,27 @@
package com.ningdatech.pmapi.common.util;

import com.ningdatech.basic.util.StrPool;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Collectors;

/**
* @Classname CodeUtil
* @Description
* @Date 2023/6/20 16:06
* @Author PoffyZhang
*/
@Slf4j
public class CodeUtil {

public static Collection<String> convertStrToList(String str) {
if(StringUtils.isBlank(str)){
return Collections.emptyList();
}
return Arrays.stream(str.split(StrPool.COMMA)).collect(Collectors.toList());
}
}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java Целия файл

@@ -122,7 +122,7 @@ public class ProjectFileManage {
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class)
.like(StringUtils.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName())
.like(StringUtils.isNotBlank(param.getBuildOrgName()), Project::getBuildOrgName, param.getBuildOrgName())
.eq(Project::getStatus, ProjectStatusEnum.ARCHIVED.getCode()).orderByDesc(Project::getUpdateOn));
.eq(Project::getStatus, ProjectStatusEnum.ACCEPTED.getCode()).orderByDesc(Project::getUpdateOn));

// 从申请借阅信息表中查出本单位及下属单位审批通过的项目添加到列表中
HashSet<Long> borrowProjectIdSet = new HashSet<>();
@@ -215,7 +215,7 @@ public class ProjectFileManage {
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!");

// 首先要判断 项目当前状态 是不是 已归档
VUtils.isTrue(!ProjectStatusEnum.ARCHIVED.getCode().equals(project.getStatus())).throwMessage("提交失败 该项目不是 已归档");
VUtils.isTrue(!ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())).throwMessage("提交失败 该项目不是 已归档");

String regionCode = user.getRegionCode();



+ 73
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java Целия файл

@@ -0,0 +1,73 @@
package com.ningdatech.pmapi.performance.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.performance.manage.PerformanceAppraisalPlanManage;
import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalCreateDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalEditDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalProjectGroupSaveDTO;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
* @Classname PerformanceAppraisalController
* @Description
* @Date 2023/6/19 14:16
* @Author PoffyZhang
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "绩效评价-评价计划")
@RequestMapping("/api/v1/performance-appraisal/plan")
public class PerformanceAppraisalPlanController {

private final PerformanceAppraisalPlanManage performanceAppraisalPlanManage;

@GetMapping("/list")
@ApiOperation("绩效评价列表")
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) {
return performanceAppraisalPlanManage.list(req);
}

@GetMapping("/detail/{id}")
@ApiOperation("绩效评价列表")
public PerformanceAppraisalVO detail(@PathVariable Long id) {
return performanceAppraisalPlanManage.detail(id);
}

@PostMapping("/create")
@ApiOperation("绩效评价创建")
@WebLog("绩效评价创建")
public String create(@Valid @RequestBody PerformanceAppraisalCreateDTO createDTO) {
return performanceAppraisalPlanManage.create(createDTO);
}

@PostMapping("/edit")
@ApiOperation("编辑绩效评价")
@WebLog("编辑绩效评价")
public String edit(@Valid @RequestBody PerformanceAppraisalEditDTO editDTO) {
return performanceAppraisalPlanManage.edit(editDTO);
}

@GetMapping("/group/list/{appraisalId}")
@ApiOperation("绩效评价分组列表")
public List<PerformanceAppraisalProjectGroupVO> groupList(@PathVariable Long appraisalId,
@RequestParam(required = false) String name) {
return performanceAppraisalPlanManage.groupList(appraisalId,name);
}

@PostMapping("/group/save")
@ApiOperation("绩效评价分组保存")
@WebLog("绩效评价分组保存")
public String groupSave(@Valid @RequestBody PerformanceAppraisalProjectGroupSaveDTO dto) {
return performanceAppraisalPlanManage.groupSave(dto);
}
}

+ 72
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java Целия файл

@@ -0,0 +1,72 @@
package com.ningdatech.pmapi.performance.convert;

import cn.hutool.core.collection.CollUtil;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import org.apache.commons.lang3.StringUtils;

import java.util.*;
import java.util.stream.Collectors;

/**
* @Classname PerformanceAppraisalConverer
* @Description
* @Date 2023/6/19 15:31
* @Author PoffyZhang
*/
public class PerformanceAppraisalConveter {

public static List<PerformanceAppraisalProjectVO> convertProjects(
List<PerformanceAppraisalProject> projects, Map<String, Project> map) {
if(CollUtil.isNotEmpty(projects) && CollUtil.isNotEmpty(map)){
return projects.stream().map(p -> {
PerformanceAppraisalProjectVO vo = new PerformanceAppraisalProjectVO();
vo.setIsReAppraisal(p.getIsReAppraisal());
vo.setId(p.getProjectId());
if(map.containsKey(p.getProjectCode())){
Project project = map.get(p.getProjectCode());
vo.setProjectCode(project.getProjectCode());
vo.setProjectName(project.getProjectName());
vo.setProjectType(project.getProjectType());
vo.setProjectTypeName(getProjectTypeName(project.getProjectType()));
vo.setBuildOrgName(project.getBuildOrgName());
}
return vo;
}).collect(Collectors.toList());
}
return Collections.emptyList();
}

public static List<PerformanceAppraisalApplicationVO> convertApplications(
List<PerformanceAppraisalApplication> applications, Map<Long, ProjectApplication> map) {
if(CollUtil.isNotEmpty(applications) && CollUtil.isNotEmpty(map)){
return applications.stream().map(a -> {
PerformanceAppraisalApplicationVO vo = new PerformanceAppraisalApplicationVO();
vo.setId(a.getApplicationId());
if(map.containsKey(a.getApplicationId())){
ProjectApplication application = map.get(a.getApplicationId());
vo.setApplicationName(StringUtils.isNotBlank(application.getApplicationName())?
application.getApplicationName() : application.getAccountAppName());
vo.setApplicationType(application.getApplicationType());
vo.setBizDomain(application.getBizDomain());
// vo.setBuildOrgName(application.get());
vo.setPublishSide(application.getPublishSide());
}
return vo;
}).collect(Collectors.toList());
}
return Collections.emptyList();
}

public static String getProjectTypeName(Integer projectType) {
if (Objects.nonNull(projectType)) {
return ProjectTypeEnum.getDesc(projectType);
}
return StringUtils.EMPTY;
}
}

+ 485
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java Целия файл

@@ -0,0 +1,485 @@
package com.ningdatech.pmapi.performance.manage;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.common.util.CodeUtil;
import com.ningdatech.pmapi.performance.convert.PerformanceAppraisalConveter;
import com.ningdatech.pmapi.performance.model.dto.AppraisalProjectDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalCreateDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalEditDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceAppraisalProjectGroupSaveDTO;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectGroupVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplicationService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectGroupService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

/**
* @Classname PerformanceAppraisalManage
* @Description
* @Date 2023/6/19 14:18
* @Author PoffyZhang
*/
@Component
@Slf4j
@AllArgsConstructor
public class PerformanceAppraisalPlanManage {

private final IPerformanceAppraisalService performanceAppraisalService;

private final IPerformanceAppraisalProjectService performanceAppraisalProjectService;

private final IPerformanceAppraisalApplicationService performanceAppraisalApplicationService;

private final IProjectService projectService;

private final IProjectApplicationService applicationService;

private final IPerformanceAppraisalProjectGroupService groupService;

private final UserInfoHelper userInfoHelper;

/**
* 绩效列表
* @param req
* @return
*/
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) {
Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.like(StringUtils.isNotBlank(req.getName()),PerformanceAppraisal::getName,req.getName())
.ge(Objects.nonNull(req.getStart()),PerformanceAppraisal::getCreateOn,req.getStart())
.le(Objects.nonNull(req.getEnd()),PerformanceAppraisal::getCreateOn,req.getEnd())
.orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page,wrapper);
if(0L == page.getTotal()){
return PageVo.empty();
}

List<Long> paIds = page.getRecords().stream().map(PerformanceAppraisal::getId).collect(Collectors.toList());
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getAppraisalId, paIds));

Map<String,Project> projectMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalProject>> papsGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paps)){
papsGroupMap = paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));

List<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE));
if(CollUtil.isNotEmpty(projects)){
projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode,p -> p));
}
}

List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.in(PerformanceAppraisalApplication::getAppraisalId, paIds));
Map<Long,ProjectApplication> applicationMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalApplication>> paasGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paas)){
paasGroupMap = paas.stream().collect(Collectors.groupingBy(PerformanceAppraisalApplication::getAppraisalId));

List<Long> applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList());
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getId, applicationIds));
if(CollUtil.isNotEmpty(apps)){
applicationMap = apps.stream().collect(Collectors.toMap(ProjectApplication::getId,a -> a));
}
}

Map<Long, List<PerformanceAppraisalProject>> finalPapsGroupMap = papsGroupMap;
Map<Long,List<PerformanceAppraisalApplication>> finalPaasGroupMap = paasGroupMap;
Map<String,Project> finalProjectMap = projectMap;
Map<Long,ProjectApplication> finalApplicationMap = applicationMap;
List<PerformanceAppraisalVO> res = page.getRecords().stream().map(p -> {
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p,PerformanceAppraisalVO.class);
if(finalPapsGroupMap.containsKey(p.getId())){
vo.setProjects(PerformanceAppraisalConveter.convertProjects(finalPapsGroupMap.get(p.getId()),finalProjectMap));
}
if(finalPaasGroupMap.containsKey(p.getId())){
vo.setApplications(PerformanceAppraisalConveter.convertApplications(finalPaasGroupMap.get(p.getId()),finalApplicationMap));
}
return vo;
}).collect(Collectors.toList());
return PageVo.of(res,page.getTotal());
}

public PerformanceAppraisalVO detail(Long id) {

PerformanceAppraisal pa = performanceAppraisalService.getById(id);
VUtils.isTrue(Objects.isNull(pa)).throwMessage("该计划不存在");

PerformanceAppraisalVO vo = BeanUtil.copyProperties(pa,PerformanceAppraisalVO.class);
//绩效关联的项目
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, id));
Map<String,Project> projectMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalProject>> papsGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paps)){
papsGroupMap = paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));

List<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE));
if(CollUtil.isNotEmpty(projects)){
projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode,p -> p));
}
}

//绩效关联的应用
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, id));
Map<Long,ProjectApplication> applicationMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalApplication>> paasGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paas)){
paasGroupMap = paas.stream().collect(Collectors.groupingBy(PerformanceAppraisalApplication::getAppraisalId));

List<Long> applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList());
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getId, applicationIds));
if(CollUtil.isNotEmpty(apps)){
applicationMap = apps.stream().collect(Collectors.toMap(ProjectApplication::getId,a -> a));
}
}

Map<Long, List<PerformanceAppraisalProject>> finalPapsGroupMap = papsGroupMap;
Map<Long,List<PerformanceAppraisalApplication>> finalPaasGroupMap = paasGroupMap;
Map<String,Project> finalProjectMap = projectMap;
Map<Long,ProjectApplication> finalApplicationMap = applicationMap;
if(finalPapsGroupMap.containsKey(vo.getId())){
vo.setProjects(PerformanceAppraisalConveter.convertProjects(finalPapsGroupMap.get(vo.getId()),finalProjectMap));
}
if(finalPaasGroupMap.containsKey(vo.getId())){
vo.setApplications(PerformanceAppraisalConveter.convertApplications(finalPaasGroupMap.get(vo.getId()),finalApplicationMap));
}
return vo;
}

/**
* 新建计划
* @param createDTO
* @return
*/
@Transactional
public String create(PerformanceAppraisalCreateDTO createDTO) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

deduplicationName(createDTO);

PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO,PerformanceAppraisal.class);
pa.setCreateOn(LocalDateTime.now());
pa.setCreateBy(user.getUsername());
pa.setUpdateOn(LocalDateTime.now());
pa.setUpdateBy(user.getUsername());
performanceAppraisalService.save(pa);

if(CollUtil.isNotEmpty(createDTO.getProjects())
&& StringUtils.isNotBlank(createDTO.getTarget())
&& createDTO.getTarget().contains("1")){
saveProjects(createDTO,pa.getId(),user);
}

if(CollUtil.isNotEmpty(createDTO.getApplicationIds())
&& StringUtils.isNotBlank(createDTO.getTarget())
&& createDTO.getTarget().contains("2")){
saveApplications(createDTO,pa.getId(),user);
}

return "新建成功";
}


/**
* 编辑计划
* @param editDTO
* @return
*/
@Transactional
public String edit(PerformanceAppraisalEditDTO editDTO) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

deduplicationName(editDTO);

PerformanceAppraisal pa = BeanUtil.copyProperties(editDTO,PerformanceAppraisal.class);

pa.setUpdateOn(LocalDateTime.now());
pa.setUpdateBy(user.getUsername());
performanceAppraisalService.updateById(pa);

if(CollUtil.isNotEmpty(editDTO.getProjects())){
saveProjects(editDTO,user);
}

if(CollUtil.isNotEmpty(editDTO.getApplicationIds())){
saveApplications(editDTO,user);
}

return "编辑成功";
}

/**
* 名称去重
* @param dto
*/
private void deduplicationName(PerformanceAppraisalCreateDTO dto) {
long count = performanceAppraisalService.count(Wrappers.lambdaQuery(PerformanceAppraisal.class)
.eq(PerformanceAppraisal::getName, dto.getName()));
VUtils.isTrue(count > 0).throwMessage("名称已经存在");
}

private void deduplicationName(PerformanceAppraisalEditDTO dto) {
if(StringUtils.isNotBlank(dto.getName())){
long count =performanceAppraisalService.count(Wrappers.lambdaQuery(PerformanceAppraisal.class)
.eq(PerformanceAppraisal::getName,dto.getName())
.ne(Objects.nonNull(dto.getId()),PerformanceAppraisal::getId,dto.getId()));
VUtils.isTrue(count > 0).throwMessage("名称已经存在");
}
}

@Transactional
public void saveProjects(PerformanceAppraisalCreateDTO createDTO,Long id,UserInfoDetails user) {
if(CollUtil.isEmpty(createDTO.getProjects())){
return;
}

List<AppraisalProjectDTO> projects = createDTO.getProjects();

for(AppraisalProjectDTO appraisalProject : projects){
Project newProject = projectService.getNewProject(appraisalProject.getId());
VUtils.isTrue(Objects.isNull(newProject)).throwMessage("项目不存在 " + appraisalProject.getId());
PerformanceAppraisalProject pap = new PerformanceAppraisalProject();
pap.setAppraisalId(id);
pap.setProjectId(appraisalProject.getId());
pap.setProjectCode(newProject.getProjectCode());
pap.setIsReAppraisal(appraisalProject.getIsReAppraisal());
pap.setCreateBy(user.getUsername());
pap.setCreateOn(LocalDateTime.now());
pap.setUpdateBy(user.getUsername());
pap.setUpdateOn(LocalDateTime.now());
performanceAppraisalProjectService.save(pap);
}
}

@Transactional
public void saveApplications(PerformanceAppraisalCreateDTO createDTO,Long id,UserInfoDetails user) {
if(CollUtil.isEmpty(createDTO.getApplicationIds())){
return;
}

List<Long> applicationIds = createDTO.getApplicationIds();

for(Long applicationId : applicationIds){
ProjectApplication projectApplication = applicationService.getById(applicationId);
VUtils.isTrue(Objects.isNull(projectApplication)).throwMessage("应用不存在 " + applicationId);
PerformanceAppraisalApplication paa = new PerformanceAppraisalApplication();
paa.setAppraisalId(id);
paa.setApplicationId(applicationId);
paa.setCreateBy(user.getUsername());
paa.setCreateOn(LocalDateTime.now());
paa.setUpdateBy(user.getUsername());
paa.setUpdateOn(LocalDateTime.now());
performanceAppraisalApplicationService.save(paa);
}
}

@Transactional
public void saveProjects(PerformanceAppraisalEditDTO editDTO,UserInfoDetails user) {
if(Objects.isNull(editDTO.getProjects())){
return;
}

//删除先
performanceAppraisalProjectService.remove(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId,editDTO.getId()));
List<AppraisalProjectDTO> projects = editDTO.getProjects();
for(AppraisalProjectDTO appraisalProject : projects){
Project newProject = projectService.getNewProject(appraisalProject.getId());
VUtils.isTrue(Objects.isNull(newProject)).throwMessage("项目不存在 " + appraisalProject.getId());
PerformanceAppraisalProject pap = new PerformanceAppraisalProject();
pap.setAppraisalId(editDTO.getId());
pap.setProjectId(appraisalProject.getId());
pap.setProjectCode(newProject.getProjectCode());
pap.setIsReAppraisal(appraisalProject.getIsReAppraisal());
pap.setCreateBy(user.getUsername());
pap.setCreateOn(LocalDateTime.now());
pap.setUpdateBy(user.getUsername());
pap.setUpdateOn(LocalDateTime.now());
performanceAppraisalProjectService.save(pap);
}
}

@Transactional
public void saveApplications(PerformanceAppraisalEditDTO editDTO,UserInfoDetails user) {
if(Objects.isNull(editDTO.getApplicationIds())){
return;
}

//删除先
performanceAppraisalApplicationService.remove(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId,editDTO.getId()));
List<Long> applicationIds = editDTO.getApplicationIds();

for(Long applicationId : applicationIds){
ProjectApplication projectApplication = applicationService.getById(applicationId);
VUtils.isTrue(Objects.isNull(projectApplication)).throwMessage("应用不存在 " + applicationId);
PerformanceAppraisalApplication paa = new PerformanceAppraisalApplication();
paa.setAppraisalId(editDTO.getId());
paa.setApplicationId(applicationId);
paa.setCreateBy(user.getUsername());
paa.setCreateOn(LocalDateTime.now());
paa.setUpdateBy(user.getUsername());
paa.setUpdateOn(LocalDateTime.now());
performanceAppraisalApplicationService.save(paa);
}
}

public List<PerformanceAppraisalProjectGroupVO> groupList(Long appraisalId,String name) {
List<PerformanceAppraisalProjectGroup> groups = groupService.list(
Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId)
.like(StringUtils.isNotBlank(name),PerformanceAppraisalProjectGroup::getName,name));
if(CollUtil.isEmpty(groups)){
return Collections.emptyList();
}

Set<String> allEmployeeCodes = Sets.newHashSet();
Set<String> projectCodes = Sets.newHashSet();
Map<String, UserFullInfoDTO> userMap = Maps.newHashMap();
Map<String, Project> projectMap = Maps.newHashMap();
groups.stream().forEach(g -> {
allEmployeeCodes.addAll(CodeUtil.convertStrToList(g.getReAppraisalUsers()));
allEmployeeCodes.addAll(CodeUtil.convertStrToList(g.getVerificationUsers()));
projectCodes.addAll(CodeUtil.convertStrToList(g.getProjectIds()));
});

if(CollUtil.isNotEmpty(allEmployeeCodes)){
List<UserFullInfoDTO> users = userInfoHelper.getUserFullInfoByEmployeeCodes(allEmployeeCodes);
if(CollUtil.isNotEmpty(users)){
userMap = users.stream().collect(Collectors.toMap(UserFullInfoDTO::getEmployeeCode,u -> u));
}
}

if(CollUtil.isNotEmpty(projectCodes)){
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode,projectCodes)
.eq(Project::getNewest,Boolean.TRUE));
if(CollUtil.isNotEmpty(projects)){
projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode,p -> p));
}
}

Map<String, Project> finalProjectMap = projectMap;
Map<String, UserFullInfoDTO> finalUserMap = userMap;
return groups.stream().map(g -> {
PerformanceAppraisalProjectGroupVO vo = new PerformanceAppraisalProjectGroupVO();
vo.setAppraisalId(g.getAppraisalId());
vo.setName(g.getName());
vo.setCreateOn(g.getCreateOn());
vo.setCreateBy(g.getCreateBy());
vo.setUpdateBy(g.getUpdateBy());
vo.setUpdateOn(g.getUpdateOn());
vo.setId(g.getId());
vo.setProjects(checkProject(g.getProjectIds(), finalProjectMap));
vo.setReAppraisalUsers(checkUser(g.getReAppraisalUsers(), finalUserMap));
vo.setVerificationUsers(checkUser(g.getVerificationUsers(), finalUserMap));
return vo;
}).collect(Collectors.toList());
}

/**
* 分组 保存
* @param dto
* @return
*/
public String groupSave(PerformanceAppraisalProjectGroupSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

PerformanceAppraisalProjectGroup group = BeanUtil.copyProperties(dto, PerformanceAppraisalProjectGroup.class);

if(Objects.isNull(dto.getId())){
group.setId(null);
group.setCreateOn(LocalDateTime.now());
group.setCreateBy(user.getUsername());
}else{
PerformanceAppraisalProjectGroup old = groupService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(old)).throwMessage("该分组不存在 编辑失败!");
group.setId(old.getId());
}
if(CollUtil.isNotEmpty(dto.getProjectCodes())){
group.setProjectIds(dto.getProjectCodes().stream().collect(Collectors.joining(StrPool.COMMA)));
}
if(CollUtil.isNotEmpty(dto.getReAppraisalUsers())){
group.setReAppraisalUsers(dto.getReAppraisalUsers().stream().collect(Collectors.joining(StrPool.COMMA)));
}
if(CollUtil.isNotEmpty(dto.getVerificationUsers())){
group.setVerificationUsers(dto.getVerificationUsers().stream().collect(Collectors.joining(StrPool.COMMA)));
}
group.setUpdateOn(LocalDateTime.now());
group.setUpdateBy(user.getUsername());
groupService.saveOrUpdate(group);
return "操作成功";
}

private List<PerformanceAppraisalProjectVO> checkProject(String projectIds, Map<String, Project> projectMap) {
if(StringUtils.isBlank(projectIds)){
return Collections.emptyList();
}
return Arrays.stream(projectIds.split(StrPool.COMMA)).map(projectCode -> {
PerformanceAppraisalProjectVO vo = new PerformanceAppraisalProjectVO();
if(projectMap.containsKey(projectCode)){
Project project = projectMap.get(projectCode);
vo.setProjectTypeName(BizUtils.getProjectTypeName(project.getProjectType()));
vo.setProjectType(project.getProjectType());
vo.setId(project.getId());
vo.setProjectCode(projectCode);
vo.setProjectYear(project.getProjectYear());
vo.setDeclareAmount(project.getDeclareAmount());
}
return vo;
}).collect(Collectors.toList());
}

private List<UserFullInfoDTO> checkUser(String users, Map<String, UserFullInfoDTO> userMap) {
if(StringUtils.isBlank(users)){
return Collections.emptyList();
}
return Arrays.stream(users.split(StrPool.COMMA)).map(
employeeCode -> userMap.get(employeeCode)
).collect(Collectors.toList());
}
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.java Целия файл

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Zpf
* @since 2023-06-03
*/
public interface PerformanceAppraisalApplicationMapper extends BaseMapper<PerformanceAppraisalApplication> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.xml Целия файл

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalApplicationMapper">

</mapper>

+ 17
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.java Целия файл

@@ -0,0 +1,17 @@
package com.ningdatech.pmapi.performance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.projectlib.model.entity.Project;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Zpf
* @since 2023-06-03
*/
public interface PerformanceAppraisalMapper extends BaseMapper<PerformanceAppraisal> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.xml Целия файл

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalMapper">

</mapper>

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.java Целия файл

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Zpf
* @since 2023-06-03
*/
public interface PerformanceAppraisalProjectGroupMapper extends BaseMapper<PerformanceAppraisalProjectGroup> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.xml Целия файл

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalProjectGroupMapper">

</mapper>

+ 17
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.java Целия файл

@@ -0,0 +1,17 @@
package com.ningdatech.pmapi.performance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Zpf
* @since 2023-06-03
*/
public interface PerformanceAppraisalProjectMapper extends BaseMapper<PerformanceAppraisalProject> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.xml Целия файл

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalProjectMapper">

</mapper>

+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalProjectDTO.java Целия файл

@@ -0,0 +1,22 @@
package com.ningdatech.pmapi.performance.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;

/**
* @Classname AppraisalProjectDTO
* @Description
* @Date 2023/6/19 17:08
* @Author PoffyZhang
*/
@Data
public class AppraisalProjectDTO {

@ApiModelProperty("项目ID")
@NotNull(message = "项目ID 必填")
private Long id;

@ApiModelProperty("是否复评")
private Boolean isReAppraisal = Boolean.FALSE;
}

+ 71
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java Целия файл

@@ -0,0 +1,71 @@
package com.ningdatech.pmapi.performance.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalApplicationVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
* @Classname PerformanceAppraisalCreateDTO
* @Description 绩效评价对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价创建对象", description = "绩效评价创建对象")
public class PerformanceAppraisalCreateDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("计划名称")
@NotBlank(message = "请输入计划名称")
private String name;

@ApiModelProperty("自评开始时间")
@NotNull(message = "自评时间错误")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime selfAppraisalStart;

@ApiModelProperty("自评结束时间")
@NotNull(message = "自评时间错误")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime selfAppraisalEnd;

@ApiModelProperty("复评开始时间")
@NotNull(message = "复评时间错误")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime reAppraisalStart;

@ApiModelProperty("复评结束时间")
@NotNull(message = "复评时间错误")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime reAppraisalEnd;

@ApiModelProperty("核查开始时间")
@NotNull(message = "核查时间错误")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime verificationStart;

@ApiModelProperty("核查结束时间")
@NotNull(message = "核查时间错误")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime verificationEnd;

@ApiModelProperty("评价目标 1项目 2应用 可多选 1,2")
@NotBlank(message = "评价目标不能为空")
private String target;

@ApiModelProperty("评价项目 只有ID 和是否复评")
private List<AppraisalProjectDTO> projects;

@ApiModelProperty("评价应用ids")
private List<Long> applicationIds;
}

+ 66
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java Целия файл

@@ -0,0 +1,66 @@
package com.ningdatech.pmapi.performance.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
* @Classname PerformanceAppraisalEditDTO
* @Description 绩效评价对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价编辑对象", description = "绩效评价编辑对象")
public class PerformanceAppraisalEditDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("id")
@NotNull(message = "编辑的时候 id必填")
private Long id;

@ApiModelProperty("计划名称")
@JSONField(format = "yyyy-MM-dd")
private String name;

@ApiModelProperty("自评开始时间")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime selfAppraisalStart;

@ApiModelProperty("自评结束时间")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime selfAppraisalEnd;

@ApiModelProperty("复评开始时间")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime reAppraisalStart;

@ApiModelProperty("复评结束时间")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime reAppraisalEnd;

@ApiModelProperty("核查开始时间")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime verificationStart;

@ApiModelProperty("核查结束时间")
@JSONField(format = "yyyy-MM-dd")
private LocalDateTime verificationEnd;

@ApiModelProperty("评价目标 1项目 2应用 可多选 1,2")
private String target;

@ApiModelProperty("评价项目 只有ID 和是否复评")
private List<AppraisalProjectDTO> projects;

@ApiModelProperty("评价应用ids")
private List<Long> applicationIds;
}

+ 43
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalProjectGroupSaveDTO.java Целия файл

@@ -0,0 +1,43 @@
package com.ningdatech.pmapi.performance.model.dto;

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

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

/**
* @Classname PerformanceAppraisalProjectGroupSaveDTO
* @Description 绩效评价和项目分组
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价项目分组", description = "绩效评价项目分组")
public class PerformanceAppraisalProjectGroupSaveDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("id")
private Long id;

@ApiModelProperty("名称")
private String name;

@ApiModelProperty("计划id")
private Long appraisalId;

@ApiModelProperty("分组内的所有项目code")
private List<String> projectCodes;

@ApiModelProperty("复评人员")
private List<String> reAppraisalUsers;

@ApiModelProperty("核查人员")
private List<String> verificationUsers;
}

+ 58
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java Целия файл

@@ -0,0 +1,58 @@
package com.ningdatech.pmapi.performance.model.entity;

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

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

/**
* @Classname PerformanceAppraisal
* @Description 绩效评价对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@TableName("nd_performance_appraisal")
@ApiModel(value = "绩效评价对象", description = "绩效评价对象")
public class PerformanceAppraisal implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("计划名称")
private String name;

@ApiModelProperty("自评开始时间")
private LocalDateTime selfAppraisalStart;

@ApiModelProperty("自评结束时间")
private LocalDateTime selfAppraisalEnd;

@ApiModelProperty("复评开始时间")
private LocalDateTime reAppraisalStart;

@ApiModelProperty("复评结束时间")
private LocalDateTime reAppraisalEnd;

@ApiModelProperty("核查开始时间")
private LocalDateTime verificationStart;

@ApiModelProperty("核查结束时间")
private LocalDateTime verificationEnd;

@ApiModelProperty("评价目标 1项目 2应用 可多选 1,2")
private String target;
}

+ 40
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java Целия файл

@@ -0,0 +1,40 @@
package com.ningdatech.pmapi.performance.model.entity;

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

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

/**
* @Classname PerformanceAppraisalApplication
* @Description 绩效评价和应用关联对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@TableName("nd_performance_appraisal_application")
@ApiModel(value = "绩效评价和应用关联对象", description = "绩效评价和应用关联对象")
public class PerformanceAppraisalApplication implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("计划id")
private Long appraisalId;

@ApiModelProperty("应用id")
private Long applicationId;
}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java Целия файл

@@ -0,0 +1,46 @@
package com.ningdatech.pmapi.performance.model.entity;

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

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

/**
* @Classname PerformanceAppraisalProject
* @Description 绩效评价和项目关联对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@TableName("nd_performance_appraisal_project")
@ApiModel(value = "绩效评价和项目关联对象", description = "绩效评价和项目关联对象")
public class PerformanceAppraisalProject implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("计划id")
private Long appraisalId;

@ApiModelProperty("项目id")
private Long projectId;

@ApiModelProperty("项目编码")
private String projectCode;

@ApiModelProperty("是否核查")
private Boolean isReAppraisal;
}

+ 49
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java Целия файл

@@ -0,0 +1,49 @@
package com.ningdatech.pmapi.performance.model.entity;

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

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

/**
* @Classname PerformanceAppraisalProjectGroup
* @Description 绩效评价和项目分组
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@TableName("nd_performance_appraisal_project_group")
@ApiModel(value = "绩效评价项目分组", description = "绩效评价项目分组")
public class PerformanceAppraisalProjectGroup implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("名称")
private String name;

@ApiModelProperty("计划id")
private Long appraisalId;

@ApiModelProperty("分组内的所有项目id")
private String projectIds;

@ApiModelProperty("复评人员")
private String reAppraisalUsers;

@ApiModelProperty("核查人员")
private String verificationUsers;
}

+ 27
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java Целия файл

@@ -0,0 +1,27 @@
package com.ningdatech.pmapi.performance.model.req;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;

/**
* <p>
* PerformanceAppraisalListReq
* </p>
*
* @author ZPF
* @since 09:32 2023/06/13
*/
@Data
public class PerformanceAppraisalListReq extends PagePo {

@ApiModelProperty("计划名称")
private String name;

@ApiModelProperty("开始时间")
private String start;

@ApiModelProperty("结束时间")
private String end;
}

+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java Целия файл

@@ -0,0 +1,38 @@
package com.ningdatech.pmapi.performance.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* @Classname PerformanceAppraisalApplicationVO
* @Description 绩效评价对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价应用对象", description = "绩效评价应用对象")
public class PerformanceAppraisalApplicationVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目ID")
private Long id;

@ApiModelProperty("应用名称")
private String applicationName;

@ApiModelProperty("申报单位")
private String buildOrgName;

@ApiModelProperty("应用类型")
private String applicationType;

@ApiModelProperty("应用领域")
private String bizDomain;

@ApiModelProperty("发布端")
private String publishSide;
}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectGroupVO.java Целия файл

@@ -0,0 +1,46 @@
package com.ningdatech.pmapi.performance.model.vo;

import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
* @Classname PerformanceAppraisalProjectGroupVO
* @Description 绩效评价和项目分组
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价项目分组", description = "绩效评价项目分组")
public class PerformanceAppraisalProjectGroupVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("名称")
private String name;

@ApiModelProperty("计划id")
private Long appraisalId;

@ApiModelProperty("分组内的所有项目")
private List<PerformanceAppraisalProjectVO> projects;

@ApiModelProperty("复评人员")
private List<UserFullInfoDTO> reAppraisalUsers;

@ApiModelProperty("核查人员")
private List<UserFullInfoDTO> verificationUsers;
}

+ 51
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java Целия файл

@@ -0,0 +1,51 @@
package com.ningdatech.pmapi.performance.model.vo;

import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
* @Classname PerformanceAppraisalProjectVO
* @Description 绩效评价对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价项目对象", description = "绩效评价项目对象")
public class PerformanceAppraisalProjectVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目ID")
private Long id;

@ApiModelProperty("项目编码")
private String projectCode;

@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("申报单位")
private String buildOrgName;

@ApiModelProperty("项目类型")
private Integer projectType;

@ApiModelProperty("项目类型名")
private String projectTypeName;

@ApiModelProperty("是否复评")
private Boolean isReAppraisal;

@ApiModelProperty("申报金额")
private BigDecimal declareAmount;

@ApiModelProperty("预算年度")
private Integer projectYear;
}

+ 60
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java Целия файл

@@ -0,0 +1,60 @@
package com.ningdatech.pmapi.performance.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
* @Classname PerformanceAppraisal
* @Description 绩效评价对象
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价对象", description = "绩效评价对象")
public class PerformanceAppraisalVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("计划名称")
private String name;

@ApiModelProperty("自评开始时间")
private LocalDateTime selfAppraisalStart;

@ApiModelProperty("自评结束时间")
private LocalDateTime selfAppraisalEnd;

@ApiModelProperty("复评开始时间")
private LocalDateTime reAppraisalStart;

@ApiModelProperty("复评结束时间")
private LocalDateTime reAppraisalEnd;

@ApiModelProperty("核查开始时间")
private LocalDateTime verificationStart;

@ApiModelProperty("核查结束时间")
private LocalDateTime verificationEnd;

@ApiModelProperty("评价目标 1项目 2应用 可多选 1,2")
private String target;

@ApiModelProperty("评价项目列表")
private List<PerformanceAppraisalProjectVO> projects;

@ApiModelProperty("评价应用列表")
private List<PerformanceAppraisalApplicationVO> applications;
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalApplicationService.java Целия файл

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;

/**
* <p>
* 服务类
* </p>
*
* @author PoffyZhang
* @since 2023-06-03
*/
public interface IPerformanceAppraisalApplicationService extends IService<PerformanceAppraisalApplication> {

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectGroupService.java Целия файл

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup;

/**
* <p>
* 服务类
* </p>
*
* @author PoffyZhang
* @since 2023-06-03
*/
public interface IPerformanceAppraisalProjectGroupService extends IService<PerformanceAppraisalProjectGroup> {

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectService.java Целия файл

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;

/**
* <p>
* 服务类
* </p>
*
* @author PoffyZhang
* @since 2023-06-03
*/
public interface IPerformanceAppraisalProjectService extends IService<PerformanceAppraisalProject> {

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalService.java Целия файл

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;

/**
* <p>
* 服务类
* </p>
*
* @author PoffyZhang
* @since 2023-06-03
*/
public interface IPerformanceAppraisalService extends IService<PerformanceAppraisal> {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalApplicationServiceImpl.java Целия файл

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.performance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalApplicationMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplicationService;
import org.springframework.stereotype.Service;

/**
* <p>
* 绩效评价和应用 服务实现类
* </p>
*
* @author ZPF
* @since 2023-06-15
*/
@Service
public class PerformanceAppraisalApplicationServiceImpl extends ServiceImpl<PerformanceAppraisalApplicationMapper,
PerformanceAppraisalApplication> implements IPerformanceAppraisalApplicationService {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectGroupServiceImpl.java Целия файл

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.performance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalProjectGroupMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectGroup;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectGroupService;
import org.springframework.stereotype.Service;

/**
* <p>
* 绩效评价分组 服务实现类
* </p>
*
* @author ZPF
* @since 2023-06-15
*/
@Service
public class PerformanceAppraisalProjectGroupServiceImpl extends ServiceImpl<PerformanceAppraisalProjectGroupMapper,
PerformanceAppraisalProjectGroup> implements IPerformanceAppraisalProjectGroupService {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectServiceImpl.java Целия файл

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.performance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalProjectMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService;
import org.springframework.stereotype.Service;

/**
* <p>
* 绩效评价和项目 服务实现类
* </p>
*
* @author ZPF
* @since 2023-06-15
*/
@Service
public class PerformanceAppraisalProjectServiceImpl extends ServiceImpl<PerformanceAppraisalProjectMapper,
PerformanceAppraisalProject> implements IPerformanceAppraisalProjectService {

}

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalServiceImpl.java Целия файл

@@ -0,0 +1,20 @@
package com.ningdatech.pmapi.performance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService;
import org.springframework.stereotype.Service;

/**
* <p>
* 绩效评价 服务实现类
* </p>
*
* @author ZPF
* @since 2023-06-15
*/
@Service
public class PerformanceAppraisalServiceImpl extends ServiceImpl<PerformanceAppraisalMapper, PerformanceAppraisal> implements IPerformanceAppraisalService {

}

+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java Целия файл

@@ -4,7 +4,9 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.req.ProjectApplicationListReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
@@ -44,6 +46,12 @@ public class ProjectLibController {
return projectLibManage.projectLibListWithPermission(req,user);
}

@GetMapping("/application/list")
@ApiOperation("应用列表")
public PageVo<ProjectApplicationVO> applicationList(ProjectApplicationListReq req) {
return projectLibManage.applicationList(req);
}

@GetMapping("/{id}")
@ApiOperation("获取项目详情")
public ProjectDetailVO detail (@PathVariable Long id){


+ 40
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Целия файл

@@ -34,8 +34,10 @@ import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.*;
import com.ningdatech.pmapi.projectlib.model.req.ProjectApplicationListReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.*;
@@ -218,6 +220,8 @@ public class ProjectLibManage {
BeanUtils.copyProperties(application, projectApplication);
projectApplication.setId(null);
projectApplication.setProjectId(finalProject.getId());
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode());
projectApplication.setBuildOrgName(finalProject.getBuildOrgName());
return projectApplication;
}).collect(Collectors.toList());
projectApplicationService.saveOrUpdateBatch(applications);
@@ -325,6 +329,8 @@ public class ProjectLibManage {
ProjectApplication app = BeanUtil.copyProperties(a,ProjectApplication.class);
app.setId(null);
app.setProjectId(project.getId());
app.setBuildOrgName(project.getBuildOrgName());
app.setBuildOrgCode(project.getBuildOrgCode());
return app;
})
.collect(Collectors.toList());
@@ -373,6 +379,8 @@ public class ProjectLibManage {
ProjectApplication app = BeanUtil.copyProperties(a,ProjectApplication.class);
app.setId(null);
app.setProjectId(project.getId());
app.setBuildOrgName(project.getBuildOrgName());
app.setBuildOrgCode(project.getBuildOrgCode());
return app;
})
.collect(Collectors.toList());
@@ -418,6 +426,8 @@ public class ProjectLibManage {
ProjectApplication app = BeanUtil.copyProperties(a,ProjectApplication.class);
app.setId(null);
app.setProjectId(project.getId());
app.setBuildOrgName(project.getBuildOrgName());
app.setBuildOrgCode(project.getBuildOrgCode());
return app;
})
.collect(Collectors.toList());
@@ -464,6 +474,8 @@ public class ProjectLibManage {
ProjectApplication app = BeanUtil.copyProperties(a,ProjectApplication.class);
app.setId(null);
app.setProjectId(project.getId());
app.setBuildOrgName(project.getBuildOrgName());
app.setBuildOrgCode(project.getBuildOrgCode());
return app;
})
.collect(Collectors.toList());
@@ -674,4 +686,32 @@ public class ProjectLibManage {
projectInst.setUpdateOn(LocalDateTime.now());
projectInstService.save(projectInst);
}

/**
* 应用列表
* @param req
* @return
*/
public PageVo<ProjectApplicationVO> applicationList(ProjectApplicationListReq req) {
Page<ProjectApplication> page = req.page();
LambdaQueryWrapper<ProjectApplication> wrapper = Wrappers.lambdaQuery(ProjectApplication.class)
.eq(StringUtils.isNotBlank(req.getBuildOrgName()),ProjectApplication::getBuildOrgName,req.getBuildOrgName());

if(StringUtils.isNotBlank(req.getApplicationName())){
wrapper.and(q1 -> q1.like(ProjectApplication::getApplicationName,req.getApplicationName())
.or(q2 -> q2.like(ProjectApplication::getAccountAppName,req.getApplicationName())));
}
wrapper.orderByDesc(ProjectApplication::getUpdateOn);
projectApplicationService.page(page,wrapper);

if(0L == page.getTotal()){
return PageVo.empty();
}

List<ProjectApplicationVO> res = page.getRecords().stream()
.map(app -> BeanUtil.copyProperties(app,ProjectApplicationVO.class))
.collect(Collectors.toList());

return PageVo.of(res,page.getTotal());
}
}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java Целия файл

@@ -156,4 +156,10 @@ public class ProjectApplicationDTO implements Serializable {
@ApiModelProperty("试点文件")
private String experimentsFile;

@ApiModelProperty("申报单位名称")
private String buildOrgName;

@ApiModelProperty("申报单位编码")
private String buildOrgCode;

}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java Целия файл

@@ -166,6 +166,12 @@ public class ProjectApplication implements Serializable {
@ApiModelProperty("试点文件")
private String experimentsFile;

@ApiModelProperty("申报单位名称")
private String buildOrgName;

@ApiModelProperty("申报单位编码")
private String buildOrgCode;

private Long createBy;

private Long updateBy;


+ 32
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApplicationListReq.java Целия файл

@@ -0,0 +1,32 @@
package com.ningdatech.pmapi.projectlib.model.req;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
* <p>
* ProjectLibListReq
* </p>
*
* @author ZPF
* @since 14:35 2023/2/1
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("应用列表查询")
@EqualsAndHashCode(callSuper = true)
public class ProjectApplicationListReq extends PagePo {

@ApiModelProperty("申报单位code")
private String buildOrgCode;

@ApiModelProperty("申报单位名")
private String buildOrgName;

@ApiModelProperty("应用名")
private String applicationName;
}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectApplicationVO.java Целия файл

@@ -162,6 +162,12 @@ public class ProjectApplicationVO implements Serializable {
@ApiModelProperty("试点文件")
private String experimentsFile;

@ApiModelProperty("申报单位名称")
private String buildOrgName;

@ApiModelProperty("申报单位编码")
private String buildOrgCode;

private Long createBy;

private Long updateBy;


+ 0
- 6
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java Целия файл

@@ -215,17 +215,12 @@ public class HandlerManage {
}

private void updateProjectApplyBorrowInfo(Project declaredProject, String instanceId) {

// 获取申请借阅信息
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class)
.eq(ProjectApplyBorrow::getProjectId, declaredProject.getId())
.eq(ProjectApplyBorrow::getInstanceId, instanceId));
// 更新项目借阅信息为成功
projectApplyBorrow.setProjectId(declaredProject.getId());
projectApplyBorrow.setInstanceId(instanceId);
projectApplyBorrow.setIsSuccess(Boolean.TRUE);
projectApplyBorrow.setCreateOn(LocalDateTime.now());
projectApplyBorrow.setCreateBy(LoginUserUtil.getUserId());
projectApplyBorrow.setUpdateOn(LocalDateTime.now());
projectApplyBorrow.setUpdateBy(LoginUserUtil.getUserId());
projectApplyBorrowService.updateById(projectApplyBorrow);
@@ -243,7 +238,6 @@ public class HandlerManage {
String constructCycle = String.valueOf(Integer.parseInt(buildCycle) + delayApply.getDelayTime());
declaredProject.setBuildCycle(constructCycle);
Long constructMonth = Long.valueOf(constructCycle);
declaredProject.setBuildCycle(String.valueOf(constructMonth));
String acceptTime = NdDateUtils.format(approvalDate.plusMonths(constructMonth), DatePattern.NORM_DATETIME_MINUTE_PATTERN);
LocalDateTime time = LocalDateTime.parse(acceptTime, DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_MINUTE_PATTERN));
declaredProject.setPlanAcceptanceTime(time);


+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java Целия файл

@@ -3,6 +3,9 @@ package com.ningdatech.pmapi.user.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.user.entity.UserInfo;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务类
@@ -17,4 +20,5 @@ public interface IUserInfoService extends IService<UserInfo> {

UserInfo getUserInfoByEmployeeCode(String employeeCode);

List<UserInfo> getUserInfoByEmployeeCodes(Collection<String> employeeCodes);
}

+ 9
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java Целия файл

@@ -10,6 +10,9 @@ import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务实现类
@@ -39,4 +42,10 @@ public class UserInfoServiceImpl extends ServiceImpl<NdUserInfoMapper, UserInfo>
return getOne(query);
}

@Override
public List<UserInfo> getUserInfoByEmployeeCodes(Collection<String> employeeCodes) {
LambdaQueryWrapper<UserInfo> query = Wrappers.lambdaQuery(UserInfo.class)
.in(UserInfo::getEmployeeCode, employeeCodes);
return list(query);
}
}

Loading…
Отказ
Запис