| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @Autowired |
| | | private WarehouseService warehouseService; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("仓库-分页查询") |
| | | @Log(title = "仓库-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, Warehouse warehouse) { |
| | | IPage<Warehouse> listPage = warehouseService.listPage(page, warehouse); |
| | | return AjaxResult.success(listPage); |
| | | @ApiOperation("仓库-查询") |
| | | @Log(title = "仓库-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage( Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.listPage( warehouse)); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("仓库-添加") |
| | | @Log(title = "仓库-添加", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Warehouse warehouse) { |
| | | boolean save = warehouseService.save(warehouse); |
| | | return save ? AjaxResult.success("添加成功") : AjaxResult.error("添加失败"); |
| | | return warehouseService.save(warehouse) ? AjaxResult.success("添加成功") : AjaxResult.error("添加失败"); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | |
| | | @Log(title = "仓库-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | boolean remove = warehouseService.deleteByIds(ids); |
| | | return remove ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败"); |
| | | return warehouseService.deleteByIds(ids) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败"); |
| | | } |
| | | } |