Sfoglia il codice sorgente

项目对标功能修改

shilin 4 anni fa
parent
commit
dc07655ed9

+ 4 - 4
src/main/java/com/gyee/frame/service/Windpowerinfoday3Service.java

@@ -674,7 +674,7 @@ public class Windpowerinfoday3Service implements BaseService<Windpowerinfoday3,
 
 		Windpowerinfoday3Example.Criteria criteria =example.createCriteria();
 
-		if(StringUtils.isNotEmpty(ids))
+		if(StringUtils.isNotEmpty(ids) && !ids.isEmpty())
 		{
 			criteria.andForeignkeyidIn(ids);
 		}
@@ -685,11 +685,11 @@ public class Windpowerinfoday3Service implements BaseService<Windpowerinfoday3,
 		if(StringUtils.isNotEmpty(location))
 		{
 			criteria.andLocationEqualTo(location);
-		}
 
-		criteria.andForeignkeyidLike("%FDC");
 
+		}
 
+		criteria.andWindpowerstationidLike("%FDC");
 
 		list= windpowerinfoday3Mapper.selectByExample(example);
 		return list;
@@ -720,7 +720,7 @@ public class Windpowerinfoday3Service implements BaseService<Windpowerinfoday3,
 			criteria.andLocationEqualTo(location);
 		}
 
-		criteria.andForeignkeyidLike("%FDC");
+		criteria.andWindpowerstationidLike("%FDC");
 
 
 

+ 22 - 0
src/main/java/com/gyee/frame/service/WindturbinecurvefittingService.java

@@ -121,4 +121,26 @@ public class WindturbinecurvefittingService implements BaseService<Windturbinecu
 
 	}
 
+	public List<Windturbinecurvefitting> comparechatAjax(List<String> wtIds, Date date)  {
+
+
+		List<Windturbinecurvefitting> list =new ArrayList<>();
+
+		WindturbinecurvefittingExample example=new WindturbinecurvefittingExample();
+		example.setOrderByClause("speed ASC");
+
+		WindturbinecurvefittingExample.Criteria criteria =example.createCriteria();
+
+		criteria.andWindturbineidIn(wtIds);
+
+		Date endDate= DateUtils.addDays(date,1);
+		criteria.andRecorddateGreaterThanOrEqualTo(date).andRecorddateLessThan(endDate);
+
+
+		list= windturbinecurvefittingMapper.selectByExample(example);
+
+		return list;
+
+	}
+
 }

+ 591 - 1
src/main/java/com/gyee/frame/service/Windturbineinfoday3Service.java

@@ -138,7 +138,7 @@ public class Windturbineinfoday3Service implements BaseService<Windturbineinfoda
             if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
 
-                example.createCriteria().andWindpowerstationidLike("FDC").andWindturbineidEqualTo(wtId).andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
+                example.createCriteria().andWindpowerstationidLike("%FDC").andWindturbineidEqualTo(wtId).andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
                 list = windturbineinfoday3Mapper.selectByExample(example);
             } else {
                 list = new ArrayList<>();
@@ -825,4 +825,594 @@ public class Windturbineinfoday3Service implements BaseService<Windturbineinfoda
         return list;
 
     }
