|
|
|
@ -89,7 +89,7 @@ public class MesEquipmentLogExtService implements IMesEquipmentLogExtService {
|
|
|
|
|
String equipVariableReadtime = TimeTool.getNowTime(true);
|
|
|
|
|
for (MesEquipVariableCfgCollectContext equipVariableCfgCollectContext : collectContextList) {
|
|
|
|
|
if (null == equipVariableCfgCollectContext || CollectionUtils.isEmpty(equipVariableCfgCollectContext.getEquipVariableCollectContextList())) continue;
|
|
|
|
|
equipVariableCfgCollectContext.getEquipVariableCollectContextList().forEach(o -> o.copyValue(filterEquipmentLog(needNewValue2Collect, unNeedNewValue2Collect, o.getClientHandle(), equipVariableCfgCollectContext.getNeedNewValue()), equipVariableReadtime));
|
|
|
|
|
equipVariableCfgCollectContext.getEquipVariableCollectContextList().forEach(o -> o.copyValue(filterEquipmentLog(needNewValue2Collect, unNeedNewValue2Collect, o.getEquipVariableId(), equipVariableCfgCollectContext.getNeedNewValue()), equipVariableReadtime));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return equipLogDispatchContext.equipVariableCfgCollectContextList(collectContextList);
|
|
|
|
@ -123,13 +123,13 @@ public class MesEquipmentLogExtService implements IMesEquipmentLogExtService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MesEquipmentLog filterEquipmentLog(Map<Long, MesEquipmentLog> needNewValue2Collect, Map<Long, MesEquipmentLog> unNeedNewValue2Collect, Integer clientHandle, Integer needNewValue) {
|
|
|
|
|
if (!StringUtils.isEmpty(needNewValue) && MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue() == needNewValue) return filterEquipmentLog(needNewValue2Collect, clientHandle);
|
|
|
|
|
else return filterEquipmentLog(unNeedNewValue2Collect, clientHandle);
|
|
|
|
|
private MesEquipmentLog filterEquipmentLog(Map<Long, MesEquipmentLog> needNewValue2Collect, Map<Long, 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, Integer clientHandle) {
|
|
|
|
|
return !CollectionUtils.isEmpty(collectMap) ? collectMap.get(Long.valueOf(clientHandle.toString())) : null;
|
|
|
|
|
private MesEquipmentLog filterEquipmentLog(Map<Long, MesEquipmentLog> collectMap, Long equipVariableId) {
|
|
|
|
|
return !CollectionUtils.isEmpty(collectMap) ? collectMap.get(equipVariableId) : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Long, MesEquipmentLog> getEquipmentLog(MesEquipLogDispatchContext equipLogDispatchContext, MesCellEquipContext cellEquipContext, List<MesEquipVariableCfgCollectContext> equipVariableCollectContextList, Integer needNewValue) {
|
|
|
|
@ -142,7 +142,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::getId, o -> o));
|
|
|
|
|
return CollectionUtils.isEmpty(equipmentLogList) ? null : equipmentLogList.stream().filter(o -> null != o).collect(Collectors.toMap(MesEquipmentLog::getEquipVariableId, o -> o));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Boolean checkEquipmentLogHasValue(List<MesEquipmentLog> equipmentLogList) {
|
|
|
|
|