Commit 2dd4708f authored by caotao's avatar caotao

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

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