| | |
| | | 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; |
| | | import com.ycl.common.utils.excel.OutputExcelUtils; |
| | | import com.ycl.domain.excel.ProjectExcelTemplate; |
| | | import com.ycl.domain.form.DocumentInfoForm; |
| | | import com.ycl.domain.form.ProjectForm; |
| | | import com.ycl.domain.form.ProjectInfoForm; |
| | | import com.ycl.domain.query.ProjectExportQuery; |
| | | import com.ycl.domain.query.ProjectInfoQuery; |
| | |
| | | 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; |
| | |
| | | return Result.ok().data(ProjectCodeGenerator.generateProjectCode()); |
| | | } |
| | | |
| | | ; |
| | | @GetMapping("/searchByKey") |
| | | public Result searchByKey(@RequestParam(required = false) String wordKey) { |
| | | return projectInfoService.searchByKey(wordKey); |
| | | } |
| | | |
| | | @GetMapping("/getManagerFlag/{recordId}") |
| | | public Result getManagerFlag(@PathVariable("recordId") Integer recordId) { |
| | |
| | | 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(); |
| | | } |
| | | |
| | | @PostMapping("/editProject") |
| | | public Result editProject(@RequestBody ProjectForm form) { |
| | | return projectInfoService.editProject(form); |
| | | } |
| | | |
| | | |
| | | |
| | | } |