@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.ningdatech.basic.function.VUtils; | import com.ningdatech.basic.function.VUtils; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.NdDateUtils; | import com.ningdatech.basic.util.NdDateUtils; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.ningdatech.pmapi.common.constant.CommonConst; | import com.ningdatech.pmapi.common.constant.CommonConst; | ||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | ||||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | import com.ningdatech.pmapi.common.helper.UserInfoHelper; | ||||
@@ -100,7 +101,7 @@ public class ConstructionPlanManage { | |||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
Project projectInfo = projectService.getById(projectDto.getId()); | |||||
Project projectInfo = projectService.getNewProject(projectDto.getId()); | |||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | ||||
VUtils.isTrue(StringUtils.isBlank(projectDto.getConstructionPlanFile())).throwMessage("提交失败 请提交建设方案!"); | VUtils.isTrue(StringUtils.isBlank(projectDto.getConstructionPlanFile())).throwMessage("提交失败 请提交建设方案!"); | ||||
@@ -112,7 +113,7 @@ public class ConstructionPlanManage { | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .eq(WflowModels::getRegionCode, regionCode) | ||||
.eq(WflowModels::getProcessType, ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()) | .eq(WflowModels::getProcessType, ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()) | ||||
.last("limit 1")); | |||||
.last(BizConst.LIMIT_1)); | |||||
if (Objects.isNull(model)) { | if (Objects.isNull(model)) { | ||||
log.error("此 【{}】区域找不到 建设申报流程配置", regionCode); | log.error("此 【{}】区域找不到 建设申报流程配置", regionCode); | ||||
@@ -98,7 +98,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
ProjectDTO projectDto = dto.getProjectInfo(); | ProjectDTO projectDto = dto.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
Project projectInfo = projectService.getById(projectDto.getId()); | |||||
Project projectInfo = projectService.getNewProject(projectDto.getId()); | |||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | ||||
//要判断 当前操作人 是不是项目主管单位的人 | //要判断 当前操作人 是不是项目主管单位的人 | ||||
@@ -158,7 +158,7 @@ public class PurchaseManage { | |||||
Long projectId = dto.getProjectId(); | Long projectId = dto.getProjectId(); | ||||
VUtils.isTrue(Objects.isNull(projectId)).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(projectId)).throwMessage("提交失败 缺少项目ID!"); | ||||
Project project = projectService.getById(projectId); | |||||
Project project = projectService.getNewProject(dto.getProjectId()); | |||||
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!"); | ||||
//首先要判断 项目当前状态 是不是 采购结果备案 | //首先要判断 项目当前状态 是不是 采购结果备案 | ||||
@@ -63,7 +63,7 @@ public class ReviewByDeptJointManage { | |||||
String startUserCode = project.getSponsor(); | String startUserCode = project.getSponsor(); | ||||
VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
Project projectInfo = projectService.getById(project.getId()); | |||||
Project projectInfo = projectService.getNewProject(project.getId()); | |||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | ||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
@@ -85,7 +85,7 @@ public class ReviewByProvincialDeptManage { | |||||
public String restartTheProcess(DefaultDeclaredDTO declaringDTO) { | public String restartTheProcess(DefaultDeclaredDTO declaringDTO) { | ||||
ProjectDTO project = declaringDTO.getProjectInfo(); | ProjectDTO project = declaringDTO.getProjectInfo(); | ||||
VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); | VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!"); | ||||
Project projectInfo = projectService.getById(project.getId()); | |||||
Project projectInfo = projectService.getNewProject(project.getId()); | |||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | ||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
@@ -16,4 +16,6 @@ import java.util.List; | |||||
public interface IProjectService extends IService<Project> { | public interface IProjectService extends IService<Project> { | ||||
public List<Long> getAllVersionProjectId(Project project); | public List<Long> getAllVersionProjectId(Project project); | ||||
Project getNewProject(Long projectId); | |||||
} | } |
@@ -1,7 +1,9 @@ | |||||
package com.ningdatech.pmapi.projectlib.service.impl; | package com.ningdatech.pmapi.projectlib.service.impl; | ||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.mapper.ProjectMapper; | import com.ningdatech.pmapi.projectlib.mapper.ProjectMapper; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
@@ -10,6 +12,7 @@ import org.springframework.stereotype.Service; | |||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@@ -37,4 +40,23 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl | |||||
return projects.stream().map(Project::getId).collect(Collectors.toList()); | return projects.stream().map(Project::getId).collect(Collectors.toList()); | ||||
} | } | ||||
@Override | |||||
public Project getNewProject(Long projectId) { | |||||
Project project = getById(projectId); | |||||
if(Objects.isNull(project)){ | |||||
return null; | |||||
} | |||||
String projectCode = project.getProjectCode(); | |||||
LambdaQueryWrapper<Project> last = Wrappers.lambdaQuery(Project.class) | |||||
.eq(Project::getNewest, Boolean.TRUE) | |||||
.eq(Project::getProjectCode, projectCode) | |||||
.last(BizConst.LIMIT_1); | |||||
Project newest = getOne(last); | |||||
return newest; | |||||
} | |||||
} | } |