排序流程 盲写代码 自测 问题修复

tags/yfai-pcn-ext-v2.3
王杰 8 months ago
parent 4440d368a0
commit 4092793204

@ -131,38 +131,6 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
} }
private List<MesProdRuleContext> resetAssembly(StationRequestBean reqBean, List<MesProdRuleContext> prodRuleContextList) {
//是否支持混腔扫描[工位参数]
String cavityNosortCfg = getCavityNosortCfg(reqBean);
prodRuleContextList.forEach(o -> {
if (!StringUtils.isEmpty(o.getAssemblyDataJson())) {
List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList = o.getNosortAssemblyDataContext();
if (!StringUtils.isEmpty(cavityNosortCfg) || hasUnBindAssemblyOptional(productionAssemblyNosortContextList)) {
productionAssemblyNosortContextList.forEach(i -> { if (i.getIsResetScan().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) i.assemblyStatusReset(); });
o.assemblyDataJson(productionAssemblyNosortContextList);
}
}
});
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 checkIsSkip(MesProductionProcessContext productionProcessContext, List<MesEquipVariableCollectContext> equipVariableCollectContextList) { private Boolean checkIsSkip(MesProductionProcessContext productionProcessContext, List<MesEquipVariableCollectContext> equipVariableCollectContextList) {
if (equipVariableCollectContextList.size() > 1) return false; if (equipVariableCollectContextList.size() > 1) return false;
@ -190,16 +158,16 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
Boolean hasUnBindAssembly = false; Boolean hasUnBindAssembly = false;
for (MesProdRuleContext prodRuleContext : prodRuleContextList) { for (MesProdRuleContext prodRuleContext : prodRuleContextList) {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue; if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList = prodRuleContext.getNosortAssemblyDataContext(); List<MesProductionAssemblySortContext> productionAssemblySortContextList = prodRuleContext.getSortAssemblyDataContext();
if (!hasUnBindAssemblyOptional(productionAssemblyNosortContextList)) continue; if (!hasUnBindAssemblyOptional(productionAssemblySortContextList)) continue;
hasUnBindAssembly = true; hasUnBindAssembly = true;
break; break;
} }
return hasUnBindAssembly; return hasUnBindAssembly;
} }
private Boolean hasUnBindAssemblyOptional(List<MesProductionAssemblyNosortContext> productionAssemblyNosortContextList) { private Boolean hasUnBindAssemblyOptional(List<MesProductionAssemblySortContext> productionAssemblySortContextList) {
Optional<MesProductionAssemblyNosortContext> optional = productionAssemblyNosortContextList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0)).findFirst(); Optional<MesProductionAssemblySortContext> optional = productionAssemblySortContextList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0)).findFirst();
return (null == optional || !optional.isPresent()) ? false : true; return (null == optional || !optional.isPresent()) ? false : true;
} }
@ -278,7 +246,7 @@ public class MesAssemblyMatchSortStepService extends BaseStepService {
continue; continue;
} }
MesProductionAssemblyNosortContext filter = (MesProductionAssemblyNosortContext) result.get(MesPcnExtConstWords.DATA); MesProductionAssemblySortContext filter = (MesProductionAssemblySortContext) result.get(MesPcnExtConstWords.DATA);
//前道防错 //前道防错
if (!StringUtils.isEmpty(filter.getProductSnId()) && !StringUtils.isEmpty(productionAssemblySortContext.getPreCraftCode())) { if (!StringUtils.isEmpty(filter.getProductSnId()) && !StringUtils.isEmpty(productionAssemblySortContext.getPreCraftCode())) {

@ -71,12 +71,17 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
//获取上下文产出零件信息 //获取上下文产出零件信息
List<MesProductionPartContext> cachedProductionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean); List<MesProductionPartContext> cachedProductionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean);
//获取工单对应的条码数据信息 List<MesProductionPsInContext> cachedProductionPsInContextList = null;
List<MesProductionPsInContext> cachedProductionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean); List<MesProductionPsOutContext> cachedProductionPsOutContextList = null;
if (!CollectionUtils.isEmpty(cachedProductionPartContextList)) {
//获取工单对应的条码数据信息
cachedProductionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean);
//获取工单对应的产出条码数据信息
cachedProductionPsOutContextList = productionDispatchContextStepService.getProductionPsOutContext(reqBean);
}
//非扫描场景 清除历史产出零件信息 //非扫描场景 清除历史产出零件信息
if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() != equipVariableCollectContextList.get(0).getMessageSource() && if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() != equipVariableCollectContextList.get(0).getMessageSource() && !CollectionUtils.isEmpty(cachedProductionPartContextList)) cachedProductionPartContextList = removeBusiData(reqBean);
(!CollectionUtils.isEmpty(cachedProductionPartContextList) || !CollectionUtils.isEmpty(cachedProductionPsInContextList))) cachedProductionPartContextList = removeBusiData(reqBean);
//验证扫描信息是否属于工艺强过码 //验证扫描信息是否属于工艺强过码
Boolean isCraftJumpCode = matchCraftJumpCode(productionProcessContext, equipVariableCollectContextList); Boolean isCraftJumpCode = matchCraftJumpCode(productionProcessContext, equipVariableCollectContextList);
@ -113,10 +118,10 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
equipVariableCollectContextList, productionPartContextList, productionPsInContextList, productionPsOutContextList).isCompleted()) return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg()); equipVariableCollectContextList, productionPartContextList, productionPsInContextList, productionPsOutContextList).isCompleted()) return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg());
//扫描场景下合并历史产出零件信息/产品条码信息 //扫描场景下合并历史产出零件信息/产品条码信息
if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() == equipVariableCollectContextList.get(0).getMessageSource() && if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() == equipVariableCollectContextList.get(0).getMessageSource() && !CollectionUtils.isEmpty(cachedProductionPartContextList)) {
(!CollectionUtils.isEmpty(cachedProductionPartContextList) || !CollectionUtils.isEmpty(productionPsInContextList))) {
productionPartContextList.addAll(cachedProductionPartContextList); productionPartContextList.addAll(cachedProductionPartContextList);
productionPsInContextList.addAll(cachedProductionPsInContextList); productionPsInContextList.addAll(cachedProductionPsInContextList);
productionPsOutContextList.addAll(cachedProductionPsOutContextList);
} }
//验证是否全部为空腔 //验证是否全部为空腔

