forked from I3-YF/i3plus-mes-pcn-yfai
step
parent
002c30ef4b
commit
ba951ff29f
@ -0,0 +1,44 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||||
|
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.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 多工位场景触发定位分屏工步
|
||||||
|
* @Author : wangjie
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service("mesManyCellTriggerTabSwitchStepService")
|
||||||
|
public class MesManyCellTriggerTabSwitchStepService extends BaseStepService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult execute(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
StationResultBean resultBean = new StationResultBean();
|
||||||
|
|
||||||
|
StepResult stepResult = StepResult.getSuccessComplete();
|
||||||
|
|
||||||
|
//从工位对象的DataMap中取出固定传参[CLIENT_INFO], 值固定格式:工厂@生产线@工位 可以调用IShippingDispatchService.getActorClientInfo
|
||||||
|
String clientInfo = (null != reqBean.getDataMap() && reqBean.getDataMap().containsKey(MesPcnExtConstWords.CLIENT_INFO)) ? (String) reqBean.getDataMap().get(MesPcnExtConstWords.CLIENT_INFO) : reqBean.getClientInfo();
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(clientInfo)) return stepResult;
|
||||||
|
|
||||||
|
if (null != reqBean.getDataMap() && reqBean.getDataMap().containsKey(MesPcnExtConstWords.CLIENT_INFO)) reqBean.getDataMap().remove(MesPcnExtConstWords.CLIENT_INFO);
|
||||||
|
|
||||||
|
StationRequestBean stationRequestBean = new StationRequestBean();
|
||||||
|
BeanUtils.copyProperties(reqBean, stationRequestBean);
|
||||||
|
stationRequestBean.setScanInfo(clientInfo);
|
||||||
|
|
||||||
|
return execDynamicsCompleteAndSendMsgReturn(stationRequestBean, resultBean, stepResult, true, MesPcnEnumUtil.STATION_BUSI_TYPE.TAB_SWITCH, MesPcnEnumUtil.STATION_DATA_TYPE.CUSTOM, String.format("多工位页面切换,从[%s]切换到[%s]!", reqBean.getClientInfo(), clientInfo));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
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.MesEquipVariableCollectContext;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
|
||||||
|
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||||
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
||||||
|
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.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 扫描装配件条码工步
|
||||||
|
* @Author : wangjie
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service("mesAssemblyScanStepService")
|
||||||
|
public class MesAssemblyScanStepService extends BaseStepService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionProcessContextStepService productionProcessContextStepService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesProductionDispatchContextStepService productionDispatchContextStepService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult guide(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
productionDispatchContextStepService.doSendStepContextMessage(reqBean);
|
||||||
|
|
||||||
|
return execSuccessCompleteAndSendGuideReturn(reqBean, new StationResultBean(), "请扫描装配件条码!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StepResult execute(StationRequestBean reqBean) {
|
||||||
|
|
||||||
|
StationResultBean resultBean = new StationResultBean();
|
||||||
|
|
||||||
|
StepResult stepResult = StepResult.getSuccessComplete();
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(reqBean.getScanInfo())) execSendGuideAndThrowEx(reqBean, resultBean, "请扫描装配件条码!");
|
||||||
|
|
||||||
|
//扫描信息置空
|
||||||
|
String scanInfo = reqBean.resetScanInfo(reqBean.getScanInfo());
|
||||||
|
|
||||||
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getCurCellEquipment(reqBean);
|
||||||
|
|
||||||
|
//获取生产过程上下文对象有异常信息 抛出异常
|
||||||
|
if (!productionProcessContext.getSuccess()) return execNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, productionProcessContext.getMessage());
|
||||||
|
|
||||||
|
//保存设备当前一轮工序待验证的装配件条码信息
|
||||||
|
productionDispatchContextStepService.saveScanAssemblySnContext(reqBean, getAssemblySnJson(reqBean, scanInfo));
|
||||||
|
|
||||||
|
//发送工步内容
|
||||||
|
productionDispatchContextStepService.doSendStepContextMessage(reqBean, scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN);
|
||||||
|
|
||||||
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("当前扫描信息装配件条码[%s]!", scanInfo));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<MesEquipVariableCollectContext> getAssemblySnJson(StationRequestBean reqBean, String scanInfo) {
|
||||||
|
|
||||||
|
List<MesEquipVariableCollectContext> equipVariableCollectContextList = new ArrayList<>();
|
||||||
|
|
||||||
|
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), scanInfo, TimeTool.getNowTime(true)));
|
||||||
|
|
||||||
|
return equipVariableCollectContextList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue