@@ -188,9 +188,14 @@ public enum ProjectStateChangeEvent implements AbstractStateChangeEvent { | |||||
CHANGE_APPLY_SUBMIT(null, null, null), | CHANGE_APPLY_SUBMIT(null, null, null), | ||||
CHANGE_APPLY_PASS(null, null, null), | CHANGE_APPLY_PASS(null, null, null), | ||||
CHANGE_APPLY_FAILED(null, null, null); | |||||
CHANGE_APPLY_FAILED(null, null, null), | |||||
/** | |||||
* 项目删除 | |||||
*/ | |||||
DELETED_APPLY_PASSED(null, null, null); | |||||
private final Integer passStatusCode; | private final Integer passStatusCode; | ||||
private final Integer rejectStatusCode; | private final Integer rejectStatusCode; | ||||
private final Integer withdrawStatusCode; | private final Integer withdrawStatusCode; | ||||
@@ -49,6 +49,7 @@ import com.hz.pm.api.open.model.vo.MeetingExpertToMhDTO; | |||||
import com.hz.pm.api.organization.service.IDingOrganizationService; | import com.hz.pm.api.organization.service.IDingOrganizationService; | ||||
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; | import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | ||||
import com.hz.pm.api.projectlib.service.IProjectService; | import com.hz.pm.api.projectlib.service.IProjectService; | ||||
@@ -1089,7 +1090,7 @@ public class MeetingManage { | |||||
} | } | ||||
String meetingType = req.getMeetingType(); | String meetingType = req.getMeetingType(); | ||||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | ||||
.notIn(Project::getStage, ProjectStatus.STOP_CHANGE_STAGE_CODES) | |||||
.notIn(Project::getStage, ProjectStatusConstant.CHANGE_STOP_DELETE_STAGE) | |||||
.eq(Project::getNewest, Boolean.TRUE); | .eq(Project::getNewest, Boolean.TRUE); | ||||
BizUtils.notEmpty(unitQueryState.getUnitIds(), w -> { | BizUtils.notEmpty(unitQueryState.getUnitIds(), w -> { | ||||
List<String> unitIdStrList = CollUtils.convert(w, String::valueOf); | List<String> unitIdStrList = CollUtils.convert(w, String::valueOf); | ||||
@@ -26,6 +26,7 @@ import com.hz.pm.api.projectdeclared.service.IPurchaseService; | |||||
import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; | import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; | ||||
import com.hz.pm.api.projectlib.entity.MhSystemReplaceInfo; | import com.hz.pm.api.projectlib.entity.MhSystemReplaceInfo; | ||||
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.enumeration.GovSystemReplaceTypeEnum; | import com.hz.pm.api.projectlib.model.enumeration.GovSystemReplaceTypeEnum; | ||||
import com.hz.pm.api.projectlib.service.IMhSystemReplaceInfoService; | import com.hz.pm.api.projectlib.service.IMhSystemReplaceInfoService; | ||||
@@ -81,6 +82,7 @@ public class OpenApiProjectLibManage { | |||||
.select(Project::getId, Project::getProjectCode, Project::getProjectName, Project::getBuildOrgCode, | .select(Project::getId, Project::getProjectCode, Project::getProjectName, Project::getBuildOrgCode, | ||||
Project::getStatus, Project::getReviewAmount, Project::getDeclareAmount, Project::getProjectYear, | Project::getStatus, Project::getReviewAmount, Project::getDeclareAmount, Project::getProjectYear, | ||||
Project::getCreateOn, Project::getBuildOrgName) | Project::getCreateOn, Project::getBuildOrgName) | ||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.exists(sql.toString()) | .exists(sql.toString()) | ||||
.eq(po.getProjectYear() != null, Project::getProjectYear, po.getProjectYear()) | .eq(po.getProjectYear() != null, Project::getProjectYear, po.getProjectYear()) | ||||
@@ -195,26 +197,25 @@ public class OpenApiProjectLibManage { | |||||
public List<TenderToMhDetailVO> listTenders(TenderListReq req) { | public List<TenderToMhDetailVO> listTenders(TenderListReq req) { | ||||
openApiCheckSignUtil.checkSign(req.getKey()); | openApiCheckSignUtil.checkSign(req.getKey()); | ||||
LambdaQueryWrapper<Purchase> purQuery = Wrappers.lambdaQuery(Purchase.class) | |||||
Wrapper<Project> projQuery = Wrappers.lambdaQuery(Project.class) | |||||
.select(Project::getId, Project::getProjectCode) | |||||
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) | |||||
.eq(req.getBuildOrgCode() != null, Project::getBuildOrgCode, req.getBuildOrgCode()) | |||||
.eq(req.getProjectCode() != null, Project::getProjectCode, req.getProjectCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE); | |||||
List<Project> projects = projectService.list(projQuery); | |||||
if (projects.isEmpty()) { | |||||
return Collections.emptyList(); | |||||
} | |||||
List<Long> projectIds = projects.stream() | |||||
.map(w -> ProjectIdCodeCacheUtil.get(w.getProjectCode())) | |||||
.flatMap(Collection::stream) | |||||
.collect(Collectors.toList()); | |||||
Wrapper<Purchase> purQuery = Wrappers.lambdaQuery(Purchase.class) | |||||
.in(Purchase::getProjectId, projectIds) | |||||
.orderByDesc(Purchase::getCreateOn) | .orderByDesc(Purchase::getCreateOn) | ||||
.orderByDesc(Purchase::getId); | .orderByDesc(Purchase::getId); | ||||
if (req.hasProjectQuery()) { | |||||
Wrapper<Project> projQuery = Wrappers.lambdaQuery(Project.class) | |||||
.select(Project::getId, Project::getProjectCode) | |||||
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) | |||||
.eq(req.getBuildOrgCode() != null, Project::getBuildOrgCode, req.getBuildOrgCode()) | |||||
.eq(req.getProjectCode() != null, Project::getProjectCode, req.getProjectCode()) | |||||
.eq(Project::getNewest, Boolean.TRUE); | |||||
List<Project> projects = projectService.list(projQuery); | |||||
if (projects.isEmpty()) { | |||||
return Collections.emptyList(); | |||||
} | |||||
List<Long> projectIds = projects.stream() | |||||
.map(w -> ProjectIdCodeCacheUtil.get(w.getProjectCode())) | |||||
.flatMap(Collection::stream) | |||||
.collect(Collectors.toList()); | |||||
purQuery.in(Purchase::getProjectId, projectIds); | |||||
} | |||||
List<Purchase> purchases = purchaseService.list(purQuery); | List<Purchase> purchases = purchaseService.list(purQuery); | ||||
if (purchases.isEmpty()) { | if (purchases.isEmpty()) { | ||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
@@ -8,6 +8,7 @@ import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO; | |||||
import com.hz.pm.api.projectdeclared.model.enumerization.ProjectDraftTypeEnum; | import com.hz.pm.api.projectdeclared.model.enumerization.ProjectDraftTypeEnum; | ||||
import com.hz.pm.api.projectdeclared.model.vo.DeclaredProgressStatisticsVO; | import com.hz.pm.api.projectdeclared.model.vo.DeclaredProgressStatisticsVO; | ||||
import com.hz.pm.api.projectdeclared.model.vo.ProjectDraftVO; | import com.hz.pm.api.projectdeclared.model.vo.ProjectDraftVO; | ||||
import com.hz.pm.api.projectlib.model.req.ProjectIdReq; | |||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | import com.hz.pm.api.projectlib.model.req.ProjectListReq; | ||||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
@@ -20,6 +21,7 @@ import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import javax.validation.Valid; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -112,4 +114,11 @@ public class DeclaredProjectController { | |||||
ExcelDownUtil.downXls(response, req, declaredProjectManage::exportList); | ExcelDownUtil.downXls(response, req, declaredProjectManage::exportList); | ||||
} | } | ||||
@PostMapping("/delete") | |||||
@ApiOperation("删除项目") | |||||
@WebLog("删除项目") | |||||
public void deleteProjectLogic(@RequestBody @Valid ProjectIdReq req) { | |||||
declaredProjectManage.deleteProjectLogic(req.getProjectId()); | |||||
} | |||||
} | } |
@@ -32,6 +32,7 @@ import com.hz.pm.api.projectdeclared.model.req.XcfhxApplyReq; | |||||
import com.hz.pm.api.projectdeclared.model.vo.*; | import com.hz.pm.api.projectdeclared.model.vo.*; | ||||
import com.hz.pm.api.projectdeclared.service.*; | import com.hz.pm.api.projectdeclared.service.*; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan; | import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | import com.hz.pm.api.projectlib.model.entity.ProjectInst; | ||||
@@ -313,7 +314,7 @@ public class ConstructionManage { | |||||
.select(Project::getId) | .select(Project::getId) | ||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.and(q1 -> q1.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE | .and(q1 -> q1.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE | ||||
+ " and np.status = {0} ", TenderMainStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.getCode()) | + " and np.status = {0} ", TenderMainStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.getCode()) | ||||
.or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE | .or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_PURCHASE_STATUS_CHANGE | ||||
@@ -370,7 +371,7 @@ public class ConstructionManage { | |||||
+ " and npsc.event = '%s'", TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES); | + " and npsc.event = '%s'", TenderStateChangeEvent.SUBMIT_FIRST_INSPECTED_FILES); | ||||
LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req) | LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.orderByAsc(Project::getDeliveryTime); | .orderByAsc(Project::getDeliveryTime); | ||||
if (req.getTabStatus() != null) { | if (req.getTabStatus() != null) { | ||||
@@ -15,6 +15,7 @@ import com.hz.pm.api.common.model.constant.RegionConst; | |||||
import com.hz.pm.api.common.model.constant.TypeReferenceConst; | import com.hz.pm.api.common.model.constant.TypeReferenceConst; | ||||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | ||||
import com.hz.pm.api.projectdeclared.model.dto.ProjectConditionDTO; | import com.hz.pm.api.projectdeclared.model.dto.ProjectConditionDTO; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
@@ -66,7 +67,7 @@ public class DeclaredProjectHelper { | |||||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | ||||
.eq(Project::getProjectName, project.getProjectName()) | .eq(Project::getProjectName, project.getProjectName()) | ||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.ne(StrUtil.isNotBlank(projectCode), Project::getProjectCode, projectCode) | .ne(StrUtil.isNotBlank(projectCode), Project::getProjectCode, projectCode) | ||||
.eq(StrUtil.isNotBlank(hisProjectCode), Project::getHisProjectCode, hisProjectCode) | .eq(StrUtil.isNotBlank(hisProjectCode), Project::getHisProjectCode, hisProjectCode) | ||||
.last(BizConst.LIMIT_1); | .last(BizConst.LIMIT_1); | ||||
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.hz.pm.api.common.enumeration.CommonEnum; | import com.hz.pm.api.common.enumeration.CommonEnum; | ||||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | import com.hz.pm.api.common.enumeration.ProjectProcessType; | ||||
import com.hz.pm.api.common.exception.ReturnException; | |||||
import com.hz.pm.api.common.helper.UserInfoHelper; | import com.hz.pm.api.common.helper.UserInfoHelper; | ||||
import com.hz.pm.api.common.model.constant.ExistsSqlConst; | import com.hz.pm.api.common.model.constant.ExistsSqlConst; | ||||
import com.hz.pm.api.common.model.constant.MhUnitConst; | import com.hz.pm.api.common.model.constant.MhUnitConst; | ||||
@@ -32,11 +33,13 @@ import com.hz.pm.api.projectdeclared.model.vo.ProjectDraftVO; | |||||
import com.hz.pm.api.projectdeclared.service.IProjectDraftService; | import com.hz.pm.api.projectdeclared.service.IProjectDraftService; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | import com.hz.pm.api.projectlib.manage.ProjectLibManage; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; | |||||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | ||||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | ||||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | import com.hz.pm.api.projectlib.model.req.ProjectListReq; | ||||
@@ -105,11 +108,10 @@ public class DeclaredProjectManage { | |||||
* 新项目 启动实例 | * 新项目 启动实例 | ||||
* | * | ||||
* @param req \ | * @param req \ | ||||
* @return \ | |||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public synchronized void store(DefaultDeclaredDTO req) { | public synchronized void store(DefaultDeclaredDTO req) { | ||||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||||
UserInfoDetails user = LoginUserUtil.userDetailNotNull(); | |||||
ProjectDTO reqProj = req.getProjectInfo(); | ProjectDTO reqProj = req.getProjectInfo(); | ||||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | ||||
reqProj.setBuildOrgName(user.getMhUnitName()); | reqProj.setBuildOrgName(user.getMhUnitName()); | ||||
@@ -138,7 +140,7 @@ public class DeclaredProjectManage { | |||||
*/ | */ | ||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public synchronized String startTheProcess(DefaultDeclaredDTO req) { | public synchronized String startTheProcess(DefaultDeclaredDTO req) { | ||||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||||
UserInfoDetails user = LoginUserUtil.userDetailNotNull(); | |||||
WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.COMPLIANCE_REVIEW, | WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.COMPLIANCE_REVIEW, | ||||
user.getMhUnitId()); | user.getMhUnitId()); | ||||
@@ -206,7 +208,7 @@ public class DeclaredProjectManage { | |||||
public synchronized String reStartTheProcess(DefaultDeclaredDTO req) { | public synchronized String reStartTheProcess(DefaultDeclaredDTO req) { | ||||
ProjectDTO reqProj = req.getProjectInfo(); | ProjectDTO reqProj = req.getProjectInfo(); | ||||
Assert.notNull(reqProj.getId(), "提交失败,缺少项目ID!"); | Assert.notNull(reqProj.getId(), "提交失败,缺少项目ID!"); | ||||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||||
UserInfoDetails user = LoginUserUtil.userDetailNotNull(); | |||||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | ||||
reqProj.setBuildOrgName(user.getMhUnitName()); | reqProj.setBuildOrgName(user.getMhUnitName()); | ||||
@@ -376,7 +378,7 @@ public class DeclaredProjectManage { | |||||
return null; | return null; | ||||
} | } | ||||
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.select(Project::getStatus, Project::getProjectCode, Project::getStage); | .select(Project::getStatus, Project::getProjectCode, Project::getStage); | ||||
List<Project> projects = projectService.list(query); | List<Project> projects = projectService.list(query); | ||||
@@ -419,8 +421,8 @@ public class DeclaredProjectManage { | |||||
} | } | ||||
} | } | ||||
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()); | |||||
query.eq(Project::getNewest, Boolean.TRUE); | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE); | |||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
if (page.getTotal() == 0) { | if (page.getTotal() == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
@@ -542,4 +544,30 @@ public class DeclaredProjectManage { | |||||
} | } | ||||
} | } | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public synchronized void deleteProjectLogic(Long projectId) { | |||||
Project project = projectService.getNewestNoNull(projectId); | |||||
if (!ProjectStatus.COMPLIANCE_REVIEW_FAILED.eq(project.getStatus())) { | |||||
throw ReturnException.wrap("当前项目不可删除"); | |||||
} | |||||
UserInfoDetails user = LoginUserUtil.userDetailNotNull(); | |||||
if (!StrUtil.equals(project.getBuildOrgCode(), user.getMhUnitIdStr()) | |||||
&& !user.getUserId().equals(project.getCreateBy()) | |||||
&& !user.hasSuperAdmin()) { | |||||
throw ReturnException.wrap("暂无权限删除此项目"); | |||||
} | |||||
ProjectStatusChange change = new ProjectStatusChange(); | |||||
change.setProjectId(project.getId()); | |||||
change.setBeforeStatus(project.getStatus()); | |||||
change.setAfterStatus(ProjectStatus.DELETED_PASSED.getCode()); | |||||
change.setEvent(ProjectStateChangeEvent.DELETED_APPLY_PASSED.name()); | |||||
change.setProjectCode(project.getProjectCode()); | |||||
change.setCreateOn(LocalDateTime.now()); | |||||
projectStatusChangeService.save(change); | |||||
// 修改项目状态为已删除 | |||||
project.setStage(ProjectStatus.DELETED.getCode()); | |||||
project.setStatus(ProjectStatus.DELETED_PASSED.getCode()); | |||||
projectService.updateById(project); | |||||
} | |||||
} | } |
@@ -33,6 +33,7 @@ import com.hz.pm.api.projectdeclared.utils.ProjectIdCodeCacheUtil; | |||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.helper.ProjectSaveHelper; | import com.hz.pm.api.projectlib.helper.ProjectSaveHelper; | ||||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | import com.hz.pm.api.projectlib.manage.ProjectLibManage; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | import com.hz.pm.api.projectlib.model.entity.ProjectInst; | ||||
@@ -156,7 +157,7 @@ public class ProjectReviewManage { | |||||
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | ||||
" and npsc.event = {0}", ProjectStateChangeEvent.EXPERT_REVIEW_PASS) | " and npsc.event = {0}", ProjectStateChangeEvent.EXPERT_REVIEW_PASS) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.select(Project::getStatus, Project::getId); | .select(Project::getStatus, Project::getId); | ||||
List<Project> projects = projectService.list(query); | List<Project> projects = projectService.list(query); | ||||
@@ -207,7 +208,7 @@ public class ProjectReviewManage { | |||||
ProjectManageUtil.projectQuery(query, req); | ProjectManageUtil.projectQuery(query, req); | ||||
query.eq(Project::getNewest, Boolean.TRUE) | query.eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()); | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED); | |||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
if (page.getTotal() == 0) { | if (page.getTotal() == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
@@ -237,7 +238,7 @@ public class ProjectReviewManage { | |||||
query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | query.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | ||||
" and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS) | " and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.select(Project::getStatus, Project::getId, Project::getConstructionPlanSealFile); | .select(Project::getStatus, Project::getId, Project::getConstructionPlanSealFile); | ||||
List<Project> projects = projectService.list(query); | List<Project> projects = projectService.list(query); | ||||
@@ -298,7 +299,7 @@ public class ProjectReviewManage { | |||||
ProjectManageUtil.projectBaseQuery(query); | ProjectManageUtil.projectBaseQuery(query); | ||||
query.eq(Project::getNewest, Boolean.TRUE) | query.eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()); | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED); | |||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
if (page.getTotal() == 0) { | if (page.getTotal() == 0) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
@@ -48,6 +48,7 @@ import com.hz.pm.api.projectdeclared.service.*; | |||||
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | ||||
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; | import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | import com.hz.pm.api.projectlib.model.entity.ProjectInst; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; | import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; | ||||
@@ -154,7 +155,7 @@ public class PurchaseManage { | |||||
} | } | ||||
//待采购状态 | //待采购状态 | ||||
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | .exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + | ||||
" and npsc.event = {0}", ProjectStateChangeEvent.DECLARED_RECORD_PASS) | " and npsc.event = {0}", ProjectStateChangeEvent.DECLARED_RECORD_PASS) | ||||
@@ -204,7 +205,7 @@ public class PurchaseManage { | |||||
} | } | ||||
//待采购状态 | //待采购状态 | ||||
query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | query.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()); | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED); | |||||
query.eq(Project::getNewest, Boolean.TRUE); | query.eq(Project::getNewest, Boolean.TRUE); | ||||
query.orderByAsc(Project::getApprovalDate); | query.orderByAsc(Project::getApprovalDate); | ||||
ProjectManageUtil.projectBaseQuery(query); | ProjectManageUtil.projectBaseQuery(query); | ||||
@@ -725,8 +726,8 @@ public class PurchaseManage { | |||||
.exists(ExistsSqlConst.PURCHASE_EXISTS_STATUS_CHANGE | .exists(ExistsSqlConst.PURCHASE_EXISTS_STATUS_CHANGE | ||||
+ " and npsc.event = {0}", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO) | + " and npsc.event = {0}", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO) | ||||
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT | .notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT | ||||
+ "and (np.stage = {0} or np.status = {1})", ProjectStatus.STOPPED.getCode(), | |||||
ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
+ "and (np.stage = {0} or np.status in ({1}),{2}))", ProjectStatus.STOPPED.getCode(), | |||||
ProjectStatus.CHANGE_APPLY_PASSED.getCode(), ProjectStatus.DELETED_PASSED.getCode()) | |||||
.orderByDesc(Purchase::getCreateOn); | .orderByDesc(Purchase::getCreateOn); | ||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | ||||
if (!purchaseService.buildPurchaseQueryPermission(query, user)) { | if (!purchaseService.buildPurchaseQueryPermission(query, user)) { | ||||
@@ -786,8 +787,8 @@ public class PurchaseManage { | |||||
.exists(ExistsSqlConst.PURCHASE_EXISTS_STATUS_CHANGE | .exists(ExistsSqlConst.PURCHASE_EXISTS_STATUS_CHANGE | ||||
+ " and npsc.event = {0}", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO) | + " and npsc.event = {0}", TenderStateChangeEvent.SUBMIT_PURCHASE_CONSTRUCTION_INFO) | ||||
.notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT | .notExists(ExistsSqlConst.PURCHASE_EXISTS_PROJECT | ||||
+ "and (np.stage = {0} or np.status = {1})", ProjectStatus.STOPPED.getCode(), | |||||
ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
+ "and (np.stage = {0} or np.status in ({1},{2}))", ProjectStatus.STOPPED.getCode(), | |||||
ProjectStatus.CHANGE_APPLY_PASSED.getCode(), ProjectStatus.DELETED_PASSED.getCode()) | |||||
.orderByDesc(Purchase::getCreateOn); | .orderByDesc(Purchase::getCreateOn); | ||||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | ||||
if (!purchaseService.buildPurchaseQueryPermission(query, user)) { | if (!purchaseService.buildPurchaseQueryPermission(query, user)) { | ||||
@@ -19,6 +19,7 @@ import com.hz.pm.api.external.model.enumeration.MhUnitStripEnum; | |||||
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; | import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; | ||||
import com.hz.pm.api.projectlib.entity.ProjectApprovalAmount; | import com.hz.pm.api.projectlib.entity.ProjectApprovalAmount; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.ProjectApprovalAmountDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectApprovalAmountDTO; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | ||||
@@ -111,7 +112,7 @@ public class AmountApprovalManage { | |||||
query.eq(Project::getAnnualPlanOpened, Boolean.TRUE) | query.eq(Project::getAnnualPlanOpened, Boolean.TRUE) | ||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()); | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED); | |||||
buildAmountApprovalFilter(req.getIsAmountApproval(), query); | buildAmountApprovalFilter(req.getIsAmountApproval(), query); | ||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
long total = page.getTotal(); | long total = page.getTotal(); | ||||
@@ -162,7 +163,7 @@ public class AmountApprovalManage { | |||||
query.eq(Project::getAnnualPlanOpened, Boolean.TRUE) | query.eq(Project::getAnnualPlanOpened, Boolean.TRUE) | ||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()); | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED); | |||||
buildAmountApprovalFilter(req.getIsAmountApproval(), query); | buildAmountApprovalFilter(req.getIsAmountApproval(), query); | ||||
List<Project> page = projectService.list(query); | List<Project> page = projectService.list(query); | ||||
AmountApprovalProgressStatisticsVO stat = new AmountApprovalProgressStatisticsVO(); | AmountApprovalProgressStatisticsVO stat = new AmountApprovalProgressStatisticsVO(); | ||||
@@ -14,6 +14,7 @@ import com.hz.pm.api.common.statemachine.util.ProjectStateMachineUtil; | |||||
import com.hz.pm.api.common.util.BizUtils; | import com.hz.pm.api.common.util.BizUtils; | ||||
import com.hz.pm.api.common.util.ExcelDownUtil; | import com.hz.pm.api.common.util.ExcelDownUtil; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | ||||
@@ -75,7 +76,7 @@ public class AnnualPlanLibManage { | |||||
.and(q1 -> q1.in(Project::getStatus, ON_ANNUAL_PLAN.getCode()) | .and(q1 -> q1.in(Project::getStatus, ON_ANNUAL_PLAN.getCode()) | ||||
.or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and event = {0}", | .or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and event = {0}", | ||||
ProjectStateChangeEvent.ANNUAL_PLAN_PASS))) | ProjectStateChangeEvent.ANNUAL_PLAN_PASS))) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()); | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()); | ||||
List<Project> projects = projectService.list(query); | List<Project> projects = projectService.list(query); | ||||
AnnualPlanProgressStatisticsVO stat = new AnnualPlanProgressStatisticsVO(); | AnnualPlanProgressStatisticsVO stat = new AnnualPlanProgressStatisticsVO(); | ||||
@@ -95,7 +96,7 @@ public class AnnualPlanLibManage { | |||||
query.and(q1 -> q1.in(Project::getStatus, ON_ANNUAL_PLAN.getCode()) | query.and(q1 -> q1.in(Project::getStatus, ON_ANNUAL_PLAN.getCode()) | ||||
.or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and event = {0}", | .or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and event = {0}", | ||||
ProjectStateChangeEvent.ANNUAL_PLAN_PASS))) | ProjectStateChangeEvent.ANNUAL_PLAN_PASS))) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()); | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()); | ||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
long total = page.getTotal(); | long total = page.getTotal(); | ||||
@@ -29,6 +29,7 @@ import com.hz.pm.api.projectdeclared.service.IProjectDraftService; | |||||
import com.hz.pm.api.projectdeclared.utils.ProjectCodeGenUtil; | import com.hz.pm.api.projectdeclared.utils.ProjectCodeGenUtil; | ||||
import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.ImportProjectFinanceInfosDTO; | import com.hz.pm.api.projectlib.model.dto.ImportProjectFinanceInfosDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ImportReplaceSystemInfosDTO; | import com.hz.pm.api.projectlib.model.dto.ImportReplaceSystemInfosDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
@@ -195,7 +196,7 @@ public class DeclaredRecordManage { | |||||
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | .eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | ||||
.ge(req.getCreateDateMin() != null, Project::getCreateOn, req.getCreateDateMin()) | .ge(req.getCreateDateMin() != null, Project::getCreateOn, req.getCreateDateMin()) | ||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | .ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | ||||
.orderByDesc(Project::getUpdateOn); | .orderByDesc(Project::getUpdateOn); | ||||
BizUtils.notNull(req.getCreateDateMax(), w -> query.lt(Project::getCreateOn, w.plusDays(1))); | BizUtils.notNull(req.getCreateDateMax(), w -> query.lt(Project::getCreateOn, w.plusDays(1))); | ||||
@@ -62,6 +62,7 @@ import com.hz.pm.api.projectlib.handle.ProcessProgressHelper; | |||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.helper.ProjectSaveHelper; | import com.hz.pm.api.projectlib.helper.ProjectSaveHelper; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectConstant; | import com.hz.pm.api.projectlib.model.constant.ProjectConstant; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoUpgradeContentDTO; | import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoUpgradeContentDTO; | ||||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | ||||
@@ -454,7 +455,7 @@ public class ProjectLibManage { | |||||
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(req.getDeclaredUnitId()); | List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(req.getDeclaredUnitId()); | ||||
req.setDeclaredUnitIds(viewUnitIds); | req.setDeclaredUnitIds(viewUnitIds); | ||||
} | } | ||||
req.setNotInStatusList(Collections.singletonList(ProjectStatus.CHANGE_APPLY_PASSED.getCode())); | |||||
req.setNotInStatusList(ProjectStatusConstant.CHANGE_DELETE_PASSED); | |||||
Page<ProjectPO> page = projectService.pageLibWithPermission(req.page(), req); | Page<ProjectPO> page = projectService.pageLibWithPermission(req.page(), req); | ||||
if (CollUtil.isEmpty(page.getRecords())) { | if (CollUtil.isEmpty(page.getRecords())) { | ||||
@@ -0,0 +1,27 @@ | |||||
package com.hz.pm.api.projectlib.model.constant; | |||||
import java.util.Arrays; | |||||
import java.util.List; | |||||
import static com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus.*; | |||||
/** | |||||
* <p> | |||||
* ProjectStatusConstant | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 16:21 2024/12/18 | |||||
*/ | |||||
public class ProjectStatusConstant { | |||||
private ProjectStatusConstant() { | |||||
} | |||||
public static final List<Integer> CHANGE_STOP_DELETE_STAGE = Arrays.asList(CHANGE.getCode(), STOPPED.getCode(), DELETED.getCode()); | |||||
public static final List<Integer> CHANGE_DELETE_PASSED = Arrays.asList(CHANGE_APPLY_PASSED.getCode(), DELETED_PASSED.getCode()); | |||||
public static final List<Integer> CHANGE_STOP_DELETE_PASSED = Arrays.asList(CHANGE_APPLY_PASSED.getCode(), STOPPED_PASSED.getCode(), DELETED_PASSED.getCode()); | |||||
} |
@@ -6,7 +6,6 @@ import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | import lombok.Getter; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.List; | |||||
import java.util.Optional; | import java.util.Optional; | ||||
/** | /** | ||||
@@ -94,7 +93,13 @@ public enum ProjectStatus implements IStatus<Integer, String> { | |||||
* 项目阶段:已归档 | * 项目阶段:已归档 | ||||
*/ | */ | ||||
ARCHIVED(30000, "已归档", 30000), | ARCHIVED(30000, "已归档", 30000), | ||||
ACCEPTED(30001, "已验收", 30000); | |||||
ACCEPTED(30001, "已验收", 30000), | |||||
/** | |||||
* 增加项目删除字段 | |||||
*/ | |||||
DELETED(90000, "项目删除", 90000), | |||||
DELETED_PASSED(90002, "项目已删除", 90000); | |||||
private final Integer code; | private final Integer code; | ||||
private final String desc; | private final String desc; | ||||
@@ -116,6 +121,4 @@ public enum ProjectStatus implements IStatus<Integer, String> { | |||||
return get(code).orElseThrow(() -> BizException.wrap("项目状态无效:%s", code)); | return get(code).orElseThrow(() -> BizException.wrap("项目状态无效:%s", code)); | ||||
} | } | ||||
public static final List<Integer> STOP_CHANGE_STAGE_CODES = Arrays.asList(CHANGE.getCode(), STOPPED.getCode()); | |||||
} | } |
@@ -31,6 +31,7 @@ import com.hz.pm.api.projectlib.entity.ProjectGovSystemReplaceInfos; | |||||
import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; | import com.hz.pm.api.projectlib.entity.PurchaseStatusChange; | ||||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | ||||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | import com.hz.pm.api.projectlib.manage.ProjectLibManage; | ||||
import com.hz.pm.api.projectlib.model.constant.ProjectStatusConstant; | |||||
import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; | ||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; | import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; | ||||
@@ -217,7 +218,7 @@ public class WorkbenchManage { | |||||
Project::getDeclareAmount) | Project::getDeclareAmount) | ||||
.eq(Project::getProjectYear, req.getProjectYear()) | .eq(Project::getProjectYear, req.getProjectYear()) | ||||
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | .eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | ||||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_DELETE_PASSED) | |||||
.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE | .exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE | ||||
+ "and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS) | + "and npsc.event = {0}", ProjectStateChangeEvent.COMPLIANCE_REVIEW_PASS) | ||||
.eq(Project::getNewest, Boolean.TRUE); | .eq(Project::getNewest, Boolean.TRUE); | ||||
@@ -366,8 +367,7 @@ public class WorkbenchManage { | |||||
.eq(Project::getProjectYear, req.getProjectYear()) | .eq(Project::getProjectYear, req.getProjectYear()) | ||||
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | .eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | ||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode(), | |||||
ProjectStatus.STOPPED_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_STOP_DELETE_PASSED) | |||||
.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and npsc.event = {0}", | .exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and npsc.event = {0}", | ||||
ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT) | ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT) | ||||
.in(Project::getBuildOrgCode, CollUtils.convert(viewUnitIds, String::valueOf)); | .in(Project::getBuildOrgCode, CollUtils.convert(viewUnitIds, String::valueOf)); | ||||
@@ -600,8 +600,7 @@ public class WorkbenchManage { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
ProjectManageUtil.projectBaseQuery(query); | ProjectManageUtil.projectBaseQuery(query); | ||||
query.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode(), | |||||
ProjectStatus.STOPPED_PASSED.getCode()); | |||||
query.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_STOP_DELETE_PASSED); | |||||
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); | projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); | ||||
switch (req.getProcessNode()) { | switch (req.getProcessNode()) { | ||||
case PROJECT_DECLARED: | case PROJECT_DECLARED: | ||||
@@ -721,8 +720,7 @@ public class WorkbenchManage { | |||||
if (query == null) { | if (query == null) { | ||||
return null; | return null; | ||||
} | } | ||||
query.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode() | |||||
, ProjectStatus.STOPPED_PASSED.getCode()) | |||||
query.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_STOP_DELETE_PASSED) | |||||
.select(Project::getProjectCode, Project::getProjectName, Project::getId, | .select(Project::getProjectCode, Project::getProjectName, Project::getId, | ||||
Project::getBuildOrgCode, Project::getBuildOrgName); | Project::getBuildOrgCode, Project::getBuildOrgName); | ||||
projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); | projectQueryByProjectStatusChange(query, ProjectStateChangeEvent.PROJECT_APPLICATION_SUBMIT); | ||||
@@ -1039,8 +1037,7 @@ public class WorkbenchManage { | |||||
.eq(Project::getNewest, Boolean.TRUE) | .eq(Project::getNewest, Boolean.TRUE) | ||||
.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) | .eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) | ||||
.eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | .eq(req.getUnitStrip() != null, Project::getUnitStrip, req.getUnitStrip()) | ||||
.notIn(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode(), | |||||
ProjectStatus.STOPPED_PASSED.getCode()) | |||||
.notIn(Project::getStatus, ProjectStatusConstant.CHANGE_STOP_DELETE_PASSED) | |||||
.eq(Project::getIsMajorProject, Boolean.TRUE) | .eq(Project::getIsMajorProject, Boolean.TRUE) | ||||
.orderByDesc(Project::getUpdateOn); | .orderByDesc(Project::getUpdateOn); | ||||
UnitQueryState state = mhUnitQueryAuthHelper.listCanViewUnitIds(req.getUnitId()); | UnitQueryState state = mhUnitQueryAuthHelper.listCanViewUnitIds(req.getUnitId()); | ||||