forked from I3-YF/i3plus-mes-pcn-yfai
44630 读胎膜信号工步,无法适配柔性焊流程,需要优化
parent
5aaa08b8b7
commit
98f999bc7e
@ -0,0 +1,91 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdOrgExtService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmCommonService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IShippingDispatchService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService;
|
||||
import cn.estsh.i3plus.mes.pcn.websocket.StationWebSocket;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellExtendCfg;
|
||||
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.util.SpringContextsUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : 验证通过后所有分屏强制跳过工序工步
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("mesManyCellTriggerJumpProcessStepService")
|
||||
public class MesManyCellTriggerJumpProcessStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IFsmCommonService fsmCommonService;
|
||||
|
||||
@Autowired
|
||||
private IMesProdOrgExtService prodOrgExtService;
|
||||
|
||||
@Autowired
|
||||
private IShippingDispatchService shippingDispatchService;
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
if (StringUtils.isEmpty(reqBean.getScanInfo())) return stepResult;
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//根据生产线代码,工位代码查询主子工位实虚关系信息(排除当前工位)
|
||||
List<MesWorkCellExtendCfg> workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode());
|
||||
|
||||
if (CollectionUtils.isEmpty(workCellExtendCfgList)) return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]未配置实虚工位对应关系", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()));
|
||||
|
||||
for (MesWorkCellExtendCfg workCellExtendCfg : workCellExtendCfgList) {
|
||||
|
||||
if (null == workCellExtendCfg) continue;
|
||||
|
||||
if (workCellExtendCfg.getWorkCenterCodeBak().equals(reqBean.getWorkCenterCode()) && workCellExtendCfg.getWorkCellCodeBak().equals(reqBean.getWorkCellCode())) continue;
|
||||
|
||||
//验证下个工位是否在线
|
||||
String clientInfo = shippingDispatchService.getActorClientInfo(reqBean.getOrganizeCode(), workCellExtendCfg.getWorkCenterCodeBak(), workCellExtendCfg.getWorkCellCodeBak());
|
||||
if (CollectionUtils.isEmpty(StationWebSocket.getStationWebSocketList(clientInfo))) continue;
|
||||
|
||||
//调用多工位场景触发定位分屏工步, CLIENT_INFO是必要传参
|
||||
reqBean.getDataMap().put(MesPcnExtConstWords.CLIENT_INFO, clientInfo);
|
||||
return ((IStepService) SpringContextsUtil.getBean("mesManyCellTriggerTabSwitchStepService")).executeInState(reqBean);
|
||||
|
||||
}
|
||||
|
||||
return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult,
|
||||
String.format("生产线[%s]工位[%s]切换分屏失败!原因:实体生产线[%s]工位[%s]%s!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(),
|
||||
workCellExtendCfgList.get(0).getWorkCenterCode(), workCellExtendCfgList.get(0).getWorkCellCode(), workCellExtendCfgList.size() == 1 ? "仅关联了当前操作的虚拟工位" : "关联的其他虚拟工位当前均不在线"));
|
||||
|
||||
}
|
||||
|
||||
//未知腔数配置【工位参数】
|
||||
private String getManyCellJumpProcess(StationRequestBean reqBean) {
|
||||
String cavityUnknownCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_UNKNOWN_CFG);
|
||||
return (!StringUtils.isEmpty(cavityUnknownCfg) && cavityUnknownCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityUnknownCfg : null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue