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

import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier;
import cn.superdesk.uniorder.dubbo.facade.accounting.supplier.DubboAccountingUnifiedSupplierFieldAccountingStatusService;
import cn.superdesk.uniorder.service.accounting.unified.supplier.AccountingUnifiedSupplierFieldAccountingStatusService;
import com.alibaba.dubbo.config.annotation.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * @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 DubboAccountingUnifiedSupplierFieldAccountingStatusServiceImpl implements DubboAccountingUnifiedSupplierFieldAccountingStatusService {

	@Autowired
	private AccountingUnifiedSupplierFieldAccountingStatusService accountingUnifiedSupplierFieldAccountingStatusService;

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

	// 状态流转为 待提交(3, "待提交")
	@Override
	public void opInitOrReset(AccountingUnifiedSupplier entity, LoginSysUser loginSysUser) {
		accountingUnifiedSupplierFieldAccountingStatusService.opInitOrReset(entity, loginSysUser);
	}

	// 状态流转为 未确认(0, "未确认")
	@Override
	public void opSubmit(AccountingUnifiedSupplier entity, LoginSysUser loginSysUser) {
		accountingUnifiedSupplierFieldAccountingStatusService.opSubmit(entity, loginSysUser);
	}

	// 状态流转为 已确认(1, "已确认")
	@Override
	public void opConfirm(AccountingUnifiedSupplier entity, LoginSysUser loginSysUser) {
		accountingUnifiedSupplierFieldAccountingStatusService.opConfirm(entity, loginSysUser);
	}

	// 状态流转为 已拒绝(2, "已拒绝")
	@Override
	public void opReject(AccountingUnifiedSupplier entity, LoginSysUser loginSysUser) {
		accountingUnifiedSupplierFieldAccountingStatusService.opReject(entity, loginSysUser);
	}

	// 状态流转为 已取消(-1, "已取消")
	@Override
	public void opCancel(AccountingUnifiedSupplier entity, LoginSysUser loginSysUser) {
		accountingUnifiedSupplierFieldAccountingStatusService.opCancel(entity, loginSysUser);
	}

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


}
