package com.ruoyi.stock.controller;
|
|
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.service.StockInRecordService;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.Operation;
|
import jakarta.servlet.http.HttpServletResponse;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.util.CollectionUtils;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
@RestController
|
@Tag(name = "入库")
|
@RequestMapping("/stockInRecord")
|
@RequiredArgsConstructor
|
public class StockInRecordController {
|
|
private final StockInRecordService stockInRecordService;
|
|
@GetMapping("/listPage")
|
@Log(title = "生产入库-入库管理-列表", businessType = BusinessType.OTHER)
|
@Operation(summary = "入库管理列表")
|
public AjaxResult listPage(Page page, StockInRecordDto stockInRecordDto) {
|
IPage<StockInRecordDto> result = stockInRecordService.listPage(page, stockInRecordDto);
|
return AjaxResult.success(result);
|
}
|
|
|
|
@DeleteMapping("")
|
@Log(title = "入库管理-删除入库", businessType = BusinessType.DELETE)
|
public AjaxResult delete(@RequestBody List<Long> ids) {
|
if(CollectionUtils.isEmpty(ids)){
|
return AjaxResult.error("请选择至少一条数据");
|
}
|
return AjaxResult.success(stockInRecordService.batchDelete(ids));
|
}
|
|
@PostMapping("/exportStockInRecord")
|
@Operation(summary = "导出入库记录")
|
public void exportStockInRecord(HttpServletResponse response, StockInRecordDto stockInRecordDto) {
|
stockInRecordService.exportStockInRecord(response,stockInRecordDto);
|
}
|
|
}
|