forked from I3-YF/i3plus-mes-pcn-yfai
step
parent
9afe79eaa9
commit
120dc75c05
@ -1,73 +0,0 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
|
||||||
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
|
||||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
|
|
||||||
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService;
|
|
||||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
|
||||||
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 lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description : 生成零件条码
|
|
||||||
* @Author : wangjie
|
|
||||||
**/
|
|
||||||
@Slf4j
|
|
||||||
@Service("mesProductSnGenerateStepService2")
|
|
||||||
public class MesProductSnGenerateStepService2 extends BaseStepService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISyncFuncService syncFuncService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public StepResult execute(StationRequestBean reqBean) {
|
|
||||||
|
|
||||||
StationResultBean resultBean = new StationResultBean();
|
|
||||||
|
|
||||||
StepResult stepResult = StepResult.getSuccessComplete();
|
|
||||||
|
|
||||||
//获取上下文信息
|
|
||||||
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
|
|
||||||
|
|
||||||
//配置错误 抛出异常
|
|
||||||
if (!productionProcessContext.getSuccess()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage());
|
|
||||||
|
|
||||||
//存储生产过程上下文对象
|
|
||||||
productionProcessContextStepService.saveProductionProcessContext(reqBean, productionProcessContext);
|
|
||||||
|
|
||||||
//获取上下文产出零件数据信息集合
|
|
||||||
List<MesProductionPartContext> productionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean);
|
|
||||||
|
|
||||||
//获取上下文进料零件条码信息集合
|
|
||||||
List<MesProductionPsInContext> productionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);
|
|
||||||
|
|
||||||
//获取上下文产品加工规则数据信息集合
|
|
||||||
List<MesProdRuleContext> prodRuleContextList = productionDispatchContextStepService.getProdRuleDataContext(reqBean);
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(prodRuleContextList)) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), "上下文中不存在加工规则信息,请重置");
|
|
||||||
|
|
||||||
|
|
||||||
return stepResult;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue