|
@@ -6,15 +6,18 @@ package com.gyee.runeconomy.service.monitor;/*
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
+import com.gyee.common.util.algorithm.MathUtils;
|
|
|
import com.gyee.common.vo.monitor.AgcVo;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.model.vo.LineTreeVo;
|
|
|
import com.gyee.runeconomy.model.vo.ProTreeVo;
|
|
|
import com.gyee.runeconomy.model.vo.TreeVo;
|
|
|
+import com.gyee.runeconomy.model.vo.WtStatusVo;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconTestingPointService;
|
|
|
import com.gyee.runeconomy.util.StringUtils;
|
|
|
import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
+import com.gyee.runeconomy.util.realtimesource.StringUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -36,12 +39,12 @@ public class DeviceDetailsService {
|
|
|
Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
|
|
|
Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
|
|
|
Map<String, List<ProBasicEquipment>> lnwtmap = CacheContext.lnwtmap;
|
|
|
+ Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
|
|
|
List<ProBasicProject> projects = wppromap.get(wpid);
|
|
|
TreeVo vo = new TreeVo();
|
|
|
List<ProTreeVo> pjvos = new ArrayList<>();
|
|
|
projects.stream().forEach(p->{
|
|
|
List<ProBasicLine> lines = prolinemap.get(p.getId());
|
|
|
- Map<String,Object> lineMap = new HashMap<>();
|
|
|
List<LineTreeVo> lnvos = new ArrayList<>();
|
|
|
ProTreeVo pjvo = new ProTreeVo();
|
|
|
pjvo.setPjid(p.getId());
|
|
@@ -51,7 +54,26 @@ public class DeviceDetailsService {
|
|
|
lnvo.setLnid(line.getId());
|
|
|
lnvo.setLnname(line.getAname());
|
|
|
List<ProBasicEquipment> equipments = lnwtmap.get(line.getId());
|
|
|
- lnvo.setWts(equipments);
|
|
|
+ List<String> points = new ArrayList<>();
|
|
|
+ equipments.stream().forEach(e->{
|
|
|
+ ProBasicEquipmentPoint proBasicEquipmentPoint = wtpAimap.get(e.getId()).get(ContantXk.SBZT);
|
|
|
+ points.add(proBasicEquipmentPoint.getNemCode());
|
|
|
+ });
|
|
|
+ List<PointData> statusData = null;
|
|
|
+ try {
|
|
|
+ statusData = edosUtil.getRealData(points);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ List<WtStatusVo> wtStatusVos = new ArrayList<>();
|
|
|
+ for (int i = 0;i<equipments.size();i++){
|
|
|
+ WtStatusVo wtStatusVo = new WtStatusVo();
|
|
|
+ wtStatusVo.setWtid(equipments.get(i).getId());
|
|
|
+ wtStatusVo.setWtname(equipments.get(i).getAname());
|
|
|
+ wtStatusVo.setStatus((int) statusData.get(i).getPointValueInDouble());
|
|
|
+ wtStatusVos.add(wtStatusVo);
|
|
|
+ }
|
|
|
+ lnvo.setWts(wtStatusVos);
|
|
|
lnvos.add(lnvo);
|
|
|
});
|
|
|
pjvo.setLns(lnvos);
|
|
@@ -85,6 +107,7 @@ public class DeviceDetailsService {
|
|
|
codes.add(equipmentPointMap.get(ContantXk.RXDJCLSSDL).getNemCode());
|
|
|
codes.add(equipmentPointMap.get(ContantXk.RCWSLDWSSDL).getNemCode());
|
|
|
codes.add(equipmentPointMap.get(ContantXk.RCWSLTQSSDL).getNemCode());
|
|
|
+ codes.add(equipmentPointMap.get(ContantXk.SBZT).getNemCode());
|
|
|
List<PointData> realData = edosUtil.getRealData(codes);
|
|
|
if (StringUtils.isNotEmpty(realData)){
|
|
|
resultMap.put("rfdl",realData.get(0).getPointValueInDouble());
|
|
@@ -100,6 +123,7 @@ public class DeviceDetailsService {
|
|
|
resultMap.put("xnss",realData.get(12).getPointValueInDouble()+realData.get(13).getPointValueInDouble()+realData.get(14).getPointValueInDouble()+realData.get(15).getPointValueInDouble());
|
|
|
resultMap.put("xdss",realData.get(16).getPointValueInDouble()+realData.get(17).getPointValueInDouble());
|
|
|
resultMap.put("slss",realData.get(18).getPointValueInDouble()+realData.get(19).getPointValueInDouble());
|
|
|
+ resultMap.put("status",realData.get(20).getPointValueInDouble());
|
|
|
}
|
|
|
|
|
|
return resultMap;
|
|
@@ -109,7 +133,7 @@ public class DeviceDetailsService {
|
|
|
Map<String,List<ProEconTestingPoint>> resultMap = new HashMap<>();
|
|
|
Map<String, ProBasicEquipment> wtmap = CacheContext.wtmap;
|
|
|
QueryWrapper<ProEconTestingPoint> qw = new QueryWrapper<>();
|
|
|
- qw.lambda().eq(ProEconTestingPoint::getModel,wtmap.get(wtid).getModelId()).eq(ProEconTestingPoint::getLogicalUnitId,part);
|
|
|
+ qw.lambda().eq(ProEconTestingPoint::getModel,wtmap.get(wtid).getModelId()).eq(ProEconTestingPoint::getLogicalUnitId,part).eq(ProEconTestingPoint::getIsDisplay,1);
|
|
|
List<ProEconTestingPoint> list = proEconTestingPointService.list(qw);
|
|
|
resultMap.put("AI",list.stream().filter(i->i.getUniformCode().startsWith("AI")).collect(Collectors.toList()));
|
|
|
resultMap.put("DI",list.stream().filter(i->i.getUniformCode().startsWith("DI")).collect(Collectors.toList()));
|