设备加工 读点位 问题修复

tags/yfai-pcn-ext-v1.0
王杰 10 months ago
parent 852525bfee
commit d32640909e

@ -293,6 +293,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
mesProductionRepeatAssembly.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue());
mesProductionRepeatAssembly.setId(null);
mesProductionRepeatAssembly.setIsOrigSn(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
mesProductionRepeatAssembly.setFid(UUID.randomUUID().toString());
mesProductionAssembly.setRepeatAssemblySn(sn);
mesProductionAssemblyRepository.update(mesProductionAssembly);

@ -87,8 +87,8 @@ public class MesEquipmentLogExtService implements IMesEquipmentLogExtService {
//标记当前设备通信默认正常
cellEquipContext.setQuality(MesExtEnumUtil.EQUIP_LOG_QUALITY.defaultQuality());
//根据常变值分别获取设备ID分表的采集数据
Map<Long, MesEquipmentLog> needNewValue2Collect = getEquipmentLog(equipLogDispatchContext, cellEquipContext, collectContextList, MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue());
Map<Long, MesEquipmentLog> unNeedNewValue2Collect = getEquipmentLog(equipLogDispatchContext, cellEquipContext, collectContextList, MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.FALSE.getValue());
Map<Long, List<MesEquipmentLog>> needNewValue2Collect = getEquipmentLog(equipLogDispatchContext, cellEquipContext, collectContextList, MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue());
Map<Long, List<MesEquipmentLog>> unNeedNewValue2Collect = getEquipmentLog(equipLogDispatchContext, cellEquipContext, collectContextList, MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.FALSE.getValue());
//根据设备ID,设备数据变量ID集合 修改设备ID分表采集数据的状态 【修改常变值配置对应的设备ID分表的采集数据的状态为1】 【isResetEquipVariable = false 标记需要修改的设备数据变量ID, 后续匹配成功后再调用updateEquipmentLogList进行修改】
if (!CollectionUtils.isEmpty(needNewValue2Collect) && checkEquipQuality(cellEquipContext.getQuality())) {
@ -133,16 +133,16 @@ public class MesEquipmentLogExtService implements IMesEquipmentLogExtService {
}
private MesEquipmentLog filterEquipmentLog(Map<Long, MesEquipmentLog> needNewValue2Collect, Map<Long, MesEquipmentLog> unNeedNewValue2Collect, Long equipVariableId, Integer needNewValue) {
private MesEquipmentLog filterEquipmentLog(Map<Long, List<MesEquipmentLog>> needNewValue2Collect, Map<Long, List<MesEquipmentLog>> unNeedNewValue2Collect, Long equipVariableId, Integer needNewValue) {
if (!StringUtils.isEmpty(needNewValue) && MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue() == needNewValue) return filterEquipmentLog(needNewValue2Collect, equipVariableId);
else return filterEquipmentLog(unNeedNewValue2Collect, equipVariableId);
}
private MesEquipmentLog filterEquipmentLog(Map<Long, MesEquipmentLog> collectMap, Long equipVariableId) {
return !CollectionUtils.isEmpty(collectMap) ? collectMap.get(equipVariableId) : null;
private MesEquipmentLog filterEquipmentLog(Map<Long, List<MesEquipmentLog>> collectMap, Long equipVariableId) {
return (!CollectionUtils.isEmpty(collectMap) && collectMap.containsKey(equipVariableId)) ? collectMap.get(equipVariableId).get(0) : null;
}
private Map<Long, MesEquipmentLog> getEquipmentLog(MesEquipLogDispatchContext equipLogDispatchContext, MesCellEquipContext cellEquipContext, List<MesEquipVariableCfgCollectContext> equipVariableCollectContextList, Integer needNewValue) {
private Map<Long, List<MesEquipmentLog>> getEquipmentLog(MesEquipLogDispatchContext equipLogDispatchContext, MesCellEquipContext cellEquipContext, List<MesEquipVariableCfgCollectContext> equipVariableCollectContextList, Integer needNewValue) {
List<MesEquipVariableCfgCollectContext> filterList = equipVariableCollectContextList.stream().filter(o -> (null != o && o.getNeedNewValue().compareTo(needNewValue) == 0)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(filterList)) return null;
List<MesEquipmentLog> equipmentLogList = getEquipmentLogList(cellEquipContext.getOrganizeCode(), cellEquipContext.getEquipId(), needNewValue, collectEquipVariableIdList(filterList));
@ -152,7 +152,7 @@ public class MesEquipmentLogExtService implements IMesEquipmentLogExtService {
//【已经采集到任何数据 或者 (equipmentLogList有数据且是长变值方式获取的 或者 不是常变值方式获取的但必须有value) 】 情况下isCollectValue标记为true
if (equipLogDispatchContext.getIsCollectValue() || (!CollectionUtils.isEmpty(equipmentLogList) && (needNewValue == MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue() || checkEquipmentLogHasValue(equipmentLogList)))) equipLogDispatchContext.isCollectValue();
return CollectionUtils.isEmpty(equipmentLogList) ? null : equipmentLogList.stream().filter(o -> null != o).collect(Collectors.toMap(MesEquipmentLog::getEquipVariableId, o -> o));
return CollectionUtils.isEmpty(equipmentLogList) ? null : equipmentLogList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesEquipmentLog::getEquipVariableId));
}
private Boolean checkEquipmentLogHasValue(List<MesEquipmentLog> equipmentLogList) {

@ -25,6 +25,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@ -139,6 +140,8 @@ public class MesAssemblySaveNosortStepService extends BaseStepService {
productionAssembly.setOrganizeCode(reqBean.getOrganizeCode());
ConvertBean.serviceModelInitialize(productionAssembly, reqBean.getUserInfo());
productionAssembly.setFid(UUID.randomUUID().toString());
productionAssemblyRepository.insert(productionAssembly);
if (!StringUtils.isEmpty(productionAssemblyNosortContext.getProductSnId())) productSnId.add(productionAssemblyNosortContext.getProductSnId());

@ -484,7 +484,11 @@ public class MesAssemblyShowNosortStepService extends BaseStepService {
productionDispatchContextStepService.deleteProductionPartContext(reqBean);
productionDispatchContextStepService.deleteProdRuleDataContext(reqBean);
productionProcessContextStepService.deleteFunctionChooseCavityOrderContext(reqBean);
productionDispatchContextStepService.deleteFirstMouldNoContext(reqBean);
if (productionDispatchContextStepService.checkFirstMouldNoIsExistContext(reqBean)) {
//存在头道模具号场景下 必须抛出异常 因为头道模具号的接口逻辑会配置非常变值,也就是每次返回回去都会拿到头道模具号 就会出现死循环线程
productionDispatchContextStepService.deleteFirstMouldNoContext(reqBean);
foundExThrowNoShowMsg();
}
}
return true;
}

@ -31,6 +31,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@ -197,8 +198,10 @@ public class MesProductSnGenerateStepService extends BaseStepService {
if (StringUtils.isEmpty(produceSn.getInWorkCenterTime())) produceSn.setInWorkCenterTime(produceSn.getModifyDatetime());
produceSn.setLotNo(produceSn.getModifyDatetime().substring(0, 10));
if (StringUtils.isEmpty(produceSn.getId())) produceSn = produceSnExtService.insert(produceSn);
else produceSnExtService.update(produceSn);
if (StringUtils.isEmpty(produceSn.getId())) {
produceSn.setFid(UUID.randomUUID().toString());
produceSn = produceSnExtService.insert(produceSn);
} else produceSnExtService.update(produceSn);
return new MesProductionPsOutContext().copy(produceSn, prodRuleContext.getForeignKey()).isCalcCompleteQty(!StringUtils.isEmpty(produceSn.getWorkOrderNo()) && !isSamePart);

@ -27,6 +27,7 @@ import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@ -144,6 +145,9 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
ConvertBean.serviceModelInitialize(productionRecord, reqBean.getUserInfo());
productionRecord.setCompleteDateTime(productionRecord.getModifyDatetime());
productionRecord.setFid(UUID.randomUUID().toString());
productionRecord.setOneMouldMoreId(UUID.randomUUID().toString());
productionRecord = productionRecordRepository.insert(productionRecord);
if (null != prodRuleContext) prodRuleContextList.stream().filter(o -> (null != o &&

Loading…
Cancel
Save