diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java index cc79497..43b37be 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java @@ -165,9 +165,9 @@ public class AppIrsManage { log.info("查询应用目录 : {}",JSON.toJSONString(forEntity)); - if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getDatas()) - && CollUtil.isNotEmpty(forEntity.getBody().getDatas().getApiApplySearchResult())){ - return forEntity.getBody().getDatas().getApiApplySearchResult().get(0); + if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getData()) + && CollUtil.isNotEmpty(forEntity.getBody().getData().getApiApplySearchResult())){ + return forEntity.getBody().getData().getApiApplySearchResult().get(0); } return null; } @@ -186,9 +186,9 @@ public class AppIrsManage { log.info("查询应用目录 : {}",JSON.toJSONString(forEntity)); - if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getDatas()) - && CollUtil.isNotEmpty(forEntity.getBody().getDatas().getApiApplySearchResult())){ - return forEntity.getBody().getDatas().getApiApplySearchResult(); + if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getData()) + && CollUtil.isNotEmpty(forEntity.getBody().getData().getApiApplySearchResult())){ + return forEntity.getBody().getData().getApiApplySearchResult(); } return Collections.emptyList(); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java index b09265e..89bf41d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java @@ -15,6 +15,5 @@ import java.util.List; public class ApiDTO { private String code; private String msg; - private String data; - private ApiSearchResult datas; + private ApiSearchResult data; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java index 75c2482..58b8d57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java @@ -58,6 +58,7 @@ public class ArchivedHandle extends AbstractProcessBusinessHandle { ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.FINAL_ACCEPTANCE_PASS.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); if(Objects.nonNull(projectStatusChange)){ processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java index 5645ce5..67b843e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java @@ -88,6 +88,7 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java index b778224..659b22d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java @@ -7,6 +7,7 @@ import java.util.Objects; import cn.hutool.core.collection.CollUtil; import com.google.common.collect.Lists; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -60,7 +61,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) .orderByDesc(ProjectInst::getCreatOn) - .last("limit 1")); + .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)){ processDetailVO.setStepStatus(StepStatusEnum.NOT_START); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java index e71b0f8..658c4f2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java @@ -78,6 +78,7 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); if(Objects.nonNull(projectStatusChange)){ processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java index b2982b8..48afa8a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java @@ -1,6 +1,7 @@ package com.ningdatech.pmapi.projectlib.handle; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; @@ -57,7 +58,9 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectStatusChange startChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectId) .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()) - .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode())); + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()).orderByDesc(ProjectStatusChange::getCreateOn) + .orderByDesc(ProjectStatusChange::getCreateOn) + .last(BizConst.LIMIT_1)); if(Objects.nonNull(startChange)){ processDetailVO.setFinishTime(startChange.getCreateOn()); } @@ -66,7 +69,9 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectStatusChange passChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectId) .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) - .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode())); + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()) + .orderByDesc(ProjectStatusChange::getCreateOn) + .last(BizConst.LIMIT_1)); if(Objects.nonNull(passChange)){ processDetailVO.setFinishTime(passChange.getCreateOn()); } @@ -75,7 +80,9 @@ public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectStatusChange rejectChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectId) .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) - .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode())); + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()) + .orderByDesc(ProjectStatusChange::getCreateOn) + .last(BizConst.LIMIT_1)); if(Objects.nonNull(rejectChange)){ processDetailVO.setFinishTime(rejectChange.getCreateOn()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java index 62f99c4..bd39aa3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java @@ -75,6 +75,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) .in(ProjectStatusChange::getProjectId, allVersionProjectIds) .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) + .orderByDesc(ProjectStatusChange::getCreateOn) .last(BizConst.LIMIT_1)); processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java index 34fcc73..14b592b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; @@ -67,7 +68,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) .orderByDesc(ProjectInst::getCreatOn) - .last("limit 1")); + .last(BizConst.LIMIT_1)); ProcessProgressVo instanceDetail = null; // 未找到当前版本项目的单位内部审核流程且当前项目版本号大于1(是被驳回重新申报的项目) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 4a22769..07f58bb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -1031,12 +1031,15 @@ public class TodoCenterManage { //批量删除 projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) .eq(ProjectApplication::getProjectId,project.getId())); + projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) + .eq(ProjectApplication::getProjectCode,project.getProjectCode())); if(isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())){ //批量添加 List applications = projectDto.getApplicationList().stream().map(application -> { ProjectApplication projectApplication = new ProjectApplication(); BeanUtils.copyProperties(application, projectApplication); projectApplication.setProjectId(project.getId()); + projectApplication.setProjectCode(project.getProjectCode()); return projectApplication; }).collect(Collectors.toList()); projectApplicationService.saveBatch(applications);