| | |
| | | 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.ProjectInfoForm; |
| | | import com.ycl.domain.query.ProjectExportQuery; |
| | | import com.ycl.domain.query.ProjectInfoQuery; |
| | | import com.ycl.service.ProjectInfoService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | // @PreAuthorize("hasAuthority('projectInfo:del')") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | public Result removeById(@PathVariable("id") Long id) { |
| | | return projectInfoService.removeById(id); |
| | | } |
| | | |
| | |
| | | public Result generateProjectCode() { |
| | | return Result.ok().data(ProjectCodeGenerator.generateProjectCode()); |
| | | }; |
| | | |
| | | @GetMapping("/getManagerFlag/{recordId}") |
| | | public Result getManagerFlag(@PathVariable("recordId") Integer recordId) { |
| | | return projectInfoService.getManagerFlag(recordId); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @PostMapping("/export/template") |
| | | 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); |
| | | } |
| | | } |