package com.xunhong.erp.turbo.biz.domain.gateway;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xunhong.erp.turbo.api.biz.dto.cmd.*;
import com.xunhong.erp.turbo.api.biz.dto.qry.LastVehicleNoQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.PurchaseOrderCountQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.PurchaseOrderListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.PurchaseOrderPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.PurchaseOrderShowQry;
import com.xunhong.erp.turbo.biz.domain.entity.PurchaseOrder;

import java.util.List;

/**
 * @author shenyifei
 */
public interface PurchaseOrderGateway {
	PurchaseOrder save(PurchaseOrderCreateCmd purchaseOrderCreateCmd);

	// 新增分步提交方法
	PurchaseOrder saveStep1(PurchaseOrderStep1Cmd purchaseOrderStep1Cmd);
	void saveStep2(PurchaseOrderStep2Cmd purchaseOrderStep2Cmd);
	void saveStep3(PurchaseOrderStep3Cmd purchaseOrderStep3Cmd);

	IPage<PurchaseOrder> page(PurchaseOrderPageQry purchaseOrderPageQry);

	List<PurchaseOrder> list(PurchaseOrderListQry purchaseOrderListQry);

	PurchaseOrder update(PurchaseOrderUpdateCmd purchaseOrderUpdateCmd);

	PurchaseOrder show(PurchaseOrderShowQry purchaseOrderShowQry);

	void destroy(PurchaseOrderDestroyCmd purchaseOrderDestroyCmd);

	void approve(PurchaseOrderApproveCmd purchaseOrderApproveCmd);

	void submitReview(PurchaseOrderSubmitReviewCmd purchaseOrderSubmitReviewCmd);

	void withdrawReview(PurchaseOrderWithdrawReviewCmd purchaseOrderWithdrawReviewCmd);

	void rejectApprove(PurchaseOrderRejectApproveCmd purchaseOrderRejectApproveCmd);

	void finalApprove(PurchaseOrderFinalApproveCmd purchaseOrderFinalApproveCmd);

	void rejectFinal(PurchaseOrderRejectFinalCmd purchaseOrderRejectFinalCmd);

	Long countBy(PurchaseOrderCountQry purchaseOrderCountQry);

	/**
	 * 获取上一车的车次号
	 *
	 * @param lastVehicleNoQry 查询参数
	 * @return 车次号
	 */
	String getLastVehicleNo(LastVehicleNoQry lastVehicleNoQry);
}