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 bdba048..c012bc1 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 @@ -84,7 +84,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<>(); @@ -177,7 +177,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 index d3bc462..032e52d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceAppraisalPlanController.java @@ -59,8 +59,9 @@ public class PerformanceAppraisalPlanController { @GetMapping("/group/list/{appraisalId}") @ApiOperation("绩效评价分组列表") - public List groupList(@PathVariable Long appraisalId) { - return performanceAppraisalPlanManage.groupList(appraisalId); + public List groupList(@PathVariable Long appraisalId, + @RequestParam(required = false) String name) { + return performanceAppraisalPlanManage.groupList(appraisalId,name); } @PostMapping("/group/save") 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 index 1dcdbd6..1f0601d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -368,11 +368,11 @@ public class PerformanceAppraisalPlanManage { } } - public List groupList(Long appraisalId) { + public List groupList(Long appraisalId,String name) { List groups = groupService.list( Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) - .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId)); - + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, appraisalId) + .like(StringUtils.isNotBlank(name),PerformanceAppraisalProjectGroup::getName,name)); if(CollUtil.isEmpty(groups)){ return Collections.emptyList(); } 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);