| | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.warehouse.dto.DocumentationDto; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.DocumentationService; |
| | |
| | | @ApiOperation("文档信息表-分页查询") |
| | | @Log(title = "文档信息表-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, Documentation documentation) { |
| | | IPage<Documentation> listPage = documentationService.listPage(page, documentation); |
| | | return AjaxResult.success(listPage); |
| | | IPage<DocumentationDto> list = documentationService.listPage(page, documentation); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @GetMapping("/list") |
| | | @ApiOperation("文档信息表") |
| | | @Log(title = "文档信息表", businessType = BusinessType.OTHER) |
| | | @ApiOperation("文档信息表查询") |
| | | @Log(title = "文档信息表查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult list() { |
| | | List<Documentation> list = documentationService.list(); |
| | | List<DocumentationDto> list = documentationService.listAll(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("文档信息表-添加") |
| | | @Log(title = "文档信息表-添加", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Documentation documentation) { |
| | | boolean save = documentationService.save(documentation); |
| | | return save ? AjaxResult.success("添加成功") : AjaxResult.error("添加失败"); |
| | | return AjaxResult.success(documentationService.save(documentation)); |
| | | } |
| | | @PostMapping("/update") |
| | | @PutMapping("/update") |
| | | @ApiOperation("文档信息表-更新") |
| | | @Log(title = "文档信息表-更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Documentation documentation) { |
| | | return AjaxResult.success(documentationService.updateById(documentation)); |
| | | } |
| | | @PostMapping("/delete") |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("文档信息表-删除") |
| | | @Log(title = "文档信息表-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | boolean remove = documentationService.removeBatchByIds(ids); |
| | | // boolean remove = documentationService.deleteByIds(ids); |
| | | return remove ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败"); |
| | | return AjaxResult.success(documentationService.deleteByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | @ApiOperation("文档信息表-导出") |
| | | @Log(title = "文档信息表-导出", businessType = BusinessType.EXPORT) |
| | | public void export(HttpServletResponse response) { |
| | | documentationService.export(response); |
| | | public void export(HttpServletResponse response,Documentation documentation ) { |
| | | documentationService.export(response,documentation); |
| | | } |
| | | //附件详情 |
| | | // @GetMapping("/getDocumentation") |
| | | // public Documentation getDocumentation(Documentation documentation) { |
| | | // return documentationService.getById(id); |
| | | // } |
| | | } |