工步方法优化

uat-temp-wj-chongqingdaqu-prod-temp-46319
王杰 3 months ago
parent 77ddb2cc7c
commit 9a1adf3285

@ -123,14 +123,14 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
//搜集装配件条码
String assemblySn = equipVariableCollectContextList.stream().filter(o -> null != o).map(MesEquipVariableCollectContext::getEquipVariableValue).collect(Collectors.toList()).toString();
//未知腔数配置【工位参数】, 不验证装配件条码的个数
String cavityUnknownCfg = getCavityUnknownCfg(reqBean);
//未知腔数配置【工位参数】, 不验证装配件条码的个数, 默认非未知腔数=2
Boolean cavityUnknownCfg = checkWcpcMapIsMatch(reqBean, MesPcnExtConstWords.CAVITY_UNKNOWN_CFG);
//根据设备代码获取可复用条码的个数
Integer repeatAssemblySnCount = productionCustomContextStepService.getRepeatAssemblySnCount(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), cellEquipContext.getEquipmentCode());
Integer repeatAssemblySnAmount = repeatAssemblySnCount * (!CollectionUtils.isEmpty(curProductionPsInContextList) ? curProductionPsInContextList.size() : 1);
//非未知腔数,验证装配件条码个数是否匹配 腔数或者未匹配的主条码个数*每腔个数
if (StringUtils.isEmpty(cavityUnknownCfg) && (equipVariableCollectContextList.size() + repeatAssemblySnAmount) != (!CollectionUtils.isEmpty(curProductionPsInContextList) ? curProductionPsInContextList.size() : cellEquipContext.getCavity()) * cellEquipContext.getBindQty()) {
if (!cavityUnknownCfg && (equipVariableCollectContextList.size() + repeatAssemblySnAmount) != (!CollectionUtils.isEmpty(curProductionPsInContextList) ? curProductionPsInContextList.size() : cellEquipContext.getCavity()) * cellEquipContext.getBindQty()) {
String suffix = repeatAssemblySnAmount == 0 ? MesPcnExtConstWords.EMPTY : String.format(",可复用个数[%s]", repeatAssemblySnAmount);
if (!CollectionUtils.isEmpty(curProductionPsInContextList)) {
productionDispatchContextStepService.dispatchProductionPsInContext(reqBean, productionPsInContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()))).collect(Collectors.toList()));
@ -166,10 +166,10 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
stepResult.msg(String.format("%s%s", suffix, !StringUtils.isEmpty(stepResult.getMsg()) ? stepResult.getMsg() : (
StringUtils.isEmpty(stepResult.getObj()) ? MesPcnExtConstWords.EMPTY : (
(!stepResult.getObj().toString().contains(MesPcnExtConstWords.EXCLAMATION) ||
stepResult.getObj().toString().indexOf(MesPcnExtConstWords.EXCLAMATION) != stepResult.getObj().toString().lastIndexOf(MesPcnExtConstWords.EXCLAMATION)
) ? MesPcnExtConstWords.EMPTY : stepResult.getObj()))
(StringUtils.isEmpty(stepResult.getObj()) || !checkWcpcMapIsMatch(reqBean, MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG)) ? MesPcnExtConstWords.EMPTY : (
(!stepResult.getObj().toString().contains(MesPcnExtConstWords.EXCLAMATION) ||
stepResult.getObj().toString().indexOf(MesPcnExtConstWords.EXCLAMATION) != stepResult.getObj().toString().lastIndexOf(MesPcnExtConstWords.EXCLAMATION)
) ? MesPcnExtConstWords.EMPTY : stepResult.getObj()))
)
);
@ -206,10 +206,9 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
}
//未知腔数配置【工位参数】
private String getCavityUnknownCfg(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;
//【工位参数】
private Boolean checkWcpcMapIsMatch(StationRequestBean reqBean, String paramCode) {
return fsmCommonService.checkWcpcMapIsMatch(reqBean, paramCode, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
}
//获取设备下所有的装配件规则清单, 根据非排序加工规则ID分组
@ -238,7 +237,7 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
}
//生成零件号业务处理
private List<MesProdRuleContext> doHandleAssemblyGeneratePartNo(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesCellEquipContext cellEquipContext, String cavityUnknownCfg,
private List<MesProdRuleContext> doHandleAssemblyGeneratePartNo(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesCellEquipContext cellEquipContext, Boolean cavityUnknownCfg,
MesProductionProcessContext productionProcessContext, List<MesProductionPsInContext> productionPsInContextList, List<MesProdRuleContext> prodRuleContextList,
Map<Long, List<MesProductionAssemblyNosortContext>> assemblyNosortCfgMap, List<MesEquipVariableCollectContext> equipVariableCollectContextList,
Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap) {
@ -263,7 +262,7 @@ public class MesAssemblyGeneratePartNoStepService extends BaseStepService {
if (CollectionUtils.isEmpty(productionAssemblyNosortContextList)) continue;
//没有未知腔数配置, 剔除装配件规则个数不等于每腔个数的数据
if (StringUtils.isEmpty(cavityUnknownCfg) && cellEquipContext.getBindQty().compareTo(productionAssemblyNosortContextList.size()) != 0) continue;
if (!cavityUnknownCfg && cellEquipContext.getBindQty().compareTo(productionAssemblyNosortContextList.size()) != 0) continue;
//收集未消费的临时数据
List<MesEquipVariableCollectContext> equipVariableCollectContextListTemp = DeepCloneUtil.deepCloneList(unConsumeList);

@ -166,7 +166,7 @@ public class MesAssemblyMatchNosortRetrodictStepService extends BaseStepService
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
stepResult.msg(String.format("%s%s", suffix, !StringUtils.isEmpty(stepResult.getMsg()) ? stepResult.getMsg() : (
StringUtils.isEmpty(stepResult.getObj()) ? MesPcnExtConstWords.EMPTY : (
(StringUtils.isEmpty(stepResult.getObj()) || !checkWcpcMapIsMatch(reqBean, MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG)) ? MesPcnExtConstWords.EMPTY : (
(!stepResult.getObj().toString().contains(MesPcnExtConstWords.EXCLAMATION) ||
stepResult.getObj().toString().indexOf(MesPcnExtConstWords.EXCLAMATION) != stepResult.getObj().toString().lastIndexOf(MesPcnExtConstWords.EXCLAMATION)
) ? MesPcnExtConstWords.EMPTY : stepResult.getObj()))
@ -422,4 +422,9 @@ public class MesAssemblyMatchNosortRetrodictStepService extends BaseStepService
return result;
}
//【工位参数】
private Boolean checkWcpcMapIsMatch(StationRequestBean reqBean, String paramCode) {
return fsmCommonService.checkWcpcMapIsMatch(reqBean, paramCode, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
}
}

@ -161,7 +161,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
stepResult.msg(String.format("%s%s", suffix, !StringUtils.isEmpty(stepResult.getMsg()) ? stepResult.getMsg() : (
StringUtils.isEmpty(stepResult.getObj()) ? MesPcnExtConstWords.EMPTY : (
(StringUtils.isEmpty(stepResult.getObj()) || !checkWcpcMapIsMatch(reqBean, MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG)) ? MesPcnExtConstWords.EMPTY : (
(!stepResult.getObj().toString().contains(MesPcnExtConstWords.EXCLAMATION) ||
stepResult.getObj().toString().indexOf(MesPcnExtConstWords.EXCLAMATION) != stepResult.getObj().toString().lastIndexOf(MesPcnExtConstWords.EXCLAMATION)
) ? MesPcnExtConstWords.EMPTY : stepResult.getObj()))
@ -175,7 +175,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
private List<MesProdRuleContext> resetAssembly(StationRequestBean reqBean, List<MesProdRuleContext> prodRuleContextList) {
//是否支持混腔扫描[工位参数]
String cavityNosortCfg = getCavityNosortCfg(reqBean);
Boolean cavityNosortCfg = checkWcpcMapIsMatch(reqBean, MesPcnExtConstWords.CAVITY_NOSORT_CFG);
prodRuleContextList.forEach(o -> {
@ -183,7 +183,7 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList = o.getNosortAssemblyDataContext();
if (!StringUtils.isEmpty(cavityNosortCfg) || hasUnBindAssemblyOptional(productionAssemblyNosortContextList)) {
if (cavityNosortCfg || hasUnBindAssemblyOptional(productionAssemblyNosortContextList)) {
productionAssemblyNosortContextList.forEach(i -> { if (i.getIsResetScan().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) i.assemblyStatusReset(); });
@ -198,10 +198,9 @@ public class MesAssemblyMatchNosortStepService extends BaseStepService {
return prodRuleContextList;
}
//是否支持混腔扫描[工位参数]
private String getCavityNosortCfg(StationRequestBean reqBean) {
String cavityNosortCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG);
return (!StringUtils.isEmpty(cavityNosortCfg) && cavityNosortCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityNosortCfg : null;
//【工位参数】
private Boolean checkWcpcMapIsMatch(StationRequestBean reqBean, String paramCode) {
return fsmCommonService.checkWcpcMapIsMatch(reqBean, paramCode, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
}
//验证当前是否属于装配件跳过码

@ -147,7 +147,7 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
stepResult.msg(String.format("%s%s", suffix, !StringUtils.isEmpty(stepResult.getMsg()) ? stepResult.getMsg() : (
StringUtils.isEmpty(stepResult.getObj()) ? MesPcnExtConstWords.EMPTY : (
(StringUtils.isEmpty(stepResult.getObj()) || !checkWcpcMapIsMatch(reqBean, MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG)) ? MesPcnExtConstWords.EMPTY : (
(!stepResult.getObj().toString().contains(MesPcnExtConstWords.EXCLAMATION) ||
stepResult.getObj().toString().indexOf(MesPcnExtConstWords.EXCLAMATION) != stepResult.getObj().toString().lastIndexOf(MesPcnExtConstWords.EXCLAMATION)
) ? MesPcnExtConstWords.EMPTY : stepResult.getObj()))
@ -339,4 +339,9 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
return false;
}
//【工位参数】
private Boolean checkWcpcMapIsMatch(StationRequestBean reqBean, String paramCode) {
return fsmCommonService.checkWcpcMapIsMatch(reqBean, paramCode, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
}
}

@ -65,7 +65,7 @@ public class MesAssemblyReadStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false).writeDbLog().checkRepeat(),

@ -433,6 +433,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
//获取前端置顶信息 【sourceId&MatchDatetime】
String topRowInfo = getTopRowInfo(allAssemblyList);
//是否显示规则列【工位参数】
Boolean isNeedShowMatchRule = checkIsNeedShowMatchRule(reqBean);
for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
@ -467,10 +468,9 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
return CollectionUtils.isEmpty(allAssemblyList) ? null : new StringJoiner(MesPcnExtConstWords.AND).add(allAssemblyList.get(0).getSourceId().toString()).add(allAssemblyList.get(0).getMatchDatetime()).toString();
}
//未知腔数配置【工位参数】
//是否显示规则列【工位参数】
private Boolean checkIsNeedShowMatchRule(StationRequestBean reqBean) {
String assemblyShowMrCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG);
return (!StringUtils.isEmpty(assemblyShowMrCfg) && assemblyShowMrCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? true : false;
return fsmCommonService.checkWcpcMapIsMatchTrue(reqBean, MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG);
}
private String getWorkOrderNo(Map<Integer, MesProductionPartContext> productionPartMap, Integer foreignKey) {

@ -265,8 +265,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
//装配件显示规则配置【工位参数】
private Boolean checkIsNeedShowMatchRule(StationRequestBean reqBean) {
String assemblyShowMrCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG);
return (!StringUtils.isEmpty(assemblyShowMrCfg) && assemblyShowMrCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? true : false;
return fsmCommonService.checkWcpcMapIsMatchTrue(reqBean, MesPcnExtConstWords.ASSEMBLY_SHOW_MR_CFG);
}
//封装匹配当前设备的装配件信息

@ -131,10 +131,8 @@ public class MesCountDownShowStepService extends BaseStepService {
if (null != countDownCfgArr) return countDownCfgArr;
//获取工位参数
Map<String, String> wcpcMap = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean);
String countDownCfg = wcpcMap.containsKey(MesPcnExtConstWords.COUNT_DOWN_CFG) ? wcpcMap.get(MesPcnExtConstWords.COUNT_DOWN_CFG) : null;
//倒计时配置【工位参数】
String countDownCfg = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.COUNT_DOWN_CFG);
if (!StringUtils.isEmpty(countDownCfg)) countDownCfgArr = getCountDownCfgArr(countDownCfg);

@ -5,16 +5,13 @@ 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.platform.common.util.MesPcnConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -51,7 +48,7 @@ public class MesManyCellTriggerJumpProcessStepService extends BaseStepService {
stepResult.unResetScanInfo();
//所有分屏强制跳过工序密码
String pwd = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.MANY_CELL_TRIGGER_JUMP_PROCESS_PWD);
String pwd = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.MANY_CELL_TRIGGER_JUMP_PROCESS_PWD);
if (StringUtils.isEmpty(pwd) || !pwd.equals(reqBean.getScanInfo())) return stepResult;
StationResultBean resultBean = new StationResultBean();

@ -124,11 +124,10 @@ public class MesProductSeqCheckNosortStepService extends MesProductSeqCheckStepS
//非排序顺序防错级别配置[工位参数]
private String getCheckProductSeqCfg(StationRequestBean reqBean) {
String checkProductSeqCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CHECK_PRODUCT_SEQ_CFG);
return (!StringUtils.isEmpty(checkProductSeqCfg) && checkProductSeqCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? checkProductSeqCfg : null;
return fsmCommonService.checkWcpcMapIsMatchValue(reqBean, MesPcnExtConstWords.CHECK_PRODUCT_SEQ_CFG, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
}
//前道工艺防错验证 【非排序】
//顺序防错验证 【非排序】
private Boolean doProductSeqCheckNosort(StationRequestBean reqBean, StepResult stepResult, MesProductionProcessContext productionProcessContext,
MesProductionPartContext productionPartContext, String checkProductSeqCfg, List<String> workOrderNoList) {

@ -105,7 +105,7 @@ public class MesProductSeqCheckSortStepService extends MesProductSeqCheckStepSer
}
//前道工艺防错验证 【排序】
//顺序防错验证 【排序】
private Boolean doProductSeqCheckSort(StationRequestBean reqBean, StepResult stepResult, MesProductionProcessContext productionProcessContext, MesProductionPartContext productionPartContext, Boolean isPushQueue) {
String message = StringUtils.isEmpty(stepResult.getMsg()) ? MesPcnExtConstWords.EMPTY : stepResult.getMsg() + MesPcnExtConstWords.SEMICOLON;

@ -67,7 +67,7 @@ public class MesProductSnReadStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false).writeDbLog().checkRepeat(),

@ -121,7 +121,7 @@ public class MesProductSnScanStepService extends BaseStepService {
if (StringUtils.isEmpty(scanInfo) && (scanedQty.compareTo(needQty) < 0 || StringUtils.isEmpty(isAllowJump) || isAllowJump)) stepSendGuideAndThrowEx(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), "请扫描主条码!");
//是否支持混腔扫描[工位参数]
String cavityNosortCfg = getCavityNosortCfg(reqBean);
Boolean cavityNosortCfg = fsmCommonService.checkWcpcMapIsMatchTrue(reqBean, MesPcnExtConstWords.CAVITY_NOSORT_CFG);
//封装待验证的主条码信息
if (!scanInfo.equals(productionProcessContext.getFinishCode())) equipVariableCollectContextList = doHandleScanProductSnContext(reqBean, scanInfo, equipVariableCollectContextList, cavityNosortCfg);
@ -144,7 +144,7 @@ public class MesProductSnScanStepService extends BaseStepService {
String scanInfoName = !scanInfo.equals(productionProcessContext.getFinishCode()) ? "主条码" : "空腔码";
if (scanedQty.compareTo(needQty) < 0 && !StringUtils.isEmpty(cavityNosortCfg))
if (scanedQty.compareTo(needQty) < 0 && cavityNosortCfg)
return stepDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.SCAN.getValue()).scanInfo(scanInfo), stepResult, false,
MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, String.format("当前扫描信息%s[%s],已知腔数[%s],还需要再连续扫描[%s]次主条码!", scanInfoName, scanInfo, needQty, needQty - equipVariableCollectContextList.size()));
@ -161,12 +161,6 @@ public class MesProductSnScanStepService extends BaseStepService {
}
//是否支持混腔扫描[工位参数]
private String getCavityNosortCfg(StationRequestBean reqBean) {
String cavityNosortCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG);
return (!StringUtils.isEmpty(cavityNosortCfg) && cavityNosortCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityNosortCfg : null;
}
private Integer calcScanedQty(List<MesEquipVariableCollectContext> equipVariableCollectContextList, List<MesProductionPsInContext> productionPsInContextList) {
return (CollectionUtils.isEmpty(equipVariableCollectContextList) ? MesPcnExtConstWords.ZERO : equipVariableCollectContextList.size()) + (CollectionUtils.isEmpty(productionPsInContextList) ? MesPcnExtConstWords.ZERO : productionPsInContextList.size());
}
@ -195,17 +189,11 @@ public class MesProductSnScanStepService extends BaseStepService {
Optional<MesProductionPsInContext> optional = CollectionUtils.isEmpty(productionPsInContextList) ? null :
productionPsInContextList.stream().filter(o -> (null != o && o.getCheckCraftResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
if (null == optional || !optional.isPresent()) return false;
//非排序是否允许强过, 默认不支持, 不支持返回null, 存在可以跳过的数据且支持跳过返回true
String isAllowJump = getIsAllowJump(reqBean);
//非排序是否允许强过【工位参数】, 默认不支持, 不支持返回null, 存在可以跳过的数据且支持跳过返回true
String isAllowJump = fsmCommonService.checkWcpcMapIsMatchValue(reqBean, MesPcnExtConstWords.IS_ALLOW_JUMP, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
return StringUtils.isEmpty(isAllowJump) ? null : true;
}
//非排序是否允许强过[工位参数]
private String getIsAllowJump(StationRequestBean reqBean) {
String isAllowJump = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.IS_ALLOW_JUMP);
return (!StringUtils.isEmpty(isAllowJump) && isAllowJump.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? isAllowJump : null;
}
//验证扫描信息属于工艺强过码 并且支持跳过,进行数据变更
private void updateProductionPsInContextList(StationRequestBean reqBean, List<MesProductionPsInContext> productionPsInContextList, String craftJumpCode) {
productionPsInContextList.forEach(o -> {
@ -234,11 +222,11 @@ public class MesProductSnScanStepService extends BaseStepService {
}
//封装扫/读信息:主条码信息
private List<MesEquipVariableCollectContext> doHandleScanProductSnContext(StationRequestBean reqBean, String scanInfo, List<MesEquipVariableCollectContext> equipVariableCollectContextList, String cavityNosortCfg) {
private List<MesEquipVariableCollectContext> doHandleScanProductSnContext(StationRequestBean reqBean, String scanInfo, List<MesEquipVariableCollectContext> equipVariableCollectContextList, Boolean cavityNosortCfg) {
if (CollectionUtils.isEmpty(equipVariableCollectContextList)) equipVariableCollectContextList = new ArrayList<>();
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), scanInfo, StringUtils.isEmpty(cavityNosortCfg) ? MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() : MesExtEnumUtil.CELL_MESSAGE_SOURCE.MANY.getValue()));
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), scanInfo, !cavityNosortCfg ? MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() : MesExtEnumUtil.CELL_MESSAGE_SOURCE.MANY.getValue()));
return equipVariableCollectContextList;

@ -67,7 +67,7 @@ public class MesProductionPartNoReadStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false).writeDbLog().checkRepeat(),

@ -68,7 +68,7 @@ public class MesRecyclablePackageReadStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes))
endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {

@ -62,7 +62,7 @@ public class MesShippingQueueFindStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false),

@ -1,7 +1,6 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
@ -154,17 +153,11 @@ public class MesWorkOrderCheckNosortStepService extends MesWorkOrderCheckStepSer
private Boolean checkIsAllowJump(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList) {
Optional<MesProductionPartContext> optional = CollectionUtils.isEmpty(productionPartContextList) ? null : productionPartContextList.stream().filter(o -> (null != o && o.getCheckSeqResult().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0)).findFirst();
if (null == optional || !optional.isPresent()) return false;
//非排序是否允许强过, 默认不支持, 不支持返回null, 存在可以跳过的数据且支持跳过返回true
String isAllowJump = getIsAllowJump(reqBean);
//非排序是否允许强过【工位参数】, 默认不支持, 不支持返回null, 存在可以跳过的数据且支持跳过返回true
String isAllowJump = fsmCommonService.checkWcpcMapIsMatchValue(reqBean, MesPcnExtConstWords.IS_ALLOW_JUMP, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr());
return StringUtils.isEmpty(isAllowJump) ? null : true;
}
//非排序是否允许强过[工位参数]
private String getIsAllowJump(StationRequestBean reqBean) {
String isAllowJump = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.IS_ALLOW_JUMP);
return (!StringUtils.isEmpty(isAllowJump) && isAllowJump.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? isAllowJump : null;
}
//验证扫描信息属于工艺强过码 并且支持强过,进行数据变更
private void updateProductionPartContextList(StationRequestBean reqBean, List<MesProductionPartContext> productionPartContextList, String craftJumpCode) {
productionPartContextList.forEach(o -> {

@ -181,7 +181,7 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
List<MesEquipVariableCollectContext> equipVariableCollectContextList, List<MesProductionPartContext> productionPartContextList,
List<MesProductionPsInContext> productionPsInContextList, List<MesProductionPsOutContext> productionPsOutContextList) {
//是否支持扫描完成状态的工单[工位参数]
String cfg = getAllowScanCompleteOrderCfg(reqBean);
Boolean allowCfg = fsmCommonService.checkWcpcMapIsMatchTrue(reqBean, MesPcnExtConstWords.ALLOW_SCAN_COMPLETE_ORDER_CFG);
//从上下文中取出生产线与工位对象
MesWorkCenter workCenter = productionProcessContext.getWorkCenter();
@ -207,9 +207,9 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
return stepResult.isCompleted(false).msg((String) itemMap.get(MesPcnExtConstWords.MESSAGE));
MesWorkOrder workOrder = (MesWorkOrder) itemMap.get(MesWorkOrder.class.getSimpleName());
if (StringUtils.isEmpty(cfg) && !MesExtEnumUtil.ORDER_STATUS.checkAllowStatus(workCenter.getCenterType(), workOrder.getWorkOrderStatus()))
if (!allowCfg && !MesExtEnumUtil.ORDER_STATUS.checkAllowStatus(workCenter.getCenterType(), workOrder.getWorkOrderStatus()))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]信息工单状态[%s]!", workOrderNo, MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrder.getWorkOrderStatus())));
if (!StringUtils.isEmpty(cfg) && !MesExtEnumUtil.ORDER_STATUS.checkNosortAllowStatus(workOrder.getWorkOrderStatus()))
if (allowCfg && !MesExtEnumUtil.ORDER_STATUS.checkNosortAllowStatus(workOrder.getWorkOrderStatus()))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]信息工单状态[%s]!", workOrderNo, MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrder.getWorkOrderStatus())));
if (!workOrder.getWorkCenterCode().equals(reqBean.getWorkCenterCode()))
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]信息所属生产线[%s]与当前生产线[%s]不一致!", workOrderNo, workOrder.getWorkCenterCode(), reqBean.getWorkCenterCode()));
@ -219,9 +219,9 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
MesProduceSn produceSn = (MesProduceSn) itemMap.get(MesProduceSn.class.getSimpleName());
if ((StringUtils.isEmpty(workCenter.getIsIgnoreQc()) || workCenter.getIsIgnoreQc().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) && produceSn.getQcStatus().compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue()) >= 0)
return stepResult.isCompleted(false).msg(String.format("请检查工单信息,加工单[%s]质量状态[%s]", workOrderNo, MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(produceSn.getQcStatus())));
if (StringUtils.isEmpty(cfg) && MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue() <= produceSn.getSnStatus())
if (!allowCfg && MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue() <= produceSn.getSnStatus())
return stepResult.isCompleted(false).msg(String.format("请检查工单产品条码信息,产品条码[%s]条码状态[%s]", produceSn.getProductSn(), MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(produceSn.getSnStatus())));
if (!StringUtils.isEmpty(cfg) && MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue() < produceSn.getSnStatus())
if (allowCfg && MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue() < produceSn.getSnStatus())
return stepResult.isCompleted(false).msg(String.format("请检查工单产品条码信息,产品条码[%s]条码状态[%s]", produceSn.getProductSn(), MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(produceSn.getSnStatus())));
MesQueueOrder queueOrder = (MesQueueOrder) itemMap.get(MesQueueOrder.class.getSimpleName());
@ -302,10 +302,4 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
return true;
}
//是否支持扫描完成状态的工单[工位参数]
private String getAllowScanCompleteOrderCfg(StationRequestBean reqBean) {
String cfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ALLOW_SCAN_COMPLETE_ORDER_CFG);
return (!StringUtils.isEmpty(cfg) && cfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cfg : null;
}
}

@ -67,11 +67,16 @@ public class MesWorkOrderQueueAcceptStepService extends BaseStepService {
private static Map<String, ReentrantLock> lockMap = new ConcurrentHashMap<>();
@Override
public void title(StationRequestBean reqBean) {
this.sendMessage(reqBean, new StationResultBean().resultObj(MesPcnExtConstWords.STEP_DISABLE_SCAN), String.format("工步: %s", reqBean.getStepName()), MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_TITLE, MesPcnEnumUtil.STATION_DATA_TYPE.TITLE);
}
@Override
public StepResult init(StationRequestBean reqBean) {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false),

@ -64,7 +64,7 @@ public class MesWorkOrderReadStepService extends BaseStepService {
StepResult stepResult = StepResult.getSuccessComplete();
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
String endlessLoopReadTimes = fsmCommonService.handleFsmWcpcMapDataForDoScanThenBackValue(reqBean, MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES);
if (StringUtils.isEmpty(endlessLoopReadTimes)) endlessLoopReadTimes = MesPcnExtConstWords.ENDLESS_LOOP_READ_TIMES_DEFAULT;
if (productionDispatchContextStepService.dispatchOverEndlessLoopReadTimes(reqBean, endlessLoopReadTimes)) {
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, new StationResultBean().isWs(false).writeDbLog().checkRepeat(),

Loading…
Cancel
Save