@ -8,6 +8,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.mes.pcn.util.StringUtil; import cn.estsh.i3plus.mes.pcn.util.StringUtil;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
@ -100,14 +101,14 @@ public class MesWorkOrderSaveSortStepService extends BaseStepService {
workOrderRepository.updateByProperties( workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID}, new String[]{MesPcnExtConstWords.ID},
new Object[]{productionPartContext.getId()}, new Object[]{productionPartContext.getId()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS}, new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.ONLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()}); new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), TimeTool.getNowTime(true)});
} else { } else {
workOrderRepository.updateByProperties( workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID}, new String[]{MesPcnExtConstWords.ID},
new Object[]{productionPartContext.getId()}, new Object[]{productionPartContext.getId()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLATED_QTY, MesPcnExtConstWords.UN_COMPLATED_QTY}, new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLATED_QTY, MesPcnExtConstWords.UN_COMPLATED_QTY, MesPcnExtConstWords.OFFLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0)}); new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), TimeTool.getNowTime(true)});
} }
log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:[{}:{}]", log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:[{}:{}]",

@ -111,7 +111,7 @@ public class MesProductionAssemblyContext implements Serializable {
public Integer foreignKey; public Integer foreignKey;
@ApiParam(value = "是否可复用条码") @ApiParam(value = "是否可复用条码")
public Integer isRepeat; public Integer isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam(value = "是否可复用条码是否写入上下文进行复用") @ApiParam(value = "是否可复用条码是否写入上下文进行复用")
public Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); public Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();

@ -50,6 +50,7 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
this.partNo = prodRuleContext.getOutPartNo(); this.partNo = prodRuleContext.getOutPartNo();
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.isRepeat)) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();

@ -128,6 +128,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
@ -152,6 +154,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();
if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType))
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();

@ -205,6 +205,10 @@ public class MesPcnExtConstWords {
public static final String REMARK = "remark"; public static final String REMARK = "remark";
//状态 //状态
public static final String STATUS = "status"; public static final String STATUS = "status";
//上线时间
public static final String ONLINE_TIME = "onlineTime";
//下线时间
public static final String OFFLINE_TIME = "offlineTime";
//BaseBean字段不包含工厂, 用于对象复制剔除属性BeanUtils.copyProperties(Object source, Object target, String... ignoreProperties) //BaseBean字段不包含工厂, 用于对象复制剔除属性BeanUtils.copyProperties(Object source, Object target, String... ignoreProperties)
public static final String[] BASE_BEAN_FIELDS = {ID, IS_DELETED, IS_VALID, CREATE_DATE_TIME, CREATE_USER, MODIFY_DATE_TIME, MODIFY_USER, DESCRIPTION, REMARK, SYSTEM_SYNC_DATE_TIME, SYSTEM_SYNC_STATUS}; public static final String[] BASE_BEAN_FIELDS = {ID, IS_DELETED, IS_VALID, CREATE_DATE_TIME, CREATE_USER, MODIFY_DATE_TIME, MODIFY_USER, DESCRIPTION, REMARK, SYSTEM_SYNC_DATE_TIME, SYSTEM_SYNC_STATUS};

Loading…
Cancel
Save