Commit 672698f3 authored by caotao's avatar caotao

户用光伏数据采集新灌入月、年发电量

parent 863a80ff
......@@ -172,6 +172,7 @@ public class GoodWeConstant {
public static String stationListUrl = "/api/OpenApi/GetUserPowerStation";
public static String stationListStatusUrl = "/api/OpenApi/QueryPowerStationMonitor";
public static String stationDetailUrl = "/api/OpenApi/GetPowerStationMonitorDetail";
public static String stationGenUrl = "/api/OpenApi/GetPowerStationPower";
public static String collectorListUrl = "/v1/api/collectorList";
public static String collectorDetailUrl = "/v1/api/collectorDetail";
public static String queryInventerUrl = "/api/OpenApi/QueryInventers";
......
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class GoodWEGenStation {
private String date;
private String power;
private String income;
}
......@@ -9,6 +9,9 @@ public interface GoodWeDataAcquisitionService {
* @descrption 场站详情数据入库
*/
void stationDetail();
void stationMonthGen();
void stationYearGen();
/**
* @descrption 采集器列表数据入库
*/
......@@ -25,6 +28,10 @@ public interface GoodWeDataAcquisitionService {
* @descrption 逆变器详情数据入库
*/
void inverterDetail();
void inverterMonthGen();
void inverterYearGen();
/**
* @descrption 采集器告警列表数据入库
*/
......
......@@ -104,12 +104,6 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
jpStation.setState(GoodWeConstant.stationStaus.get(goodWeStationList.getStatus()));
jpStation.setDayGenerate(goodWeStationList.getEday());
jpStation.setDayIncome(goodWeStationList.getEday_income());
jpStation.setMonthGenerate(goodWeStationList.getEmonth());
if(ObjectUtils.isNotEmpty(goodWeStationList.getEmonth())){
jpStation.setMonthIncome(goodWeStationList.getEmonth()*jpStation.getPrice());
}
jpStation.setYearGenerate(0.0);
jpStation.setYearIncome(0.0);
jpStation.setAccumulatedPower(goodWeStationList.getEtotal());
jpStation.setCumulativeIncome(goodWeStationList.getEtotal_income());
if(ObjectUtils.isEmpty(jpStation.getSequenceNbr())){
......@@ -242,10 +236,58 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
}
});
}
@Override
public void stationMonthGen() {
List<String> stationIds = goodWeStationMonitorListMapper.getStationIds();
stationIds.forEach(stationId ->{
String currentMonth = DateUtil.format(new Date(),"yyyyMM");
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("id",stationId);
requestInfo.put("date",DateUtil.today());
requestInfo.put("count",0);
requestInfo.put("type",1);
String requstParam = JSON.toJSONString(requestInfo);
List<GoodWEGenStation> goodWEGenStations =goodWeRequestUtil.getResPonse(GoodWeConstant.stationGenUrl, GoodWeConstant.requestPost, requstParam, GoodWeConstant.resovleRule_data, GoodWEGenStation.class);
List<GoodWEGenStation> currentMonthGenStations = goodWEGenStations.stream().filter(goodWEGenStation -> goodWEGenStation.getDate().equals(currentMonth)).collect(Collectors.toList());
currentMonthGenStations.forEach(goodWEGenStation -> {
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.GDW.getCode()).eq("third_station_id",stationId));
if(ObjectUtils.isNotEmpty(jpStation)){
jpStation.setMonthGenerate(Double.parseDouble(goodWEGenStation.getPower()));
jpStation.setMonthIncome(jpStation.getMonthGenerate()*0.42);
jpStationMapper.updateById(jpStation);
}
});
});
}
@Override
public void stationYearGen() {
List<String> stationIds = goodWeStationMonitorListMapper.getStationIds();
stationIds.forEach(stationId ->{
String currentYear = DateUtil.format(new Date(),"yyyy");
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("id",stationId);
requestInfo.put("date",DateUtil.today());
requestInfo.put("count",0);
requestInfo.put("type",2);
String requstParam = JSON.toJSONString(requestInfo);
List<GoodWEGenStation> goodWEGenStations =goodWeRequestUtil.getResPonse(GoodWeConstant.stationGenUrl, GoodWeConstant.requestPost, requstParam, GoodWeConstant.resovleRule_data, GoodWEGenStation.class);
List<GoodWEGenStation> currentMonthGenStations = goodWEGenStations.stream().filter(goodWEGenStation -> goodWEGenStation.getDate().equals(currentYear)).collect(Collectors.toList());
currentMonthGenStations.forEach(goodWEGenStation -> {
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().eq("third_code", PVProducerInfoEnum.GDW.getCode()).eq("third_station_id",stationId));
if(ObjectUtils.isNotEmpty(jpStation)){
jpStation.setYearGenerate(Double.parseDouble(goodWEGenStation.getPower()));
jpStation.setYearIncome(jpStation.getYearGenerate()*0.42);
jpStationMapper.updateById(jpStation);
}
});
});
}
@Override
public void collectorList() {
}
......@@ -309,6 +351,16 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
}
@Override
public void inverterMonthGen() {
}
@Override
public void inverterYearGen() {
}
@Override
public void inverAlramInfo() {
HashMap<String, Object> requestInfo = new HashMap<>();
String today = DateUtil.today();
......
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