Commit 727d40d3 authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

parents bfb61503 18c69a38
...@@ -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){
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*;
import com.yeejoin.amos.api.householdapi.face.service.*; import com.yeejoin.amos.api.householdapi.face.service.*;
import com.yeejoin.amos.api.householdapi.face.service.business.*; import com.yeejoin.amos.api.householdapi.face.service.business.*;
import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl; import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.JpStationServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl; import com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl;
import fastjson.JSON; import fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -77,6 +78,20 @@ public class HouseholdTestController { ...@@ -77,6 +78,20 @@ public class HouseholdTestController {
@Autowired @Autowired
private TanYinDataAcquisitionService tanYinDataAcquisitionService; private TanYinDataAcquisitionService tanYinDataAcquisitionService;
@Autowired
private JpStationServiceImpl jpStationService;
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/testInitStation")
@ApiOperation(httpMethod = "GET", value = "测试初始化场站", notes = "测试初始化场站")
public void testInitStation() throws IOException {
jpStationService.initStationValue();
}
/** /**
* 新增户用光伏-厂商API haders * 新增户用光伏-厂商API haders
......
...@@ -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();
} }
...@@ -258,11 +262,15 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -258,11 +262,15 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate); TdHYGFStationMonthGenerateMapper.insert(TdHYGFStationMonthGenerate);
} }
// 户用场站月发电量 // 户用场站月发电量
TdHYGFStationYearGenerate TdHYGFStationYearGenerate = TdHYGFStationYearGenerateMapper List<TdHYGFStationYearGenerate> tdHYGFStationYearGenerateList = TdHYGFStationYearGenerateMapper
.selectOne(new QueryWrapper<TdHYGFStationYearGenerate>() .selectList(new QueryWrapper<TdHYGFStationYearGenerate>()
.eq("third_station_id", jpStation.getThirdStationId()) .eq("third_station_id", jpStation.getThirdStationId())
.eq("month_time", DateUtil.format(today1, "yyyy-MM")) .eq("month_time", DateUtil.format(today1, "yyyy-MM"))
.eq("year", DateUtil.format(today1, "yyyy"))); .eq("year", DateUtil.format(today1, "yyyy")));
TdHYGFStationYearGenerate TdHYGFStationYearGenerate=null;
if(CollectionUtil.isNotEmpty(tdHYGFStationYearGenerateList)){
TdHYGFStationYearGenerate=tdHYGFStationYearGenerateList.get(0);
}
if (org.springframework.util.ObjectUtils.isEmpty(TdHYGFStationYearGenerate)) { if (org.springframework.util.ObjectUtils.isEmpty(TdHYGFStationYearGenerate)) {
TdHYGFStationYearGenerate = new TdHYGFStationYearGenerate(); TdHYGFStationYearGenerate = new TdHYGFStationYearGenerate();
} }
...@@ -287,11 +295,16 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -287,11 +295,16 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
TdHYGFStationYearGenerateMapper.insert(TdHYGFStationYearGenerate); TdHYGFStationYearGenerateMapper.insert(TdHYGFStationYearGenerate);
} }
// 户用场站年发电量 // 户用场站年发电量
TdHYGFStationAllGenerate TdHYGFStationAllGenerate = TdHYGFStationAllGenerateMapper List<TdHYGFStationAllGenerate> tdHYGFStationAllGenerateList = TdHYGFStationAllGenerateMapper
.selectOne(new QueryWrapper<TdHYGFStationAllGenerate>() .selectList(new QueryWrapper<TdHYGFStationAllGenerate>()
.eq("third_station_id", jpStation.getThirdStationId()) .eq("third_station_id", jpStation.getThirdStationId())
.eq("year_time", DateUtil.format(today1, "yyyy")) .eq("year_time", DateUtil.format(today1, "yyyy"))
.eq("year", DateUtil.format(today1, "yyyy"))); .eq("year", DateUtil.format(today1, "yyyy")));
TdHYGFStationAllGenerate TdHYGFStationAllGenerate=null;
if(CollectionUtil.isNotEmpty(tdHYGFStationAllGenerateList)){
TdHYGFStationAllGenerate=tdHYGFStationAllGenerateList.get(0);
}
if (org.springframework.util.ObjectUtils.isEmpty(TdHYGFStationAllGenerate)) { if (org.springframework.util.ObjectUtils.isEmpty(TdHYGFStationAllGenerate)) {
TdHYGFStationAllGenerate = new TdHYGFStationAllGenerate(); TdHYGFStationAllGenerate = new TdHYGFStationAllGenerate();
} }
......
package com.yeejoin.amos.api.householdapi.face.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@Service
public class JpStationServiceImpl {
@Autowired
JpStationMapper jpStationMapper;
@Scheduled(cron = "${dataRequstScheduled.initStation:0 0 0 * * ?}")
@Async
public void initStationValue(){
LambdaUpdateWrapper<JpStation> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(JpStation::getCapacity,0.0)
.set(JpStation::getRealTimePower,0.0)
.set(JpStation::getAccumulatedPower,0.0)
.set(JpStation::getDayGenerate,0.0)
.set(JpStation::getMonthGenerate,0.0)
.set(JpStation::getYearGenerate,0.0)
.set(JpStation::getDayIncome,0.0)
.set(JpStation::getMonthIncome,0.0)
.set(JpStation::getYearIncome,0.0)
.set(JpStation::getCumulativeIncome,0.0)
.set(JpStation::getDayPowerUse,0.0)
.set(JpStation::getMonthPowerUse,0.0)
.set(JpStation::getYearPowerUse,0.0)
.set(JpStation::getRatedPower,0.0);
jpStationMapper.update(null,wrapper);
}
}
...@@ -244,39 +244,61 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -244,39 +244,61 @@ public class SunlightServiceImpl implements SunlightService {
jpStation.setSnCode(sunlightDto.getPs_id().toString());// sncode jpStation.setSnCode(sunlightDto.getPs_id().toString());// sncode
try { try {
Map<String, String> map = sunlightDto.getTotal_capcity(); try {
if (map != null && map.get("unit") != null && !map.get("unit").isEmpty() Map<String, String> map = sunlightDto.getTotal_capcity();
&& !"--".equals(map.get("value"))) { if (map != null && map.get("unit") != null && !map.get("unit").isEmpty()
jpStation.setCapacity(SunlightUtil.zj.get(String.valueOf(map.get("unit"))) && !"--".equals(map.get("value"))) {
* Double.valueOf(String.valueOf(map.get("value"))));// 装机容量 jpStation.setCapacity(SunlightUtil.zj.get(String.valueOf(map.get("unit")))
* Double.valueOf(String.valueOf(map.get("value"))));// 装机容量
}
}catch (Exception e){
jpStation.setCapacity(0.0);
} }
Map<String, String> map1 = sunlightDto.getCurr_power(); try {
if (map1 != null && map1.get("unit") != null && !map1.get("unit").isEmpty() Map<String, String> map1 = sunlightDto.getCurr_power();
&& !"--".equals(map1.get("value"))) { if (map1 != null && map1.get("unit") != null && !map1.get("unit").isEmpty()
jpStation.setRealTimePower(SunlightUtil.GL.get(String.valueOf(map1.get("unit"))) && !"--".equals(map1.get("value"))) {
* Double.valueOf(String.valueOf(map1.get("value"))));// 实时功率 jpStation.setRealTimePower(SunlightUtil.GL.get(String.valueOf(map1.get("unit")))
* Double.valueOf(String.valueOf(map1.get("value"))));// 实时功率
}
}catch (Exception e){
jpStation.setRealTimePower(0.0);
} }
Map<String, String> map2 = sunlightDto.getToday_energy(); try {
if (map2 != null && map2.get("unit") != null && !map2.get("unit").isEmpty() Map<String, String> map2 = sunlightDto.getToday_energy();
&& !"--".equals(map2.get("value"))) { if (map2 != null && map2.get("unit") != null && !map2.get("unit").isEmpty()
jpStation.setDayGenerate(SunlightUtil.fd.get(String.valueOf(map2.get("unit"))) && !"--".equals(map2.get("value"))) {
* Double.valueOf(String.valueOf(map2.get("value"))));// 日发电量 jpStation.setDayGenerate(SunlightUtil.fd.get(String.valueOf(map2.get("unit")))
* Double.valueOf(String.valueOf(map2.get("value"))));// 日发电量
}
}catch (Exception e){
jpStation.setDayGenerate(0.0);
} }
Map<String, String> map3 = sunlightDto.getTotal_energy();
if (map3 != null && map3.get("unit") != null && !map3.get("unit").isEmpty() try {
&& !"--".equals(map3.get("value"))) { Map<String, String> map3 = sunlightDto.getTotal_energy();
jpStation.setAccumulatedPower(SunlightUtil.fd.get(String.valueOf(map3.get("unit"))) if (map3 != null && map3.get("unit") != null && !map3.get("unit").isEmpty()
* Double.valueOf(String.valueOf(map3.get("value"))));// 累计发电量 && !"--".equals(map3.get("value"))) {
jpStation.setAccumulatedPower(SunlightUtil.fd.get(String.valueOf(map3.get("unit")))
* Double.valueOf(String.valueOf(map3.get("value"))));// 累计发电量
}
}catch (Exception e){
jpStation.setAccumulatedPower(0.0);
} }
Map<String, String> map4 = sunlightDto.getToday_income(); try {
if (map4 != null && map4.get("unit") != null && !map4.get("unit").isEmpty() Map<String, String> map4 = sunlightDto.getToday_income();
&& !"--".equals(map4.get("value"))) { if (map4 != null && map4.get("unit") != null && !map4.get("unit").isEmpty()
jpStation.setDayIncome(SunlightUtil.sy.get(String.valueOf(map4.get("unit"))) && !"--".equals(map4.get("value"))) {
* Double.valueOf(String.valueOf(map4.get("value"))));// 日收益 jpStation.setDayIncome(SunlightUtil.sy.get(String.valueOf(map4.get("unit")))
* Double.valueOf(String.valueOf(map4.get("value"))));// 日收益
}
}catch (Exception e){
jpStation.setDayIncome(0.0);
} }
Map<String, String> map5 = sunlightDto.getTotal_income(); Map<String, String> map5 = sunlightDto.getTotal_income();
...@@ -338,7 +360,7 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -338,7 +360,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);
// 获取电站,月发电量 // 获取电站,月发电量
...@@ -473,11 +495,11 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -473,11 +495,11 @@ public class SunlightServiceImpl implements SunlightService {
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
if (listd != null) { if (CollectionUtil.isNotEmpty(listd)) {
this.setJpInverte(listd, jpStation, listdtx); this.setJpInverte(listd, jpStation, listdtx);
} }
if (listd != null) { if (CollectionUtil.isNotEmpty(listdtx)) {
this.collectorDetail(listdtx, jpStation); this.collectorDetail(listdtx, jpStation);
} }
......
...@@ -66,12 +66,12 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi ...@@ -66,12 +66,12 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
# ?????????? # ??????????
dataRequstScheduled.jinlangyun=0 0/40 8 * * dataRequstScheduled.jinlangyun=0 0/40 * * * *
dataRequstScheduled.huawei=0 0/40 8 * * dataRequstScheduled.huawei=0 0/40 * * * *
dataRequstScheduled.keshida=0 0/40 8 * * dataRequstScheduled.keshida=0 0/40 * * * *
dataRequstScheduled.Sunlight=0 0/40 8 * * dataRequstScheduled.Sunlight=0 0/40 * * * *
dataRequstScheduled.GoodWe=0 0/40 8 * * dataRequstScheduled.GoodWe=0 0/40 * * * *
dataRequstScheduled.Sofar=0 0/20 * * * * dataRequstScheduled.Sofar=0 0/20 * * * *
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
and hph.project_address like concat(concat('%',#{map.province}),'%') and hph.project_address like concat(concat('%',#{map.province}),'%')
</if> </if>
GROUP BY hps.peasant_household_id GROUP BY hps.peasant_household_id
ORDER BY hps.rec_date desc ORDER BY hps.peasant_household_id desc
</select> </select>
<select id="getBasicInformation" resultType="java.util.Map"> <select id="getBasicInformation" resultType="java.util.Map">
......
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