| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | |
| | | import com.ruoyi.warehouse.mapper.DocumentationBorrowManagementMapper; |
| | | import com.ruoyi.warehouse.mapper.DocumentationReturnManagementMapper; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.DocumentationBorrowManagementService; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | public class DocumentationBorrowManagementController extends BaseController { |
| | | @Autowired |
| | | private DocumentationBorrowManagementService documentationBorrowManagementService; |
| | | @Autowired |
| | | private DocumentationBorrowManagementMapper documentationBorrowManagementMapper; |
| | | @Autowired |
| | | private DocumentationReturnManagementMapper documentationReturnManagementMapper; |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("文档借阅管理-分页查询") |
| | | @Log(title = "文档借阅管理-分页查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation("文档借阅管理-借阅分页查询") |
| | | @Log(title = "文档借阅管理-借阅分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement) { |
| | | IPage<DocumentationBorrowManagement> listPage = documentationBorrowManagementService.listPage(page, documentationBorrowManagement); |
| | | return AjaxResult.success(listPage); |
| | | return AjaxResult.success(documentationBorrowManagementService.listPage(page, documentationBorrowManagement)); |
| | | } |
| | | @GetMapping("/list") |
| | | @ApiOperation("文档借阅管理-借阅查询") |
| | | @Log(title = "文档借阅管理-借阅查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(documentationBorrowManagementService.listAll()); |
| | | } |
| | | @GetMapping("/listPageReturn") |
| | | @ApiOperation("文档借阅管理-归还分页查询") |
| | | @Log(title = "文档借阅管理-归还分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageReturn(Page page, DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationReturnManagementMapper.listPage(page, documentationReturnManagement)); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("文档借阅管理-添加") |
| | | @Log(title = "文档借阅管理-添加", businessType = BusinessType.INSERT) |
| | | @ApiOperation("文档借阅管理-借阅") |
| | | @Log(title = "文档借阅管理-借阅", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | documentationBorrowManagementService.save(documentationBorrowManagement); |
| | | return AjaxResult.success(); |
| | | return AjaxResult.success(documentationBorrowManagementService.add(documentationBorrowManagement)); |
| | | } |
| | | @PostMapping("/update") |
| | | @PutMapping("/revent") |
| | | @ApiOperation("文档借阅管理-归还") |
| | | @Log(title = "文档借阅管理-归还", businessType = BusinessType.UPDATE) |
| | | public AjaxResult revent(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.reventdbm(documentationReturnManagement)); |
| | | } |
| | | @PutMapping("/update") |
| | | @ApiOperation("文档借阅管理-更新") |
| | | @Log(title = "文档借阅管理-更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | documentationBorrowManagementService.updateById(documentationBorrowManagement); |
| | | return AjaxResult.success(); |
| | | return AjaxResult.success(documentationBorrowManagementService.updateById(documentationBorrowManagement)); |
| | | } |
| | | @PostMapping("/delete") |
| | | @ApiOperation("文档借阅管理-删除") |
| | | @Log(title = "文档借阅管理-删除", businessType = BusinessType.DELETE) |
| | | @PutMapping("/reventUpdate") |
| | | @ApiOperation("文档借阅管理-归还更新") |
| | | @Log(title = "文档借阅管理-归还更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult reventupdate(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationReturnManagementMapper.updateById(documentationReturnManagement)); |
| | | } |
| | | @DeleteMapping ("/delete") |
| | | @ApiOperation("文档借阅管理-借阅删除") |
| | | @Log(title = "文档借阅管理-借阅删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | documentationBorrowManagementService.removeByIds(ids); |
| | | return AjaxResult.success(); |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(documentationBorrowManagementService.deleteByIds(ids)); |
| | | } |
| | | @DeleteMapping ("/reventDelete") |
| | | @ApiOperation("文档借阅管理-归还删除") |
| | | @Log(title = "文档借阅管理-归还删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult reventdelete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(documentationBorrowManagementService.reventDeleteByIds(ids)); |
| | | } |
| | | @PostMapping("/export") |
| | | @ApiOperation("文档信息表-导出") |
| | | @Log(title = "文档信息表-导出", businessType = BusinessType.EXPORT) |
| | | public void export(HttpServletResponse response) { |
| | | documentationBorrowManagementService.export(response); |
| | | @ApiOperation("文档借阅管理-借阅导出") |
| | | @Log(title = "文档借阅管理-借阅导出", businessType = BusinessType.EXPORT) |
| | | public void export(HttpServletResponse response,DocumentationBorrowManagement documentationBorrowManagement) { |
| | | documentationBorrowManagementService.export(response,documentationBorrowManagement); |
| | | } |
| | | @PostMapping("/exportrevent") |
| | | @ApiOperation("文档借阅管理-归还导出") |
| | | @Log(title = "文档借阅管理-归还导出", businessType = BusinessType.EXPORT) |
| | | public void exportrevent(HttpServletResponse response, DocumentationReturnManagement documentationReturnManagement) { |
| | | documentationBorrowManagementService.exportrevent(response,documentationReturnManagement); |
| | | } |
| | | } |