| | |
| | | package com.ruoyi.stock.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | 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.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @since 2026-01-21 05:27:04 |
| | | */ |
| | | @Api(tags = "出库") |
| | | @RestController |
| | | @RequestMapping("/stockOutRecord") |
| | | public class StockOutRecordController { |
| | | @Autowired |
| | | private StockOutRecordService stockOutRecordService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "生产出库-出库管理-列表", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "出库管理列表") |
| | | public AjaxResult listPage(Page page, StockOutRecordDto stockOutRecordDto) { |
| | | IPage<StockOutRecordDto> result = stockOutRecordService.listPage(page, stockOutRecordDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("") |
| | | @Log(title = "出库管理-新增出库", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return AjaxResult.success(stockOutRecordService.add(stockOutRecordDto)); |
| | | } |
| | | |
| | | @PutMapping("/{id}") |
| | | @Log(title = "出库管理-更新出库", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return AjaxResult.success(stockOutRecordService.update(id, stockOutRecordDto)); |
| | | } |
| | | |
| | | @DeleteMapping("") |
| | | @Log(title = "出库管理-删除出库", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | } |
| | | return AjaxResult.success(stockOutRecordService.batchDelete(ids)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockOutRecord") |
| | | @ApiOperation("导出出库记录") |
| | | public void exportStockOutRecord(HttpServletResponse response, StockOutRecordDto stockOutRecordDto) { |
| | | stockOutRecordService.exportStockOutRecord(response,stockOutRecordDto); |
| | | } |
| | | |
| | | } |