Commit 5a4cb052 authored by chenzhao's avatar chenzhao

电站整体发电历史问题修复

parent 86c29321
......@@ -51,15 +51,23 @@ public class HouseholdPvApiServiceImpl extends BaseService<HouseholdPvApiDto, Ho
.eq("day_time", DateUtil.format(new Date(), "yyyy-MM-dd"))
.eq("hour", currentTime)
.eq("year_month", DateUtil.format(new Date(), "yyyy-MM")));
Long createdTime = tdHYGFStationDayGenerate.getCreatedTime();
boolean flag= false;
if (ObjectUtils.isEmpty(tdHYGFStationDayGenerate)) {
tdHYGFStationDayGenerate = new TdHYGFStationDayGenerate();
flag= true;
}
BeanUtils.copyProperties(tdHYGFStationMonthGenerate,tdHYGFStationDayGenerate);
tdHYGFStationDayGenerate.setHour(currentTime);
if (tdHYGFStationDayGenerate.getStationState().equals("离线")){
tdHYGFStationDayGenerate.setGenerate(null);
}
if (flag){
tdHYGFStationDayGenerate.setCreatedTime(System.currentTimeMillis());
}else {
tdHYGFStationDayGenerate.setCreatedTime(createdTime);
}
TdHYGFStationDayGenerateMapper.insert(tdHYGFStationDayGenerate);
}
......
......@@ -282,8 +282,13 @@ public class SunlightServiceImpl implements SunlightService {
Map<String, String> map5 = sunlightDto.getTotal_income();
if (map5 != null && map5.get("unit") != null && !map5.get("unit").isEmpty()
&& !"--".equals(map5.get("value"))) {
if (!map5.get("unit").equals("")){
jpStation.setCumulativeIncome(SunlightUtil.sy.get(String.valueOf(map5.get("unit")))
* Double.valueOf(String.valueOf(map5.get("value"))));// 累计收益
}else {
jpStation.setCumulativeIncome(0.0);
}
}
} catch (Exception e) {
......
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