package cn.superdesk.uniorder.dubbo.provider.invoice.customer.state;

import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.customer.InvoiceApply;
import cn.superdesk.uniorder.dto.param.invoice.customer.status.OpMailTickStatusFormV2_1;
import cn.superdesk.uniorder.dubbo.facade.invoice.customer.state.DubboInvoiceApplyFieldMailTickStatusService;
import cn.superdesk.uniorder.service.invoice.customer.state.InvoiceApplyCustomerFieldMailTickStatusService;
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 DubboInvoiceApplyFieldMailTickStatusServiceImpl implements DubboInvoiceApplyFieldMailTickStatusService {

	@Autowired
	private InvoiceApplyCustomerFieldMailTickStatusService invoiceApplyFieldMailTickStatusService;

	/****************************************** 状态机 外部使用 类门面 start ******************************************/
	// 状态流转为 未邮寄(0, "未邮寄")
	@Override
	public void opInit(InvoiceApply entity, LoginSysUser loginSysUser) {
		invoiceApplyFieldMailTickStatusService.opInit(entity, loginSysUser);
	}

	// 状态流转为 已邮寄(1, "已邮寄")
	@Override
	public void opComplete(InvoiceApply entity, LoginSysUser loginSysUser) {
		invoiceApplyFieldMailTickStatusService.opComplete(entity, loginSysUser);
	}

	// 状态流转为 已邮寄(1, "已邮寄")
	@Override
	public void opCompleteV2_1(List<InvoiceApply> entitys, OpMailTickStatusFormV2_1 form, LoginSysUser loginSysUser) {
		invoiceApplyFieldMailTickStatusService.opCompleteV2_1(entitys, form, loginSysUser);
	}

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


}
