diff --git a/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java b/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java index 36a5ef0..789a74f 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java +++ b/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java @@ -36,7 +36,7 @@ public class StationRemoteControl implements Serializable { private String intranetIp; @ApiModelProperty(value = "ems页面类型") - private Integer type; + private String type; @JsonFormat(pattern = CommonConstant.DATE) @ApiModelProperty(value = "创建时间") diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java index 0461a99..aa827d2 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/OpenStationServiceImpl.java @@ -159,9 +159,10 @@ public class OpenStationServiceImpl implements OpenStationService { BigDecimal totalReleaseMppt = vo.getTotalRelease() == null ? BigDecimal.ZERO : vo.getTotalRelease().getValue(); BigDecimal pvDailyReleaseStart = vo.getPvDailyReleaseStart() == null ? BigDecimal.ZERO : vo.getPvDailyReleaseStart().getValue(); BigDecimal dailyReleaseElecMppt = totalReleaseMppt.subtract(pvDailyReleaseStart); - pvActivePower.add(pvActivePowerMppt); - totalRelease.add(totalReleaseMppt); - dailyReleaseElec.add(dailyReleaseElecMppt); + dailyReleaseElecMppt = dailyReleaseElecMppt.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:dailyReleaseElecMppt; + pvActivePower = pvActivePower.add(pvActivePowerMppt); + totalRelease = totalRelease.add(totalReleaseMppt); + dailyReleaseElec = dailyReleaseElec.add(dailyReleaseElecMppt); } } } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java index b1b22a6..2db351d 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/StationHomeServiceImpl.java @@ -822,13 +822,16 @@ public class StationHomeServiceImpl implements StationHomeService { data.setDailyReleaseElec(pv.getDailyReleaseElec()); //计算累计发电量 BigDecimal totalReleaseElec = elecMeterValueService.selectSumValue(station.getId(),DeviceTypeConstant.ELEC_METER_VALUE_TYPE.PV_CHARGE,null); + totalReleaseElec = totalReleaseElec.add(pv.getDailyReleaseElec()); data.setTotalReleaseElec(totalReleaseElec); //今日收益 String key = RedisKeyConstant.PV.STATION_PV_TODAY_PROFIT + station.getId(); BigDecimal todayIncone = (BigDecimal)redisService.get(key); + todayIncone = todayIncone==null?BigDecimal.ZERO:todayIncone; data.setTodayIncone(todayIncone); //累计收益 BigDecimal totalIncome = earningsCalculateMpptService.countAllPvIncome(station.getId(),null,null); + totalIncome = totalIncome.add(todayIncone); data.setTotalIncome(totalIncome); //额定功率(光伏) data.setPvPower(station.getPvPower()); diff --git a/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml b/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml index cce2060..f61b24c 100644 --- a/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml +++ b/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml @@ -28,7 +28,7 @@ #{entity.userName,jdbcType=VARCHAR}, #{entity.password,jdbcType=VARCHAR}, #{entity.intranetIp,jdbcType=VARCHAR}, - #{entity.type,jdbcType=INTEGER}, + #{entity.type,jdbcType=VARCHAR}, #{entity.createTime,jdbcType=TIMESTAMP}, #{entity.updateTime,jdbcType=TIMESTAMP},