| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.asset.AssetWarehouseDTO; |
| | | import com.ruoyi.system.query.AssetWarehousePageQuery; |
| | | import com.ruoyi.system.service.AssetWarehouseService; |
| | | import com.ruoyi.system.vo.asset.AssetWarehouseVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author WuGuanFengYue |
| | | * @since 2025-09-15 |
| | | */ |
| | | @Api(tags = {"资产-仓库管理相关接口"}) |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("/asset-warehouse") |
| | | @RequiredArgsConstructor |
| | | public class AssetWarehouseController { |
| | | private final AssetWarehouseService assetWarehouseService; |
| | | |
| | | @ApiOperation("获取仓库分页列表") |
| | | @PostMapping("/page-list") |
| | | public R<IPage<AssetWarehouseVO>> getPageList(@RequestBody AssetWarehousePageQuery pageQuery) { |
| | | IPage<AssetWarehouseVO> page = assetWarehouseService.getPageList(pageQuery); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation("新增仓库") |
| | | @PostMapping("/add") |
| | | public R<Void> addWarehouse(@Valid @RequestBody AssetWarehouseDTO dto) { |
| | | assetWarehouseService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("编辑仓库") |
| | | @PutMapping("/add") |
| | | public R<Void> editWarehouse(@Valid @RequestBody AssetWarehouseDTO dto) { |
| | | assetWarehouseService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("删除仓库") |
| | | @DeleteMapping("/{id}") |
| | | public R<Void> deleteWarehouse(@ApiParam(name = "id", value = "仓库ID", required = true) @PathVariable Integer id) { |
| | | assetWarehouseService.delete(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |