代码优化

tags/yfai-pcn-ext-v1.6
王杰 9 months ago
parent 2623fb0b66
commit bfc210fca0

@ -42,7 +42,7 @@ public class MesFunctionProductionUnlockService extends BaseSwsService implement
reqBean.setBusiType(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_DO_SCAN.getCode());
reqBean.setTriggerAutoFsm(true);
shippingDispatchService.doSendScanQueueIfNoQueue(reqBean);
shippingDispatchService.doSendScanQueueIfNoQueue(reqBean, false, this.getClass().getSimpleName());
return true;

@ -59,7 +59,7 @@ public class MesEquipByPassReadStepService extends BaseStepService {
//当前工位使用的设备
MesCellEquipContext cellEquipContext = productionProcessContext.getCurCellEquip();
if (null == cellEquipContext || StringUtils.isEmpty(cellEquipContext.getCtrlByPass()) || cellEquipContext.getCtrlByPass().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) return stepResult.isCompleted(false);
if (null == cellEquipContext) return stepResult.isCompleted(false);
//获取生产过程上下文对象有异常信息
if (!productionProcessContextStepService.getEquipmentVariableCfgList(productionProcessContext).getSuccess()) return stepResult.isCompleted(false).msg(productionProcessContext.getMessage());
@ -72,7 +72,7 @@ public class MesEquipByPassReadStepService extends BaseStepService {
//配置错误
if (!productionProcessContextStepService.checkNecessaryEquipmentVariableCfgAndValue(productionProcessContext, cellEquipContext, equipmentVariableCfgList, MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.BYPASS.getValue()).getSuccess())
return execDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().checkRepeat(), stepResult, false, MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, productionProcessContext.getMessage());
return execDynamicsCompleteAndSendMsgReturn(reqBean, resultBean, stepResult, false, MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, productionProcessContext.getMessage());
//搜集设备数据变量接口逻辑信息中的二级变量
List<String> categoryLevelTwoList = productionProcessContextStepService.collectCategoryLevelTwoList(equipmentVariableCfgList);

@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
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.api.iservice.base.IPartService;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
@ -39,6 +40,9 @@ import java.util.stream.Collectors;
public class MesProductionPartNoReadStepService extends BaseStepService {
@Autowired
private IFsmCommonService fsmCommonService;
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
@ -64,10 +68,20 @@ public class MesProductionPartNoReadStepService extends BaseStepService {
@Override
public StepResult init(StationRequestBean reqBean) {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.doCheckOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
execThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false).restoreDbLog().checkRepeat(),
stepResult.isCompleted(false).msg(String.format("当前读取到设备的零件号匹配失败超过[%s]次!", endlessLoopReadTimes)),
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, getStepParams(reqBean), MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
}
//发送工步内容
productionCustomContextStepService.doSendStepContextMessage(reqBean);
return super.init(reqBean);
return stepResult;
}

@ -11,7 +11,6 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.model.ActorMessage;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesOrderModel;
import cn.estsh.i3plus.mes.pcn.config.SpringExtProvider;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
@ -35,8 +34,6 @@ import java.util.stream.Collectors;
@Slf4j
@Service
public class MesVariableWhenFinishedReadStepService extends BaseStepService {
@Autowired
private SnowflakeIdMaker snowflakeIdMaker;
@Autowired
private ActorSystem actorSystem;
@ -44,13 +41,9 @@ public class MesVariableWhenFinishedReadStepService extends BaseStepService {
@Autowired
private IMesProductionProcessContextStepService productionProcessContextStepService;
@Autowired
private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService;
public static final String ORDER_NO_JIS_SORT = "ORDER_NO_JIS_SORT";
private static final Map<String, ActorRef> refMap = new ConcurrentHashMap<>(200);
/**

@ -68,7 +68,7 @@ public class MesWorkOrderReadStepService extends BaseStepService {
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.doCheckOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
execThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false).restoreDbLog().checkRepeat(),
stepResult.isCompleted(false).msg(String.format("当前读取到设备的装配件条码匹配失败超过[%s]次!", endlessLoopReadTimes)),
stepResult.isCompleted(false).msg(String.format("当前读取到设备的加工单匹配失败超过[%s]次!", endlessLoopReadTimes)),
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, getStepParams(reqBean), MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
}

Loading…
Cancel
Save