package com.fjhx.controller.order;

import com.fjhx.params.order.IssueVo;
import com.fjhx.params.order.OrderDetailsEx;
import com.fjhx.service.order.OrderDetailsService;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 销售订单明细表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-12-02
 */
@RestController
@RequestMapping("/orderDetails")
public class OrderDetailsController {

    @Autowired
    private OrderDetailsService orderDetailsService;

    @PostMapping("/listByOrderSalesId")
    public R listByOrderSalesId(@RequestBody Map<String, Object> condition) {
        List<OrderDetailsEx> result = orderDetailsService.listByOrderSalesId(condition);
        return R.success(result);
    }

    @PostMapping("/issue")
    public R issue(@RequestBody IssueVo issueVo) {
        orderDetailsService.issue(issueVo);
        return R.success();
    }

}