+
+
+    public List<Windturbineinfoday3> utilizationList( Tablepar tablepar,String wpId,Date beginDate, Date endDate,String type) {
+
+        List<Windturbineinfoday3> vos=new ArrayList<>();
+        List<Windturbineinfoday3> ls = null;
+
+        if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+            Windturbineinfoday3Example example = new Windturbineinfoday3Example();
+            example.setOrderByClause("recorddate DESC");
+
+            if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+               example.createCriteria().andWindpowerstationidLike("%FDC").andWindpowerstationidEqualTo(wpId).andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
+                ls = windturbineinfoday3Mapper.selectByExample(example);
+            } else {
+                ls = new ArrayList<>();
+            }
+
+            Map<String, Windturbineinfoday3> map = new TreeMap<String, Windturbineinfoday3>();
+            switch (type) {
+                case "0":
+                    if (!ls.isEmpty()) {
+                        setWpMap(map, ls);
+                    }
+                    break;
+                case "1":
+                    setPjMap(map, ls);
+
+                    break;
+                case "2":
+                    setLnMap(map, ls);
+
+                    break;
+                case "3":
+                    setWtMap(map, ls);
+
+                default:
+                    if (!ls.isEmpty()) {
+                        setWpMap(map, ls);
+                    }
+                    break;
+            }
+
+            Set<Map.Entry<String, Windturbineinfoday3>> set = map.entrySet();
+            for (Iterator<Map.Entry<String, Windturbineinfoday3>> it = set.iterator(); it.hasNext();) {
+                Map.Entry<String, Windturbineinfoday3> entry = (Map.Entry<String, Windturbineinfoday3>) it.next();
+                Windturbineinfoday3 wi=entry.getValue();
+                wi.setDaydl2(new BigDecimal(wi.getDaydl2()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue());
+                wi.setDaylldl(new BigDecimal(wi.getDaylldl()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue());
+                double temp=1.0;
+                if(wi.getDaylldl()!=0)
+                {
+                    temp=wi.getDaylldl();
+                }
+
+                double fdlyl=new BigDecimal(wi.getDaydl2()).divide(new BigDecimal(temp), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                wi.setDayspeed(fdlyl);
+                vos.add(wi);
+            }
+
+            Collections.sort(vos,new Comparator<Windturbineinfoday3>(){
+                public int compare(Windturbineinfoday3 arg0, Windturbineinfoday3 arg1) {
+                    int result=0;
+
+                    if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("daydl2")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDaydl2().compareTo(o2.getDaydl2());
+                                }
+
+                            });
+                        } else  {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDaydl2().compareTo(o1.getDaydl2());
+                                }
+
+                            });
+                        }
+
+                    }
+
+                    else 	if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("daylldl")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDaylldl().compareTo(o2.getDaylldl());
+                                }
+
+                            });
+                        } else    {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDaylldl().compareTo(o1.getDaylldl());
+                                }
+
+                            });
+                        }
+
+                    }
+
+                    else 	if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("dayspeed")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDayspeed().compareTo(o2.getDayspeed());
+                                }
+
+                            });
+                        } else   {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDayspeed().compareTo(o1.getDayspeed());
+                                }
+
+                            });
+                        }
+
+                    }
+
+
+                    return result;
+
+                }
+            });
+            int i=1;
+            for(Windturbineinfoday3 vo:vos)
+            {
+                vo.setId(i);
+                i++;
+            }
+        }
+        return vos;
+
+    }
+
+
+
+    public List<Windturbineinfoday3> lossList( Tablepar tablepar,String wpId,Date beginDate, Date endDate,String type) {
+
+        List<Windturbineinfoday3> vos=new ArrayList<>();
+        List<Windturbineinfoday3> ls = null;
+
+        if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+            Windturbineinfoday3Example example = new Windturbineinfoday3Example();
+            example.setOrderByClause("recorddate DESC");
+
+            if (StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+                example.createCriteria().andWindpowerstationidLike("%FDC").andWindpowerstationidEqualTo(wpId).andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
+                ls = windturbineinfoday3Mapper.selectByExample(example);
+            } else {
+                ls = new ArrayList<>();
+            }
+
+            Map<String, Windturbineinfoday3> map = new TreeMap<String, Windturbineinfoday3>();
+            switch (type) {
+                case "0":
+                    if (!ls.isEmpty()) {
+                        setWpLossMap(map, ls);
+                    }
+                    break;
+                case "1":
+                    setPjLossMap(map, ls);
+
+                    break;
+                case "2":
+                    setLnLossMap(map, ls);
+
+                    break;
+                case "3":
+                    setWtLossMap(map, ls);
+
+                default:
+                    if (!ls.isEmpty()) {
+                        setWpMap(map, ls);
+                    }
+                    break;
+            }
+
+            Set<Map.Entry<String, Windturbineinfoday3>> set = map.entrySet();
+            for (Iterator<Map.Entry<String, Windturbineinfoday3>> it = set.iterator(); it.hasNext();) {
+                Map.Entry<String, Windturbineinfoday3> entry = (Map.Entry<String, Windturbineinfoday3>) it.next();
+                Windturbineinfoday3 wi = entry.getValue();
+                double temp = 1.0;
+                if (wi.getDaydl2() != 0) {
+                    temp = wi.getDaydl2();
+                }
+
+                wi.setDaynhgzssdl2(new BigDecimal(wi.getDaynhgzssdl2()).divide(new BigDecimal(temp), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue());
+                wi.setDaynhwhssdl2(new BigDecimal(wi.getDaynhwhssdl2()).divide(new BigDecimal(temp), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue());
+                wi.setDaynhxdssdl2(new BigDecimal(wi.getDaynhxdssdl2()).divide(new BigDecimal(temp), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue());
+
+                wi.setDayspeed(0.0);
+                vos.add(wi);
+            }
+
+            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                public int compare(Windturbineinfoday3 arg0, Windturbineinfoday3 arg1) {
+                    int result = 0;
+                    if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("daynhgzssdl2")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDaynhgzssdl2().compareTo(o2.getDaynhgzssdl2());
+                                }
+
+                            });
+                        } else   {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDaynhgzssdl2().compareTo(o1.getDaynhgzssdl2());
+                                }
+
+                            });
+                        }
+
+                    }
+
+                    else if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("daynhwhssdl2")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDaynhwhssdl2().compareTo(o2.getDaynhwhssdl2());
+                                }
+
+                            });
+                        } else   {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDaynhwhssdl2().compareTo(o1.getDaynhwhssdl2());
+                                }
+
+                            });
+                        }
+
+                    } else if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("daynhxdssdl2")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDaynhxdssdl2().compareTo(o2.getDaynhxdssdl2());
+                                }
+
+                            });
+                        } else  {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDaynhxdssdl2().compareTo(o1.getDaynhxdssdl2());
+                                }
+
+                            });
+                        }
+
+                    }
+
+                    else if (StringUtils.notEmp(tablepar.getOrderByColumn()) && tablepar.getOrderByColumn().equals("dayspeed")) {
+
+                        if (tablepar.getIsAsc().equals("asc")) {
+
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o1.getDayspeed().compareTo(o2.getDayspeed());
+                                }
+
+                            });
+                        } else   {
+                            Collections.sort(vos, new Comparator<Windturbineinfoday3>() {
+                                // 升序排序
+                                public int compare(Windturbineinfoday3 o1, Windturbineinfoday3 o2) {
+                                    return o2.getDayspeed().compareTo(o1.getDayspeed());
+                                }
+
+                            });
+                        }
+
+                    }
+
+                    return result;
+
+                }
+            });
+            int i = 1;
+            for (Windturbineinfoday3 vo : vos) {
+                vo.setId(i);
+                i++;
+            }
+        }
+        return vos;
+
+    }
+
+    private void setWpMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getWindpowerstationid())) {
+                Windturbineinfoday3 oldwd=map.get(wd.getWindpowerstationid());
+
+                double sfdl=null!=wd.getDaydl2()?wd.getDaydl2():0.0;
+                double llfdl=null!=wd.getDaylldl()?wd.getDaylldl():0.0;
+
+
+                oldwd.setDaydl2(oldwd.getDaydl2()+sfdl);
+                oldwd.setDaylldl(oldwd.getDaylldl()+llfdl);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindpowerstationid(), oldwd);
+            }else
+            {
+                Windturbineinfoday3 oldwd=new Windturbineinfoday3();
+
+                if(InitialRunner.wpmap.containsKey(wd.getWindpowerstationid()))
+                {
+                    Windpowerstation wp=InitialRunner.wpmap.get(wd.getWindpowerstationid());
+                    oldwd.setWindturbineid(wp.getName());
+                }
+                oldwd.setDaydl2(null!=wd.getDaydl2()?wd.getDaydl2():0.0);
+                oldwd.setDaylldl(null!=wd.getDaylldl()?wd.getDaylldl():0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindpowerstationid(), oldwd);
+            }
+
+        }
+    }
+
+    private void setPjMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getProjectid())) {
+                Windturbineinfoday3 oldwd=map.get(wd.getProjectid());
+
+                double sfdl=null!=wd.getDaydl2()?wd.getDaydl2():0.0;
+                double llfdl=null!=wd.getDaylldl()?wd.getDaylldl():0.0;
+
+
+                oldwd.setDaydl2(oldwd.getDaydl2()+sfdl);
+                oldwd.setDaylldl(oldwd.getDaylldl()+llfdl);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getProjectid(), oldwd);
+            }else
+            {
+                Windturbineinfoday3 oldwd=new Windturbineinfoday3();
+
+                if(InitialRunner.pjmap.containsKey(wd.getProjectid()))
+                {
+                    Project pj=InitialRunner.pjmap.get(wd.getProjectid());
+                    oldwd.setWindturbineid(pj.getName());
+                }
+                oldwd.setDaydl2(null!=wd.getDaydl2()?wd.getDaydl2():0.0);
+                oldwd.setDaylldl(null!=wd.getDaylldl()?wd.getDaylldl():0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getProjectid(), oldwd);
+            }
+
+        }
+    }
+
+    private void setLnMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getLineid())) {
+                Windturbineinfoday3 oldwd=map.get(wd.getLineid());
+
+                double sfdl=null!=wd.getDaydl2()?wd.getDaydl2():0.0;
+                double llfdl=null!=wd.getDaylldl()?wd.getDaylldl():0.0;
+
+
+                oldwd.setDaydl2(oldwd.getDaydl2()+sfdl);
+                oldwd.setDaylldl(oldwd.getDaylldl()+llfdl);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getLineid(), oldwd);
+            }else
+            {
+                Windturbineinfoday3 oldwd=new Windturbineinfoday3();
+
+                if(InitialRunner.lnmap.containsKey(wd.getLineid()))
+                {
+                    Line ln=InitialRunner.lnmap.get(wd.getLineid());
+                    oldwd.setWindturbineid(ln.getName());
+                }
+                oldwd.setDaydl2(null!=wd.getDaydl2()?wd.getDaydl2():0.0);
+                oldwd.setDaylldl(null!=wd.getDaylldl()?wd.getDaylldl():0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getLineid(), oldwd);
+            }
+
+        }
+    }
+    private void setWtMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getWindturbineid())) {
+                Windturbineinfoday3 oldwd=map.get(wd.getWindturbineid());
+
+                double sfdl=null!=wd.getDaydl2()?wd.getDaydl2():0.0;
+                double llfdl=null!=wd.getDaylldl()?wd.getDaylldl():0.0;
+
+
+                oldwd.setDaydl2(oldwd.getDaydl2()+sfdl);
+                oldwd.setDaylldl(oldwd.getDaylldl()+llfdl);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindturbineid(), oldwd);
+            }else
+            {
+                Windturbineinfoday3 oldwd=new Windturbineinfoday3();
+
+                oldwd.setWindturbineid(wd.getWindturbineid());
+                oldwd.setDaydl2(null!=wd.getDaydl2()?wd.getDaydl2():0.0);
+                oldwd.setDaylldl(null!=wd.getDaylldl()?wd.getDaylldl():0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindturbineid(), oldwd);
+            }
+
+        }
+    }
+
+
+
+
+
+    private void setWpLossMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getWindpowerstationid())) {
+                Windturbineinfoday3 oldwd = map.get(wd.getWindpowerstationid());
+
+                double sfdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0.0;
+                double gzfdl = null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0;
+                double whfdl = null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0;
+                double xdfdl = null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0;
+
+                oldwd.setDaydl2(oldwd.getDaydl2() + sfdl);
+                oldwd.setDaynhgzssdl2(oldwd.getDaynhgzssdl2() + gzfdl);
+                oldwd.setDaynhwhssdl2(oldwd.getDaynhwhssdl2() + whfdl);
+                oldwd.setDaynhxdssdl2(oldwd.getDaynhxdssdl2() + xdfdl);
+
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindpowerstationid(), oldwd);
+            } else {
+                Windturbineinfoday3 oldwd = new Windturbineinfoday3();
+
+                if (InitialRunner.wpmap.containsKey(wd.getWindpowerstationid())) {
+                    Windpowerstation wp = InitialRunner.wpmap.get(wd.getWindpowerstationid());
+                    oldwd.setWindturbineid(wp.getName());
+                }
+                oldwd.setDaydl2(null != wd.getDaydl2() ? wd.getDaydl2() : 0.0);
+                oldwd.setDaynhgzssdl2(null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0);
+                oldwd.setDaynhwhssdl2(null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0);
+                oldwd.setDaynhxdssdl2(null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0);
+
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindpowerstationid(), oldwd);
+            }
+
+        }
+    }
+
+    private void setPjLossMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getProjectid())) {
+                Windturbineinfoday3 oldwd = map.get(wd.getProjectid());
+
+                double sfdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0.0;
+                double gzfdl = null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0;
+                double whfdl = null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0;
+                double xdfdl = null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0;
+
+                oldwd.setDaydl2(oldwd.getDaydl2() + sfdl);
+                oldwd.setDaynhgzssdl2(oldwd.getDaynhgzssdl2() + gzfdl);
+                oldwd.setDaynhwhssdl2(oldwd.getDaynhwhssdl2() + whfdl);
+                oldwd.setDaynhxdssdl2(oldwd.getDaynhxdssdl2() + xdfdl);
+
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getProjectid(), oldwd);
+            } else {
+                Windturbineinfoday3 oldwd = new Windturbineinfoday3();
+
+                if (InitialRunner.pjmap.containsKey(wd.getProjectid())) {
+                    Project pj = InitialRunner.pjmap.get(wd.getProjectid());
+                    oldwd.setWindturbineid(pj.getName());
+                }
+                oldwd.setDaydl2(null != wd.getDaydl2() ? wd.getDaydl2() : 0.0);
+                oldwd.setDaynhgzssdl2(null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0);
+                oldwd.setDaynhwhssdl2(null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0);
+                oldwd.setDaynhxdssdl2(null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getProjectid(), oldwd);
+            }
+
+        }
+    }
+
+    private void setLnLossMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getLineid())) {
+                Windturbineinfoday3 oldwd = map.get(wd.getLineid());
+
+                double sfdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0.0;
+                double gzfdl = null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0;
+                double whfdl = null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0;
+                double xdfdl = null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0;
+
+                oldwd.setDaydl2(oldwd.getDaydl2() + sfdl);
+                oldwd.setDaynhgzssdl2(oldwd.getDaynhgzssdl2() + gzfdl);
+                oldwd.setDaynhwhssdl2(oldwd.getDaynhwhssdl2() + whfdl);
+                oldwd.setDaynhxdssdl2(oldwd.getDaynhxdssdl2() + xdfdl);
+
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getLineid(), oldwd);
+            } else {
+                Windturbineinfoday3 oldwd = new Windturbineinfoday3();
+
+                if (InitialRunner.lnmap.containsKey(wd.getLineid())) {
+                    Line ln = InitialRunner.lnmap.get(wd.getLineid());
+                    oldwd.setWindturbineid(ln.getName());
+                }
+                oldwd.setDaydl2(null != wd.getDaydl2() ? wd.getDaydl2() : 0.0);
+                oldwd.setDaynhgzssdl2(null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0);
+                oldwd.setDaynhwhssdl2(null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0);
+                oldwd.setDaynhxdssdl2(null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getLineid(), oldwd);
+            }
+
+        }
+    }
+
+    private void setWtLossMap(Map<String, Windturbineinfoday3> map, List<Windturbineinfoday3> ls) {
+        for (Windturbineinfoday3 wd : ls) {
+
+            if (map.containsKey(wd.getWindturbineid())) {
+                Windturbineinfoday3 oldwd = map.get(wd.getWindturbineid());
+
+                double sfdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0.0;
+                double gzfdl = null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0;
+                double whfdl = null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0;
+                double xdfdl = null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0;
+
+                oldwd.setDaydl2(oldwd.getDaydl2() + sfdl);
+                oldwd.setDaynhgzssdl2(oldwd.getDaynhgzssdl2() + gzfdl);
+                oldwd.setDaynhwhssdl2(oldwd.getDaynhwhssdl2() + whfdl);
+                oldwd.setDaynhxdssdl2(oldwd.getDaynhxdssdl2() + xdfdl);
+
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindturbineid(), oldwd);
+            } else {
+                Windturbineinfoday3 oldwd = new Windturbineinfoday3();
+
+                oldwd.setWindturbineid(wd.getWindturbineid());
+                oldwd.setDaydl2(null != wd.getDaydl2() ? wd.getDaydl2() : 0.0);
+                oldwd.setDaynhgzssdl2(null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0);
+                oldwd.setDaynhwhssdl2(null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0);
+                oldwd.setDaynhxdssdl2(null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0);
+                oldwd.setDayspeed(0.0);
+                map.put(wd.getWindturbineid(), oldwd);
+            }
+
+        }
+    }
 }

