|
@@ -338,12 +338,65 @@ public class PowerCompareController {
|
|
|
}
|
|
|
List<Windturbineinfoday3> vos = windturbineinfoday3Service.getWindturbineinfo(wpIds, pjIds, lineIds, beginDate_d, endDate_d, sortName,
|
|
|
sortOrder);
|
|
|
- if(vos !=null && !vos.isEmpty())
|
|
|
+// if(vos !=null && !vos.isEmpty())
|
|
|
+// {
|
|
|
+// return AjaxResult.successData(AjaxStatus.success.code,vos);
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// return AjaxResult.successData(AjaxStatus.emptyresultset.code,vos);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String,Object>> lylls=new ArrayList<>();
|
|
|
+ Map<String,Object> result=new LinkedHashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(vos !=null && !vos.isEmpty())
|
|
|
{
|
|
|
- return AjaxResult.successData(AjaxStatus.success.code,vos);
|
|
|
+
|
|
|
+
|
|
|
+ Optional<Windturbineinfoday3> maxEmp= vos.stream().filter(Objects::nonNull).max(Comparator.comparingDouble(Windturbineinfoday3 ::getTotal));
|
|
|
+ Windturbineinfoday3 wi3 = maxEmp.orElse(new Windturbineinfoday3());
|
|
|
+ double xAxis=wi3.getTotal();
|
|
|
+ for (int i=0;i<vos.size();i++)
|
|
|
+ {
|
|
|
+ Windturbineinfoday3 wi=vos.get(i);
|
|
|
+ Map<String,Object> data=new LinkedHashMap<>();
|
|
|
+ data.put("yAxis",i+1);
|
|
|
+ data.put("xAxis",xAxis+10);
|
|
|
+ data.put("symbolSize",18);
|
|
|
+ data.put("symbol","circle");
|
|
|
+
|
|
|
+ Map<String,Object> itemStyle=new LinkedHashMap<>();
|
|
|
+ Map<String,Object> normal=new LinkedHashMap<>();
|
|
|
+ normal.put("color","#87b754");
|
|
|
+ itemStyle.put("normal",normal);
|
|
|
+ data.put("itemStyle",itemStyle);
|
|
|
+
|
|
|
+ Map<String,Object> label=new LinkedHashMap<>();
|
|
|
+ Map<String,Object> normal2=new LinkedHashMap<>();
|
|
|
+
|
|
|
+ normal2.put("color","#000");
|
|
|
+ normal2.put("position","right");
|
|
|
+ normal2.put("distance",12);
|
|
|
+ normal2.put("show",true);
|
|
|
+ normal2.put("formatter","风能利用率"+wi.getLyl());
|
|
|
+
|
|
|
+ label.put("normal",normal2);
|
|
|
+ data.put("label",label);
|
|
|
+
|
|
|
+ lylls.add(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ // System.out.println( JSONObject.toJSONString(lylls));
|
|
|
+
|
|
|
+ result.put("list",vos);
|
|
|
+ result.put("lyl",lylls);
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code,result);
|
|
|
}else
|
|
|
{
|
|
|
- return AjaxResult.successData(AjaxStatus.emptyresultset.code,vos);
|
|
|
+ return AjaxResult.successData(AjaxStatus.emptyresultset.code,result);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -375,12 +428,57 @@ public class PowerCompareController {
|
|
|
vos = windpowerinfoday3Service.getWindturbineinfoAll(wpIds, beginDate_d, endDate_d, 2, sortName,
|
|
|
sortOrder);
|
|
|
}
|
|
|
- if(vos !=null && !vos.isEmpty())
|
|
|
+
|
|
|
+ List<Map<String,Object>> lylls=new ArrayList<>();
|
|
|
+ Map<String,Object> result=new LinkedHashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(vos !=null && !vos.isEmpty())
|
|
|
{
|
|
|
- return AjaxResult.successData(AjaxStatus.success.code,vos);
|
|
|
+
|
|
|
+
|
|
|
+ Optional<Windpowerinfoday3> maxEmp= vos.stream().filter(Objects::nonNull).max(Comparator.comparingDouble(Windpowerinfoday3 ::getTotal));
|
|
|
+ Windpowerinfoday3 wi3 = maxEmp.orElse(new Windpowerinfoday3());
|
|
|
+ double xAxis=wi3.getTotal();
|
|
|
+ for (int i=0;i<vos.size();i++)
|
|
|
+ {
|
|
|
+ Windpowerinfoday3 wi=vos.get(i);
|
|
|
+ Map<String,Object> data=new LinkedHashMap<>();
|
|
|
+ data.put("yAxis",i+1);
|
|
|
+ data.put("xAxis",xAxis+10);
|
|
|
+ data.put("symbolSize",18);
|
|
|
+ data.put("symbol","circle");
|
|
|
+
|
|
|
+ Map<String,Object> itemStyle=new LinkedHashMap<>();
|
|
|
+ Map<String,Object> normal=new LinkedHashMap<>();
|
|
|
+ normal.put("color","#87b754");
|
|
|
+ itemStyle.put("normal",normal);
|
|
|
+ data.put("itemStyle",itemStyle);
|
|
|
+
|
|
|
+ Map<String,Object> label=new LinkedHashMap<>();
|
|
|
+ Map<String,Object> normal2=new LinkedHashMap<>();
|
|
|
+
|
|
|
+ normal2.put("color","#000");
|
|
|
+ normal2.put("position","right");
|
|
|
+ normal2.put("distance",12);
|
|
|
+ normal2.put("show",true);
|
|
|
+ normal2.put("formatter","风能利用率"+wi.getLyl());
|
|
|
+
|
|
|
+ label.put("normal",normal2);
|
|
|
+ data.put("label",label);
|
|
|
+
|
|
|
+ lylls.add(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ // System.out.println( JSONObject.toJSONString(lylls));
|
|
|
+
|
|
|
+ result.put("list",vos);
|
|
|
+ result.put("lyl",lylls);
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code,result);
|
|
|
}else
|
|
|
{
|
|
|
- return AjaxResult.successData(AjaxStatus.emptyresultset.code,vos);
|
|
|
+ return AjaxResult.successData(AjaxStatus.emptyresultset.code,result);
|
|
|
}
|
|
|
}
|
|
|
}
|