package com.trade.admin.purchase.service.impl;

import com.trade.admin.purchase.dto.PurchaseContractSearchDto;
import com.trade.admin.purchase.service.PurchaseContractService;
import com.trade.common.core.page.GridPage;
import com.trade.service.purchase.dto.PurchaseContractDetailDto;
import com.trade.service.purchase.dto.PurchaseContractDto;
import com.trade.service.purchase.dto.PurchaseContractSearchBaseDto;
import com.trade.service.purchase.service.PurchaseContractBaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 采购合同表基础表服务实现类
 *
 * @author hlb
 * @since 2024-09-07 16:30:38
 */
@Service("purchaseContractService")
public class PurchaseContractServiceImpl implements PurchaseContractService {

    private static final Logger logger = LoggerFactory.getLogger(PurchaseContractServiceImpl.class);
    @Resource
    private PurchaseContractBaseService purchaseContractBaseService;

    @Override
    public GridPage<PurchaseContractDto> getPurchaseContractBySearch(PurchaseContractSearchDto searchDto) {
        PurchaseContractSearchBaseDto searchBaseDto = new PurchaseContractSearchBaseDto();
        searchBaseDto.setPoint(false);
        searchBaseDto.setContractStatus(searchDto.getContractStatus());
        searchBaseDto.setContractInfo(searchDto.getContractInfo());
        searchBaseDto.setCustomerUserInfo(searchDto.getCustomerUserInfo());
        searchBaseDto.setVendorEntityNo(searchDto.getVendorEntityNo());
        searchBaseDto.setAgencyCertNo(searchDto.getAgencyCertNo());
        searchBaseDto.setTimeStart(searchDto.getGmtSubmitStart());
        searchBaseDto.setTimeEnd(searchDto.getGmtSubmitEnd());
        return purchaseContractBaseService.getPurchaseContractBySearch(searchBaseDto);
    }

    @Override
    public PurchaseContractDetailDto findPurchaseContractDetailById(Long id) {
        return purchaseContractBaseService.findPurchaseContractDetailById(id);
    }
}
