| | |
| | | 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.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @GetMapping("/tree") |
| | | @Operation(summary = "仓库-查询树") |
| | | @Log(title = "仓库-查询树", businessType = BusinessType.OTHER) |
| | | public AjaxResult listTree() { |
| | | return AjaxResult.success(warehouseService.findListTree()); |
| | | public R<?> listTree() { |
| | | return R.ok(warehouseService.findListTree()); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "仓库-查询") |
| | | @Log(title = "仓库-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.findList(warehouse)); |
| | | public R<?> list(Warehouse warehouse) { |
| | | return R.ok(warehouseService.findList(warehouse)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "仓库-添加") |
| | | @Log(title = "仓库-添加", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.save(warehouse)); |
| | | public R<?> add(@RequestBody Warehouse warehouse) { |
| | | return R.ok(warehouseService.save(warehouse)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "仓库-更新") |
| | | @Log(title = "仓库-更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.updateById(warehouse)); |
| | | public R<?> update(@RequestBody Warehouse warehouse) { |
| | | return R.ok(warehouseService.updateById(warehouse)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "仓库-删除") |
| | | @Log(title = "仓库-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(warehouseService.deleteByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("请传入要删除的ID"); |
| | | return R.ok(warehouseService.deleteByIds(ids)); |
| | | } |
| | | } |