package cn.estsh.i3plus.ext.mes.pcn.api.busi;

import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesWorkOrderCreateSnErrorRecord;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description:
 * @Reference:
 * @Author: wangjie
 * @CreateDate: 2019/11/12 14:42
 * @Modify:
 **/
public interface IWorkOrderCreateSnErrorRecordService {

    /**
     * 插入工单条码生成异常记录表(新事务，不回滚)
     *
     * @param record 绑定记录拓展
     */
    @ApiOperation(value = "插入工单条码生成异常记录表(新事务，不回滚)", notes = "插入工单条码生成异常记录表(新事务，不回滚)")
    @Transactional(propagation = Propagation.REQUIRES_NEW, noRollbackFor = {ImppBusiException.class, Exception.class})
    void insertWorkOrderCreateSnErrorRecordNoRollback(MesWorkOrderCreateSnErrorRecord record);

    /**
     * 获取工单条码生成异常记录
     * @param organizeCode 组织代码
     * @return 工单条码生成异常记录
     */
    @ApiOperation(value = "获取工单条码生成异常记录", notes = "获取工单条码生成异常记录")
    List<MesWorkOrderCreateSnErrorRecord> getWorkOrderCreateSnErrorRecordList(String organizeCode);

    /**
     * 根据工单号获取工单条码生成异常记录
     * @param organizeCode 组织代码
     * @param workOrderNo 生产工单号
     * @return 工单条码生成异常记录
     */
    @ApiOperation(value = "根据工单号获取工单条码生成异常记录", notes = "根据工单号获取工单条码生成异常记录")
    MesWorkOrderCreateSnErrorRecord getWorkOrderCreateSnErrorRecordByWorkOrderNo(String organizeCode, String workOrderNo);

}
