Browse Source

修改了天气接口

yang 3 years ago
parent
commit
0dacd07ebc

+ 4 - 6
huimv-farm-environ/src/main/java/com/huimv/environ/eco/controller/WeatherController.java

@@ -41,10 +41,11 @@ public class WeatherController {
 
 
         LambdaQueryWrapper<Farm> wrapper = Wrappers.lambdaQuery();
         LambdaQueryWrapper<Farm> wrapper = Wrappers.lambdaQuery();
 
 
-        wrapper.eq(Farm::getId, farmId);//未删除的阈值
+        wrapper.eq(Farm::getId, farmId);
 
 
         Farm farm = farmMapper.selectOne(wrapper);
         Farm farm = farmMapper.selectOne(wrapper);
 
 
+
         String[] location = farm.getFrontLocation().split(",");
         String[] location = farm.getFrontLocation().split(",");
 
 
         String province = location[0];
         String province = location[0];
@@ -132,10 +133,6 @@ public class WeatherController {
 
 
         Object degree = JSONObject.fromObject(forecastobject01hDetail).get("degree");//当前温度
         Object degree = JSONObject.fromObject(forecastobject01hDetail).get("degree");//当前温度
 
 
-
-
-
-
         Object maxDegree = JSONObject.fromObject(forecastobject24hDetail).get("max_degree");//当天最高温
         Object maxDegree = JSONObject.fromObject(forecastobject24hDetail).get("max_degree");//当天最高温
 
 
         Object minDegree = JSONObject.fromObject(forecastobject24hDetail).get("min_degree");//当天最 低温
         Object minDegree = JSONObject.fromObject(forecastobject24hDetail).get("min_degree");//当天最 低温
@@ -203,9 +200,10 @@ public class WeatherController {
         }
         }
 
 
 
 
-
         WeatherResultEntity weatherResultEntity = new WeatherResultEntity();
         WeatherResultEntity weatherResultEntity = new WeatherResultEntity();
 
 
+        weatherResultEntity.setLocation(farm.getLocation());
+
         weatherResultEntity.setAlarm( alarm.toString());
         weatherResultEntity.setAlarm( alarm.toString());
 
 
         weatherResultEntity.setDegree((String) degree);
         weatherResultEntity.setDegree((String) degree);

+ 2 - 0
huimv-farm-environ/src/main/java/com/huimv/environ/eco/entity/WeatherResultEntity.java

@@ -34,6 +34,8 @@ public class WeatherResultEntity {
     private String humidity ;
     private String humidity ;
     //空气质量
     //空气质量
     private String airQuility ;
     private String airQuility ;
+    //地区
+    private String location ;
     //上传时间
     //上传时间
     private Date sendTime ;
     private Date sendTime ;
     //24 小时 时间
     //24 小时 时间