소스 검색

修正沙盘主页和功能页面

shilin 3 년 전
부모
커밋
0dbd14f4e9

+ 9 - 5
src/main/java/com/gyee/frame/controller/monitor/GenreSetPushController.java

@@ -330,15 +330,19 @@ public class GenreSetPushController {
 
     public AjaxResult getForecastwindspeedInfo(String wpId) throws Exception {
 
-
+        Map<String,Object> map=new HashMap<>();
         List<DataVo> retValue = new ArrayList<>();
-
+        List<String> datels=new ArrayList<>();
 
         retValue = forecastwindspeedService.getForecastwindspeedInfo(wpId);
-        if (null!=retValue){
-            return AjaxResult.successData(AjaxStatus.success.code, retValue);
+        datels = forecastwindspeedService.getDayInfo();
+
+        map.put("retValue",retValue);
+        map.put("datels",datels);
+        if (null!=map){
+            return AjaxResult.successData(AjaxStatus.success.code, map);
         } else {
-            return AjaxResult.successData(AjaxStatus.error.code, retValue);
+            return AjaxResult.successData(AjaxStatus.error.code, map);
         }
 
     }

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

@@ -277,7 +277,7 @@ public class ForecastwindspeedService  {
 		return vos;
 	}
 
-	public List<String> getDayInfo(String wpId)
+	public List<String> getDayInfo()
 	{
 		List<String> vos=new ArrayList<>();
 		Calendar cal = Calendar.getInstance();

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

@@ -179,7 +179,7 @@ public class WeatherService  {
 						if(StringUtils.notEmp(wind.getDeg()))
 						{
 							double fx=wind.getDeg();
-							if(fx<= 11.25 && fx>= 348.76)
+							if(fx<= 11.25 || fx>= 348.76)
 							{
 								//风向
 								map.put("fx","北");

+ 10 - 4
src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -1311,8 +1311,14 @@ public class GenreSetPushService {
         List<PointData> rfdls = realApiUtil.getHistoryDatasSnap(rfdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
         List<PointData> swdls = realApiUtil.getHistoryDatasSnap(swdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
         List<PointData> gwdls = realApiUtil.getHistoryDatasSnap(gwdlai, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
-        List<PointData> ssfss = realApiUtil.getHistoryDatasSnap(ssfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
-
+        List<PointData> ssfss =null;
+        if(wpId.equals("PL_GDC"))
+        {
+            ssfss = realApiUtil.getHistoryDatasSnap("PLGGL.NX_GD_PLG_YC_P1_L1_001_QXZ0001", beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
+        }else
+        {
+            ssfss = realApiUtil.getHistoryDatasSnap(ssfs, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, 86400L);
+        }
         if (!rfdls.isEmpty() && !swdls.isEmpty() && !gwdls.isEmpty()
                 && rfdls.size() == swdls.size() && rfdls.size() == gwdls.size()
         ) {
@@ -1328,13 +1334,13 @@ public class GenreSetPushService {
                 // vo.setTime(dateformat.parse(entry.getKey()).getTime());
 
                 if (i + 1 <= today) {
-                    vo.setTimestr(i + 1 + "");
+                    vo.setTimestr(i + 1 + "");
                     vo.setValue1(StringUtils.round(rfdls.get(i).getPointValueInDouble(), 2));// 日发电量
                     vo.setValue2(StringUtils.round(swdls.get(i).getPointValueInDouble(), 2));// 上网电量
                     vo.setValue3(StringUtils.round(gwdls.get(i).getPointValueInDouble(), 2));// 购网电量
                     vo.setSpeed(StringUtils.round(ssfss.get(i).getPointValueInDouble(), 2));
                 } else {
-                    vo.setTimestr("");
+                    vo.setTimestr(i + 1 + "");
                     vo.setValue1(0.0);// 日发电量
                     vo.setValue2(0.0);// 上网电量
                     vo.setValue3(0.0);// 购网电量

+ 2 - 3
src/test/java/test/GenreSetPushTest.java

@@ -3,11 +3,10 @@ package test;
 import com.gyee.SpringbootStart;
 import com.gyee.frame.common.spring.SpringUtils;
 import com.gyee.frame.controller.monitor.GenreSetPushController;
-import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.service.websocket.GenreSetPushService;
 import org.springframework.boot.SpringApplication;
 
-import java.util.List;
+import java.util.Map;
 
 public class GenreSetPushTest {
 
@@ -40,7 +39,7 @@ public class GenreSetPushTest {
 //        map.put(GF, genreSetPushService.findBasicDataInfo(GF));
 
 
-        List<DataVo> map = genreSetPushService.findPowerWpChart("PL_GDC");
+        Map<String, Object> map = genreSetPushController.getForecastwindspeedInfo("0");
 
          System.out.println(map.size());