@@ -4,6 +4,7 @@ import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; | import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | ||||
@@ -50,4 +51,11 @@ public class AnnualPlanController { | |||||
annualPlanLibManage.projectApproved(req); | annualPlanLibManage.projectApproved(req); | ||||
} | } | ||||
@PostMapping("/suspendAnnualPlan") | |||||
@ApiOperation("暂缓年度计划") | |||||
@WebLog("暂缓年度计划") | |||||
public void suspendAnnualPlan(@RequestBody @Valid ProjectIdReq req) throws Exception { | |||||
annualPlanLibManage.suspendAnnualPlan(req); | |||||
} | |||||
} | } |
@@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | |||||
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; | import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; | |||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; | import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; | ||||
@@ -47,7 +48,6 @@ public class AnnualPlanLibManage { | |||||
*/ | */ | ||||
private static final List<ProjectStatusEnum> ANNUAL_PLAN_LIST_STATUS = Arrays.asList( | private static final List<ProjectStatusEnum> ANNUAL_PLAN_LIST_STATUS = Arrays.asList( | ||||
IN_THE_ANNUAL_PLAN, | IN_THE_ANNUAL_PLAN, | ||||
BE_SUSPENDED, | |||||
SCHEME_UNDER_REVIEW, | SCHEME_UNDER_REVIEW, | ||||
SCHEME_REVIEW_FAILED, | SCHEME_REVIEW_FAILED, | ||||
TO_BE_APPROVED, | TO_BE_APPROVED, | ||||
@@ -123,4 +123,10 @@ public class AnnualPlanLibManage { | |||||
projectService.update(update); | projectService.update(update); | ||||
} | } | ||||
@Transactional(rollbackFor = Exception.class) | |||||
public void suspendAnnualPlan(ProjectIdReq req) throws Exception { | |||||
Project project = projectService.getById(req.getProjectId()); | |||||
stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); | |||||
} | |||||
} | } |
@@ -40,7 +40,7 @@ public class ProjectApprovedReq { | |||||
@ApiModelProperty("建设周期") | @ApiModelProperty("建设周期") | ||||
@NotNull(message = "建设周期不能为空") | @NotNull(message = "建设周期不能为空") | ||||
@Range(min = 1, max = 99999, message = "建设周期无效") | @Range(min = 1, max = 99999, message = "建设周期无效") | ||||
private LocalDate buildCycle; | |||||
private Integer buildCycle; | |||||
@ApiModelProperty("批复文件ID") | @ApiModelProperty("批复文件ID") | ||||
@NotNull(message = "批复文件不能为空") | @NotNull(message = "批复文件不能为空") | ||||
@@ -0,0 +1,23 @@ | |||||
package com.ningdatech.pmapi.projectlib.model.req; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
/** | |||||
* <p> | |||||
* ProjectIdReq | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 09:32 2023/2/13 | |||||
*/ | |||||
@Data | |||||
public class ProjectIdReq { | |||||
@ApiModelProperty("项目ID") | |||||
@NotNull(message = "项目ID不能为空") | |||||
private Long projectId; | |||||
} |