Browse Source

单机信息总览线路明细功率曲线接口

shilin 3 years ago
parent
commit
979539a030

+ 2 - 2
src/main/java/com/gyee/frame/service/ActivePowerDataService.java

@@ -92,7 +92,7 @@ public class ActivePowerDataService implements BaseService<ActivePowerData, Acti
 		return activePowerDataMapper.deleteByExample(example);
 	}
 
-	public List<StatisticalAnalysisRnewTopVo> getStatisticalAnalysisRnewTopVoList(List<String> wpIds, Date beginDate, Date endDate)  {
+	public List<StatisticalAnalysisRnewTopVo> getStatisticalAnalysisRnewTopVoList(String wpIds, Date beginDate, Date endDate)  {
 
 
 		List<StatisticalAnalysisRnewTopVo> list =new ArrayList<>();
@@ -105,7 +105,7 @@ public class ActivePowerDataService implements BaseService<ActivePowerData, Acti
 
 		if(StringUtils.isNotEmpty(wpIds))
 		{
-			criteria.andWindpowerstationidIn(wpIds);
+			criteria.andWindpowerstationidEqualTo(wpIds);
 		}
 
 

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

@@ -3,8 +3,10 @@ package com.gyee.frame.service;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.WindturbinecurvefittingmonthMapper;
+import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.auto.Windturbinecurvefittingmonth;
 import com.gyee.frame.model.auto.WindturbinecurvefittingmonthExample;
 import com.gyee.frame.model.custom.Tablepar;
@@ -157,7 +159,7 @@ public class WindturbinecurvefittingmonthService implements BaseService<Windturb
 
 	}
 
-	public List<Windturbinecurvefittingmonth> getWindturbinecurvefittingmonthList(Date endDate)  {
+	public List<Windturbinecurvefittingmonth> getWindturbinecurvefittingmonthList(String wpIps,Date endDate)  {
 
 
 		List<Windturbinecurvefittingmonth> list =new ArrayList<>();
@@ -168,6 +170,19 @@ public class WindturbinecurvefittingmonthService implements BaseService<Windturb
 		WindturbinecurvefittingmonthExample.Criteria criteria =example.createCriteria();
 
 
+		if(StringUtils.notEmp(wpIps))
+		{
+			if(InitialRunner.wp_wtmap.containsKey(wpIps))
+			{
+				List<Windturbine> ls=InitialRunner.wp_wtmap.get(wpIps);
+				List<String> wtls=new ArrayList<>();
+				for (Windturbine wt : ls) {
+					wtls.add(wt.getId());
+				}
+				criteria.andWindturbineidIn(wtls);
+			}
+
+		}
 		Calendar c= Calendar.getInstance();
 		c.setTime(endDate);
 
@@ -176,6 +191,8 @@ public class WindturbinecurvefittingmonthService implements BaseService<Windturb
 		criteria.andYearEqualTo(String.valueOf(year));
 		criteria.andMonthEqualTo(String.valueOf(month));
 
+
+
 		list= windturbinecurvefittingmonthMapper.selectByExample(example);
 
 

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

@@ -996,15 +996,24 @@ public class Windturbineinfoday3Service implements BaseService<Windturbineinfoda
             Windturbineinfoday3Example example = new Windturbineinfoday3Example();
             example.setOrderByClause("recorddate DESC");
 
+            Windturbineinfoday3Example.Criteria criteria =example.createCriteria();
+
             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<>();
+                criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
+
+            }
+            if(StringUtils.notEmp(wpId))
+            {
+                criteria.andWindpowerstationidEqualTo(wpId);
+
             }
 
+            criteria.andWindpowerstationidLike("%FDC");
+
+            ls = windturbineinfoday3Mapper.selectByExample(example);
+
             Map<String, Windturbineinfoday3> map = new TreeMap<String, Windturbineinfoday3>();
             switch (type) {
                 case "0":

+ 18 - 18
src/main/java/com/gyee/frame/service/leaderboard/LeaderboardService.java

@@ -44,23 +44,23 @@ public class LeaderboardService {
 
     public List<StatisticalAnalysisTopVo> getRnewTopDate(String wpIps, Date beginDate, Date endDate) {
 
-        List<String> wpls=new ArrayList<>();
-        if (StringUtils.empty(wpIps)) {
-
-            for (Windpowerstation wp : InitialRunner.wpls) {
-                if(wp.getId().endsWith("FDC"))
-                {
-                    wpls.add(wp.getId());
-                }
-
-            }
-
-        } else {
-            wpls.add(wpIps);
-        }
-        List<StatisticalAnalysisRnewTopVo> list =activePowerDataService.getStatisticalAnalysisRnewTopVoList(wpls,beginDate, endDate);
-
-        List<Windturbinecurvefittingmonth> windturbineList=windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(endDate);
+//        List<String> wpls=new ArrayList<>();
+//        if (StringUtils.empty(wpIps)) {
+//
+//            for (Windpowerstation wp : InitialRunner.wpls) {
+//                if(wp.getId().endsWith("FDC"))
+//                {
+//                    wpls.add(wp.getId());
+//                }
+//
+//            }
+//
+//        } else {
+//            wpls.add(wpIps);
+//        }
+        List<StatisticalAnalysisRnewTopVo> list =activePowerDataService.getStatisticalAnalysisRnewTopVoList(wpIps,beginDate, endDate);
+
+        List<Windturbinecurvefittingmonth> windturbineList=windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wpIps,endDate);
 
         Map<String, Map<Double, Windturbinecurvefittingmonth>> res = new HashMap<String, Map<Double,Windturbinecurvefittingmonth>>();
         Map<Double, Windturbinecurvefittingmonth> map = null;
@@ -260,7 +260,7 @@ public class LeaderboardService {
     public List<Windturbineinfoday3> lossList(Tablepar tablepar, String wpIds, Date beginDate, Date endDate, String type)  {
         List<Windturbineinfoday3> ls=new ArrayList<>();
 
-        if (StringUtils.notEmp(wpIds) && StringUtils.notEmp(type) &&  StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+        if ( StringUtils.notEmp(type) &&  StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
 
             ls = windturbineinfoday3Service.lossList(tablepar, wpIds, beginDate, endDate, type);

+ 7 - 7
src/main/resources/application-dev.yml

@@ -7,14 +7,14 @@ spring:
     druid:
      #主库数据源
      master:
-        url: jdbc:mysql://localhost:3306/springbootv2?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
-        username: root
-        password: 123456
+#        url: jdbc:mysql://localhost:3306/springbootv2?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC&zeroDateTimeBehavior=convertToNull
+#        username: root
+#        password: 123456
 
-#        url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd49.4.78.143
-#        username: nxfdprod
-#        password: gdnxfd123
-#        driver-class-name: oracle.jdbc.driver.OracleDriver
+        url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
+        username: nxfdprod
+        password: gdnxfd123
+        driver-class-name: oracle.jdbc.driver.OracleDriver
 
      #备数据源 #关闭
      slave:

+ 1 - 1
src/main/resources/application.yml

@@ -109,7 +109,7 @@ spring :
 #    cache-enabled: false
 #pagehelper分页插件
 pagehelper:
-    helperDialect: mysql
+    helperDialect: oracle
     reasonable: true
     supportMethodsArguments: true
     params: count=countSql