Commit 25ff0bb2 authored by xukaiqiang's avatar xukaiqiang

bug

parent dae9c3a5
...@@ -840,13 +840,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -840,13 +840,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
List<FmeaPointInputitem> fmeaPointInputitems = fmeaPointInputitemMapper.listByPointIdAndInputItemIds(pointId, inputIds); List<FmeaPointInputitem> fmeaPointInputitems = fmeaPointInputitemMapper.listByPointIdAndInputItemIds(pointId, inputIds);
Set<Long> fmeaIds = Sets.newHashSet(); Set<Long> fmeaIds = Sets.newHashSet();
List<Long> ids = Lists.newArrayList(); List<Long> failIds = Lists.newArrayList();
List<Long> successIds = Lists.newArrayList();
fmeaPointInputitems.forEach(fmeaPointInputitem -> { fmeaPointInputitems.forEach(fmeaPointInputitem -> {
fmeaIds.add(fmeaPointInputitem.getFmeaId()); if (fmeaPointInputitem.getState().equals(2)) {
ids.add(fmeaPointInputitem.getId()); failIds.add(fmeaPointInputitem.getId());
fmeaIds.add(fmeaPointInputitem.getFmeaId());
} else {
successIds.add(fmeaPointInputitem.getId());
fmeaIds.add(fmeaPointInputitem.getFmeaId());
}
}); });
Integer state = 1; fmeaPointInputitemMapper.updateStateByIds(1, failIds);
fmeaPointInputitemMapper.updateStateByIds(state, ids); fmeaPointInputitemMapper.updateStateByIds(0, successIds);
RsDataQueue rsDataQueue = RsDataQueue.getInstance(); RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addAbnormalMessage(fmeaId)); fmeaIds.forEach(fmeaId -> rsDataQueue.addAbnormalMessage(fmeaId));
} }
...@@ -1203,21 +1209,31 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -1203,21 +1209,31 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if ("all".equals(type)) { if ("all".equals(type)) {
FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(param.getPointCode()); FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(param.getPointCode());
Dict dict = null;
if (fireEquipmentPoint.getAlarmType() != null) {
dict = dictDao.findOne(fireEquipmentPoint.getAlarmType());
}
if (!param.getState().equals(fireEquipmentPoint.getValue())) { if (!param.getState().equals(fireEquipmentPoint.getValue())) {
fireEquipmentPoint.setValue(param.getState()); fireEquipmentPoint.setValue(param.getState());
updateFirePointValue(fireEquipmentPoint.getId(), param.getState()); updateFirePointValue(fireEquipmentPoint.getId(), param.getState());
Equipment equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(Long.valueOf(data.getFireEquipmentId())); Equipment equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(Long.valueOf(data.getFireEquipmentId()));
if (!ObjectUtils.isEmpty(equipment)) { if (!ObjectUtils.isEmpty(equipment)) {
if ("true".equals(data.getState())) { if (dict != null && dict.getDictCode().equals("alarm_type_trouble")) {
List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId()); List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId());
Set<Long> fmeaIds = Sets.newHashSet(); Set<Long> fmeaIds = Sets.newHashSet();
List<Long> ids = Lists.newArrayList(); List<Long> failIds = Lists.newArrayList();
List<Long> successIds = Lists.newArrayList();
fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> { fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> {
fmeaIds.add(fmeaEquipmentPoint.getFmeaId()); if (fmeaEquipmentPoint.getState().equals(2)) {
ids.add(fmeaEquipmentPoint.getId()); failIds.add(fmeaEquipmentPoint.getId());
fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
} else {
successIds.add(fmeaEquipmentPoint.getId());
fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
}
}); });
Integer state = 1; fmeaEquipmentPointMapper.updateStateByIds(1, failIds);
fmeaEquipmentPointMapper.updateStateByIds(state, ids); fmeaEquipmentPointMapper.updateStateByIds(0, successIds);
RsDataQueue rsDataQueue = RsDataQueue.getInstance(); RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addAbnormalMessage(fmeaId)); fmeaIds.forEach(fmeaId -> rsDataQueue.addAbnormalMessage(fmeaId));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment