package com.xunhong.erp.turbo.api.biz.api;

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.api.biz.dto.vo.PurchaseOrderVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;

import java.util.List;

/**
 * @author shenyifei
 */
public interface PurchaseOrderServiceI {
	PurchaseOrderVO create(PurchaseOrderCreateCmd purchaseOrderCreateCmd);

	PageDTO<PurchaseOrderVO> page(PurchaseOrderPageQry purchaseOrderPageQry);

	List<PurchaseOrderVO> list(PurchaseOrderListQry purchaseOrderListQry);

	PurchaseOrderVO update(PurchaseOrderUpdateCmd purchaseOrderUpdateCmd);

	PurchaseOrderVO 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 countPurchaseOrderByState(PurchaseOrderCountQry purchaseOrderCountQry);
	
	// 分步提交方法
	PurchaseOrderVO saveStep1(PurchaseOrderStep1Cmd purchaseOrderStep1Cmd);
	void saveStep2(PurchaseOrderStep2Cmd purchaseOrderStep2Cmd);
	void saveStep3(PurchaseOrderStep3Cmd purchaseOrderStep3Cmd);

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