From 2f8a479844035310adff25434092599c0e932645 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 21 Feb 2023 14:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/util/ExcelDownUtil.java | 2 +- .../ProjectRenewalFundDeclarationController.java | 8 ++++++ .../manage/ProjectRenewalFundManage.java | 13 ++++++++++ .../model/req/ProjectRenewalAuditReq.java | 30 ++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectRenewalAuditReq.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java index ae2fa91..e31d162 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java @@ -136,7 +136,7 @@ public class ExcelDownUtil { } public static void setExportResponseHeader(String fileName, HttpServletResponse response) throws UnsupportedEncodingException { // 设置响应头和保存文件名 - response.setContentType(StrPool.CONTENT_TYPE); + response.setContentType(ExcelUtil.XLS_CONTENT_TYPE); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java index cadf505..0313d41 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java @@ -4,6 +4,7 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.projectlib.manage.ProjectRenewalFundManage; import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDTO; +import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; import io.swagger.annotations.Api; @@ -44,4 +45,11 @@ public class ProjectRenewalFundDeclarationController { private Long declared (@Validated @RequestBody ProjectRenewalFundDeclarationDTO dto){ return projectRenewalFundManage.declared(dto); } + + @PostMapping("/audit") + @ApiOperation("续建项目审核") + private Long audit(@Validated @RequestBody ProjectRenewalAuditReq param){ + return projectRenewalFundManage.audit(param); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index ecd6f5f..a2521bd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -10,6 +10,7 @@ import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDT import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration; import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; +import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; @@ -115,4 +116,16 @@ public class ProjectRenewalFundManage { } return declaration.getId(); } + + public Long audit(ProjectRenewalAuditReq param) { + Long projectRenewalId = param.getProjectRenewalId(); + ProjectRenewalFundDeclaration projectRenewal = projectRenewalFundDeclarationService.getById(projectRenewalId); + if (Boolean.TRUE.equals(param.getResult())){ + projectRenewal.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PASS.name()); + }else { + projectRenewal.setApprovalStatus(ProjectRenewalApprovalStatusEnum.NOT_PASS.name()); + } + // projectRenewal + return null; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectRenewalAuditReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectRenewalAuditReq.java new file mode 100644 index 0000000..a5beb0b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectRenewalAuditReq.java @@ -0,0 +1,30 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Max; +import javax.validation.constraints.NotNull; + +/** + * 续建项目审核请求实体 + * + * @author CMM + * @since 2023/02/21 13:43 + */ +@Data +@ApiModel("续建项目审核请求参数") +public class ProjectRenewalAuditReq { + + @ApiModelProperty("续建项目ID") + private Long projectRenewalId; + + @NotNull(message = "审核结果不能为空") + @ApiModelProperty("审核结果") + private Boolean result; + + @ApiModelProperty("审核意见") + @Max(200) + private String auditOpinion; +}