diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index 4bae14f..112dd95 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/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 { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java index a7a5d31..306a086 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java @@ -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 getUserFullInfos(List userInfos); + String getUserName(Long userId); /** @@ -34,6 +39,8 @@ public interface UserInfoHelper { UserFullInfoDTO getUserFullInfoByEmployeeCode(String employeeCode); + List getUserFullInfoByEmployeeCodes(Collection employeeCodes); + /** * 获取用户任职所在单位code * diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java index cc9b9c0..7dc75e0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java @@ -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 getUserFullInfos(List userInfos) { + List res = Lists.newArrayList(); + + if(CollUtil.isEmpty(userInfos)){ + return res; + } + + Map userMap = userInfos.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode,e->e)); + + // 获取浙政钉雇员信息 组织信息 + List employeeCodes = userInfos.stream().map(UserInfo::getEmployeeCode).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(employeeCodes)) { + List dingEmployeeInfoList = iDingEmployeeInfoService + .list(Wrappers.lambdaQuery(DingEmployeeInfo.class) + .in(DingEmployeeInfo::getEmployeeCode, employeeCodes) + .eq(DingEmployeeInfo::getMainJob, "true")); + + if(CollUtil.isEmpty(dingEmployeeInfoList)){ + return res; + } + + // 装配用户任职所在单位 + List empPosUnitCodes = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getEmpPosUnitCode).collect(Collectors.toList()); + List orgCodes = dingEmployeeInfoList.stream().map(DingEmployeeInfo::getOrganizationCode).collect(Collectors.toList()); + List allOrgCodes = Stream.concat(empPosUnitCodes.stream(),orgCodes.stream()).collect(Collectors.toList()); + if (CollUtil.isEmpty(allOrgCodes)) { + return res; + } + List dingOrganizations = iDingOrganizationService.listByCodes(allOrgCodes); + if (CollUtil.isEmpty(dingOrganizations)) { + return res; + } + Map 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 getUserFullInfoByEmployeeCodes(Collection employeeCodes) { + List userInfos = userInfoService.getUserInfoByEmployeeCodes(employeeCodes); + return getUserFullInfos(userInfos); + } + + @Override public String getUserEmpPosUnitCode(Long userId) { UserFullInfoDTO userFullInfo = getUserFullInfo(userId); return userFullInfo.getEmpPosUnitCode(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java index 809dca5..a30cd3f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java +++ b/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; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/CodeUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/CodeUtil.java new file mode 100644 index 0000000..12a5268 --- /dev/null +++ b/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 convertStrToList(String str) { + if(StringUtils.isBlank(str)){ + return Collections.emptyList(); + } + return Arrays.stream(str.split(StrPool.COMMA)).collect(Collectors.toList()); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java index 01901c3..05baa00 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java @@ -122,7 +122,7 @@ public class ProjectFileManage { List 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 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(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java new file mode 100644 index 0000000..032e52d --- /dev/null +++ b/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 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 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); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java new file mode 100644 index 0000000..1b45196 --- /dev/null +++ b/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 convertProjects( + List projects, Map 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 convertApplications( + List applications, Map 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; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java new file mode 100644 index 0000000..1f0601d --- /dev/null +++ b/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 list(PerformanceAppraisalListReq req) { + Page page = req.page(); + LambdaQueryWrapper 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 paIds = page.getRecords().stream().map(PerformanceAppraisal::getId).collect(Collectors.toList()); + List paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) + .in(PerformanceAppraisalProject::getAppraisalId, paIds)); + + Map projectMap = Maps.newHashMap(); + Map> papsGroupMap = Maps.newHashMap(); + if(CollUtil.isNotEmpty(paps)){ + papsGroupMap = paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId)); + + List projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList()); + List 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 paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) + .in(PerformanceAppraisalApplication::getAppraisalId, paIds)); + Map applicationMap = Maps.newHashMap(); + Map> paasGroupMap = Maps.newHashMap(); + if(CollUtil.isNotEmpty(paas)){ + paasGroupMap = paas.stream().collect(Collectors.groupingBy(PerformanceAppraisalApplication::getAppraisalId)); + + List applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList()); + List 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> finalPapsGroupMap = papsGroupMap; + Map> finalPaasGroupMap = paasGroupMap; + Map finalProjectMap = projectMap; + Map finalApplicationMap = applicationMap; + List 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 paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) + .eq(PerformanceAppraisalProject::getAppraisalId, id)); + Map projectMap = Maps.newHashMap(); + Map> papsGroupMap = Maps.newHashMap(); + if(CollUtil.isNotEmpty(paps)){ + papsGroupMap = paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId)); + + List projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList()); + List 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 paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class) + .eq(PerformanceAppraisalApplication::getAppraisalId, id)); + Map applicationMap = Maps.newHashMap(); + Map> paasGroupMap = Maps.newHashMap(); + if(CollUtil.isNotEmpty(paas)){ + paasGroupMap = paas.stream().collect(Collectors.groupingBy(PerformanceAppraisalApplication::getAppraisalId)); + + List applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList()); + List 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> finalPapsGroupMap = papsGroupMap; + Map> finalPaasGroupMap = paasGroupMap; + Map finalProjectMap = projectMap; + Map 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 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 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 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 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 groupList(Long appraisalId,String name) { + List 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 allEmployeeCodes = Sets.newHashSet(); + Set projectCodes = Sets.newHashSet(); + Map userMap = Maps.newHashMap(); + Map 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 users = userInfoHelper.getUserFullInfoByEmployeeCodes(allEmployeeCodes); + if(CollUtil.isNotEmpty(users)){ + userMap = users.stream().collect(Collectors.toMap(UserFullInfoDTO::getEmployeeCode,u -> u)); + } + } + + if(CollUtil.isNotEmpty(projectCodes)){ + List 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 finalProjectMap = projectMap; + Map 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 checkProject(String projectIds, Map 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 checkUser(String users, Map userMap) { + if(StringUtils.isBlank(users)){ + return Collections.emptyList(); + } + return Arrays.stream(users.split(StrPool.COMMA)).map( + employeeCode -> userMap.get(employeeCode) + ).collect(Collectors.toList()); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.java new file mode 100644 index 0000000..957f22f --- /dev/null +++ b/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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Zpf + * @since 2023-06-03 + */ +public interface PerformanceAppraisalApplicationMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.xml new file mode 100644 index 0000000..7b75dce --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalApplicationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.java new file mode 100644 index 0000000..1e9a37f --- /dev/null +++ b/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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Zpf + * @since 2023-06-03 + */ +public interface PerformanceAppraisalMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.xml new file mode 100644 index 0000000..c0801d4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.java new file mode 100644 index 0000000..9fb9b82 --- /dev/null +++ b/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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Zpf + * @since 2023-06-03 + */ +public interface PerformanceAppraisalProjectGroupMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.xml new file mode 100644 index 0000000..b017ca1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectGroupMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.java new file mode 100644 index 0000000..2a0e102 --- /dev/null +++ b/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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Zpf + * @since 2023-06-03 + */ +public interface PerformanceAppraisalProjectMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.xml new file mode 100644 index 0000000..afcb05f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalProjectDTO.java new file mode 100644 index 0000000..1e4eace --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalCreateDTO.java new file mode 100644 index 0000000..dd3e2b4 --- /dev/null +++ b/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 projects; + + @ApiModelProperty("评价应用ids") + private List applicationIds; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalEditDTO.java new file mode 100644 index 0000000..1654133 --- /dev/null +++ b/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 projects; + + @ApiModelProperty("评价应用ids") + private List applicationIds; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalProjectGroupSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceAppraisalProjectGroupSaveDTO.java new file mode 100644 index 0000000..b5bc523 --- /dev/null +++ b/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 projectCodes; + + @ApiModelProperty("复评人员") + private List reAppraisalUsers; + + @ApiModelProperty("核查人员") + private List verificationUsers; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisal.java new file mode 100644 index 0000000..a52c803 --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalApplication.java new file mode 100644 index 0000000..fe82b6c --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java new file mode 100644 index 0000000..6de11c4 --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectGroup.java new file mode 100644 index 0000000..dd6939c --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java new file mode 100644 index 0000000..064add0 --- /dev/null +++ b/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; + +/** + *

+ * PerformanceAppraisalListReq + *

+ * + * @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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalApplicationVO.java new file mode 100644 index 0000000..a84bf01 --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectGroupVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectGroupVO.java new file mode 100644 index 0000000..333e8a4 --- /dev/null +++ b/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 projects; + + @ApiModelProperty("复评人员") + private List reAppraisalUsers; + + @ApiModelProperty("核查人员") + private List verificationUsers; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java new file mode 100644 index 0000000..57a3828 --- /dev/null +++ b/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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalVO.java new file mode 100644 index 0000000..f1e1aaa --- /dev/null +++ b/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 projects; + + @ApiModelProperty("评价应用列表") + private List applications; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalApplicationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalApplicationService.java new file mode 100644 index 0000000..3fc9a0c --- /dev/null +++ b/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; + +/** + *

+ * 服务类 + *

+ * + * @author PoffyZhang + * @since 2023-06-03 + */ +public interface IPerformanceAppraisalApplicationService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectGroupService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectGroupService.java new file mode 100644 index 0000000..4548554 --- /dev/null +++ b/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; + +/** + *

+ * 服务类 + *

+ * + * @author PoffyZhang + * @since 2023-06-03 + */ +public interface IPerformanceAppraisalProjectGroupService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectService.java new file mode 100644 index 0000000..5749b93 --- /dev/null +++ b/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; + +/** + *

+ * 服务类 + *

+ * + * @author PoffyZhang + * @since 2023-06-03 + */ +public interface IPerformanceAppraisalProjectService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalService.java new file mode 100644 index 0000000..12b3c01 --- /dev/null +++ b/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; + +/** + *

+ * 服务类 + *

+ * + * @author PoffyZhang + * @since 2023-06-03 + */ +public interface IPerformanceAppraisalService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalApplicationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalApplicationServiceImpl.java new file mode 100644 index 0000000..020d8bb --- /dev/null +++ b/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; + +/** + *

+ * 绩效评价和应用 服务实现类 + *

+ * + * @author ZPF + * @since 2023-06-15 + */ +@Service +public class PerformanceAppraisalApplicationServiceImpl extends ServiceImpl implements IPerformanceAppraisalApplicationService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectGroupServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectGroupServiceImpl.java new file mode 100644 index 0000000..4ac484e --- /dev/null +++ b/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; + +/** + *

+ * 绩效评价分组 服务实现类 + *

+ * + * @author ZPF + * @since 2023-06-15 + */ +@Service +public class PerformanceAppraisalProjectGroupServiceImpl extends ServiceImpl implements IPerformanceAppraisalProjectGroupService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectServiceImpl.java new file mode 100644 index 0000000..d03db8f --- /dev/null +++ b/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; + +/** + *

+ * 绩效评价和项目 服务实现类 + *

+ * + * @author ZPF + * @since 2023-06-15 + */ +@Service +public class PerformanceAppraisalProjectServiceImpl extends ServiceImpl implements IPerformanceAppraisalProjectService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalServiceImpl.java new file mode 100644 index 0000000..0613978 --- /dev/null +++ b/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; + +/** + *

+ * 绩效评价 服务实现类 + *

+ * + * @author ZPF + * @since 2023-06-15 + */ +@Service +public class PerformanceAppraisalServiceImpl extends ServiceImpl implements IPerformanceAppraisalService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index 44bbf6f..7f7dae5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/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 applicationList(ProjectApplicationListReq req) { + return projectLibManage.applicationList(req); + } + @GetMapping("/{id}") @ApiOperation("获取项目详情") public ProjectDetailVO detail (@PathVariable Long id){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index f6dd325..af79310 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/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 applicationList(ProjectApplicationListReq req) { + Page page = req.page(); + LambdaQueryWrapper 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 res = page.getRecords().stream() + .map(app -> BeanUtil.copyProperties(app,ProjectApplicationVO.class)) + .collect(Collectors.toList()); + + return PageVo.of(res,page.getTotal()); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java index b03528b..23fa04f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java +++ b/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; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java index 29e5af8..d053af0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java +++ b/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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApplicationListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApplicationListReq.java new file mode 100644 index 0000000..0ec5190 --- /dev/null +++ b/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.*; + +/** + *

+ * ProjectLibListReq + *

+ * + * @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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectApplicationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectApplicationVO.java index dd19153..feb42b4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectApplicationVO.java +++ b/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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index 125e1db..615f648 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/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); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java index c285c2c..7f5ac38 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java +++ b/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; + /** *

* 服务类 @@ -17,4 +20,5 @@ public interface IUserInfoService extends IService { UserInfo getUserInfoByEmployeeCode(String employeeCode); + List getUserInfoByEmployeeCodes(Collection employeeCodes); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java index ba023a4..3f5fa28 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java +++ b/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; + /** *

* 服务实现类 @@ -39,4 +42,10 @@ public class UserInfoServiceImpl extends ServiceImpl return getOne(query); } + @Override + public List getUserInfoByEmployeeCodes(Collection employeeCodes) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(UserInfo.class) + .in(UserInfo::getEmployeeCode, employeeCodes); + return list(query); + } }