+ 1 - 1
src/main/java/com/gyee/frame/service/WindturbineinfodayService.java

@@ -141,7 +141,7 @@ public class WindturbineinfodayService implements BaseService<WindTurbineInfoDay
 			if(StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)){
 
 
-				example.createCriteria().andWindpowerstationidLike("FDC").andWindturbineidEqualTo(wtId).andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
+				example.createCriteria().andWindpowerstationidLike("%FDC").andWindturbineidEqualTo(wtId).andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
 				list= windTurbineInfoDayMapper.selectByExample(example);
 			}else
 			{

+ 85 - 41
src/main/java/com/gyee/frame/service/contrast/ContrastLnService.java

@@ -47,11 +47,36 @@ public class ContrastLnService {
 					String[] strs = wpId.split(",");
 					if (strs.length > 0) {
 						for (int i = 0; i < strs.length; i++) {
-							wpids.add(strs[i]);
+							if(InitialRunner.pjsmap.containsKey(strs[i]))
+							{
+								List<Project> pjls=InitialRunner.pjsmap.get(strs[i]);
+								for(Project pj:pjls)
+								{
+									if(InitialRunner.lnsmap.containsKey(strs[i]))
+									{
+										List<Line> lnls=InitialRunner.lnsmap.get(strs[i]);
+										for(Line ln:lnls)
+										{
+											wpids.add(ln.getId());
+										}
+									}
+								}
+							}
 						}
 					}
 				} else {
-					wpids.add(wpId);
+					List<Project> pjls=InitialRunner.pjsmap.get(wpId);
+					for(Project pj:pjls)
+					{
+						if(InitialRunner.lnsmap.containsKey(wpId))
+						{
+							List<Line> lnls=InitialRunner.lnsmap.get(wpId);
+							for(Line ln:lnls)
+							{
+								wpids.add(ln.getId());
+							}
+						}
+					}
 				}
 			}
 
