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.DubboInvoiceApplySupplierFieldMakeInvoiceStatusService;
import cn.superdesk.uniorder.service.invoice.supplier.InvoiceApplySupplierFieldMakeInvoiceStatusService;
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 DubboInvoiceApplySupplierFieldMakeInvoiceStatusServiceImpl implements DubboInvoiceApplySupplierFieldMakeInvoiceStatusService {

	@Autowired
	private InvoiceApplySupplierFieldMakeInvoiceStatusService invoiceApplySupplierFieldMakeInvoiceStatusService;

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

	// 状态流转为 未开票(0, "未开票")
	@Override
	public void opInit(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
		invoiceApplySupplierFieldMakeInvoiceStatusService.opInit(entity, loginSysUser);
	}

	// 状态流转为 已开票(1, "已开票")
	@Override
	public void opComplete(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
		invoiceApplySupplierFieldMakeInvoiceStatusService.opComplete(entity, loginSysUser);
	}

	// 状态流转为 已开票(1, "已开票")
	@Override
	public void opComplete(List<InvoiceApplySupplier> entitys, InvoiceApplySupplierOpCommonDimAccountingOrderForm form, LoginSysUser loginSysUser) {
		invoiceApplySupplierFieldMakeInvoiceStatusService.opComplete(entitys, form, loginSysUser);
	}

	// 状态流转为 已撤消(2, "已撤消")
	@Override
	public void opBecomeInvalid(InvoiceApplySupplier entity, LoginSysUser loginSysUser) {
		invoiceApplySupplierFieldMakeInvoiceStatusService.opBecomeInvalid(entity, loginSysUser);
	}

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


}
