package com.dk.mdm.controller.sale;

import com.dk.common.model.pojo.PageList;
import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.pojo.sale.OrderItem;
import com.dk.common.controller.BaseController;
import com.dk.common.service.BaseService;
import com.dk.mdm.model.query.sale.OrderItemQuery;
import com.dk.mdm.model.response.sale.OrderItemResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.dk.mdm.service.sale.OrderItemService;

@Api(tags = "销售明细API接口")
@RestController
@RequestMapping("/sale/orderItem")
public class OrderItemController{

    public BaseService<OrderItem> getService() {
        return orderItemService;
    }

    @Autowired
    private OrderItemService orderItemService;

    /**
     * @desc   : 以销定采查询销售订单接口
     * @author : 常皓宁
     * @date   : 2024/3/29 16:26
     */
    @ApiOperation(
            value = "以销定采查询销售订单接口（新建编辑使用）",
            notes = "以销定采查询销售订单接口（新建编辑使用）"
    )
    @PostMapping("purchase_based_on_sale_select_order")
    public ResponseResultVO<PageList<OrderItemResponse>> purchaseBasedOnSaleSelectOrder(@RequestBody OrderItemQuery orderItemQuery) {
        return orderItemService.purchaseBasedOnSaleSelectOrder(orderItemQuery);
    }

}
