package com.fjhx.sale.controller.intermediate;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.contract.vo.ContractPdfInfoVo;
import com.fjhx.sale.entity.intermediate.dto.IntermediateContractDto;
import com.fjhx.sale.entity.intermediate.dto.IntermediateContractSelectDto;
import com.fjhx.sale.entity.intermediate.po.IntermediateContract;
import com.fjhx.sale.entity.intermediate.vo.IntermediateContractVo;
import com.fjhx.sale.service.intermediate.IntermediateContractService;
import com.ruoyi.common.core.domain.BaseSelectDto;
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
 * @since 2023-06-28
 */
@RestController
@RequestMapping("/intermediateContract")
public class IntermediateContractController {

    @Autowired
    private IntermediateContractService intermediateContractService;

    /**
     * 中间合同分页
     */
    @PostMapping("/page")
    public Page<IntermediateContractVo> page(@RequestBody IntermediateContractSelectDto dto) {
        return intermediateContractService.getPage(dto);
    }

    /**
     * 中间合同明细
     */
    @PostMapping("/detail")
    public IntermediateContractVo detail(@RequestBody BaseSelectDto dto) {
        return intermediateContractService.detail(dto.getId());
    }
    /**
     * 中间合同删除
     */
    @PostMapping("/del")
    public void del(@RequestBody BaseSelectDto dto) {
        intermediateContractService.del(dto.getId());
    }

    /**
     * 中间合同编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody IntermediateContractDto intermediateContractDto) {
        intermediateContractService.edit(intermediateContractDto);
    }

    /**
     * 获取合中间同历史联系方式
     */
    @PostMapping("/contactList")
    public List<IntermediateContractVo> contactList(@RequestBody IntermediateContractDto dto) {
        return intermediateContractService.contactList(dto);
    }

    /**
     * 获取合中间同历史联系方式
     */
    @PostMapping("/getPrintInfo")
    public IntermediateContract getPrintInfo(@RequestBody IntermediateContractDto dto) {
        return intermediateContractService.getPrintInfo(dto);
    }

}
