From 982e63b981079caaae2be3ad8bb11d29cf9cd97b Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 24 十二月 2024 14:43:36 +0800 Subject: [PATCH] 驳回使用自带驳回,对已完成流程查看流程推进的处理 --- business/src/main/java/com/ycl/controller/ProjectInfoController.java | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 47 insertions(+), 5 deletions(-) diff --git a/business/src/main/java/com/ycl/controller/ProjectInfoController.java b/business/src/main/java/com/ycl/controller/ProjectInfoController.java index 2eea7dc..5ab6f3c 100644 --- a/business/src/main/java/com/ycl/controller/ProjectInfoController.java +++ b/business/src/main/java/com/ycl/controller/ProjectInfoController.java @@ -1,6 +1,7 @@ package com.ycl.controller; import com.ycl.common.base.Result; +import com.ycl.common.exception.base.BaseException; import com.ycl.common.group.Add; import com.ycl.common.group.Update; import com.ycl.common.utils.ProjectCodeGenerator; @@ -8,6 +9,7 @@ import com.ycl.domain.excel.ProjectExcelTemplate; import com.ycl.domain.form.DocumentInfoForm; import com.ycl.domain.form.ProjectInfoForm; +import com.ycl.domain.query.ProjectExportQuery; import com.ycl.domain.query.ProjectInfoQuery; import com.ycl.service.ProjectInfoService; import io.swagger.annotations.Api; @@ -15,10 +17,12 @@ import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotEmpty; import java.io.IOException; +import java.util.ArrayList; import java.util.List; /** @@ -42,12 +46,14 @@ public Result add(@RequestBody @Validated(Add.class) ProjectInfoForm form) { return projectInfoService.add(form); } + @PostMapping("/document") @ApiOperation(value = "娣诲姞鐩稿叧鏂囦欢", notes = "娣诲姞鐩稿叧鏂囦欢") // @PreAuthorize("hasAuthority('projectInfo:add')") public Result addDoc(@RequestBody @Validated(Add.class) DocumentInfoForm form) { return projectInfoService.addDoc(form); } + @PutMapping @ApiOperation(value = "淇敼", notes = "淇敼") // @PreAuthorize("hasAuthority('projectInfo:edit')") @@ -82,12 +88,14 @@ public Result detail(@PathVariable("id") Integer id) { return projectInfoService.detail(id); } + @GetMapping("/document/{id}") @ApiOperation(value = "鐩稿叧鏂囦欢璇︽儏", notes = "鐩稿叧鏂囦欢璇︽儏") // @PreAuthorize("hasAuthority('projectInfo:detail')") public Result docDetail(@PathVariable("id") Integer id) { return projectInfoService.docDetail(id); } + @GetMapping("/list") // @PreAuthorize("hasAuthority('projectInfo:list')") @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃") @@ -97,12 +105,15 @@ /** * 鐢熸垚椤圭洰缂栧彿 + * * @return 椤圭洰缂栧彿 */ @GetMapping("/getProjectCode") public Result generateProjectCode() { return Result.ok().data(ProjectCodeGenerator.generateProjectCode()); - }; + } + + ; @GetMapping("/getManagerFlag/{recordId}") public Result getManagerFlag(@PathVariable("recordId") Integer recordId) { @@ -111,14 +122,45 @@ /** * 瀵煎嚭妯℃澘 + * * @param response * @return */ @PostMapping("/export/template") - public void exportTemplate(HttpServletResponse response, - @RequestBody List<String> fieldList - ) throws IOException { - OutputExcelUtils.export(response, "瀵煎叆妯℃澘", "椤圭洰淇℃伅", null, ProjectExcelTemplate.class ,fieldList); + public void exportTemplate(HttpServletResponse response) throws IOException { + List<String> fieldList = new ArrayList<>(); + OutputExcelUtils.export(response, "瀵煎叆妯℃澘", "椤圭洰淇℃伅", null, ProjectExcelTemplate.class, fieldList); } + /** + * 椤圭洰瀵煎嚭 + * + * @param response + * @throws IOException + */ + @PostMapping("/export") + public void export(HttpServletResponse response, ProjectExportQuery query) throws IOException { + projectInfoService.export(response, query); + } + + @PutMapping("usedStatus/{id}/{usedStatus}") + @ApiOperation(value = "淇敼浣跨敤鐘舵��", notes = "淇敼浣跨敤鐘舵��") +// @PreAuthorize("hasAuthority('projectInfo:edit')") + public Result updateUsedStatus(@PathVariable Integer id, @PathVariable Integer usedStatus) { + return projectInfoService.updateUsedStatus(id, usedStatus); + } + + /** + * 椤圭洰瀵煎叆 + * @param file + * @return + */ + @PostMapping("/import") + public Result importProject(MultipartFile file) { + if (file.getSize() > 100 * 1024 * 1024) { + throw new BaseException("鏂囦欢杩囧ぇ锛屾枃浠朵笉寰楄秴杩�100MB"); + } + projectInfoService.importProject(file); + return Result.ok(); + } } -- Gitblit v1.8.0