package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step.method;

import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesPackageDataContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesPackageRuleContext;
import cn.estsh.i3plus.pojo.mes.bean.MesPackage;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
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;

public interface IMesPackageNoGenerateStepService {

    @ApiOperation(value = "根据包装ID查询包装信息")
    MesPackage getMesPackage(String organizeCode, Long packageId);

    @ApiOperation(value = "强制打包业务处理")
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = {ImppBusiException.class, Exception.class})
    void doForcePrint(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, List<MesPackageDataContext> packageDataContextList, MesPackage packageDb);

    @ApiOperation(value = "删除包装信息")
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = {ImppBusiException.class, Exception.class})
    void deletePackageData(StationRequestBean reqBean, MesPackage packageDb, Integer generateType);

    @ApiOperation(value = "修改包装信息的数量")
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = {ImppBusiException.class, Exception.class})
    void savePackageData(StationRequestBean reqBean, MesPackage packageDb, Double qty);

    @ApiOperation(value = "获取包装规则信息")
    MesPackageRuleContext getPackageRuleContext(StationRequestBean reqBean, StepResult stepResult, String partNo, Boolean isAsyn);

    @ApiOperation(value = "零件打包业务处理")
    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = {ImppBusiException.class, Exception.class})
    void doHandlePackagePart(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesPackageDataContext packageDataContext);

}
