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

import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description : 打印主条码
 * @Reference :
 * @Author : Castle
 * @CreateDate : 2024/6/6 13:39
 * @Modify:
 **/
@Service("mesProductSnPrintStepService")
public class MesProductSnPrintStepService extends BaseStepService {

    @Autowired
    private IMesProductionProcessContextStepService productionProcessContextStepService;

    @Override
    public StepResult execute(StationRequestBean reqBean) {

        //排序线 打印客户条码工步
        if (MesExtEnumUtil.WORK_CENTER_TYPE.SORT.getValue() == productionProcessContextStepService.getCenterType(reqBean)) return ((IStepService) SpringContextsUtil.getBean("mesProductSnPrintSortStepService")).executeInState(reqBean);

        //非排序线 打印主条码工步
        return ((IStepService) SpringContextsUtil.getBean("mesProductSnPrintNosortStepService")).executeInState(reqBean);

    }

}
