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

import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dto.param.invoice.excel.InvoiceInvoicedOpBackCollectionForm;
import cn.superdesk.uniorder.dubbo.facade.invoice.customer.invoiced.DubboInvoiceInvoicedFieldIsBackCollectionService;
import cn.superdesk.uniorder.service.invoice.customer.invoiced.InvoiceInvoicedFieldIsBackCollectionService;
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 DubboInvoiceInvoicedFieldIsBackCollectionServiceImpl implements DubboInvoiceInvoicedFieldIsBackCollectionService {

	@Autowired
	private InvoiceInvoicedFieldIsBackCollectionService invoiceInvoicedFieldIsBackCollectionService;

	/****************************************** 状态机 外部使用 类门面 start ******************************************/
	// 状态流转为 未回款(0, "未回款")
	@Override
	public void opInitOrReset(InvoiceInvoicedOpBackCollectionForm form, LoginSysUser loginSysUser) {
		invoiceInvoicedFieldIsBackCollectionService.opInitOrReset(form, loginSysUser);
	}

	// 状态流转为 部分回款(1, "部分回款")
	@Override
	public void opPart(InvoiceInvoicedOpBackCollectionForm form, LoginSysUser loginSysUser) {
		invoiceInvoicedFieldIsBackCollectionService.opPart(form, loginSysUser);
	}

	@Override
	public void opPartBatchByImportExcel(List<InvoiceInvoicedOpBackCollectionForm> formList, LoginSysUser loginSysUser) {
		invoiceInvoicedFieldIsBackCollectionService.opPartBatchByImportExcel(formList, loginSysUser);
	}

	// 状态流转为 全部回款-已回款(2, "全部回款-已回款")
	@Override
	public void opComplete(InvoiceInvoicedOpBackCollectionForm form, LoginSysUser loginSysUser) {
		invoiceInvoicedFieldIsBackCollectionService.opComplete(form, loginSysUser);
	}

	// 状态流转为 红冲发票(69, "红冲发票")
	@Override
	public void opRedWriteOff(InvoiceInvoicedOpBackCollectionForm form, LoginSysUser loginSysUser) {
		invoiceInvoicedFieldIsBackCollectionService.opRedWriteOff(form, loginSysUser);
	}

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

	@Override
	public void opPartBatchByExcelImportLogStep01(List<InvoiceInvoicedOpBackCollectionForm> formList, LoginSysUser loginSysUser){
		invoiceInvoicedFieldIsBackCollectionService.opPartBatchByExcelImportLogStep01(formList, loginSysUser);
	}


}
