| | |
| | | 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.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.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public class WarehouseController extends BaseController { |
| | | @Autowired |
| | | private WarehouseService warehouseService; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @GetMapping("/tree") |
| | | @ApiOperation("仓库-查询树") |
| | | @Log(title = "仓库-查询树", businessType = BusinessType.OTHER) |
| | | public AjaxResult listTree() { |
| | | return AjaxResult.success(warehouseService.findListTree()); |
| | | } |
| | | @GetMapping("/list") |
| | | @ApiOperation("仓库-查询") |
| | | @Log(title = "仓库-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage( Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.listPage( warehouse)); |
| | | public AjaxResult list(Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.findList(warehouse)); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("仓库-添加") |
| | | @Log(title = "仓库-添加", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Warehouse warehouse) { |
| | | return warehouseService.save(warehouse) ? AjaxResult.success("添加成功") : AjaxResult.error("添加失败"); |
| | | return AjaxResult.success(warehouseService.save(warehouse)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @PutMapping("/update") |
| | | @ApiOperation("仓库-更新") |
| | | @Log(title = "仓库-更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Warehouse warehouse) { |
| | |
| | | @Log(title = "仓库-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return warehouseService.deleteByIds(ids) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败"); |
| | | return AjaxResult.success(warehouseService.deleteByIds(ids)); |
| | | } |
| | | } |