package com.sw.mes.yb.production.service;

import java.math.BigDecimal;
import java.util.List;

import com.sw.mes.core.base.BaseService;
import com.sw.mes.yb.production.dto.AgainTask.ConfirmWeightDto;
import com.sw.mes.yb.production.entity.AgainTask;
import com.sw.mes.yb.production.entity.AgainTaskDetail;
import com.sw.mes.yb.production.entity.InputFurnaceBurden;
import com.sw.mes.yb.production.entity.InputFurnaceDetail;

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
public interface AgainTaskService extends BaseService<AgainTask> {

	public void createChildTask(AgainTask entity, ConfirmWeightDto dto, Integer tongNum, Integer carrierNum) throws Exception;

	public AgainTask getByEquipmentLastTask(String equimentCode, String lotNo);

	AgainTask getByLotNoAndAgainNum(Integer againNum, String lotNo);

	public AgainTask getByEquipmentAndStateLastTask(String equimentCode, String lotNo,Integer rawStatus);

	public List<AgainTask> findByLotNo(String lotNo);

	public List<AgainTask> findByLotNoAndAgainNum(String lotNo, Integer againNum);

	public AgainTask getByRepeatOpenTask(String equipmentCode, String lotNo);


	public InputFurnaceBurden saveInputFurnaceBurden(List<AgainTaskDetail> againTaskDetails);

    void cancelTask(Long id, String cause);

	void repeatOpenTask(Long id);

	List<AgainTask> findSuccessByLotNoAndAgainNum(String lotNo, Integer againNum);

	List<AgainTask> findByLotNoList(List<String> lotNo);

	List<AgainTask> findSuccessByEquipmentCodeAndAgainNum(String equipmentCode, Integer againNum);

    AgainTask findByEquipmentCode(String code);

	/**
	 * 根据炉次号查询复投成功的复投任务信息
	 */
	List<AgainTask> findSuccessByLotNo(String lotNo);

	List<InputFurnaceDetail> findByLotNoAndProductCode(String lotNo, String code);

	/**
	 * 根据炉次号查询最新已完成的复投任务
	 */
	AgainTask findCompletedTopByLotNo(String lotNo);


	/**
	 * 根据设备号查询最新已完成的复投任务
	 */
	AgainTask findCompletedTopByEquipmentCode(String equipmentCode);


	/**
	 * 根据炉次号,复投次数查询最新已完成的复投任务
	 */
	AgainTask findCompletedByLotNoAndAgainNum(String lotNo, Integer againNum);

	/**
	 * 根据炉次号和复投次数查询正常复投任务
	 */
	List<AgainTask> findNormalTasks(String lotNo, Integer againNum);

}
