| | |
| | | import com.ruoyi.oA.dto.OaProjectDto; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.ruoyi.oA.service.OaProjectService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "oA项目管理") |
| | | @Tag(name = "oA项目管理") |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/oA/project") |
| | | public class OaProjectController { |
| | | private final OaProjectService oaProjectService; |
| | | |
| | | @ApiOperation("获取项目列表") |
| | | @Operation(summary = "获取项目列表") |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, OaProjectDto oaProjectDto) { |
| | | IPage<OaProjectDto> listPage = oaProjectService.listPage(page, oaProjectDto); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | @ApiOperation("获取项目列表详情") |
| | | @Operation(summary = "获取项目列表详情") |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(Page page, OaProjectDto oaProjectDto) { |
| | | IPage<OaProjectDto> listPage = oaProjectService.listPage(page, oaProjectDto); |
| | |
| | | }); |
| | | return AjaxResult.success(Map); |
| | | } |
| | | @ApiOperation("增添项目") |
| | | @Operation(summary = "增添项目") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody OaProject oaProject) { |
| | | boolean save = oaProjectService.save(oaProject); |
| | | return AjaxResult.success(save); |
| | | } |
| | | @ApiOperation("删除项目") |
| | | @Operation(summary = "删除项目") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | boolean remove = oaProjectService.deleteById(id); |
| | | return AjaxResult.success(remove); |
| | | } |
| | | @ApiOperation("更新项目") |
| | | @Operation(summary = "更新项目") |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody OaProject oaProject) { |
| | | boolean update = oaProjectService.updateById(oaProject); |
| | | return AjaxResult.success(update); |
| | | } |
| | | // @ApiOperation("根据ID获取项目详情") |
| | | // @Operation(summary = "根据ID获取项目详情") |
| | | // @GetMapping("/getById") |
| | | // public AjaxResult getById(Long id) { |
| | | // OaProject oaProject = oaProjectService.getById(id); |
| | | // return AjaxResult.success(oaProject); |
| | | // } |
| | | @ApiOperation("导出所选项目") |
| | | @Operation(summary = "导出所选项目") |
| | | @PostMapping("/export/{ids}") |
| | | public void export(HttpServletResponse response, @PathVariable("ids") List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |