package cn.superdesk.uniorder.dubbo.provider.invoice.supplier;

import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.supplier.InvoiceApplySupplier;
import cn.superdesk.uniorder.dto.param.invoice.supplier.status.InvoiceApplySupplierOpCommonDimAccountingOrderForm;
import cn.superdesk.uniorder.dubbo.facade.invoice.supplier.DubboInvoiceApplySupplierFieldPayoffAccountStatusService;
import cn.superdesk.uniorder.service.invoice.supplier.InvoiceApplySupplierFieldPayoffAccountStatusService;
import com.alibaba.dubbo.config.annotation.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * @Description: 简易状态机 星型结构
 * @Author: linjinyu
 * @CreateDate: 10/12/20 4:28 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 10/12/20 4:28 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboInvoiceApplySupplierFieldPayoffAccountStatusServiceImpl implements DubboInvoiceApplySupplierFieldPayoffAccountStatusService {

    @Autowired
    private InvoiceApplySupplierFieldPayoffAccountStatusService invoiceApplySupplierFieldPayoffAccountStatusService;

    /****************************************** 状态机 外部使用 类门面 start ******************************************/

    // 状态流转为 待付款(0, "待付款")
    @Override
    public int opInit(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
        return invoiceApplySupplierFieldPayoffAccountStatusService.opInit(entity, loginSysUser);
    }

    // 状态流转为 付款中(10, "付款中")
    @Override
    public int opRegulatoryPipeline(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
        return invoiceApplySupplierFieldPayoffAccountStatusService.opRegulatoryPipeline(entity, loginSysUser);
    }

    // 状态流转为 付款中(10, "付款中")
    @Override
    public int opRegulatoryPipeline(List<InvoiceApplySupplier> entitys, InvoiceApplySupplierOpCommonDimAccountingOrderForm form, LoginSysUser loginSysUser) {
        return invoiceApplySupplierFieldPayoffAccountStatusService.opRegulatoryPipeline(entitys, form, loginSysUser);
    }

    // 状态流转为 部分付款(1, "部分付款")
    @Override
    public int opPart(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
        return invoiceApplySupplierFieldPayoffAccountStatusService.opPart(entity, loginSysUser);
    }

    // 状态流转为 已付款(2, "已付款")
    @Override
    public int opComplete(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
        return invoiceApplySupplierFieldPayoffAccountStatusService.opComplete(entity, loginSysUser);
    }

    // 状态流转为 已付款(2, "已付款")
    @Override
    public int opComplete(List<InvoiceApplySupplier> entitys, InvoiceApplySupplierOpCommonDimAccountingOrderForm form, LoginSysUser loginSysUser) {
        return invoiceApplySupplierFieldPayoffAccountStatusService.opComplete(entitys, form, loginSysUser);
    }

    /****************************************** 状态机 外部使用 类门面   end ******************************************/


}
