package cn.superdesk.uniorder.openapi.service.qchjc.task.accounting;

import cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcAccountingUnifiedSupplierVo;
import cn.superdesk.uniorder.dubbo.facade.thirdpart.qchjc.accounting.DubboQchjcSupplierStatementService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author xc
 * @description
 * @date 2022/4/4 14:56
 */
@Service
@Slf4j
public class QchjcSupplierStatementDubboConsumerService {

    @Reference(version = "1.0.0", timeout = 300000, retries = -1)
    private DubboQchjcSupplierStatementService dubboQchjcSupplierStatementService;


    /**
     * 集采-采购单位对账单入库
     *
     * @param id
     */
    @Transactional(rollbackFor = Exception.class)
    //@DistributedLock(name = "#vo.accountingOrderSn")
    public void doSave(Long id) {
        dubboQchjcSupplierStatementService.doSave(id);
    }

    /**
     * 集采-获取待入库状态供应商对账单集合
     *
     * @return
     */
    public QchjcAccountingUnifiedSupplierVo getTodoList(Long id) {
        return dubboQchjcSupplierStatementService.getTodoList(id);
    }

    public List<Long> getTodoIdList() {
        return dubboQchjcSupplierStatementService.getTodoIdList();
    }
}
