zouyu
2 天以前 8f98ff2e202e5d7a39be484753db63d0165d70d7
src/main/java/com/ruoyi/production/controller/ProductionOrderController.java
对比新文件
@@ -0,0 +1,90 @@
package com.ruoyi.production.controller;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.OrderUtils;
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.production.mapper.ProductionOrderMapper;
import com.ruoyi.production.pojo.ProductionOrder;
import com.ruoyi.production.service.ProductionOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * @author :yys
 * @date : 2025/11/26 14:21
 */
@RestController
@Api(tags = "鐢熶骇璁㈠崟")
@RequestMapping("/productionOrder")
public class ProductionOrderController extends BaseController {
    @Autowired
    private ProductionOrderService productionOrderService;
    @Autowired
    private ProductionOrderMapper productionOrderMapper;
    @GetMapping("/listPage")
    @Log(title = "鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
    @ApiOperation("鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ")
    public AjaxResult listPage(Page page, ProductionOrder productionOrder) {
        return productionOrderService.listPage(page, productionOrder);
    }
    @PostMapping("/addProductionOrder")
    @Log(title = "鐢熶骇璁㈠崟-鏂板", businessType = BusinessType.INSERT)
    @ApiOperation("鐢熶骇璁㈠崟-鏂板")
    public AjaxResult addProductionOrder(@RequestBody ProductionOrder productionOrder) {
        String scdd = OrderUtils.countTodayByCreateTime(productionOrderMapper, "SCDD");
        productionOrder.setOrderNo(scdd);
        return AjaxResult.success(productionOrderService.save(productionOrder));
    }
    @PostMapping("/updateProductionOrder")
    @Log(title = "鐢熶骇璁㈠崟-淇敼", businessType = BusinessType.UPDATE)
    @ApiOperation("鐢熶骇璁㈠崟-淇敼")
    public AjaxResult updateProductionOrder(@RequestBody ProductionOrder productionOrder) {
        return AjaxResult.success(productionOrderService.updateById(productionOrder));
    }
    @DeleteMapping("/deleteProductionOrder")
    @Log(title = "鐢熶骇璁㈠崟-鍒犻櫎", businessType = BusinessType.DELETE)
    @ApiOperation("鐢熶骇璁㈠崟-鍒犻櫎")
    public AjaxResult deleteProductionOrder(@RequestBody List<Long> ids) {
        if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
        return AjaxResult.success(productionOrderService.removeBatchByIds(ids));
    }
    /**
     * 瀵煎嚭
     * @param response
     */
    @PostMapping("/export")
    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-瀵煎嚭")
    @Log(title = "鐢熶骇璁㈠崟-瀵煎嚭", businessType = BusinessType.EXPORT)
    public void export(HttpServletResponse response) {
        productionOrderService.export(response);
    }
    /**
     * 瀵煎嚭
     * @param response
     */
    @PostMapping("/exportOne")
    @ApiOperation("鐢熶骇绠$悊-鐢熶骇娲惧伐-瀵煎嚭")
    @Log(title = "鐢熶骇璁㈠崟-瀵煎嚭", businessType = BusinessType.EXPORT)
    public void exportOne(HttpServletResponse response) {
        productionOrderService.exportOne(response);
    }
}