Commit a3dbdb0c authored by tangwei's avatar tangwei

采集数据修改

parent ea23a769
......@@ -99,9 +99,9 @@ public class GoodWeRequestUtil {
}
}
}
if (jsonArray.size() == 0) {
jsonArray.add(jsonObject);
}
// if (jsonArray.size() == 0) {
// jsonArray.add(jsonObject);
// }
}
return jsonArray;
}
......
......@@ -13,10 +13,10 @@ public class GoodWeConstant {
public static final HashMap<String, String> stationStaus = new HashMap<String, String>() {
{
put("-1", "离线");
put("0", "线");
put("0", "线");
put("1", "在线");
put("2", "离线");
put("-2", "离线");
put("2", "报警");
put("-2", "报警");
}
};
public static final HashMap<String, String> warningStaus = new HashMap<String, String>() {
......@@ -32,6 +32,27 @@ public class GoodWeConstant {
}
};
public static final HashMap<String, String> types = new HashMap<String, String>() {
{
put("0", "家庭户用");
put("1", "工商业屋顶");
put("2", "地面电站");
put("3", "扶贫电站");
put("4", "储能电站");
}
};
public static final HashMap<String, List<String>> errorCodeMap = new HashMap<String, List<String>>() {
{
put("E0", Arrays.asList("漏电流自检异常",
......
......@@ -85,16 +85,16 @@ public class HouseholdTestController {
@PostMapping(value = "/goodweDemo")
@ApiOperation(httpMethod = "POST", value = "固德威示例", notes = "固德威示例")
public void goodweDemo() throws IOException {
// goodWeDataAcquisitionService.stationList();
goodWeDataAcquisitionService.stationList();
// goodWeDataAcquisitionService.stationDetail();
// goodWeDataAcquisitionService.inverAlramInfo();
// goodWeDataAcquisitionService.inverAlramInfo();
// goodWeDataAcquisitionService.inverterList();
// goodWeDataAcquisitionService.inverterDetail();
// goodWeDataAcquisitionService.stationMonthGen();
// goodWeDataAcquisitionService.stationYearGen();
// goodWeDataAcquisitionService.inverterDetail();
goodWeDataAcquisitionService.inverterMonthGen();
goodWeDataAcquisitionService.inverterYearGen();
// goodWeDataAcquisitionService.inverterMonthGen();
// goodWeDataAcquisitionService.inverterYearGen();
}
/**
......@@ -111,8 +111,8 @@ public class HouseholdTestController {
// goLangDataAcquisitionService.collectorList();
// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
// goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
}
......@@ -125,13 +125,13 @@ public class HouseholdTestController {
@PostMapping(value = "/sofarnew")
@ApiOperation(httpMethod = "POST", value = "首航", notes = "首航")
public void sofarnew() throws IOException {
sofarDataAcquisitionService.stationList();
// sofarDataAcquisitionService.stationList();
// goLangDataAcquisitionService.stationDetail();
// goLangDataAcquisitionService.collectorList();
// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
// goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
goLangDataAcquisitionService.inverAlramInfo();
}
/**
......
......@@ -35,5 +35,5 @@ public interface GoodWeDataAcquisitionService {
/**
* @descrption 采集器告警列表数据入库
*/
void inverAlramInfo();
void inverAlramInfo(String stationid);
}
......@@ -109,7 +109,7 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
jpStation.setCapacity(goodWeStationList.getCapacity());
jpStation.setName(goodWeStationList.getStationname());
jpStation.setPrice(0.42);
jpStation.setAddress(goodWeStationList.getAddress());
jpStation.setAddress(goodWeStationList.getLocation());
jpStation.setLatitude(goodWeStationList.getLatitude());
jpStation.setLongitude(goodWeStationList.getLongitude());
jpStation.setUserName(goodWeStationList.getOwner_name()==null?goodWeStationList.getStationname():goodWeStationList.getOwner_name());
......@@ -122,7 +122,8 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
jpStation.setDayIncome(goodWeStationList.getEday_income());
jpStation.setAccumulatedPower(goodWeStationList.getEtotal());
jpStation.setCumulativeIncome(goodWeStationList.getEtotal_income());
jpStation.setType(goodWeStationList.getPowerstation_type());
jpStation.setRecDate(new Date());
if (ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStation.setCreateTime(new Date(goodWeStationList.getCreatedTime()));
......@@ -135,7 +136,7 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
jpStationMapper.updateById(jpStation);
}
this.inverAlramInfo(goodWeStationList.getPowerstation_id());
//增加td 电站区域公司,经销商绑定表
// TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
// eq("third_code",PVProducerInfoEnum.GDW.getCode()).
......@@ -742,15 +743,15 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
}
@Override
@Scheduled(cron = "${dataRequstScheduled.GoodWe}")
public void inverAlramInfo() {
public void inverAlramInfo(String stationid) {
HashMap<String, Object> requestInfo = new HashMap<>();
String today = DateUtil.today();
requestInfo.put("page_index", 1);
requestInfo.put("page_size", 1000);
requestInfo.put("starttime", today + " 00:00:00");
requestInfo.put("endtime", today + " 23:59:59");
requestInfo.put("status", 2);
requestInfo.put("stationid", stationid);
// requestInfo.put("status", 2);
String requstParam = JSON.toJSONString(requestInfo);
List<GoodWeAlarmDto> alarmList = goodWeRequestUtil.getResPonse(GoodWeConstant.alarmListUrl, GoodWeConstant.requestPost, requstParam, GoodWeConstant.resovleRule_data_list, GoodWeAlarmDto.class);
alarmList.forEach(goodWeAlarmDto -> {
......
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