package com.fjhx.ehsd.controller.delivery;

import cn.hutool.http.server.SimpleServer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.contract.dto.ContractProductDto;
import com.fjhx.sale.entity.contract.dto.ContractProductSelectDto;
import com.fjhx.sale.entity.contract.vo.ContractProductVo;
import com.fjhx.sale.entity.sample.dto.SampleSelectDto;
import com.fjhx.sale.entity.sample.vo.SampleVo;
import com.fjhx.sale.service.contract.ContractProductService;
import com.fjhx.sale.service.sample.SampleService;
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;


/**
 * <p>
 * 交接单
 * </p>
 *
 * @author  czj
 * @since 2023-05-05
 */
@RestController
@RequestMapping("/delivery")
public class DeliveryController {

    @Autowired
    private ContractProductService contractProductService;

    @Autowired
    private SampleService sampleService;

    /**
     * 交接单--分页
     */
    @PostMapping("/page")
    public Page<ContractProductVo> page(@RequestBody ContractProductSelectDto dto) {
        return contractProductService.getEHSDPage(dto);
    }

    /**
     * 合同交接单--分页
     */
    @PostMapping("/contractHandoverPage")
    public Page<ContractProductVo> contractHandoverPage(@RequestBody ContractProductSelectDto dto) {
        return contractProductService.contractHandoverPage(dto);
    }

    /**
     * 样品交接单列表
     */
    @PostMapping("/sampleHandoverList")
    public Page<ContractProductVo> sampleHandoverList(@RequestBody SampleSelectDto dto) {
        return  sampleService.sampleHandoverList(dto);
    }

}
