Commit 2dd4708f authored by caotao's avatar caotao

锦浪云-日发电量增加格式转换、入库代码调整

parent 94254d38
...@@ -56,4 +56,5 @@ public class GoLangConstant { ...@@ -56,4 +56,5 @@ public class GoLangConstant {
public static String requestPost = "POST"; public static String requestPost = "POST";
public static String datePattern = "yyyy-MM-dd HH:mm:ss.SSS"; public static String datePattern = "yyyy-MM-dd HH:mm:ss.SSS";
public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern(datePattern); public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern(datePattern);
public static Double kwhToMwh =0.0001 ;
} }
...@@ -56,10 +56,11 @@ public class HouseholdTestController { ...@@ -56,10 +56,11 @@ public class HouseholdTestController {
@ApiOperation(httpMethod = "POST", value = "锦浪云", notes = "锦浪云") @ApiOperation(httpMethod = "POST", value = "锦浪云", notes = "锦浪云")
public void golangnew() throws IOException { public void golangnew() throws IOException {
// goLangDataAcquisitionService.stationList(); // goLangDataAcquisitionService.stationList();
goLangDataAcquisitionService.stationDetail();
// goLangDataAcquisitionService.collectorList(); // goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList(); //// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail(); // goLangDataAcquisitionService.collectorDetail();
goLangDataAcquisitionService.inverterDetail(); // goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo(); // goLangDataAcquisitionService.inverAlramInfo();
} }
} }
...@@ -3,9 +3,11 @@ package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine; ...@@ -3,9 +3,11 @@ package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
@Data @Data
@TableName(value = "td_hygf_day_power" ,autoResultMap = true) @TableName(value = "td_hygf_day_power",autoResultMap = true)
public class HYGFJPDayPower { public class HYGFJPDayPower implements Serializable {
private Long createdTime; private Long createdTime;
private String tationId; private String tationId;
private String hour; private String hour;
......
...@@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit; ...@@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit;
@Service @Service
public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionService { public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionService {
private final String dataRequstScheduled = "0 0/10 * * * *"; private final String dataRequstScheduled = "0 0/10 * * * *";
private final String stationPowerScheduled = "0 0 * * * *";
@Autowired @Autowired
private GolangRequestUtil golangRequestUtil; private GolangRequestUtil golangRequestUtil;
@Autowired @Autowired
...@@ -142,7 +142,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -142,7 +142,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode()); jpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode());
jpStation.setRealTimePower(golangStationDetail.getPower()); jpStation.setRealTimePower(golangStationDetail.getPower());
jpStation.setState(GoLangConstant.intoNetWorkStatus.get(String.valueOf(golangStationDetail.getStationtypenew()))); jpStation.setState(GoLangConstant.intoNetWorkStatus.get(String.valueOf(golangStationDetail.getStationtypenew())));
jpStation.setDayGenerate(golangStationDetail.getDayenergy()); jpStation.setDayGenerate(golangStationDetail.getDayenergy()*GoLangConstant.kwhToMwh);
jpStation.setMonthGenerate(golangStationDetail.getMonthenergy()); jpStation.setMonthGenerate(golangStationDetail.getMonthenergy());
jpStation.setYearGenerate(golangStationDetail.getYearenergy()); jpStation.setYearGenerate(golangStationDetail.getYearenergy());
jpStation.setDayIncome(golangStationDetail.getDayincome()); jpStation.setDayIncome(golangStationDetail.getDayincome());
...@@ -162,16 +162,16 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -162,16 +162,16 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode()); hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis()); hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory); hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(new QueryWrapper<HYGFJPDayPower>(). HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
eq("tation_id", String.valueOf(golangStationDetail.getId())). new QueryWrapper<HYGFJPDayPower>().
eq("tation_id", stationIds.get(i)).
eq("year_month_day", today). eq("year_month_day", today).
eq("hour", hour) eq("hour", hour)
); );
if (ObjectUtils.isEmpty(hygfjpDayPower)) { if (ObjectUtils.isEmpty(hygfjpDayPower)) {
hygfjpDayPower = new HYGFJPDayPower(); hygfjpDayPower = new HYGFJPDayPower();
} }
hygfjpDayPower = new HYGFJPDayPower(); hygfjpDayPower.setTationId(stationIds.get(i));
hygfjpDayPower.setTationId(String.valueOf(golangStationDetail.getId()));
hygfjpDayPower.setHour(hour); hygfjpDayPower.setHour(hour);
hygfjpDayPower.setYearMonthDay(today); hygfjpDayPower.setYearMonthDay(today);
hygfjpDayPower.setPower(golangStationDetail.getPower()); hygfjpDayPower.setPower(golangStationDetail.getPower());
...@@ -346,7 +346,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -346,7 +346,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpInverter.setCollectorSnCode(inverterDetailDto.getCollectorsn()); jpInverter.setCollectorSnCode(inverterDetailDto.getCollectorsn());
jpInverter.setUpdateTime(new Date()); jpInverter.setUpdateTime(new Date());
jpInverter.setCurrentPower(inverterDetailDto.getPac()); jpInverter.setCurrentPower(inverterDetailDto.getPac());
jpInverter.setDayPowerGeneration(inverterDetailDto.getEToday()); jpInverter.setDayPowerGeneration(inverterDetailDto.getEToday()*GoLangConstant.kwhToMwh);
jpInverter.setMonthPowerGeneration(inverterDetailDto.getEMonth()); jpInverter.setMonthPowerGeneration(inverterDetailDto.getEMonth());
jpInverter.setYearPowerGeneration(inverterDetailDto.getEYear()); jpInverter.setYearPowerGeneration(inverterDetailDto.getEYear());
jpInverter.setTotalPowerGeneration(inverterDetailDto.getETotal()); jpInverter.setTotalPowerGeneration(inverterDetailDto.getETotal());
...@@ -436,8 +436,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -436,8 +436,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterHistory.setSnCode(inverterDetailDto.getSn()); hygfjpInverterHistory.setSnCode(inverterDetailDto.getSn());
hygfjpInverterHistory.setThirdCode(PVProducerInfoEnum.JLY.getCode()); hygfjpInverterHistory.setThirdCode(PVProducerInfoEnum.JLY.getCode());
hygfjpInverterHistory.setGenerationHours(inverterDetailDto.getFullHour()); hygfjpInverterHistory.setGenerationHours(inverterDetailDto.getFullHour());
hygfjpInverterHistory.setPowerGeneration(inverterDetailDto.getEToday()); hygfjpInverterHistory.setPowerGeneration(inverterDetailDto.getEToday()*GoLangConstant.kwhToMwh);
SimpleDateFormat format = new SimpleDateFormat(GoLangConstant.datePattern);
if (ObjectUtils.isEmpty(hygfjpInverterHistory.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterHistory.getCreatedTime())) {
hygfjpInverterHistory.setCreatedTime(System.currentTimeMillis()); hygfjpInverterHistory.setCreatedTime(System.currentTimeMillis());
hygfjpInverterHistoryMapper.insert(hygfjpInverterHistory); hygfjpInverterHistoryMapper.insert(hygfjpInverterHistory);
......
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