gongchunyi
6 天以前 ad65726388fc99ff95db91b4a8a716362cccedd7
src/main/java/com/ruoyi/procurementrecord/controller/ProcurementPlanController.java
@@ -2,16 +2,18 @@
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.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.procurementrecord.pojo.ProcurementPlan;
import com.ruoyi.procurementrecord.service.ProcurementPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -19,45 +21,45 @@
 * @date : 2025/9/18 16:13
 */
@RestController
@Api(tags = "采购计划")
@Tag(name = "采购计划")
@RequestMapping("/procurementPlan")
@AllArgsConstructor
public class ProcurementPlanController extends BaseController {
    @Autowired
    private ProcurementPlanService procurementPlanService;
    @RequestMapping("/listPage")
    @ApiOperation("采购计划-查询")
    @Operation(summary = "采购计划-查询")
    public AjaxResult listPage(Page page, ProcurementPlan procurementPlan){
        IPage<ProcurementPlan> result = procurementPlanService.listPage(page, procurementPlan);
        return AjaxResult.success(result);
    }
    @Log(title = "新增采购计划", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ApiOperation("采购计划-添加")
    @Operation(summary = "采购计划-添加")
    public AjaxResult add(@RequestBody ProcurementPlan procurementPlan){
        boolean result = procurementPlanService.save(procurementPlan);
        return result ? AjaxResult.success() : AjaxResult.error();
    }
    @Log(title = "修改采购计划", businessType = BusinessType.UPDATE)
    @PostMapping("/update")
    @ApiOperation("采购计划-修改")
    @Operation(summary = "采购计划-修改")
    public AjaxResult update(@RequestBody ProcurementPlan procurementPlan){
        boolean result = procurementPlanService.updateById(procurementPlan);
        return result ? AjaxResult.success() : AjaxResult.error();
    }
    @Log(title = "删除采购计划", businessType = BusinessType.DELETE)
    @DeleteMapping("/del")
    @ApiOperation("采购计划-删除")
    @Operation(summary = "采购计划-删除")
    public AjaxResult del(@RequestBody List<Long> ids){
        boolean result = procurementPlanService.removeByIds(ids);
        return result ? AjaxResult.success() : AjaxResult.error();
    }
    /**
     * 导出
     * @param response
     */
    @Log(title = "导出采购计划", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response) {
        procurementPlanService.export(response);