package com.prolog.cs.biz.inbound.service.rcv;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.prolog.cs.biz.inbound.constant.ValidatorGroup.validAdd;
import com.prolog.cs.biz.inbound.dto.CargoChangeIn;
import com.prolog.cs.biz.inbound.dto.PageParam;
import com.prolog.cs.biz.inbound.dto.failure.ExceptionLineQueryDTO;
import com.prolog.cs.biz.inbound.dto.rcv.*;
import com.prolog.cs.biz.inbound.dto.rqc.RqcLinesDTO;
import com.prolog.cs.biz.inbound.dto.rqc.RqcReLinesDTO;
import com.prolog.cs.biz.inbound.model.rcv.RcvHeaders;
import com.prolog.cs.biz.inbound.model.rcv.RcvLines;
import com.prolog.cs.biz.inbound.model.rcv.WmsInRcvTempSave;
import com.prolog.cs.biz.inbound.vo.*;
import com.prolog.cs.bpm.core.exception.ProcessException;
import com.prolog.framework.authority.core.dto.UserDTO;
import com.prolog.framework.core.pojo.Page;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Date 2021-03-24
 */
@Validated
public interface RcvHeadersService {

	/**
	 * @Description
	 * @Date 2021-03-24 add RcvHeadersDTO
	 */
	@Validated(validAdd.class)
	public Object add(@Valid RcvHeadersDTO rcvHeadersDTO, UserDTO userDTO);

	/**
	 * @Description
	 * @Date 2021-03-24 edit RcvHeadersDTO
	 */
	public Object edit(String pkId, RcvHeadersDTO rcvHeadersDTO);

	/**
	 * @Description
	 * @Date 2021-03-24 delete RcvHeadersDTO
	 */
	public Object deletePkId(String pkId);

	/**
	 * @Description
	 * @Date 2021-03-24 delete RcvHeadersDTO
	 */
	public Object delIds(List<String> pkIdList);

	/**
	 * @Description
	 * @Date 2021-03-24 page condition search RcvHeadersDTO
	 */
	public Page<RcvHeadersDTO> findList(RcvQueryVO rcvQueryVO, PageParam pageParam);

	/**
	 * @Description
	 * @Date 2021-03-24 batchAdd RcvHeadersDTO
	 */
	public Object batchAdd(List<RcvHeadersDTO> rcvHeadersDTOList);

	/**
	 * @Description
	 * @Date 2021-03-24 batchEdit RcvHeadersDTO
	 */
	public Object batchEdit(List<RcvHeadersDTO> rcvHeadersDTOList);

	/**
	 * @Description
	 * @Date 2021-03-24 condition search all RcvHeadersDTO
	 */
	public List<RcvHeadersDTO> findAll(RcvQueryVO rcvQueryVO);

	/**
	 * @Description
	 * @Date 2021-03-24 findOne RcvHeadersDTO
	 */
	public RcvDTO findByPkId(String pkId);

	/**
	 * 新增关联的级联信息
	 * 
	 * @param rcvDTO
	 * @return
	 * @throws JsonProcessingException
	 * @throws ProcessException
	 */
	public Object addWithRelated(RcvDTO rcvDTO);

	/**
	 * 修改关联的级联信息
	 * 
	 * @param rcvDTO
	 * @return
	 */
	public Object editWithRelated(RcvDTO rcvDTO);

	public Object batchAddWithRelated(List<RcvDTO> rcvDTOList);

	public Object batchEditWithRelated(List<RcvHeadersDTO> rcvHeadersDTOList);

	public Object submitConclusion(String pkId);

	public Page<RcvHAndPDTO> findListWithPro(RcvQueryVO rcvQueryVO, PageParam pageParam);

	public RcvHeaders findById(String id);

	Page<RcvHDTO> findListWithProfile(RcvQueryVO rcvQueryVO, PageParam pageParam);

	public Object getRcvPrintData(RcvLinesQueryVO queryVo);

	Boolean addWithRelatedTemp(RcvDTO rcvDTO);

	String findWithRelatedTemp(String warehouseId);

	public Object getRcvItemLotNum(RcvLinesQueryVO queryVo);

	public Object vaildateRcvItemLotNum(List<RcvLineLotInfo> rcvLineLotInfoList);

	public Page<WmsInRcvTempSave> findWithRelatedTempPage(WmsInRcvTempSave rcvQueryVO, PageParam pageParam);

	String findWithRelatedTempById(String id);

	public boolean vaildateRcvComplete(String rcvHeaderId);

	public Object vaildateRcvSplit(List<RcvLineSpiltInfo> rcvLineSpiltInfoList);

	public Page<RcvHDTO> getReportHeader(RcvQueryVO rcvQueryVO, PageParam pageParam);

	public Page<RcvLinesDTO> getReportRcvLine(LineQueryVO lineQueryVO, PageParam pageParam);

	public Page<RqcLinesDTO> getReportRqcLine(LineQueryVO lineQueryVO, PageParam pageParam);

	public Page<RqcReLinesDTO> getReportRqcReLine(LineQueryVO lineQueryVO, PageParam pageParam);

	public Page<RcvRejectLinesDTO> getReportRejectLine(LineQueryVO lineQueryVO, PageParam pageParam);

	public Page<ExceptionLineQueryDTO> getReportExceptionLine(LineQueryVO lineQueryVO, PageParam pageParam);

	public Page<RcvInstockLinesDTO> getReportInstockLine(LineQueryVO lineQueryVO, PageParam pageParam);

	public Object findItemWithRelatedTemp(String tempSaveId);

	public Object testGetRcvNO();

	public Object lockBill(String billId);

	public Object cargoChangeIn(List<CargoChangeIn> cargoChangeInList);

	public Object cargoChangeInBillInfo(List<String> billIds);

	public Object addWithRelatedByPda(RcvDTO rcvDTO);

	public Boolean rfSaveValidate(RcvDTO rcvDTO);

	public Object rfSaveConfrim(RcvDTO rcvDTO);

	RcvDTO findRcvDtoByBillId(String billId);

	Boolean deleteRcvDByRcvLineId(DeleteTobeConfirmed deleteTobeConfirmed);

	RcvDTO buildRcvDto(RcvDetailsDTO rcvDetailsDTO);

	BigDecimal calculationQty(Boolean flag, RcvDTO rcvDTO);

	List<RcvLineDetailsDTO> extractAsnLine(String billId);

	void saveItemLotArriveQty(RcvDTO rcvDTO);

	RcvLines arriveQtyByItemLot(RcvLinesDTO rcvLinesDTO);

}
