|
@@ -96,11 +96,148 @@ public class WtInfoPushService {
|
|
|
Map<String,List<WtTargetConfig>> wtcmap=wtTargetConfigService.findWtTargetConfigMap(wt.getModelid());
|
|
|
if(!wtcmap.isEmpty())
|
|
|
{
|
|
|
- List<WtTargetConfigVo> vos=new ArrayList<>();
|
|
|
+
|
|
|
List<String> codels=new ArrayList<>();
|
|
|
for (Map.Entry<String, List<WtTargetConfig>> entry : wtcmap.entrySet()) {
|
|
|
List<WtTargetConfig> wtcls=entry.getValue();
|
|
|
+ List<WtTargetConfigVo> vos=new ArrayList<>();
|
|
|
+ if(!wtcls.isEmpty())
|
|
|
+ {
|
|
|
+ for(WtTargetConfig wtc:wtcls)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(wtc.getUniformcode()))
|
|
|
+ {
|
|
|
+ codels.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, wtc.getUniformcode()).getCode());
|
|
|
+
|
|
|
+ WtTargetConfigVo vo=new WtTargetConfigVo();
|
|
|
+ vo.setCode(wtc.getCode());
|
|
|
+ vo.setModelid(wtc.getModelid());
|
|
|
+ vo.setName(wtc.getName());
|
|
|
+ vo.setPointtype(wtc.getPointtype());
|
|
|
+ vo.setTypes(wtc.getTypes());
|
|
|
+ vo.setUnit(wtc.getUnit());
|
|
|
+ vo.setRate(wtc.getRate());
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> pols= realApiUtil.getRealData(codels);
|
|
|
+ if(!pols.isEmpty() && pols.size()==codels.size())
|
|
|
+ {
|
|
|
+ for( int i=0;i<vos.size();i++)
|
|
|
+ {
|
|
|
+ WtTargetConfigVo wtc=vos.get(i);
|
|
|
+ if(StringUtils.notEmp(wtc.getRate()))
|
|
|
+ {
|
|
|
+ PointData po=pols.get(i);
|
|
|
+ double rate=wtc.getRate();
|
|
|
+ double result=new BigDecimal(po.getPointValueInDouble()).multiply(new BigDecimal(rate)).doubleValue();
|
|
|
+ result= StringUtils.round(result,2);
|
|
|
+ wtc.setValue(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ map.put(entry.getKey(), vos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+/*************************************************关系库指标**************************************************************/
|
|
|
+
|
|
|
+ Map<String, Object> gxkmap = new HashMap<>();
|
|
|
+ Date date = DateUtils.truncate(new Date());
|
|
|
+ List<WindTurbineInfoDay> wtdls = windturbineinfodayService.getWindturbineinfo(id, date);
|
|
|
+ if (!wtdls.isEmpty()) {
|
|
|
+ WindTurbineInfoDay wd = wtdls.get(0);
|
|
|
+ gxkmap.put("ndxkyss", wd.getYeardxkyxs());
|
|
|
+ gxkmap.put("nsbklyl", wd.getYearsbklyl());
|
|
|
+ gxkmap.put("ydxkyss", wd.getMonthdxkyxs());
|
|
|
+ gxkmap.put("ysbklyl", wd.getMonthsbklyl());
|
|
|
+
|
|
|
+ gxkmap.put("yyxxs", wd.getMonthruntime());
|
|
|
+ gxkmap.put("ygzxs", wd.getMonthfaulttime());
|
|
|
+ gxkmap.put("yjxxs", wd.getMonthmaintaintime());
|
|
|
+ gxkmap.put("ytjxs", wd.getMonhtstoptime());
|
|
|
|
|
|
+ Map<String, Object> jczbmap =(Map<String, Object>)map.get("jczbmap");
|
|
|
+ jczbmap.put("FJKYL", wd.getDaysbklyl());
|
|
|
+ map.put("jczbmap", jczbmap);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ gxkmap.put("ndxkyss", 0.0);
|
|
|
+ gxkmap.put("nsbklyl", 0.0);
|
|
|
+ gxkmap.put("ydxkyss", 0.0);
|
|
|
+ gxkmap.put("ysbklyl", 0.0);
|
|
|
+
|
|
|
+ gxkmap.put("yyxxs", 0.0);
|
|
|
+ gxkmap.put("ygzxs", 0.0);
|
|
|
+ gxkmap.put("yjxxs", 0.0);
|
|
|
+ gxkmap.put("ytjxs", 0.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ WarningRecords warningRecords= warningRecordsService.getWarningRecords(id);
|
|
|
+
|
|
|
+ if(null !=warningRecords && null !=warningRecords.getWarningid() && InitialRunner.warningmap.containsKey(warningRecords.getWarningid()))
|
|
|
+ {
|
|
|
+ Warning2 warning2=InitialRunner.warningmap.get(warningRecords.getWarningid());
|
|
|
+ gxkmap.put("bjmc", warning2.getChinesetext());
|
|
|
+ gxkmap.put("bjsj", DateUtils.formatDateTime(warningRecords.getWarningtime()));
|
|
|
+ }
|
|
|
+
|
|
|
+// List<SawVo> ls=alarmsnapService.getWarningRecordsList(id);
|
|
|
+// if(!ls.isEmpty())
|
|
|
+// {
|
|
|
+// gxkmap.put("bjmc", ls.get(0).getName());
|
|
|
+// gxkmap.put("bjsj", DateUtils.formatDateTime(ls.get(0).getTime()));
|
|
|
+// }
|
|
|
+ map.put("gxkmap", gxkmap);
|
|
|
+
|
|
|
+/*************************************************关系库指标**************************************************************/
|
|
|
+ }
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Map<String, Object> findNbqInfo(String id) throws Exception {
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(id)) {
|
|
|
+
|
|
|
+ if (InitialRunner.nbqmap.containsKey(id)) {
|
|
|
+
|
|
|
+ Map<String, String[]> namemap = new HashMap<String, String[]>();
|
|
|
+ Inverter wt = InitialRunner.nbqmap.get(id);
|
|
|
+
|
|
|
+ map.put("model", wt.getModelid());
|
|
|
+ map.put("wpid", wt.getWindpowerstationid());
|
|
|
+ map.put("pjid", wt.getProjectid());
|
|
|
+ map.put("lnid", wt.getLineid());
|
|
|
+ map.put("code", wt.getCode());
|
|
|
+ Line ln= InitialRunner.lnmap.get(wt.getLineid());
|
|
|
+ map.put("lnname", ln.getName());
|
|
|
+
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(wt.getModelid()))
|
|
|
+ {
|
|
|
+ Map<String,List<WtTargetConfig>> wtcmap=wtTargetConfigService.findWtTargetConfigMap(wt.getModelid());
|
|
|
+ if(!wtcmap.isEmpty())
|
|
|
+ {
|
|
|
+
|
|
|
+ List<String> codels=new ArrayList<>();
|
|
|
+ for (Map.Entry<String, List<WtTargetConfig>> entry : wtcmap.entrySet()) {
|
|
|
+ List<WtTargetConfig> wtcls=entry.getValue();
|
|
|
+ List<WtTargetConfigVo> vos=new ArrayList<>();
|
|
|
if(!wtcls.isEmpty())
|
|
|
{
|
|
|
for(WtTargetConfig wtc:wtcls)
|