| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | 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.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | |
| | | @RestController |
| | | @Api(tags = "商品货架") |
| | | @RequestMapping("/warehouse/goodsShelves") |
| | | @AllArgsConstructor |
| | | public class WarehouseGoodsShelvesController extends BaseController { |
| | | @Autowired |
| | | private WarehouseGoodsShelvesService warehouseGoodsShelvesService; |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("商品货架-分页查询") |
| | | @Log(title = "商品货架-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | IPage<WarehouseGoodsShelves> listPage = warehouseGoodsShelvesService.listPage(page, warehouseGoodsShelves); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @GetMapping("/listById") |
| | | @ApiOperation("商品货架-查询") |
| | | @Log(title = "商品货架-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listById(Long warehouseId) { |
| | | List<WarehouseGoodsShelves> list = warehouseGoodsShelvesService.list(new QueryWrapper<WarehouseGoodsShelves>().lambda() |
| | | .eq(WarehouseGoodsShelves::getWarehouseId, warehouseId)); |
| | | public AjaxResult listById(WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | List<WarehouseGoodsShelvesDto> list = warehouseGoodsShelvesService.findList(warehouseGoodsShelves); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @PostMapping("/add") |
| | |
| | | public AjaxResult add(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return AjaxResult.success(warehouseGoodsShelvesService.add(warehouseGoodsShelves)); |
| | | } |
| | | @PostMapping("/update") |
| | | @PutMapping("/update") |
| | | @ApiOperation("商品货架-更新") |
| | | @Log(title = "商品货架-更新", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |