package com.jwipc.finance.logic.impl;

import com.jwipc.exception.DaoException;
import com.jwipc.finance.entity.CostInvoicedApplyPostResult;
import com.jwipc.finance.entity.InvoicedApplyPostResult;
import com.jwipc.finance.logic.CostInvoicedApplyPostResultLogic;
import com.jwipc.finance.logic.InvoicedApplyPostResultLogic;
import com.jwipc.finance.service.ICostInvoicedApplyPostResultService;
import com.jwipc.finance.service.IInvoicedApplyPostResultService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author shenyang.ou
 * @date 2024/3/7 13:56
 * @desc
 */
@Service
@RequiredArgsConstructor
public class CostInvoicedApplyPostResultLogicImpl implements CostInvoicedApplyPostResultLogic {
    private final ICostInvoicedApplyPostResultService invoicedApplyPostResultService;
    /**
     * 获取最新的过账结果记录
     *
     * @param iaId 开票申请ID
     * @return 结果
     */
    @Override
    public CostInvoicedApplyPostResult findLastPostResult(Long iaId) {
        return invoicedApplyPostResultService.findLastPostResult(iaId);
    }

    @Override
    public void updateNExpireDate(Long iaId, String paymentExpireDate) {
        invoicedApplyPostResultService.updateNExpireDate(iaId,paymentExpireDate);
        if (null == iaId) {
            throw new DaoException("参数错误");
        }
    }
}
