package com.jwipc.contract.impl;

import com.jwipc.contract.base.ContractDetailClientDTO;
import com.jwipc.contract.client.ContractDetailClient;
import com.jwipc.contract.convert.ContractClientConvert;
import com.jwipc.contract.dto.ContractDetailDTO;
import com.jwipc.contract.logic.ContractLogic;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyang.ou
 * @date 2024/7/23 16:29
 * @desc
 */

@Service
@RequiredArgsConstructor
public class ContractDetailClientImpl implements ContractDetailClient {
    private final ContractLogic contractLogic;
    private final ContractClientConvert contractClientConvert;
    @Override
    public List<ContractDetailClientDTO> getDetailListByPurchaseCodeAndeItem(String billCode, String itemCode) {
        List<ContractDetailDTO> contractDetailClientDTOS = contractLogic.getDetailListByPurchaseCodeAndeItem(billCode,itemCode);
        return contractClientConvert.detailListToClient(contractDetailClientDTOS);
    }
}
