Commit 5fd9d6dc authored by hezhuozhi's avatar hezhuozhi

优化电站监控

parent e61875a4
...@@ -102,6 +102,9 @@ public class GolangRequestUtil { ...@@ -102,6 +102,9 @@ public class GolangRequestUtil {
JSONObject page = data.getJSONObject("page"); JSONObject page = data.getJSONObject("page");
responePages = page.getInteger("pages"); responePages = page.getInteger("pages");
} }
if(Objects.isNull(responePages)){
responePages=0;
}
if (responePages <= pageNo){ if (responePages <= pageNo){
break; break;
} else { } else {
......
...@@ -96,7 +96,7 @@ public class GoodWeRequestUtil { ...@@ -96,7 +96,7 @@ public class GoodWeRequestUtil {
//处理其他页数的数据 //处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone); JSONObject responeJSON = JSONObject.parseObject(respone);
JSONObject data = responeJSON.getJSONObject("data"); JSONObject data = responeJSON.getJSONObject("data");
Integer record = data.getInteger("record"); Integer record = data.getInteger("record") == null ? 0:data.getInteger("record");
Integer pageSize= requestInfo.get("page_size")==null || (Integer)requestInfo.get("page_size")==0? 1:(Integer)requestInfo.get("page_size"); Integer pageSize= requestInfo.get("page_size")==null || (Integer)requestInfo.get("page_size")==0? 1:(Integer)requestInfo.get("page_size");
Integer responePages=(record/pageSize)+1; Integer responePages=(record/pageSize)+1;
if (responePages <= pageNo){ if (responePages <= pageNo){
......
...@@ -131,7 +131,7 @@ public class SofarRequestUtil { ...@@ -131,7 +131,7 @@ public class SofarRequestUtil {
thirdStationLogService.saveLog(hygfThirdStationLog); thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据 //处理其他页数的数据
JSONObject responeJSON = JSONObject.parseObject(respone); JSONObject responeJSON = JSONObject.parseObject(respone);
Integer total = responeJSON.getInteger("total"); Integer total = responeJSON.getInteger("total")==null ? 0:responeJSON.getInteger("total");
Integer pageSize= requestInfo.get("size")==null || (Integer)requestInfo.get("size")==0? 1:(Integer)requestInfo.get("size"); Integer pageSize= requestInfo.get("size")==null || (Integer)requestInfo.get("size")==0? 1:(Integer)requestInfo.get("size");
Integer responePages=(total/pageSize)+1; Integer responePages=(total/pageSize)+1;
if (responePages <= pageNo){ if (responePages <= pageNo){
......
...@@ -253,7 +253,7 @@ public class SunlightUtil { ...@@ -253,7 +253,7 @@ public class SunlightUtil {
hygfThirdStationLog.setResBody(res); hygfThirdStationLog.setResBody(res);
thirdStationLogService.saveLog(hygfThirdStationLog); thirdStationLogService.saveLog(hygfThirdStationLog);
//处理其他页数的数据 //处理其他页数的数据
Integer rowCount = resultData.getInt("rowCount"); Integer rowCount = resultData.getInt("rowCount") ==null ? 0: resultData.getInt("rowCount");
Integer pageSize= bodyparam.get("size")==null || (Integer)bodyparam.get("size")==0? 1:(Integer)bodyparam.get("size"); Integer pageSize= bodyparam.get("size")==null || (Integer)bodyparam.get("size")==0? 1:(Integer)bodyparam.get("size");
Integer responePages=(rowCount/pageSize)+1; Integer responePages=(rowCount/pageSize)+1;
if (responePages <= pageNo){ if (responePages <= pageNo){
......
...@@ -123,9 +123,13 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -123,9 +123,13 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
BeanUtil.copyProperties(goodWeStationMonitorDto, goodWeStationList); BeanUtil.copyProperties(goodWeStationMonitorDto, goodWeStationList);
goodWeStationList.setCreatedTime(System.currentTimeMillis()); goodWeStationList.setCreatedTime(System.currentTimeMillis());
goodWeStationMonitorListMapper.insert(goodWeStationList); goodWeStationMonitorListMapper.insert(goodWeStationList);
JpStation jpStation = jpStationMapper List<JpStation> jpStationList = jpStationMapper
.selectOne(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.GDW.getCode()) .selectList(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.GDW.getCode())
.eq("third_station_id", goodWeStationList.getPowerstation_id())); .eq("third_station_id", goodWeStationList.getPowerstation_id()));
JpStation jpStation=null;
if(CollectionUtil.isNotEmpty(jpStationList)){
jpStation=jpStationList.get(0);
}
if (ObjectUtils.isEmpty(jpStation)) { if (ObjectUtils.isEmpty(jpStation)) {
jpStation = new JpStation(); jpStation = new JpStation();
} }
......
...@@ -338,7 +338,7 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -338,7 +338,7 @@ public class SunlightServiceImpl implements SunlightService {
bodyparamjp.put("size", 3000); bodyparamjp.put("size", 3000);
bodyparamjp.put("curPage", 1); bodyparamjp.put("curPage", 1);
bodyparamjp.put("device_type_list", lif); bodyparamjp.put("device_type_list", lif);
JSONObject jsonObject1data = SunlightUtil.getDataList(SunlightUtil.getDeviceList, bodyparamjp); JSONObject jsonObject1data = SunlightUtil.getdata(SunlightUtil.getDeviceList, bodyparamjp);
List<Device> listd = JSONArray.parseArray(JSON.toJSONString(jsonObject1data.get("pageList")), Device.class); List<Device> listd = JSONArray.parseArray(JSON.toJSONString(jsonObject1data.get("pageList")), Device.class);
// 获取电站,月发电量 // 获取电站,月发电量
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment