|
@@ -51,12 +51,12 @@ public class AlarmWtService {
|
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(AlarmWtService.class);
|
|
|
- public void dropSuperTable()
|
|
|
- {
|
|
|
+
|
|
|
+ public void dropSuperTable() {
|
|
|
alarmTsService.dropSuperTable(AlarmSuperTalbeType.WT.getCode());
|
|
|
}
|
|
|
- public void createSuperTable()
|
|
|
- {
|
|
|
+
|
|
|
+ public void createSuperTable() {
|
|
|
|
|
|
alarmTsService.createSuperTable(AlarmSuperTalbeType.WT.getCode());
|
|
|
}
|
|
@@ -64,9 +64,8 @@ public class AlarmWtService {
|
|
|
public void initalWtAlarm() throws Exception {
|
|
|
|
|
|
|
|
|
-
|
|
|
- List<AlarmVo> alarmVoList=CacheContext.alarmWtList;
|
|
|
- List<AlarmTag> alarmTags=new ArrayList<>();
|
|
|
+ List<AlarmVo> alarmVoList = CacheContext.alarmWtList;
|
|
|
+ List<AlarmTag> alarmTags = new ArrayList<>();
|
|
|
|
|
|
|
|
|
// List<String> ls=new ArrayList<>();
|
|
@@ -98,10 +97,8 @@ public class AlarmWtService {
|
|
|
// valuemap.put(po.getEdnaId(),po);
|
|
|
// }
|
|
|
|
|
|
- if(!alarmVoList.isEmpty())
|
|
|
- {
|
|
|
- for(AlarmVo vo: alarmVoList)
|
|
|
- {
|
|
|
+ if (!alarmVoList.isEmpty()) {
|
|
|
+ for (AlarmVo vo : alarmVoList) {
|
|
|
|
|
|
|
|
|
alarmTsService.createTable(vo.getTbName(), vo.getAlarmid(), vo.getAlarmtype(),
|
|
@@ -115,9 +112,9 @@ public class AlarmWtService {
|
|
|
vo.getResettable(), vo.getStationid(),
|
|
|
vo.getStationname(), vo.getSubcomponents(),
|
|
|
vo.getSuffix(), vo.getTagid(),
|
|
|
- vo.getTriggertype(), vo.getUniformcode(),vo.getSuperTableName(),
|
|
|
+ vo.getTriggertype(), vo.getUniformcode(), vo.getSuperTableName(),
|
|
|
vo.getName(),
|
|
|
- vo.getNemCode(),vo.getFaultCause(),vo.getResolvent(),vo.getFaultType(),vo.getAname());
|
|
|
+ vo.getNemCode(), vo.getFaultCause(), vo.getResolvent(), vo.getFaultType(), vo.getAname());
|
|
|
|
|
|
// AlarmTag po=new AlarmTag();
|
|
|
// po.setId(vo.getTbName());
|
|
@@ -147,13 +144,12 @@ public class AlarmWtService {
|
|
|
|
|
|
public List<AlarmVo> initalAlarmVo() throws Exception {
|
|
|
|
|
|
- List<AlarmVo> alarmVoList=new ArrayList<>();
|
|
|
+ List<AlarmVo> alarmVoList = new ArrayList<>();
|
|
|
Map<String, List<ProEconAlarmConfiguration>> wtAlarmMap = CacheContext.wtAlarmMap;
|
|
|
Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
|
|
|
for (ProBasicEquipment wt : CacheContext.wtls) {
|
|
|
|
|
|
- if(wt.getId().contains("_G_"))
|
|
|
- {
|
|
|
+ if (wt.getId().contains("_G_")) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -170,21 +166,23 @@ public class AlarmWtService {
|
|
|
|
|
|
if (!alarmls.isEmpty()) {
|
|
|
// System.out.println(wt.getId());
|
|
|
+
|
|
|
+// if(wt.getId().equals("SXJ_KGDL_PTZ_F_WT_0001_EQ"))
|
|
|
+// {
|
|
|
+// System.out.println("");
|
|
|
+// }
|
|
|
for (ProEconAlarmConfiguration alarm : alarmls) {
|
|
|
if (pointMap.containsKey(alarm.getUniformCode())) {
|
|
|
ProBasicEquipmentPoint equipmentPoint = pointMap.get(alarm.getUniformCode());
|
|
|
|
|
|
- if(StringUtils.notEmp(initialcode) &&
|
|
|
+ if (StringUtils.notEmp(initialcode) &&
|
|
|
StringUtils.notEmp(equipmentPoint.getNemCode()) &&
|
|
|
!equipmentPoint.getNemCode().equals(initialcode) &&
|
|
|
alarm.getAlarmType().equals(AlarmTypeValue.WT.getCode())
|
|
|
- )
|
|
|
-
|
|
|
-
|
|
|
- {
|
|
|
+ ) {
|
|
|
|
|
|
// System.out.println("ok");
|
|
|
- AlarmVo vo=new AlarmVo();
|
|
|
+ AlarmVo vo = new AlarmVo();
|
|
|
StringBuilder tbName = new StringBuilder();
|
|
|
tbName.append(wt.getId()).append("_").append(alarm.getId());
|
|
|
vo.setTbName(String.valueOf(tbName));
|
|
@@ -199,24 +197,21 @@ public class AlarmWtService {
|
|
|
vo.setDevicetype(alarm.getDeviceType());
|
|
|
vo.setEnabled(alarm.getEnable());
|
|
|
vo.setLineid(wt.getLineId());
|
|
|
- if(CacheContext.lnmap.containsKey(wt.getLineId()))
|
|
|
- {
|
|
|
- ProBasicLine ln=CacheContext.lnmap.get(wt.getLineId());
|
|
|
+ if (CacheContext.lnmap.containsKey(wt.getLineId())) {
|
|
|
+ ProBasicLine ln = CacheContext.lnmap.get(wt.getLineId());
|
|
|
vo.setLinename(ln.getName());
|
|
|
}
|
|
|
vo.setModelId(wt.getModelId());
|
|
|
vo.setProjectid(wt.getProjectId());
|
|
|
- if(CacheContext.pjmap.containsKey(wt.getProjectId()))
|
|
|
- {
|
|
|
- ProBasicProject pj=CacheContext.pjmap.get(wt.getProjectId());
|
|
|
+ if (CacheContext.pjmap.containsKey(wt.getProjectId())) {
|
|
|
+ ProBasicProject pj = CacheContext.pjmap.get(wt.getProjectId());
|
|
|
vo.setProjectname(pj.getName());
|
|
|
}
|
|
|
vo.setRank(alarm.getRank());
|
|
|
vo.setResettable(alarm.getResetTable());
|
|
|
vo.setStationid(wt.getWindpowerstationId());
|
|
|
- if(CacheContext.wpmap.containsKey(wt.getWindpowerstationId()))
|
|
|
- {
|
|
|
- ProBasicPowerstation wp=CacheContext.wpmap.get(wt.getWindpowerstationId());
|
|
|
+ if (CacheContext.wpmap.containsKey(wt.getWindpowerstationId())) {
|
|
|
+ ProBasicPowerstation wp = CacheContext.wpmap.get(wt.getWindpowerstationId());
|
|
|
vo.setStationname(wp.getName());
|
|
|
}
|
|
|
vo.setSubcomponents(alarm.getSubcomponents());
|
|
@@ -247,35 +242,27 @@ public class AlarmWtService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- return alarmVoList;
|
|
|
+ return alarmVoList;
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public List<AlarmTag> findTags(String stbaleName, String wpIds) {
|
|
|
+ List<AlarmVo> vos = new ArrayList<>();
|
|
|
+ List<AlarmTag> ls = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(stbaleName) && StringUtils.notEmp(wpIds)) {
|
|
|
|
|
|
-
|
|
|
- public List<AlarmTag> findTags(String stbaleName,String wpIds)
|
|
|
- {
|
|
|
- List<AlarmVo> vos= new ArrayList<>();
|
|
|
- List<AlarmTag> ls=new ArrayList<>();
|
|
|
- if(StringUtils.notEmp(stbaleName) && StringUtils.notEmp(wpIds))
|
|
|
- {
|
|
|
-
|
|
|
- String[] ids= wpIds.split(",");
|
|
|
- for(int i=0;i<ids.length;i++)
|
|
|
- {
|
|
|
- if(CacheContext.alarmWpMap.containsKey(ids[i]))
|
|
|
- {
|
|
|
+ String[] ids = wpIds.split(",");
|
|
|
+ for (int i = 0; i < ids.length; i++) {
|
|
|
+ if (CacheContext.alarmWpMap.containsKey(ids[i])) {
|
|
|
vos.addAll(CacheContext.alarmWpMap.get(ids[i]));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(!vos.isEmpty())
|
|
|
- {
|
|
|
- for(AlarmVo vo:vos)
|
|
|
- {
|
|
|
- AlarmTag po=new AlarmTag();
|
|
|
+ if (!vos.isEmpty()) {
|
|
|
+ for (AlarmVo vo : vos) {
|
|
|
+ AlarmTag po = new AlarmTag();
|
|
|
po.setId(vo.getTbName());
|
|
|
po.setOval(null);
|
|
|
po.setTriggerType(vo.getTriggertype());
|
|
@@ -293,16 +280,16 @@ public class AlarmWtService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public synchronized void saveAlarms(List<AlarmTag> ls) throws EncodeException, IOException {
|
|
|
+ public synchronized void saveAlarms(List<AlarmTag> ls) throws EncodeException, IOException, InterruptedException {
|
|
|
|
|
|
- if(StringUtils.notEmp(ls) && !ls.isEmpty()) {
|
|
|
+ if (StringUtils.notEmp(ls) && !ls.isEmpty()) {
|
|
|
|
|
|
for (AlarmTag alarm : ls) {
|
|
|
- alarm.setConfirmed(false);
|
|
|
+ alarm.setConfirmed(false);
|
|
|
|
|
|
}
|
|
|
alarmTsService.insertList(ls);
|
|
|
- Map<String,ProEconAlarmInfo> tempmap=new HashMap<>();
|
|
|
+ Map<String, ProEconAlarmInfo> tempmap = new HashMap<>();
|
|
|
|
|
|
if (StringUtils.notEmp(ls) && !ls.isEmpty()) {
|
|
|
|
|
@@ -313,6 +300,7 @@ public class AlarmWtService {
|
|
|
ProEconAlarmInfo po = new ProEconAlarmInfo();
|
|
|
po.setTbname(vo.getTbName());
|
|
|
po.setLastUpdateTime(new Date(alarm.getTs()));
|
|
|
+ po.setUpdateTime(new Date(alarm.getTs()));
|
|
|
po.setTagId(alarm.getTagId());
|
|
|
po.setTriggerType(alarm.getTriggerType());
|
|
|
po.setAlarmId(vo.getAlarmid());
|
|
@@ -353,21 +341,18 @@ public class AlarmWtService {
|
|
|
alarm.setDeviceId(vo.getDeviceid());
|
|
|
alarm.setAlarmId(vo.getAlarmid());
|
|
|
|
|
|
- if(StringUtils.notEmp(vo.getDeviceid()) && CacheContext.wtmap.containsKey(vo.getDeviceid()))
|
|
|
- {
|
|
|
+ if (StringUtils.notEmp(vo.getDeviceid()) && CacheContext.wtmap.containsKey(vo.getDeviceid())) {
|
|
|
alarm.setCode(CacheContext.wtmap.get(vo.getDeviceid()).getNemCode());
|
|
|
}
|
|
|
|
|
|
- if(CacheContext.wpmap.containsKey(vo.getStationid()))
|
|
|
- {
|
|
|
+ if (CacheContext.wpmap.containsKey(vo.getStationid())) {
|
|
|
alarm.setWpName(CacheContext.wpmap.get(vo.getStationid()).getName());
|
|
|
}
|
|
|
|
|
|
alarm.setWpId(vo.getStationid());
|
|
|
- pushDataSevice.pushWtData(alarm);
|
|
|
|
|
|
|
|
|
- tempmap.put(po.getTbname(),po);
|
|
|
+ tempmap.put(po.getTbname(), po);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -379,14 +364,30 @@ public class AlarmWtService {
|
|
|
for (ProEconAlarmInfo vo : valuels) {
|
|
|
idls.add(vo.getTbname());
|
|
|
}
|
|
|
+//
|
|
|
+// Map<String,ProEconAlarmInfo> infoMap=new HashMap<>();
|
|
|
if (!idls.isEmpty()) {
|
|
|
|
|
|
+// List<ProEconAlarmInfo> templs= proEconAlarmInfoService.listByIds(idls);
|
|
|
+// if(!templs.isEmpty())
|
|
|
+// {
|
|
|
+// for(ProEconAlarmInfo info:templs)
|
|
|
+// {
|
|
|
+// infoMap.put(info.getTbname().toLowerCase(),info);
|
|
|
+// }
|
|
|
+// }
|
|
|
proEconAlarmInfoService.removeByIds(idls);
|
|
|
}
|
|
|
|
|
|
|
|
|
List<ProEconAlarmInfo> templs = new ArrayList<>();
|
|
|
for (ProEconAlarmInfo vo : valuels) {
|
|
|
+
|
|
|
+// if(infoMap.containsKey(vo.getTbname().toLowerCase()))
|
|
|
+// {
|
|
|
+// ProEconAlarmInfo in=infoMap.get(vo.getTbname().toLowerCase());
|
|
|
+// vo.setUpdateTime(in.getLastUpdateTime());
|
|
|
+// }
|
|
|
templs.add(vo);
|
|
|
if (templs.size() == 500) {
|
|
|
proEconAlarmInfoService.saveBatch(templs);
|
|
@@ -398,61 +399,89 @@ public class AlarmWtService {
|
|
|
proEconAlarmInfoService.saveBatch(templs);
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(ls) && !ls.isEmpty()) {
|
|
|
+
|
|
|
+
|
|
|
+ for (AlarmTag alarm : ls) {
|
|
|
+ if (CacheContext.alarmWtMap.containsKey(alarm.getId())) {
|
|
|
+ AlarmVo vo = CacheContext.alarmWtMap.get(alarm.getId());
|
|
|
|
|
|
+ alarm.setRank(vo.getRank());
|
|
|
+ alarm.setDescription(vo.getDescription());
|
|
|
+ alarm.setAlarmType(vo.getAlarmtype());
|
|
|
+ alarm.setDeviceType(vo.getDevicetype());
|
|
|
+
|
|
|
+ alarm.setCharacteristic(vo.getCharacteristic());
|
|
|
+ alarm.setFaultCause(vo.getFaultCause());
|
|
|
+ alarm.setResolvent(vo.getResolvent());
|
|
|
+ alarm.setIsClose(false);
|
|
|
+ alarm.setDeviceId(vo.getDeviceid());
|
|
|
+ alarm.setAlarmId(vo.getAlarmid());
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(vo.getDeviceid()) && CacheContext.wtmap.containsKey(vo.getDeviceid())) {
|
|
|
+ alarm.setCode(CacheContext.wtmap.get(vo.getDeviceid()).getNemCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CacheContext.wpmap.containsKey(vo.getStationid())) {
|
|
|
+ alarm.setWpName(CacheContext.wpmap.get(vo.getStationid()).getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ alarm.setWpId(vo.getStationid());
|
|
|
+
|
|
|
+
|
|
|
+ pushDataSevice.pushWtData(alarm);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Thread.sleep(300);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public synchronized void updateAlarms(List<AlarmTag> ls) throws EncodeException, IOException {
|
|
|
+ public synchronized void updateAlarms(List<AlarmTag> ls) throws EncodeException, IOException, InterruptedException {
|
|
|
|
|
|
if (StringUtils.notEmp(ls) && !ls.isEmpty()) {
|
|
|
|
|
|
- StringBuilder sb=new StringBuilder();
|
|
|
- Map<String, AlarmSimpleVo> map=new HashMap<>();
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ Map<String, AlarmSimpleVo> map = new HashMap<>();
|
|
|
for (AlarmTag alarm : ls) {
|
|
|
if (CacheContext.alarmWtMap.containsKey(alarm.getId())) {
|
|
|
AlarmVo vo = CacheContext.alarmWtMap.get(alarm.getId());
|
|
|
- if(vo.getAlarmtype().equals(AlarmTypeValue.WT.getCode()) )
|
|
|
- {
|
|
|
+ if (vo.getAlarmtype().equals(AlarmTypeValue.WT.getCode())) {
|
|
|
sb.append("'").append(alarm.getId().toLowerCase()).append("',");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- String ids=null;
|
|
|
- if(sb.length()>0)
|
|
|
- {
|
|
|
- ids=sb.substring(0,sb.length()-1);
|
|
|
+ String ids = null;
|
|
|
+ if (sb.length() > 0) {
|
|
|
+ ids = sb.substring(0, sb.length() - 1);
|
|
|
}
|
|
|
- List<AlarmSimpleVo> alarmls=new ArrayList<>();
|
|
|
- if( null !=ids)
|
|
|
- {
|
|
|
- alarmls=alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.WT.getCode(),ids);
|
|
|
+ List<AlarmSimpleVo> alarmls = new ArrayList<>();
|
|
|
+ if (null != ids) {
|
|
|
+ alarmls = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.WT.getCode(), ids);
|
|
|
}
|
|
|
|
|
|
- if(!alarmls.isEmpty())
|
|
|
- {
|
|
|
- for(AlarmSimpleVo vo:alarmls)
|
|
|
- {
|
|
|
- map.put(vo.getTbName().toLowerCase(),vo);
|
|
|
+ if (!alarmls.isEmpty()) {
|
|
|
+ for (AlarmSimpleVo vo : alarmls) {
|
|
|
+ map.put(vo.getTbName().toLowerCase(), vo);
|
|
|
}
|
|
|
}
|
|
|
- List<AlarmTag> alarmTagls=new ArrayList<>();
|
|
|
+ List<AlarmTag> alarmTagls = new ArrayList<>();
|
|
|
for (AlarmTag alarm : ls) {
|
|
|
|
|
|
|
|
|
- if(map.containsKey(alarm.getId().toLowerCase()))
|
|
|
- {
|
|
|
- AlarmSimpleVo tag=map.get(alarm.getId().toLowerCase());
|
|
|
+ if (map.containsKey(alarm.getId().toLowerCase())) {
|
|
|
+ AlarmSimpleVo tag = map.get(alarm.getId().toLowerCase());
|
|
|
|
|
|
- if(null !=tag.getTs())
|
|
|
- {
|
|
|
+ if (null != tag.getTs()) {
|
|
|
alarm.setTs(tag.getTs());
|
|
|
Date begin = new Date(alarm.getEndts());
|
|
|
Date end = new Date(alarm.getTs());
|
|
|
|
|
|
- double value= DateUtils.secondsDiff(begin,end);
|
|
|
+ double value = DateUtils.secondsDiff(begin, end);
|
|
|
alarm.setTimeLong(value);
|
|
|
alarm.setConfirmed(tag.getConfirmed());
|
|
|
alarm.setSuperTalbe(AlarmSuperTalbeType.WT.getCode());
|
|
@@ -468,16 +497,17 @@ public class AlarmWtService {
|
|
|
alarmTsService.insertList(alarmTagls);
|
|
|
}
|
|
|
|
|
|
- Map<String,ProEconAlarmInfo> tempmap=new HashMap<>();
|
|
|
+ Map<String, ProEconAlarmInfo> tempmap = new HashMap<>();
|
|
|
if (StringUtils.notEmp(alarmTagls) && !alarmTagls.isEmpty()) {
|
|
|
|
|
|
List<ProEconAlarmInfo> valuels = new ArrayList<>();
|
|
|
for (AlarmTag alarm : alarmTagls) {
|
|
|
if (CacheContext.alarmWtMap.containsKey(alarm.getId())) {
|
|
|
AlarmVo vo = CacheContext.alarmWtMap.get(alarm.getId());
|
|
|
- ;
|
|
|
+
|
|
|
ProEconAlarmInfo po = new ProEconAlarmInfo();
|
|
|
po.setTbname(vo.getTbName());
|
|
|
+ po.setUpdateTime(new Date(alarm.getTs()));
|
|
|
po.setLastUpdateTime(new Date(alarm.getEndts()));
|
|
|
po.setTagId(alarm.getTagId());
|
|
|
po.setTriggerType(alarm.getTriggerType());
|
|
@@ -520,20 +550,23 @@ public class AlarmWtService {
|
|
|
alarm.setDeviceId(vo.getDeviceid());
|
|
|
alarm.setAlarmId(vo.getAlarmid());
|
|
|
alarm.setIsClose(true);
|
|
|
- if(CacheContext.wtmap.containsKey(vo.getDeviceid()))
|
|
|
- {
|
|
|
+ if (CacheContext.wtmap.containsKey(vo.getDeviceid())) {
|
|
|
alarm.setCode(CacheContext.wtmap.get(vo.getDeviceid()).getNemCode());
|
|
|
}
|
|
|
|
|
|
- if(CacheContext.wpmap.containsKey(vo.getStationid()))
|
|
|
- {
|
|
|
+ if (CacheContext.wpmap.containsKey(vo.getStationid())) {
|
|
|
alarm.setWpName(CacheContext.wpmap.get(vo.getStationid()).getName());
|
|
|
}
|
|
|
|
|
|
- pushDataSevice.pushWtData(alarm);
|
|
|
+// try {
|
|
|
+// pushDataSevice.pushWtData(alarm);
|
|
|
+// }catch (Exception e)
|
|
|
+// {
|
|
|
+// logger.info(e.getMessage());
|
|
|
+// }
|
|
|
|
|
|
|
|
|
- tempmap.put(po.getTbname(),po);
|
|
|
+ tempmap.put(po.getTbname(), po);
|
|
|
}
|
|
|
}
|
|
|
for (Map.Entry<String, ProEconAlarmInfo> entry : tempmap.entrySet()) {
|
|
@@ -543,13 +576,29 @@ public class AlarmWtService {
|
|
|
for (ProEconAlarmInfo vo : valuels) {
|
|
|
idls.add(vo.getTbname());
|
|
|
}
|
|
|
+// Map<String,ProEconAlarmInfo> infoMap=new HashMap<>();
|
|
|
if (!idls.isEmpty()) {
|
|
|
|
|
|
+// List<ProEconAlarmInfo> templs= proEconAlarmInfoService.listByIds(idls);
|
|
|
+// if(!templs.isEmpty())
|
|
|
+// {
|
|
|
+// for(ProEconAlarmInfo info:templs)
|
|
|
+// {
|
|
|
+// infoMap.put(info.getTbname().toLowerCase(),info);
|
|
|
+// }
|
|
|
+// }
|
|
|
proEconAlarmInfoService.removeByIds(idls);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
List<ProEconAlarmInfo> templs = new ArrayList<>();
|
|
|
for (ProEconAlarmInfo vo : valuels) {
|
|
|
+
|
|
|
+// if(infoMap.containsKey(vo.getTbname().toLowerCase()))
|
|
|
+// {
|
|
|
+// ProEconAlarmInfo in=infoMap.get(vo.getTbname().toLowerCase());
|
|
|
+// vo.setUpdateTime(in.getLastUpdateTime());
|
|
|
+// }
|
|
|
templs.add(vo);
|
|
|
if (templs.size() == 500) {
|
|
|
proEconAlarmInfoService.saveBatch(templs);
|
|
@@ -562,8 +611,44 @@ public class AlarmWtService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ if (StringUtils.notEmp(ls) && !ls.isEmpty()) {
|
|
|
+
|
|
|
+
|
|
|
+ for (AlarmTag alarm : ls) {
|
|
|
+ if (CacheContext.alarmWtMap.containsKey(alarm.getId())) {
|
|
|
+ AlarmVo vo = CacheContext.alarmWtMap.get(alarm.getId());
|
|
|
+
|
|
|
+ alarm.setRank(vo.getRank());
|
|
|
+ alarm.setDescription(vo.getDescription());
|
|
|
+ alarm.setAlarmType(vo.getAlarmtype());
|
|
|
+ alarm.setDeviceType(vo.getDevicetype());
|
|
|
+
|
|
|
+ alarm.setCharacteristic(vo.getCharacteristic());
|
|
|
+ alarm.setFaultCause(vo.getFaultCause());
|
|
|
+ alarm.setResolvent(vo.getResolvent());
|
|
|
+ alarm.setIsClose(false);
|
|
|
+ alarm.setDeviceId(vo.getDeviceid());
|
|
|
+ alarm.setAlarmId(vo.getAlarmid());
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(vo.getDeviceid()) && CacheContext.wtmap.containsKey(vo.getDeviceid())) {
|
|
|
+ alarm.setCode(CacheContext.wtmap.get(vo.getDeviceid()).getNemCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CacheContext.wpmap.containsKey(vo.getStationid())) {
|
|
|
+ alarm.setWpName(CacheContext.wpmap.get(vo.getStationid()).getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ alarm.setWpId(vo.getStationid());
|
|
|
+
|
|
|
+
|
|
|
+ pushDataSevice.pushWtData(alarm);
|
|
|
+ }
|
|
|
+
|
|
|
+ Thread.sleep(300);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|