Commit 25ff0bb2 authored by xukaiqiang's avatar xukaiqiang

bug

parent dae9c3a5
......@@ -840,13 +840,19 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
List<FmeaPointInputitem> fmeaPointInputitems = fmeaPointInputitemMapper.listByPointIdAndInputItemIds(pointId, inputIds);
Set<Long> fmeaIds = Sets.newHashSet();
List<Long> ids = Lists.newArrayList();
List<Long> failIds = Lists.newArrayList();
List<Long> successIds = Lists.newArrayList();
fmeaPointInputitems.forEach(fmeaPointInputitem -> {
fmeaIds.add(fmeaPointInputitem.getFmeaId());
ids.add(fmeaPointInputitem.getId());
if (fmeaPointInputitem.getState().equals(2)) {
failIds.add(fmeaPointInputitem.getId());
fmeaIds.add(fmeaPointInputitem.getFmeaId());
} else {
successIds.add(fmeaPointInputitem.getId());
fmeaIds.add(fmeaPointInputitem.getFmeaId());
}
});
Integer state = 1;
fmeaPointInputitemMapper.updateStateByIds(state, ids);
fmeaPointInputitemMapper.updateStateByIds(1, failIds);
fmeaPointInputitemMapper.updateStateByIds(0, successIds);
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addAbnormalMessage(fmeaId));
}
......@@ -1203,21 +1209,31 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if ("all".equals(type)) {
FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(param.getPointCode());
Dict dict = null;
if (fireEquipmentPoint.getAlarmType() != null) {
dict = dictDao.findOne(fireEquipmentPoint.getAlarmType());
}
if (!param.getState().equals(fireEquipmentPoint.getValue())) {
fireEquipmentPoint.setValue(param.getState());
updateFirePointValue(fireEquipmentPoint.getId(), param.getState());
Equipment equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(Long.valueOf(data.getFireEquipmentId()));
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());
Set<Long> fmeaIds = Sets.newHashSet();
List<Long> ids = Lists.newArrayList();
List<Long> failIds = Lists.newArrayList();
List<Long> successIds = Lists.newArrayList();
fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> {
fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
ids.add(fmeaEquipmentPoint.getId());
if (fmeaEquipmentPoint.getState().equals(2)) {
failIds.add(fmeaEquipmentPoint.getId());
fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
} else {
successIds.add(fmeaEquipmentPoint.getId());
fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
}
});
Integer state = 1;
fmeaEquipmentPointMapper.updateStateByIds(state, ids);
fmeaEquipmentPointMapper.updateStateByIds(1, failIds);
fmeaEquipmentPointMapper.updateStateByIds(0, successIds);
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
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