Commit 66f50370 authored by tangwei's avatar tangwei

增加所属电站信息

parent 70dc4643
...@@ -13,4 +13,12 @@ public class HYGFJPDayPower implements Serializable { ...@@ -13,4 +13,12 @@ public class HYGFJPDayPower implements Serializable {
private String hour; private String hour;
private String yearMonthDay; private String yearMonthDay;
private Double power; private Double power;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -23,4 +23,8 @@ public class HYGFJPInverterWarn implements Serializable { ...@@ -23,4 +23,8 @@ public class HYGFJPInverterWarn implements Serializable {
private String state; private String state;
private String warnId; private String warnId;
private String handlerStatus; private String handlerStatus;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -14,4 +14,8 @@ public class HYGFJPStationPowerHistory implements Serializable { ...@@ -14,4 +14,8 @@ public class HYGFJPStationPowerHistory implements Serializable {
private long time; private long time;
private String thirdStationId; private String thirdStationId;
private String thirdCode; private String thirdCode;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -143,5 +143,11 @@ public class TdHYGFInverterDayGenerate implements Serializable { ...@@ -143,5 +143,11 @@ public class TdHYGFInverterDayGenerate implements Serializable {
private Double income; private Double income;
private Double fullhour; private Double fullhour;
private String name; private String name;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -41,5 +41,10 @@ public class TdHYGFInverterMonthGenerate implements Serializable { ...@@ -41,5 +41,10 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
private Double fullhour; private Double fullhour;
private Double income; private Double income;
private String name; private String name;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -42,5 +42,11 @@ public class TdHYGFInverterTotalGenerate implements Serializable { ...@@ -42,5 +42,11 @@ public class TdHYGFInverterTotalGenerate implements Serializable {
private Double fullhour; private Double fullhour;
private Double income; private Double income;
private String name; private String name;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -42,5 +42,10 @@ public class TdHYGFInverterYearGenerate implements Serializable { ...@@ -42,5 +42,10 @@ public class TdHYGFInverterYearGenerate implements Serializable {
private Double income; private Double income;
private String name; private String name;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -39,5 +39,10 @@ public class TdHYGFStationDayGenerate implements Serializable { ...@@ -39,5 +39,10 @@ public class TdHYGFStationDayGenerate implements Serializable {
* 收益 * 收益
*/ */
private Double income; private Double income;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -39,5 +39,10 @@ public class TdHYGFStationMonthGenerate implements Serializable { ...@@ -39,5 +39,10 @@ public class TdHYGFStationMonthGenerate implements Serializable {
* 收益 * 收益
*/ */
private Double income; private Double income;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -39,5 +39,10 @@ public class TdHYGFStationYearGenerate implements Serializable { ...@@ -39,5 +39,10 @@ public class TdHYGFStationYearGenerate implements Serializable {
* 收益 * 收益
*/ */
private Double income; private Double income;
private String stationName; //名称
private String regionalCompaniesCode; //区域公司code
private String amosCompanyCode; //经销商code
} }
...@@ -209,33 +209,48 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -209,33 +209,48 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
//增加td 电站区域公司,经销商绑定表 // //增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). // TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code", PVProducerInfoEnum.JLY.getCode()). // eq("third_code", PVProducerInfoEnum.JLY.getCode()).
eq("third_station_id", stationIds.get(i))); // eq("third_station_id", stationIds.get(i)));
//判断是否存在 // //判断是否存在
if (ObjectUtils.isEmpty(tdJpStation)) { // if (ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation(); // tdJpStation = new TdJpStation();
} // }
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode()); // tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); // tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId(stationIds.get(i)); // tdJpStation.setThirdStationId(stationIds.get(i));
tdJpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode()); // tdJpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode());
tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0); // tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0);
tdJpStation.setStationName(jpStation.getName()); // tdJpStation.setStationName(jpStation.getName());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) { // if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} else { // } else {
tdJpStation.setCreatedTime(System.currentTimeMillis()); // tdJpStation.setCreatedTime(System.currentTimeMillis());
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} // }
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory(); HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId()); hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
hygfjpStationPowerHistory.setPower(golangStationDetail.getPower()); hygfjpStationPowerHistory.setPower(golangStationDetail.getPower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode()); hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
//新加
hygfjpStationPowerHistory.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpStationPowerHistory.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpStationPowerHistory.setStationName(jpStation.getName());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory); hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne( HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>(). new QueryWrapper<HYGFJPDayPower>().
eq("tation_id", stationIds.get(i)). eq("tation_id", stationIds.get(i)).
...@@ -249,6 +264,12 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -249,6 +264,12 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpDayPower.setHour(hour); hygfjpDayPower.setHour(hour);
hygfjpDayPower.setYearMonthDay(today); hygfjpDayPower.setYearMonthDay(today);
hygfjpDayPower.setPower(golangStationDetail.getPower()); hygfjpDayPower.setPower(golangStationDetail.getPower());
//新加
hygfjpDayPower.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpDayPower.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpDayPower.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis()); hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
hygfjpDayPowerMapper.insert(hygfjpDayPower); hygfjpDayPowerMapper.insert(hygfjpDayPower);
...@@ -270,6 +291,14 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -270,6 +291,14 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate()); tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate());
tdHYGFStationDayGenerate.setFullhour(jpStation.getDayGenerate() / jpStation.getCapacity()); tdHYGFStationDayGenerate.setFullhour(jpStation.getDayGenerate() / jpStation.getCapacity());
tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome()); tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome());
//新加
tdHYGFStationDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationDayGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) {
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate); tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
...@@ -290,6 +319,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -290,6 +319,10 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFStationMonthGenerate.setGenerate(jpStation.getMonthGenerate()); tdHYGFStationMonthGenerate.setGenerate(jpStation.getMonthGenerate());
tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity()); tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity());
tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome()); tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome());
//新加
tdHYGFStationMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationMonthGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) {
tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate); tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate);
...@@ -310,6 +343,11 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -310,6 +343,11 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate()); tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate());
tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity()); tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity());
tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome()); tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome());
//新加
tdHYGFStationYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationYearGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) {
tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
...@@ -649,6 +687,24 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -649,6 +687,24 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterDayGenerate.setIgbtTemp(inverterDetailDto.getInverterTemperature()); tdHYGFInverterDayGenerate.setIgbtTemp(inverterDetailDto.getInverterTemperature());
tdHYGFInverterDayGenerate.setIncome(null); tdHYGFInverterDayGenerate.setIncome(null);
tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code",PVProducerInfoEnum.JLY.getCode()).
eq("third_station_id", String.valueOf(inverterDetailDto.getStationId())));
if(jpStation!=null){
tdHYGFInverterDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterDayGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate); tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate);
//户用场站月发电量 //户用场站月发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -667,7 +723,13 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -667,7 +723,13 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM")); tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration()); tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration());
tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());
//新加
if(jpStation!=null){
tdHYGFInverterMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterMonthGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) {
tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate); tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate);
...@@ -690,6 +752,17 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -690,6 +752,17 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration()); tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration());
tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity());
tdHYGFInverterYearGenerate.setName(jpInverter.getName()); tdHYGFInverterYearGenerate.setName(jpInverter.getName());
//新加
if(jpStation!=null){
tdHYGFInverterYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterYearGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
...@@ -712,7 +785,12 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -712,7 +785,12 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
tdHYGFInverterTotalGenerate.setYear(DateUtil.format(today1, "yyyy")); tdHYGFInverterTotalGenerate.setYear(DateUtil.format(today1, "yyyy"));
tdHYGFInverterTotalGenerate.setGenerate(jpInverter.getYearPowerGeneration()); tdHYGFInverterTotalGenerate.setGenerate(jpInverter.getYearPowerGeneration());
tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity());
//新加
if(jpStation!=null){
tdHYGFInverterTotalGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterTotalGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterTotalGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) {
tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate); tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate);
...@@ -766,6 +844,23 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -766,6 +844,23 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.JLY.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.JLY.getCode());
hygfjpInverterWarn.setTreatment(alarmDto.getAdvice()); hygfjpInverterWarn.setTreatment(alarmDto.getAdvice());
hygfjpInverterWarn.setStartTime(alarmDto.getAlarmBeginTime()); hygfjpInverterWarn.setStartTime(alarmDto.getAlarmBeginTime());
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code", PVProducerInfoEnum.JLY.getCode()).
eq("third_station_id", String.valueOf(String.valueOf(alarmDto.getStationId()))));
if(jpStation!=null){
hygfjpInverterWarn.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName());
}
hygfjpInverterWarn.setRecoverTime(null); hygfjpInverterWarn.setRecoverTime(null);
if (!ObjectUtils.isEmpty(alarmDto.getAlarmEndTime())) { if (!ObjectUtils.isEmpty(alarmDto.getAlarmEndTime())) {
hygfjpInverterWarn.setRecoverTime(alarmDto.getAlarmEndTime()); hygfjpInverterWarn.setRecoverTime(alarmDto.getAlarmEndTime());
......
...@@ -134,25 +134,25 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -134,25 +134,25 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
//增加td 电站区域公司,经销商绑定表 //增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). // TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code",PVProducerInfoEnum.GDW.getCode()). // eq("third_code",PVProducerInfoEnum.GDW.getCode()).
eq("third_station_id", jpStation.getThirdStationId())); // eq("third_station_id", jpStation.getThirdStationId()));
//判断是否存在 // //判断是否存在
if (org.springframework.util.ObjectUtils.isEmpty(tdJpStation)) { // if (org.springframework.util.ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation(); // tdJpStation = new TdJpStation();
} // }
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode()); // tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); // tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId( jpStation.getThirdStationId()); // tdJpStation.setThirdStationId( jpStation.getThirdStationId());
tdJpStation.setThirdCode(PVProducerInfoEnum.GDW.getCode()); // tdJpStation.setThirdCode(PVProducerInfoEnum.GDW.getCode());
tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0); // tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0);
tdJpStation.setStationName(jpStation.getName()); // tdJpStation.setStationName(jpStation.getName());
if (!org.springframework.util.ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) { // if (!org.springframework.util.ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} else { // } else {
tdJpStation.setCreatedTime(System.currentTimeMillis()); // tdJpStation.setCreatedTime(System.currentTimeMillis());
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} // }
...@@ -164,6 +164,13 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -164,6 +164,13 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
hygfjpStationPowerHistory.setPower(jpStation.getRealTimePower()); hygfjpStationPowerHistory.setPower(jpStation.getRealTimePower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode()); hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
//新加
hygfjpStationPowerHistory.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpStationPowerHistory.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpStationPowerHistory.setStationName(jpStation.getName());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory); hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne( HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>(). new QueryWrapper<HYGFJPDayPower>().
...@@ -178,6 +185,12 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -178,6 +185,12 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
hygfjpDayPower.setHour(hour); hygfjpDayPower.setHour(hour);
hygfjpDayPower.setYearMonthDay(today); hygfjpDayPower.setYearMonthDay(today);
hygfjpDayPower.setPower(jpStation.getRealTimePower()); hygfjpDayPower.setPower(jpStation.getRealTimePower());
//新加
hygfjpDayPower.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpDayPower.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpDayPower.setStationName(jpStation.getName());
if (org.springframework.util.ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) { if (org.springframework.util.ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis()); hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
hygfjpDayPowerMapper.insert(hygfjpDayPower); hygfjpDayPowerMapper.insert(hygfjpDayPower);
...@@ -199,6 +212,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -199,6 +212,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate()); tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate());
tdHYGFStationDayGenerate.setFullhour(goodWeStationList.getTo_hour()); tdHYGFStationDayGenerate.setFullhour(goodWeStationList.getTo_hour());
tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome()); tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome());
//新加
tdHYGFStationDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationDayGenerate.setStationName(jpStation.getName());
if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) { if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) {
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate); tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
...@@ -221,6 +238,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -221,6 +238,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity()); tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity());
} }
tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome()); tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome());
//新加
tdHYGFStationMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationMonthGenerate.setStationName(jpStation.getName());
if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) { if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) {
tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate); tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate);
...@@ -241,6 +262,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -241,6 +262,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate()); tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate());
tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity()); tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity());
tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome()); tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome());
//新加
tdHYGFStationYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationYearGenerate.setStationName(jpStation.getName());
if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) { if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) {
tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
...@@ -526,6 +551,22 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -526,6 +551,22 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
tdHYGFInverterDayGenerate.setIncome(null); tdHYGFInverterDayGenerate.setIncome(null);
if(ObjectUtils.isNotEmpty(jpInverter.getCapacity())&&ObjectUtils.isNotEmpty(jpInverter.getDayPowerGeneration())){ if(ObjectUtils.isNotEmpty(jpInverter.getCapacity())&&ObjectUtils.isNotEmpty(jpInverter.getDayPowerGeneration())){
tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());} tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());}
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code",PVProducerInfoEnum.GDW.getCode()).
eq("third_station_id", String.valueOf(jpInverter.getThirdStationId())));
if(jpStation!=null){
tdHYGFInverterDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterDayGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate); tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate);
//户用场站月发电量 //户用场站月发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -543,6 +584,15 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -543,6 +584,15 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
tdHYGFInverterMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd")); tdHYGFInverterMonthGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd"));
tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM")); tdHYGFInverterMonthGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration()); tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration());
//新加
if(jpStation!=null){
tdHYGFInverterMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterMonthGenerate.setStationName(jpStation.getName());
}
if(ObjectUtils.isNotEmpty(jpInverter.getCapacity())&&ObjectUtils.isNotEmpty(jpInverter.getDayPowerGeneration())){ if(ObjectUtils.isNotEmpty(jpInverter.getCapacity())&&ObjectUtils.isNotEmpty(jpInverter.getDayPowerGeneration())){
tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());} tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());}
...@@ -570,6 +620,14 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -570,6 +620,14 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity());
} }
tdHYGFInverterYearGenerate.setName(jpInverter.getName()); tdHYGFInverterYearGenerate.setName(jpInverter.getName());
//新加
if(jpStation!=null){
tdHYGFInverterYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterYearGenerate.setStationName(jpStation.getName());
}
if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
...@@ -594,7 +652,12 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -594,7 +652,12 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
if(ObjectUtils.isNotEmpty(jpInverter.getCapacity())&&ObjectUtils.isNotEmpty(jpInverter.getYearPowerGeneration())) { if(ObjectUtils.isNotEmpty(jpInverter.getCapacity())&&ObjectUtils.isNotEmpty(jpInverter.getYearPowerGeneration())) {
tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity());
} }
//新加
if(jpStation!=null){
tdHYGFInverterTotalGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterTotalGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterTotalGenerate.setStationName(jpStation.getName());
}
if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) { if (org.springframework.util.ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) {
tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate); tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate);
...@@ -683,6 +746,23 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe ...@@ -683,6 +746,23 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.GDW.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.GDW.getCode());
hygfjpInverterWarn.setTreatment(GoodWeConstant.errorCodeMap.get(goodWeAlarmDto.getError_code()).get(2)); hygfjpInverterWarn.setTreatment(GoodWeConstant.errorCodeMap.get(goodWeAlarmDto.getError_code()).get(2));
hygfjpInverterWarn.setStartTime(goodWeAlarmDto.getHappentime().getMillis()); hygfjpInverterWarn.setStartTime(goodWeAlarmDto.getHappentime().getMillis());
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code", PVProducerInfoEnum.GDW.getCode()).
eq("third_station_id", String.valueOf(goodWeAlarmDto.getStationId())));
if(jpStation!=null){
hygfjpInverterWarn.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName());
}
hygfjpInverterWarn.setRecoverTime(null); hygfjpInverterWarn.setRecoverTime(null);
if (!ObjectUtils.isEmpty(goodWeAlarmDto.getRecoverytime())) { if (!ObjectUtils.isEmpty(goodWeAlarmDto.getRecoverytime())) {
hygfjpInverterWarn.setRecoverTime(goodWeAlarmDto.getRecoverytime().getMillis()); hygfjpInverterWarn.setRecoverTime(goodWeAlarmDto.getRecoverytime().getMillis());
......
...@@ -303,25 +303,25 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -303,25 +303,25 @@ public class ImasterDataServiceImpl implements ImasterDataService {
//增加td 电站区域公司,经销商绑定表 //增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). // TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code",PVProducerInfoEnum.HUAWEI.getCode()). // eq("third_code",PVProducerInfoEnum.HUAWEI.getCode()).
eq("third_station_id", imasterStationList.getPlantCode())); // eq("third_station_id", imasterStationList.getPlantCode()));
//判断是否存在 // //判断是否存在
if (ObjectUtils.isEmpty(tdJpStation)) { // if (ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation(); // tdJpStation = new TdJpStation();
} // }
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode()); // tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); // tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId( imasterStationList.getPlantCode()); // tdJpStation.setThirdStationId( imasterStationList.getPlantCode());
tdJpStation.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode()); // tdJpStation.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0); // tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0);
tdJpStation.setStationName(jpStation.getName()); // tdJpStation.setStationName(jpStation.getName());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) { // if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} else { // } else {
tdJpStation.setCreatedTime(System.currentTimeMillis()); // tdJpStation.setCreatedTime(System.currentTimeMillis());
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} // }
...@@ -333,8 +333,21 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -333,8 +333,21 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId()); hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
// hygfjpStationPowerHistory.setPower(imasterStationDetail.getPower()); // hygfjpStationPowerHistory.setPower(imasterStationDetail.getPower());
hygfjpStationPowerHistory.setPower(jpStation.getRealTimePower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode()); hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
//新加
hygfjpStationPowerHistory.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpStationPowerHistory.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpStationPowerHistory.setStationName(jpStation.getName());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory); hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne( HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>(). new QueryWrapper<HYGFJPDayPower>().
...@@ -348,8 +361,11 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -348,8 +361,11 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpDayPower.setTationId(imasterStationList.getPlantCode()); hygfjpDayPower.setTationId(imasterStationList.getPlantCode());
hygfjpDayPower.setHour(hour); hygfjpDayPower.setHour(hour);
hygfjpDayPower.setYearMonthDay(today); hygfjpDayPower.setYearMonthDay(today);
hygfjpDayPower.setPower(active_power); hygfjpDayPower.setPower(active_power);
//新加
hygfjpDayPower.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpDayPower.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpDayPower.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis()); hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
...@@ -372,6 +388,11 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -372,6 +388,11 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate()); tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate());
tdHYGFStationDayGenerate.setFullhour(jpStation.getDayGenerate() / jpStation.getCapacity()); tdHYGFStationDayGenerate.setFullhour(jpStation.getDayGenerate() / jpStation.getCapacity());
tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome()); tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome());
//新加
tdHYGFStationDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationDayGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) {
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate); tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
...@@ -392,6 +413,10 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -392,6 +413,10 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFStationMonthGenerate.setGenerate(jpStation.getMonthGenerate()); tdHYGFStationMonthGenerate.setGenerate(jpStation.getMonthGenerate());
tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity()); tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity());
tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome()); tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome());
//新加
tdHYGFStationMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationMonthGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) {
tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate); tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate);
...@@ -412,6 +437,10 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -412,6 +437,10 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate()); tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate());
tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity()); tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity());
tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome()); tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome());
//新加
tdHYGFStationYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationYearGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) {
tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
...@@ -860,6 +889,18 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -860,6 +889,18 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFInverterDayGenerate.setIgbtTemp(inverterDetailDto.getTemperature()); tdHYGFInverterDayGenerate.setIgbtTemp(inverterDetailDto.getTemperature());
tdHYGFInverterDayGenerate.setIncome(null); tdHYGFInverterDayGenerate.setIncome(null);
tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code",PVProducerInfoEnum.HUAWEI.getCode()).
eq("third_station_id", String.valueOf(jpInverter.getThirdStationId())));
if(jpStation!=null){
tdHYGFInverterDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterDayGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate); tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate);
//户用场站月发电量 //户用场站月发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -878,6 +919,15 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -878,6 +919,15 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration()); tdHYGFInverterMonthGenerate.setGenerate(jpInverter.getDayPowerGeneration());
tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());
tdHYGFInverterMonthGenerate.setName(jpInverter.getName()); tdHYGFInverterMonthGenerate.setName(jpInverter.getName());
//新加
if(jpStation!=null){
tdHYGFInverterMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterMonthGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) {
tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate); tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate);
...@@ -900,6 +950,14 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -900,6 +950,14 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration()); tdHYGFInverterYearGenerate.setGenerate(jpInverter.getMonthPowerGeneration());
tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity());
tdHYGFInverterYearGenerate.setName(jpInverter.getName()); tdHYGFInverterYearGenerate.setName(jpInverter.getName());
//新加
if(jpStation!=null){
tdHYGFInverterYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterYearGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
...@@ -922,7 +980,12 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -922,7 +980,12 @@ public class ImasterDataServiceImpl implements ImasterDataService {
tdHYGFInverterTotalGenerate.setGenerate(jpInverter.getYearPowerGeneration()); tdHYGFInverterTotalGenerate.setGenerate(jpInverter.getYearPowerGeneration());
tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity());
tdHYGFInverterTotalGenerate.setName(jpInverter.getName()); tdHYGFInverterTotalGenerate.setName(jpInverter.getName());
//新加
if(jpStation!=null){
tdHYGFInverterTotalGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterTotalGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterTotalGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) {
tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate); tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate);
...@@ -985,6 +1048,21 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -985,6 +1048,21 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpInverterWarn.setStartTime(alarmDto.getRaiseTime()); hygfjpInverterWarn.setStartTime(alarmDto.getRaiseTime());
hygfjpInverterWarn.setRecoverTime(null); hygfjpInverterWarn.setRecoverTime(null);
hygfjpInverterWarn.setTimeLong(null); hygfjpInverterWarn.setTimeLong(null);
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code", PVProducerInfoEnum.HUAWEI.getCode()).
eq("third_station_id", String.valueOf(alarmDto.getStationCode())));
if(jpStation!=null){
hygfjpInverterWarn.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName());
}
hygfjpInverterWarn.setState(ImasterConstant.alarmstatus.get(alarmDto.getStatus().toString())); hygfjpInverterWarn.setState(ImasterConstant.alarmstatus.get(alarmDto.getStatus().toString()));
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
...@@ -243,26 +243,26 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -243,26 +243,26 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
//增加td 电站区域公司,经销商绑定表 //增加td 电站区域公司,经销商绑定表
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). // TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
eq("third_code",PVProducerInfoEnum.KSOLAR.getCode()). // eq("third_code",PVProducerInfoEnum.KSOLAR.getCode()).
eq("third_station_id", ksolarStation.getStationId())); // eq("third_station_id", ksolarStation.getStationId()));
//判断是否存在 // //判断是否存在
if (ObjectUtils.isEmpty(tdJpStation)) { // if (ObjectUtils.isEmpty(tdJpStation)) {
tdJpStation = new TdJpStation(); // tdJpStation = new TdJpStation();
} // }
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode()); // tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); // tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStation.setThirdStationId( ksolarStation.getStationId()); // tdJpStation.setThirdStationId( ksolarStation.getStationId());
tdJpStation.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode()); // tdJpStation.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0); // tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0);
tdJpStation.setStationName(jpStation.getName()); // tdJpStation.setStationName(jpStation.getName());
//
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) { // if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} else { // } else {
tdJpStation.setCreatedTime(System.currentTimeMillis()); // tdJpStation.setCreatedTime(System.currentTimeMillis());
tdJpStationMapper.insert(tdJpStation); // tdJpStationMapper.insert(tdJpStation);
} // }
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory(); HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
...@@ -270,6 +270,14 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -270,6 +270,14 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
hygfjpStationPowerHistory.setPower(ksolarStation.getPowerInter()); hygfjpStationPowerHistory.setPower(ksolarStation.getPowerInter());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode()); hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
//新加
hygfjpStationPowerHistory.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpStationPowerHistory.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpStationPowerHistory.setStationName(jpStation.getName());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory); hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne( HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>(). new QueryWrapper<HYGFJPDayPower>().
...@@ -284,6 +292,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -284,6 +292,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
hygfjpDayPower.setHour(hour); hygfjpDayPower.setHour(hour);
hygfjpDayPower.setYearMonthDay(today); hygfjpDayPower.setYearMonthDay(today);
hygfjpDayPower.setPower(ksolarStation.getPowerInter()); hygfjpDayPower.setPower(ksolarStation.getPowerInter());
//新加
hygfjpDayPower.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpDayPower.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpDayPower.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis()); hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
hygfjpDayPowerMapper.insert(hygfjpDayPower); hygfjpDayPowerMapper.insert(hygfjpDayPower);
...@@ -308,6 +322,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -308,6 +322,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate()); tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate());
tdHYGFStationDayGenerate.setFullhour(jpStation.getDayGenerate() / jpStation.getCapacity()); tdHYGFStationDayGenerate.setFullhour(jpStation.getDayGenerate() / jpStation.getCapacity());
tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome()); tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome());
//新加
tdHYGFStationDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationDayGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) {
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate); tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
...@@ -328,6 +347,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -328,6 +347,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFStationMonthGenerate.setGenerate(jpStation.getMonthGenerate()); tdHYGFStationMonthGenerate.setGenerate(jpStation.getMonthGenerate());
tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity()); tdHYGFStationMonthGenerate.setFullhour(jpStation.getMonthGenerate() / jpStation.getCapacity());
tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome()); tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome());
//新加
tdHYGFStationMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationMonthGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) {
tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate); tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate);
...@@ -348,6 +372,10 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -348,6 +372,10 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate()); tdHYGFStationYearGenerate.setGenerate(jpStation.getYearGenerate());
tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity()); tdHYGFStationYearGenerate.setFullhour(jpStation.getYearGenerate() / jpStation.getCapacity());
tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome()); tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome());
//新加
tdHYGFStationYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationYearGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) {
tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
...@@ -971,6 +999,21 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -971,6 +999,21 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterDayGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code",PVProducerInfoEnum.KSOLAR.getCode()).
eq("third_station_id", String.valueOf(jpInverter.getThirdStationId())));
if(jpStation!=null){
tdHYGFInverterDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterDayGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate); tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate);
//户用场站月发电量 //户用场站月发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -990,6 +1033,14 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -990,6 +1033,14 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFInverterMonthGenerate.setName(jpInverter.getName()); tdHYGFInverterMonthGenerate.setName(jpInverter.getName());
tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterMonthGenerate.setFullhour(jpInverter.getDayPowerGeneration() / jpInverter.getCapacity());
//新加
if(jpStation!=null){
tdHYGFInverterMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterMonthGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) {
tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate); tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate);
...@@ -1014,6 +1065,14 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1014,6 +1065,14 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterYearGenerate.setFullhour(jpInverter.getMonthPowerGeneration() / jpInverter.getCapacity());
//新加
if(jpStation!=null){
tdHYGFInverterYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterYearGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
...@@ -1036,7 +1095,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1036,7 +1095,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
tdHYGFInverterTotalGenerate.setGenerate(jpInverter.getYearPowerGeneration()); tdHYGFInverterTotalGenerate.setGenerate(jpInverter.getYearPowerGeneration());
tdHYGFInverterTotalGenerate.setFullhour(0.0d); tdHYGFInverterTotalGenerate.setFullhour(0.0d);
tdHYGFInverterTotalGenerate.setName(jpInverter.getName()); tdHYGFInverterTotalGenerate.setName(jpInverter.getName());
//新加
if(jpStation!=null){
tdHYGFInverterTotalGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterTotalGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterTotalGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity()); tdHYGFInverterTotalGenerate.setFullhour(jpInverter.getYearPowerGeneration() / jpInverter.getCapacity());
if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) {
tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis());
...@@ -1327,6 +1391,23 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1327,6 +1391,23 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
hygfjpInverterWarn.setState(KSolarConstant.alarmstatus.get(ksolarAlarmDto.getStatus())); hygfjpInverterWarn.setState(KSolarConstant.alarmstatus.get(ksolarAlarmDto.getStatus()));
hygfjpInverterWarn.setTimeLong(null); hygfjpInverterWarn.setTimeLong(null);
hygfjpInverterWarn.setRecoverTime(null); hygfjpInverterWarn.setRecoverTime(null);
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code", PVProducerInfoEnum.KSOLAR.getCode()).
eq("third_station_id", ksolarAlarmDto.getStationId()));
if(jpStation!=null){
hygfjpInverterWarn.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName());
}
if (StringUtils.isNotBlank(ksolarAlarmDto.getRemoveTime())) { if (StringUtils.isNotBlank(ksolarAlarmDto.getRemoveTime())) {
hygfjpInverterWarn.setRecoverTime(DateUtil.parse(ksolarAlarmDto.getRemoveTime(), DatePattern.NORM_DATETIME_PATTERN).getTime()); hygfjpInverterWarn.setRecoverTime(DateUtil.parse(ksolarAlarmDto.getRemoveTime(), DatePattern.NORM_DATETIME_PATTERN).getTime());
} }
...@@ -1340,6 +1421,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1340,6 +1421,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
hygfjpInverterWarnMapper.insert(hygfjpInverterWarn); hygfjpInverterWarnMapper.insert(hygfjpInverterWarn);
} }
} }
} }
} }
} }
......
...@@ -76,6 +76,10 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -76,6 +76,10 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
private JpCollectorMapper jpCollectorMapper; private JpCollectorMapper jpCollectorMapper;
@Autowired @Autowired
TdJpStationMapper tdJpStationMapper; TdJpStationMapper tdJpStationMapper;
@Autowired
private HYGFJPDayPowerMapper hygfjpDayPowerMapper;
@Override @Override
@Scheduled(cron = "${dataRequstScheduled.Sofar}") @Scheduled(cron = "${dataRequstScheduled.Sofar}")
public void stationList() { public void stationList() {
...@@ -311,29 +315,54 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -311,29 +315,54 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
//增加td 电站区域公司,经销商绑定表 HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). new QueryWrapper<HYGFJPDayPower>().
eq("third_code",PVProducerInfoEnum.SH.getCode()). eq("tation_id", sunlightDto.getId().toString()).
eq("third_station_id", jpStation.getThirdStationId())); eq("year_month_day", today).
//判断是否存在 eq("hour", hour)
if (ObjectUtils.isEmpty(tdJpStation)) { );
tdJpStation = new TdJpStation(); if (ObjectUtils.isEmpty(hygfjpDayPower)) {
hygfjpDayPower = new HYGFJPDayPower();
} }
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode()); hygfjpDayPower.setTationId(sunlightDto.getId().toString());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); hygfjpDayPower.setHour(hour);
tdJpStation.setThirdStationId( jpStation.getThirdStationId()); hygfjpDayPower.setYearMonthDay(today);
tdJpStation.setThirdCode(PVProducerInfoEnum.SH.getCode()); hygfjpDayPower.setPower(jpStation.getRealTimePower());
tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0); //新加
tdJpStation.setStationName(jpStation.getName()); hygfjpDayPower.setAmosCompanyCode(jpStation.getAmosCompanyCode());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) { hygfjpDayPower.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStationMapper.insert(tdJpStation); hygfjpDayPower.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
hygfjpDayPowerMapper.insert(hygfjpDayPower);
} else { } else {
tdJpStation.setCreatedTime(System.currentTimeMillis()); hygfjpDayPowerMapper.insert(hygfjpDayPower);
tdJpStationMapper.insert(tdJpStation);
} }
//增加td 电站区域公司,经销商绑定表
// TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
// eq("third_code",PVProducerInfoEnum.SH.getCode()).
// eq("third_station_id", jpStation.getThirdStationId()));
// //判断是否存在
// if (ObjectUtils.isEmpty(tdJpStation)) {
// tdJpStation = new TdJpStation();
// }
// tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
// tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
// tdJpStation.setThirdStationId( jpStation.getThirdStationId());
// tdJpStation.setThirdCode(PVProducerInfoEnum.SH.getCode());
// tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0);
// tdJpStation.setStationName(jpStation.getName());
// if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
// tdJpStationMapper.insert(tdJpStation);
// } else {
// tdJpStation.setCreatedTime(System.currentTimeMillis());
// tdJpStationMapper.insert(tdJpStation);
// }
//逆变器信信息 //逆变器信信息
...@@ -347,6 +376,11 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -347,6 +376,11 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
//电站报表 //电站报表
//户用场站日发电量 //户用场站日发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -361,6 +395,12 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -361,6 +395,12 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
tdHYGFStationDayGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd")); tdHYGFStationDayGenerate.setDayTime(DateUtil.format(today1, "yyyy-MM-dd"));
tdHYGFStationDayGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM")); tdHYGFStationDayGenerate.setYearMonth(DateUtil.format(today1, "yyyy-MM"));
tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate()); tdHYGFStationDayGenerate.setGenerate(jpStation.getDayGenerate());
//新加
tdHYGFStationDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationDayGenerate.setStationName(jpStation.getName());
tdHYGFStationDayGenerate.setFullhour( tdHYGFStationDayGenerate.setFullhour(
(jpStation.getDayGenerate()==null || jpStation.getCapacity()==null)?null: (jpStation.getDayGenerate()==null || jpStation.getCapacity()==null)?null:
...@@ -397,6 +437,11 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -397,6 +437,11 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
); );
tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome()); tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome());
//新加
tdHYGFStationMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationMonthGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) {
tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate); tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate);
...@@ -421,12 +466,21 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -421,12 +466,21 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
(jpStation.getCapacity()<=0.0?null:jpStation.getYearGenerate()/jpStation.getCapacity()) (jpStation.getCapacity()<=0.0?null:jpStation.getYearGenerate()/jpStation.getCapacity())
); );
tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome()); tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome());
//新加
tdHYGFStationYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationYearGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) {
tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
} else { } else {
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
} }
} }
...@@ -569,7 +623,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -569,7 +623,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
jpInverter.setYearPowerGeneration(jpStation.getYearGenerate()); jpInverter.setYearPowerGeneration(jpStation.getYearGenerate());
jpInverter.setTotalPowerGeneration(jpStation.getAccumulatedPower()); jpInverter.setTotalPowerGeneration(jpStation.getAccumulatedPower());
jpInverter.setThirdStationId(jpStation.getThirdStationId()); jpInverter.setThirdStationId(jpStation.getThirdStationId());
jpInverter.setThirdCode(PVProducerInfoEnum.YG.getCode()); jpInverter.setThirdCode(PVProducerInfoEnum.SH.getCode());
jpInverter.setName(jpStation.getName()); jpInverter.setName(jpStation.getName());
jpInverter.setStationName(jpStation.getName()); jpInverter.setStationName(jpStation.getName());
jpInverter.setAddr(jpStation.getAddress()); jpInverter.setAddr(jpStation.getAddress());
...@@ -625,7 +679,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -625,7 +679,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
} }
jpInverterElectricity.setInverterId(jpInverter.getId()); jpInverterElectricity.setInverterId(jpInverter.getId());
jpInverterElectricity.setSnCode(jpInverter.getSnCode()); jpInverterElectricity.setSnCode(jpInverter.getSnCode());
jpInverterElectricity.setThirdCode(PVProducerInfoEnum.YG.getCode()); jpInverterElectricity.setThirdCode(PVProducerInfoEnum.SH.getCode());
jpInverterElectricity.setThirdStationId(jpInverter.getThirdStationId()); jpInverterElectricity.setThirdStationId(jpInverter.getThirdStationId());
if(i>2){ if(i>2){
...@@ -773,6 +827,22 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -773,6 +827,22 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
(jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null: (jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null:
(jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity())
); );
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code",PVProducerInfoEnum.SH.getCode()).
eq("third_station_id", String.valueOf(jpInverter.getThirdStationId())));
if(jpStation!=null){
tdHYGFInverterDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterDayGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate); tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate);
//户用场站月发电量 //户用场站月发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -794,6 +864,15 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -794,6 +864,15 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
(jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null: (jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null:
(jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity())
); );
//新加
if(jpStation!=null){
tdHYGFInverterMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterMonthGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) {
tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate); tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate);
...@@ -820,6 +899,14 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -820,6 +899,14 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
(jpInverter.getCapacity()<=0.0?null:jpInverter.getMonthPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getMonthPowerGeneration()/jpInverter.getCapacity())
); );
//新加
if(jpStation!=null){
tdHYGFInverterYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterYearGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
......
...@@ -87,7 +87,8 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -87,7 +87,8 @@ public class SunlightServiceImpl implements SunlightService {
@Autowired @Autowired
TdJpStationMapper tdJpStationMapper; TdJpStationMapper tdJpStationMapper;
@Autowired
private HYGFJPDayPowerMapper hygfjpDayPowerMapper;
//td电站信息存储 //td电站信息存储
@Override @Override
@Scheduled(cron = "${dataRequstScheduled.Sunlight}") @Scheduled(cron = "${dataRequstScheduled.Sunlight}")
...@@ -303,28 +304,56 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -303,28 +304,56 @@ public class SunlightServiceImpl implements SunlightService {
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
//增加td 电站区域公司,经销商绑定表 HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). new QueryWrapper<HYGFJPDayPower>().
eq("third_code", PVProducerInfoEnum.YG.getCode()). eq("tation_id",sunlightDto.getPs_id().toString()).
eq("third_station_id", jpStation.getThirdStationId())); eq("year_month_day", today).
//判断是否存在 eq("hour", hour)
if (ObjectUtils.isEmpty(tdJpStation)) { );
tdJpStation = new TdJpStation(); if (ObjectUtils.isEmpty(hygfjpDayPower)) {
hygfjpDayPower = new HYGFJPDayPower();
} }
tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode()); hygfjpDayPower.setTationId(sunlightDto.getPs_id().toString());
tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode()); hygfjpDayPower.setHour(hour);
tdJpStation.setThirdStationId( jpStation.getThirdStationId()); hygfjpDayPower.setYearMonthDay(today);
tdJpStation.setThirdCode( PVProducerInfoEnum.YG.getCode()); hygfjpDayPower.setPower(jpStation.getRealTimePower());
tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0); //新加
tdJpStation.setStationName(jpStation.getName()); hygfjpDayPower.setAmosCompanyCode(jpStation.getAmosCompanyCode());
if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) { hygfjpDayPower.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdJpStationMapper.insert(tdJpStation); hygfjpDayPower.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
hygfjpDayPowerMapper.insert(hygfjpDayPower);
} else { } else {
tdJpStation.setCreatedTime(System.currentTimeMillis()); hygfjpDayPowerMapper.insert(hygfjpDayPower);
tdJpStationMapper.insert(tdJpStation);
} }
//增加td 电站区域公司,经销商绑定表
// TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
// eq("third_code", PVProducerInfoEnum.YG.getCode()).
// eq("third_station_id", jpStation.getThirdStationId()));
// //判断是否存在
// if (ObjectUtils.isEmpty(tdJpStation)) {
// tdJpStation = new TdJpStation();
// }
// tdJpStation.setAmosCompanyCode(jpStation.getAmosCompanyCode());
// tdJpStation.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
// tdJpStation.setThirdStationId( jpStation.getThirdStationId());
// tdJpStation.setThirdCode( PVProducerInfoEnum.YG.getCode());
// tdJpStation.setIsDelete(jpStation.getIsDelete()?1:0);
// tdJpStation.setStationName(jpStation.getName());
// if (!ObjectUtils.isEmpty(tdJpStation.getCreatedTime())) {
// tdJpStationMapper.insert(tdJpStation);
// } else {
// tdJpStation.setCreatedTime(System.currentTimeMillis());
// tdJpStationMapper.insert(tdJpStation);
// }
this.setJpInverte(listd.get(0),jpStation); this.setJpInverte(listd.get(0),jpStation);
} }
...@@ -351,6 +380,11 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -351,6 +380,11 @@ public class SunlightServiceImpl implements SunlightService {
); );
tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome()); tdHYGFStationDayGenerate.setIncome(jpStation.getDayIncome());
//新加
tdHYGFStationDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationDayGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate.getCreatedTime())) {
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate); tdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
...@@ -380,6 +414,16 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -380,6 +414,16 @@ public class SunlightServiceImpl implements SunlightService {
); );
tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome()); tdHYGFStationMonthGenerate.setIncome(jpStation.getMonthIncome());
//新加
tdHYGFStationMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationMonthGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationMonthGenerate.getCreatedTime())) {
tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate); tdHYGFStationMonthGenerateMapper.insert(tdHYGFStationMonthGenerate);
...@@ -404,6 +448,10 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -404,6 +448,10 @@ public class SunlightServiceImpl implements SunlightService {
(jpStation.getCapacity()<=0.0?null:jpStation.getYearGenerate()/jpStation.getCapacity()) (jpStation.getCapacity()<=0.0?null:jpStation.getYearGenerate()/jpStation.getCapacity())
); );
tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome()); tdHYGFStationYearGenerate.setIncome(jpStation.getYearIncome());
//新加
tdHYGFStationYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFStationYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFStationYearGenerate.setStationName(jpStation.getName());
if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFStationYearGenerate.getCreatedTime())) {
tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFStationYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate); tdHYGFStationYearGenerateMapper.insert(tdHYGFStationYearGenerate);
...@@ -639,6 +687,19 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -639,6 +687,19 @@ public class SunlightServiceImpl implements SunlightService {
(jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null: (jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null:
(jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity())
); );
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code",PVProducerInfoEnum.YG.getCode()).
eq("third_station_id", String.valueOf(jpInverter.getThirdStationId())));
if(jpStation!=null){
tdHYGFInverterDayGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterDayGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterDayGenerate.setStationName(jpStation.getName());
}
tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate); tdHYGFInverterDayGenerateMapper.insert(tdHYGFInverterDayGenerate);
//户用场站月发电量 //户用场站月发电量
Date today1 = new Date(); Date today1 = new Date();
...@@ -660,6 +721,16 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -660,6 +721,16 @@ public class SunlightServiceImpl implements SunlightService {
(jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null: (jpInverter.getDayPowerGeneration()==null || jpInverter.getCapacity()==null)?null:
(jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getDayPowerGeneration()/jpInverter.getCapacity())
); );
//新加
if(jpStation!=null){
tdHYGFInverterMonthGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterMonthGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterMonthGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterMonthGenerate.getCreatedTime())) {
tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterMonthGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate); tdHYGFInverterMonthGenerateMapper.insert(tdHYGFInverterMonthGenerate);
...@@ -685,7 +756,12 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -685,7 +756,12 @@ public class SunlightServiceImpl implements SunlightService {
(jpInverter.getMonthPowerGeneration()==null || jpInverter.getCapacity()==null)?null: (jpInverter.getMonthPowerGeneration()==null || jpInverter.getCapacity()==null)?null:
(jpInverter.getCapacity()<=0.0?null:jpInverter.getMonthPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getMonthPowerGeneration()/jpInverter.getCapacity())
); );
//新加
if(jpStation!=null){
tdHYGFInverterYearGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterYearGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterYearGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterYearGenerate.getCreatedTime())) {
tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterYearGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate); tdHYGFInverterYearGenerateMapper.insert(tdHYGFInverterYearGenerate);
...@@ -712,6 +788,16 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -712,6 +788,16 @@ public class SunlightServiceImpl implements SunlightService {
(jpInverter.getYearPowerGeneration()==null || jpInverter.getCapacity()==null)?null: (jpInverter.getYearPowerGeneration()==null || jpInverter.getCapacity()==null)?null:
(jpInverter.getCapacity()<=0.0?null:jpInverter.getYearPowerGeneration()/jpInverter.getCapacity()) (jpInverter.getCapacity()<=0.0?null:jpInverter.getYearPowerGeneration()/jpInverter.getCapacity())
); );
//新加
if(jpStation!=null){
tdHYGFInverterTotalGenerate.setAmosCompanyCode(jpStation.getAmosCompanyCode());
tdHYGFInverterTotalGenerate.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
tdHYGFInverterTotalGenerate.setStationName(jpStation.getName());
}
if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) { if (ObjectUtils.isEmpty(tdHYGFInverterTotalGenerate.getCreatedTime())) {
tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis()); tdHYGFInverterTotalGenerate.setCreatedTime(System.currentTimeMillis());
tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate); tdHYGFInverterTotalGenerateMapper.insert(tdHYGFInverterTotalGenerate);
...@@ -790,6 +876,25 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -790,6 +876,25 @@ public class SunlightServiceImpl implements SunlightService {
hygfjpInverterWarn.setRecoverTime(null); hygfjpInverterWarn.setRecoverTime(null);
hygfjpInverterWarn.setTimeLong(null); hygfjpInverterWarn.setTimeLong(null);
hygfjpInverterWarn.setWarnId(sunlightWarm.getFault_code()); hygfjpInverterWarn.setWarnId(sunlightWarm.getFault_code());
//电站区域经销商,
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code", PVProducerInfoEnum.YG.getCode()).
eq("third_station_id", sunlightWarm.getPs_id().toString()));
if(jpStation!=null){
hygfjpInverterWarn.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpInverterWarn.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpInverterWarn.setStationName(jpStation.getName());
}
try { try {
TimeUnit.MINUTES.sleep(1); TimeUnit.MINUTES.sleep(1);
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
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