@@ -72,20 +97,20 @@ public class ContrastLnService {
 			if (!lnids.isEmpty()) {
 				ls =windpowerinfoday3Service.getWindpowerinfoday3(lnids, begin, end, "line");
 			} else if (!wpids.isEmpty()) {
-				ls =windpowerinfoday3Service.getWindpowerinfoday3(wpids, begin, end, "windpower");
+				ls =windpowerinfoday3Service.getWindpowerinfoday3(wpids, begin, end, "line");
+			}else  {
+				ls =windpowerinfoday3Service.getWindpowerinfoday3(new ArrayList<>(), begin, end, "line");
 			}
 
+			Map<String, Line> linemap = InitialRunner.lnmap;
 			Map<String, Windpowerstation> wpmap = InitialRunner.wpmap;
-
-			Map<String, Project> pjmap = InitialRunner.pjmap;
-
 			Map<String, Windpowerinfoday3> wdmap = new HashMap<String, Windpowerinfoday3>();
 			if (!ls.isEmpty()) {
 				for (Windpowerinfoday3 wd : ls) {
-					if (wdmap.containsKey(wd.getProjectid())) {
-						Windpowerinfoday3 w = wdmap.get(wd.getProjectid());
+					if (wdmap.containsKey(wd.getLineid())) {
+						Windpowerinfoday3 w = wdmap.get(wd.getLineid());
 						w.setWindpowerstationid(wd.getWindpowerstationid());
-						w.setProjectid(wd.getProjectid());
+						w.setLineid(wd.getLineid());
 						double losspower1 = null != wd.getDaynhxdssdl() ? wd.getDaynhxdssdl() : 0.0;
 						double losspower2 = null != wd.getDaynhgzssdl() ? wd.getDaynhgzssdl() : 0.0;
 						double losspower3 = null != wd.getDaynhwhssdl() ? wd.getDaynhwhssdl() : 0.0;
@@ -97,11 +122,11 @@ public class ContrastLnService {
 						w.setDaynhwhssdl(w.getDaynhwhssdl() + losspower3);
 						w.setDaynhqfdl(w.getDaynhqfdl() + losspower4);
 						w.setDaydl2(w.getDaydl2() + scadafdl);
-						wdmap.put(wd.getProjectid(), w);
+						wdmap.put(wd.getLineid(), w);
 					} else {
 						Windpowerinfoday3 w = new Windpowerinfoday3();
 						w.setWindpowerstationid(wd.getWindpowerstationid());
-						w.setProjectid(wd.getProjectid());
+						w.setLineid(wd.getLineid());
 						double scadafdl = null != wd.getDaydl2() ? wd.getDaydl2() : 0; // scada发电量
 						double losspower1 = null != wd.getDaynhxdssdl() ? wd.getDaynhxdssdl() : 0.0;
 						double losspower2 = null != wd.getDaynhgzssdl() ? wd.getDaynhgzssdl() : 0.0;
@@ -112,7 +137,7 @@ public class ContrastLnService {
 						w.setDaynhgzssdl(losspower2);
 						w.setDaynhwhssdl(losspower3);
 						w.setDaynhqfdl(losspower4);
-						wdmap.put(wd.getProjectid(), w);
+						wdmap.put(wd.getLineid(), w);
 					}
 				}
 
@@ -125,10 +150,10 @@ public class ContrastLnService {
 					Windpowerinfoday3 wd = entry.getValue();
 					BenchMarkVo vo = new BenchMarkVo();
 
-					if (pjmap.containsKey(wd.getProjectid())) {
-						Project pj = pjmap.get(wd.getProjectid());
-						vo.setPjId(wd.getProjectid());
-						vo.setPjName(pj.getName());
+					if (linemap.containsKey(wd.getLineid())) {
+						Line ln = linemap.get(wd.getLineid());
+						vo.setLnId(ln.getId());
+						vo.setLnName(ln.getName());
 
 					}
 					if (wpmap.containsKey(wd.getWindpowerstationid())) {
@@ -304,11 +329,36 @@ public class ContrastLnService {
 				String[] strs = wpId.split(",");
 				if (strs.length > 0) {
 					for (int i = 0; i < strs.length; i++) {
-						wpids.add(strs[i]);
+						if(InitialRunner.pjsmap.containsKey(strs[i]))
+						{
+							List<Project> pjls=InitialRunner.pjsmap.get(strs[i]);
+							for(Project pj:pjls)
+							{
+								if(InitialRunner.lnsmap.containsKey(strs[i]))
+								{
+									List<Line> lnls=InitialRunner.lnsmap.get(strs[i]);
+									for(Line ln:lnls)
+									{
+										wpids.add(ln.getId());
+									}
+								}
+							}
+						}
 					}
 				}
 			} else {
-				wpids.add(wpId);
+				List<Project> pjls=InitialRunner.pjsmap.get(wpId);
+				for(Project pj:pjls)
+				{
+					if(InitialRunner.lnsmap.containsKey(wpId))
+					{
+						List<Line> lnls=InitialRunner.lnsmap.get(wpId);
+						for(Line ln:lnls)
+						{
+							wpids.add(ln.getId());
+						}
+					}
+				}
 			}
 		}
 
@@ -330,15 +380,17 @@ public class ContrastLnService {
 			ls =windpowerinfoday3Service.getWindpowerinfoday3(lnids, begin, end, "line");
 		} else if (!wpids.isEmpty()) {
 			ls =windpowerinfoday3Service.getWindpowerinfoday3(wpids, begin, end, "windpower");
+		}else  {
+			ls =windpowerinfoday3Service.getWindpowerinfoday3(new ArrayList<>(), begin, end, "line");
 		}
-		// Map<String, Windpowerstation> wpmap = CacheContext.wpmap;
-		Map<String, Project> pjmap = InitialRunner.pjmap;
+
+		Map<String, Line> linemap = InitialRunner.lnmap;
 		Map<String, DataVo> vomap = new HashMap<String, DataVo>();
 		if (!ls.isEmpty()) {
 			for (int i = 0; i < ls.size(); i++) {
 				Windpowerinfoday3 wd = ls.get(i);
-				if (vomap.containsKey(wd.getProjectid())) {
-					DataVo vo = vomap.get(wd.getProjectid());
+				if (vomap.containsKey(wd.getLineid())) {
+					DataVo vo = vomap.get(wd.getLineid());
 					double losspower1 = null != wd.getDaynhxdssdl2() ? wd.getDaynhxdssdl2() : 0.0;
 					double losspower2 = null != wd.getDaynhgzssdl2() ? wd.getDaynhgzssdl2() : 0.0;
 					double losspower3 = null != wd.getDaynhwhssdl2() ? wd.getDaynhwhssdl2() : 0.0;
@@ -351,7 +403,7 @@ public class ContrastLnService {
 					vo.setValue4(vo.getValue4() + losspower4);// 欠发损失
 					vo.setValue5(0.0);// 受累损失
 					vo.setValue6(vo.getValue6() + fdl);// 发电量
-					vomap.put(wd.getProjectid(), vo);
+					vomap.put(wd.getLineid(), vo);
 				} else {
 					DataVo vo = new DataVo();
 
@@ -361,7 +413,7 @@ public class ContrastLnService {
 					vo.setValue4(null != wd.getDaynhqfdl2() ? wd.getDaynhqfdl2() : 0.0);// 欠发损失
 
 					vo.setValue5(0.0);// 受累损失
-					vo.setValue6(null != wd.getDaydl2() ? (new BigDecimal(wd.getDaydl2()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue()) : 0.0);// 发电量
+					vo.setValue6(null != wd.getDaydl2() ? (new BigDecimal(wd.getDaydl2()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0.0);// 发电量
 
 					// vo.setValue7(null != wd.getGridelectricity() ?
 					// wd.getGridelectricity() : 0.0);// 上网电量
@@ -369,19 +421,11 @@ public class ContrastLnService {
 					// wd.getBuyelectricity() : 0.0);// 购网电量
 
 					vo.setTime(DateUtils.truncate(DateUtils.addDays(wd.getRecorddate(), 1)).getTime());
-
-					if (pjmap.containsKey(wd.getProjectid())) {
-						Project pj = pjmap.get(wd.getProjectid());
-						vo.setName(pj.getName());
-
+					if (linemap.containsKey(wd.getLineid())) {
+						Line line = linemap.get(wd.getLineid());
+						vo.setName(line.getName());
 					}
-					// if(wpmap.containsKey(wd.getWindpowerstationid()))
-					// {
-					// Windpowerstation
-					// wp=wpmap.get(wd.getWindpowerstationid());
-					// vo.setName(wp.getName());
-					// }
-					vomap.put(wd.getProjectid(), vo);
+					vomap.put(wd.getLineid(), vo);
 				}
 
 			}
@@ -391,12 +435,12 @@ public class ContrastLnService {
 				// System.out.println(entry.getKey() + "--->" +
 				// entry.getValue());
 				DataVo vo = entry.getValue();
-				vo.setValue1(new BigDecimal(vo.getValue1()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				vo.setValue2(new BigDecimal(vo.getValue2()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				vo.setValue3(new BigDecimal(vo.getValue3()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				vo.setValue4(new BigDecimal(vo.getValue4()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
+				vo.setValue1(new BigDecimal(vo.getValue1()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
+				vo.setValue2(new BigDecimal(vo.getValue2()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
+				vo.setValue3(new BigDecimal(vo.getValue3()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
+				vo.setValue4(new BigDecimal(vo.getValue4()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
 				vo.setValue5(StringUtils.round(vo.getValue5(), 2));
-				vo.setValue6(new BigDecimal(vo.getValue6()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
+				vo.setValue6(new BigDecimal(vo.getValue6()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
 				// vo.setValue7(StringUtils.round(vo.getValue7(), 2));
 				// vo.setValue8(StringUtils.round(vo.getValue8(), 2));
 				vos.add(vo);

+ 33 - 10
src/main/java/com/gyee/frame/service/contrast/ContrastPjService.java

@@ -47,11 +47,25 @@ public class ContrastPjService {
 					String[] strs = wpId.split(",");
 					if (strs.length > 0) {
 						for (int i = 0; i < strs.length; i++) {
-							wpids.add(strs[i]);
+							if(InitialRunner.pjsmap.containsKey(strs[i]))
+							{
+								List<Project> pjls=InitialRunner.pjsmap.get(strs[i]);
+								for(Project pj:pjls)
+								{
+									wpids.add(pj.getId());
+								}
+							}
 						}
 					}
 				} else {
-					wpids.add(wpId);
+					if(InitialRunner.pjsmap.containsKey(wpId))
+					{
+						List<Project> pjls=InitialRunner.pjsmap.get(wpId);
+						for(Project pj:pjls)
+						{
+							wpids.add(pj.getId());
+						}
+					}
 				}
 			}
 
@@ -72,7 +86,9 @@ public class ContrastPjService {
 			if (!pjids.isEmpty()) {
 				ls =windpowerinfoday3Service.getWindpowerinfoday3(pjids, begin, end, "project");
 			} else if (!wpids.isEmpty()) {
-				ls =windpowerinfoday3Service.getWindpowerinfoday3(wpids, begin, end, "windpower");
+				ls =windpowerinfoday3Service.getWindpowerinfoday3(wpids, begin, end, "project");
+			}else {
+				ls =windpowerinfoday3Service.getWindpowerinfoday3(new ArrayList<>(), begin, end, "project");
 			}
 
 			Map<String, Windpowerstation> wpmap = InitialRunner.wpmap;
@@ -315,7 +331,14 @@ public class ContrastPjService {
 					}
 				}
 			} else {
-				wpids.add(wpId);
+				if(InitialRunner.pjsmap.containsKey(wpId))
+				{
+					List<Project> pjls=InitialRunner.pjsmap.get(wpId);
+					for(Project pj:pjls)
+					{
+						wpids.add(pj.getId());
+					}
+				}
 			}
 		}
 
@@ -370,7 +393,7 @@ public class ContrastPjService {
 					vo.setValue4(null != wd.getDaynhqfdl2() ? wd.getDaynhqfdl2() : 0.0);// 欠发损失
 
 					vo.setValue5(0.0);// 受累损失
-					vo.setValue6(null != wd.getDaydl2() ? (new BigDecimal(wd.getDaydl2()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue()) : 0.0);// 发电量
+					vo.setValue6(null != wd.getDaydl2() ? (new BigDecimal(wd.getDaydl2()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue()) : 0.0);// 发电量
 
 					// vo.setValue7(null != wd.getGridelectricity() ?
 					// wd.getGridelectricity() : 0.0);// 上网电量
@@ -400,12 +423,12 @@ public class ContrastPjService {
 				// System.out.println(entry.getKey() + "--->" +
 				// entry.getValue());
 				DataVo vo = entry.getValue();
-				vo.setValue1(new BigDecimal(vo.getValue1()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				vo.setValue2(new BigDecimal(vo.getValue2()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				vo.setValue3(new BigDecimal(vo.getValue3()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
-				vo.setValue4(new BigDecimal(vo.getValue4()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
+				vo.setValue1(new BigDecimal(vo.getValue1()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
+				vo.setValue2(new BigDecimal(vo.getValue2()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
+				vo.setValue3(new BigDecimal(vo.getValue3()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
+				vo.setValue4(new BigDecimal(vo.getValue4()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
 				vo.setValue5(StringUtils.round(vo.getValue5(), 2));
-				vo.setValue6(new BigDecimal(vo.getValue6()).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP).doubleValue());
+				vo.setValue6(new BigDecimal(vo.getValue6()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue());
 				// vo.setValue7(StringUtils.round(vo.getValue7(), 2));
 				// vo.setValue8(StringUtils.round(vo.getValue8(), 2));
 				vos.add(vo);