Compare commits
2 Commits
bae47f7abd
...
dd6fe0668d
Author | SHA1 | Date | |
---|---|---|---|
dd6fe0668d | |||
9064c3e786 |
@ -21,13 +21,22 @@ public class EmsHomePageController extends BaseController{
|
||||
@Autowired
|
||||
private IEmsSiteService emsSiteService;
|
||||
|
||||
/**
|
||||
* 获取站点总信息
|
||||
*/
|
||||
@GetMapping("/getSiteTotalInfo")
|
||||
public AjaxResult getSiteTotalInfo()
|
||||
{
|
||||
return success(homePageService.getSiteTotalInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页看板数据
|
||||
*/
|
||||
@GetMapping("/dataList")
|
||||
public AjaxResult list()
|
||||
{
|
||||
return success(homePageService.getSiteVo());
|
||||
return success(homePageService.getSiteTotalInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -40,4 +49,5 @@ public class EmsHomePageController extends BaseController{
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import com.xzzn.ems.service.IHomePageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
*
|
||||
// * 站点地图
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/siteMap")
|
||||
public class EmsSiteMapController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private IHomePageService homePageService;
|
||||
|
||||
/**
|
||||
* 获取某个站点基本信息
|
||||
*/
|
||||
@GetMapping("/getSingleSiteBaseInfo")
|
||||
public AjaxResult getSingleSiteBaseInfo(@RequestParam Long siteId)
|
||||
{
|
||||
return success(homePageService.getSingleSiteBaseInfo(siteId));
|
||||
}
|
||||
|
||||
}
|
@ -130,6 +130,14 @@ public class EmsPcsData extends BaseEntity
|
||||
@Excel(name = "设备唯一标识符")
|
||||
private Long deviceId;
|
||||
|
||||
/** 月 */
|
||||
@Excel(name = "月")
|
||||
private int dateMonth;
|
||||
|
||||
/** 日 */
|
||||
@Excel(name = "日")
|
||||
private int dateDay;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -410,6 +418,22 @@ public class EmsPcsData extends BaseEntity
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public int getDateMonth() {
|
||||
return dateMonth;
|
||||
}
|
||||
|
||||
public void setDateMonth(int dateMonth) {
|
||||
this.dateMonth = dateMonth;
|
||||
}
|
||||
|
||||
public int getDateDay() {
|
||||
return dateDay;
|
||||
}
|
||||
|
||||
public void setDateDay(int dateDay) {
|
||||
this.dateDay = dateDay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -446,6 +470,8 @@ public class EmsPcsData extends BaseEntity
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("dateMonth", getDateMonth())
|
||||
.append("dateDay", getDateDay())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,48 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 实时运行-电池平均SOC数据
|
||||
*
|
||||
*/
|
||||
public class BatteryAveSOCVo {
|
||||
/**
|
||||
* 月份 月+日
|
||||
*/
|
||||
private String monthDay;
|
||||
|
||||
/**
|
||||
* 实时SOC
|
||||
*/
|
||||
private BigDecimal batterySOC;
|
||||
|
||||
/**
|
||||
* 昨日SOC
|
||||
*/
|
||||
private BigDecimal ytdBatterySOC;
|
||||
|
||||
public String getMonthDay() {
|
||||
return monthDay;
|
||||
}
|
||||
|
||||
public void setMonthDay(String monthDay) {
|
||||
this.monthDay = monthDay;
|
||||
}
|
||||
|
||||
public BigDecimal getBatterySOC() {
|
||||
return batterySOC;
|
||||
}
|
||||
|
||||
public void setBatterySOC(BigDecimal batterySOC) {
|
||||
this.batterySOC = batterySOC;
|
||||
}
|
||||
|
||||
public BigDecimal getYtdBatterySOC() {
|
||||
return ytdBatterySOC;
|
||||
}
|
||||
|
||||
public void setYtdBatterySOC(BigDecimal ytdBatterySOC) {
|
||||
this.ytdBatterySOC = ytdBatterySOC;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 实时运行-电池平均温度数据
|
||||
*
|
||||
*/
|
||||
public class BatteryAveTempVo {
|
||||
/**
|
||||
* 月份 月+日
|
||||
*/
|
||||
private String monthDay;
|
||||
|
||||
/**
|
||||
* 实时温度
|
||||
*/
|
||||
private BigDecimal batteryTemp;
|
||||
|
||||
/**
|
||||
* 昨日温度
|
||||
*/
|
||||
private BigDecimal batteryYtdTemp;
|
||||
|
||||
|
||||
public String getMonthDay() {
|
||||
return monthDay;
|
||||
}
|
||||
|
||||
public void setMonthDay(String monthDay) {
|
||||
this.monthDay = monthDay;
|
||||
}
|
||||
|
||||
public BigDecimal getBatteryTemp() {
|
||||
return batteryTemp;
|
||||
}
|
||||
|
||||
public void setBatteryTemp(BigDecimal batteryTemp) {
|
||||
this.batteryTemp = batteryTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getBatteryYtdTemp() {
|
||||
return batteryYtdTemp;
|
||||
}
|
||||
|
||||
public void setBatteryYtdTemp(BigDecimal batteryYtdTemp) {
|
||||
this.batteryYtdTemp = batteryYtdTemp;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 实时运行-储能功率数据
|
||||
*
|
||||
*/
|
||||
public class EnergyStoragePowVo {
|
||||
/**
|
||||
* 月份 月+日
|
||||
*/
|
||||
private String monthDay;
|
||||
|
||||
/**
|
||||
* pcs实时有功功率
|
||||
*/
|
||||
private BigDecimal pcsTotalActPower;
|
||||
|
||||
/**
|
||||
* pcs实时无功功率
|
||||
*/
|
||||
private BigDecimal pcsTotalReactivePower;
|
||||
|
||||
/**
|
||||
* pcs昨日有功功率
|
||||
*/
|
||||
private BigDecimal pcsYtdActPower;
|
||||
|
||||
/**
|
||||
* pcs昨日无功功率
|
||||
*/
|
||||
private BigDecimal pcsYtdReactivePower;
|
||||
|
||||
public String getMonthDay() {
|
||||
return monthDay;
|
||||
}
|
||||
|
||||
public void setMonthDay(String monthDay) {
|
||||
this.monthDay = monthDay;
|
||||
}
|
||||
|
||||
public BigDecimal getPcsTotalActPower() {
|
||||
return pcsTotalActPower;
|
||||
}
|
||||
|
||||
public void setPcsTotalActPower(BigDecimal pcsTotalActPower) {
|
||||
this.pcsTotalActPower = pcsTotalActPower;
|
||||
}
|
||||
|
||||
public BigDecimal getPcsTotalReactivePower() {
|
||||
return pcsTotalReactivePower;
|
||||
}
|
||||
|
||||
public void setPcsTotalReactivePower(BigDecimal pcsTotalReactivePower) {
|
||||
this.pcsTotalReactivePower = pcsTotalReactivePower;
|
||||
}
|
||||
|
||||
public BigDecimal getPcsYtdActPower() {
|
||||
return pcsYtdActPower;
|
||||
}
|
||||
|
||||
public void setPcsYtdActPower(BigDecimal pcsYtdActPower) {
|
||||
this.pcsYtdActPower = pcsYtdActPower;
|
||||
}
|
||||
|
||||
public BigDecimal getPcsYtdReactivePower() {
|
||||
return pcsYtdReactivePower;
|
||||
}
|
||||
|
||||
public void setPcsYtdReactivePower(BigDecimal pcsYtdReactivePower) {
|
||||
this.pcsYtdReactivePower = pcsYtdReactivePower;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 实时运行-pcs平均温度数据
|
||||
*
|
||||
*/
|
||||
public class PCSAveTempVo {
|
||||
/**
|
||||
* 月份 月+日
|
||||
*/
|
||||
private String monthDay;
|
||||
|
||||
/**
|
||||
* 实时温度
|
||||
*/
|
||||
private BigDecimal pcsTemp;
|
||||
|
||||
/**
|
||||
* 昨日同时段温度(到分)
|
||||
*/
|
||||
private BigDecimal pcsYtdTemp;
|
||||
|
||||
public String getMonthDay() {
|
||||
return monthDay;
|
||||
}
|
||||
|
||||
public void setMonthDay(String monthDay) {
|
||||
this.monthDay = monthDay;
|
||||
}
|
||||
|
||||
public BigDecimal getPcsTemp() {
|
||||
return pcsTemp;
|
||||
}
|
||||
|
||||
public void setPcsTemp(BigDecimal pcsTemp) {
|
||||
this.pcsTemp = pcsTemp;
|
||||
}
|
||||
|
||||
public BigDecimal getPcsYtdTemp() {
|
||||
return pcsYtdTemp;
|
||||
}
|
||||
|
||||
public void setPcsYtdTemp(BigDecimal pcsYtdTemp) {
|
||||
this.pcsYtdTemp = pcsYtdTemp;
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点地图-某个站点基本信息
|
||||
*
|
||||
*/
|
||||
public class SingleSiteBaseInfo {
|
||||
/**
|
||||
* 今日充电量
|
||||
*/
|
||||
private BigDecimal dayChargedCap;
|
||||
|
||||
/**
|
||||
* 今日放电量
|
||||
*/
|
||||
private BigDecimal dayDisChargedCap;
|
||||
|
||||
/**
|
||||
* 总充电量
|
||||
*/
|
||||
private BigDecimal totalChargedCap;
|
||||
|
||||
/**
|
||||
* 总放电量
|
||||
*/
|
||||
private BigDecimal totalDischargedCap;
|
||||
|
||||
/**
|
||||
* 站点位置
|
||||
*/
|
||||
private String siteLocation;
|
||||
|
||||
/**
|
||||
* 投运时间
|
||||
*/
|
||||
private String runningTime;
|
||||
|
||||
/**
|
||||
* 装机功率(MW)
|
||||
*/
|
||||
private BigDecimal installedPower;
|
||||
|
||||
/**
|
||||
* 装机容量(MW)
|
||||
*/
|
||||
private BigDecimal installedCap;
|
||||
|
||||
/**
|
||||
* 七天放电统计
|
||||
*/
|
||||
private List<SiteMonitorDataVo> SevenDayDischargeStats;
|
||||
|
||||
public BigDecimal getDayChargedCap() {
|
||||
return dayChargedCap;
|
||||
}
|
||||
|
||||
public void setDayChargedCap(BigDecimal dayChargedCap) {
|
||||
this.dayChargedCap = dayChargedCap;
|
||||
}
|
||||
|
||||
public List<SiteMonitorDataVo> getSevenDayDischargeStats() {
|
||||
return SevenDayDischargeStats;
|
||||
}
|
||||
|
||||
public void setSevenDayDischargeStats(List<SiteMonitorDataVo> sevenDayDischargeStats) {
|
||||
SevenDayDischargeStats = sevenDayDischargeStats;
|
||||
}
|
||||
|
||||
public BigDecimal getInstalledCap() {
|
||||
return installedCap;
|
||||
}
|
||||
|
||||
public void setInstalledCap(BigDecimal installedCap) {
|
||||
this.installedCap = installedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getInstalledPower() {
|
||||
return installedPower;
|
||||
}
|
||||
|
||||
public void setInstalledPower(BigDecimal installedPower) {
|
||||
this.installedPower = installedPower;
|
||||
}
|
||||
|
||||
public String getRunningTime() {
|
||||
return runningTime;
|
||||
}
|
||||
|
||||
public void setRunningTime(String runningTime) {
|
||||
this.runningTime = runningTime;
|
||||
}
|
||||
|
||||
public String getSiteLocation() {
|
||||
return siteLocation;
|
||||
}
|
||||
|
||||
public void setSiteLocation(String siteLocation) {
|
||||
this.siteLocation = siteLocation;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalDischargedCap() {
|
||||
return totalDischargedCap;
|
||||
}
|
||||
|
||||
public void setTotalDischargedCap(BigDecimal totalDischargedCap) {
|
||||
this.totalDischargedCap = totalDischargedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalChargedCap() {
|
||||
return totalChargedCap;
|
||||
}
|
||||
|
||||
public void setTotalChargedCap(BigDecimal totalChargedCap) {
|
||||
this.totalChargedCap = totalChargedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getDayDisChargedCap() {
|
||||
return dayDisChargedCap;
|
||||
}
|
||||
|
||||
public void setDayDisChargedCap(BigDecimal dayDisChargedCap) {
|
||||
this.dayDisChargedCap = dayDisChargedCap;
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单站监控-设备监控-实时运行数据
|
||||
*
|
||||
*/
|
||||
public class SiteMonitorRuningInfoVo {
|
||||
/**
|
||||
* 实时有功功率
|
||||
*/
|
||||
private BigDecimal totalActivePower;
|
||||
|
||||
/**
|
||||
* 实时无功功率
|
||||
*/
|
||||
private BigDecimal totalReactivePower;
|
||||
|
||||
/**
|
||||
* 电池簇SOC
|
||||
*/
|
||||
private BigDecimal soc;
|
||||
|
||||
/**
|
||||
* 电池堆SOH
|
||||
*/
|
||||
private BigDecimal soh;
|
||||
|
||||
/**
|
||||
* 今日充电量
|
||||
*/
|
||||
private BigDecimal dayChargedCap;
|
||||
|
||||
/**
|
||||
* 今日放电量
|
||||
*/
|
||||
private BigDecimal dayDisChargedCap;
|
||||
|
||||
/**
|
||||
* 储能功率list
|
||||
*/
|
||||
private List<EnergyStoragePowVo> energyStoragePowList;
|
||||
|
||||
/**
|
||||
* pcs平均温度list
|
||||
*/
|
||||
private List<PCSAveTempVo> pcsAveTempList;
|
||||
|
||||
/**
|
||||
* 电池平均soclist
|
||||
*/
|
||||
private List<BatteryAveSOCVo> batteryAveSOCList;
|
||||
|
||||
/**
|
||||
* 电池平均温度list
|
||||
*/
|
||||
private List<BatteryAveTempVo> batteryAveTempList;
|
||||
|
||||
public BigDecimal getTotalActivePower() {
|
||||
return totalActivePower;
|
||||
}
|
||||
|
||||
public void setTotalActivePower(BigDecimal totalActivePower) {
|
||||
this.totalActivePower = totalActivePower;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalReactivePower() {
|
||||
return totalReactivePower;
|
||||
}
|
||||
|
||||
public void setTotalReactivePower(BigDecimal totalReactivePower) {
|
||||
this.totalReactivePower = totalReactivePower;
|
||||
}
|
||||
|
||||
public BigDecimal getSoc() {
|
||||
return soc;
|
||||
}
|
||||
|
||||
public void setSoc(BigDecimal soc) {
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
public BigDecimal getSoh() {
|
||||
return soh;
|
||||
}
|
||||
|
||||
public void setSoh(BigDecimal soh) {
|
||||
this.soh = soh;
|
||||
}
|
||||
|
||||
public BigDecimal getDayChargedCap() {
|
||||
return dayChargedCap;
|
||||
}
|
||||
|
||||
public void setDayChargedCap(BigDecimal dayChargedCap) {
|
||||
this.dayChargedCap = dayChargedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getDayDisChargedCap() {
|
||||
return dayDisChargedCap;
|
||||
}
|
||||
|
||||
public void setDayDisChargedCap(BigDecimal dayDisChargedCap) {
|
||||
this.dayDisChargedCap = dayDisChargedCap;
|
||||
}
|
||||
|
||||
public List<EnergyStoragePowVo> getEnergyStoragePowList() {
|
||||
return energyStoragePowList;
|
||||
}
|
||||
|
||||
public void setEnergyStoragePowList(List<EnergyStoragePowVo> energyStoragePowList) {
|
||||
this.energyStoragePowList = energyStoragePowList;
|
||||
}
|
||||
|
||||
public List<PCSAveTempVo> getPcsAveTempList() {
|
||||
return pcsAveTempList;
|
||||
}
|
||||
|
||||
public void setPcsAveTempList(List<PCSAveTempVo> pcsAveTempList) {
|
||||
this.pcsAveTempList = pcsAveTempList;
|
||||
}
|
||||
|
||||
public List<BatteryAveSOCVo> getBatteryAveSOCList() {
|
||||
return batteryAveSOCList;
|
||||
}
|
||||
|
||||
public void setBatteryAveSOCList(List<BatteryAveSOCVo> batteryAveSOCList) {
|
||||
this.batteryAveSOCList = batteryAveSOCList;
|
||||
}
|
||||
|
||||
public List<BatteryAveTempVo> getBatteryAveTempList() {
|
||||
return batteryAveTempList;
|
||||
}
|
||||
|
||||
public void setBatteryAveTempList(List<BatteryAveTempVo> batteryAveTempList) {
|
||||
this.batteryAveTempList = batteryAveTempList;
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 站点总信息
|
||||
*
|
||||
*/
|
||||
public class SiteTotalInfoVo {
|
||||
/**
|
||||
* 站点总数(座)
|
||||
*/
|
||||
private int siteNum;
|
||||
|
||||
/**
|
||||
* 装机功率(MW)
|
||||
*/
|
||||
private BigDecimal installedPower;
|
||||
|
||||
/**
|
||||
* 装机容量(MW)
|
||||
*/
|
||||
private BigDecimal installedCap;
|
||||
|
||||
/**
|
||||
* 总充电量(MWH)
|
||||
*/
|
||||
private BigDecimal totalChargedCap;
|
||||
|
||||
/**
|
||||
* 总放电量(MWH)
|
||||
*/
|
||||
private BigDecimal totalDischargedCap;
|
||||
|
||||
public int getSiteNum() {
|
||||
return siteNum;
|
||||
}
|
||||
|
||||
public void setSiteNum(int siteNum) {
|
||||
this.siteNum = siteNum;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalDischargedCap() {
|
||||
return totalDischargedCap;
|
||||
}
|
||||
|
||||
public void setTotalDischargedCap(BigDecimal totalDischargedCap) {
|
||||
this.totalDischargedCap = totalDischargedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalChargedCap() {
|
||||
return totalChargedCap;
|
||||
}
|
||||
|
||||
public void setTotalChargedCap(BigDecimal totalChargedCap) {
|
||||
this.totalChargedCap = totalChargedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getInstalledCap() {
|
||||
return installedCap;
|
||||
}
|
||||
|
||||
public void setInstalledCap(BigDecimal installedCap) {
|
||||
this.installedCap = installedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getInstalledPower() {
|
||||
return installedPower;
|
||||
}
|
||||
|
||||
public void setInstalledPower(BigDecimal installedPower) {
|
||||
this.installedPower = installedPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SiteVo{" +
|
||||
"siteNum=" + siteNum +
|
||||
", installedPower=" + installedPower +
|
||||
", installedCap=" + installedCap +
|
||||
", totalChargedCap=" + totalChargedCap +
|
||||
", totalDischargedCap=" + totalDischargedCap +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
|
||||
/**
|
||||
* 站点Mapper接口
|
||||
@ -57,4 +58,10 @@ public interface EmsSiteMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取站点总信息
|
||||
* @return
|
||||
*/
|
||||
public SiteTotalInfoVo getSiteTotalInfo();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.xzzn.ems.service;
|
||||
|
||||
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -15,4 +16,5 @@ public interface IEmsSiteService
|
||||
public List<EmsSite> getAllSites();
|
||||
|
||||
|
||||
public SiteTotalInfoVo getSiteTotalInfo();
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.ems.domain.vo.SiteVo;
|
||||
import com.xzzn.ems.domain.vo.SingleSiteBaseInfo;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
|
||||
/**
|
||||
* 站点信息 服务层
|
||||
@ -9,7 +10,7 @@ import com.xzzn.ems.domain.vo.SiteVo;
|
||||
public interface IHomePageService
|
||||
{
|
||||
|
||||
public SiteVo getSiteVo();
|
||||
|
||||
public SiteTotalInfoVo getSiteTotalInfo();
|
||||
|
||||
public SingleSiteBaseInfo getSingleSiteBaseInfo(Long siteId);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorHomeVo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorRuningInfoVo;
|
||||
|
||||
/**
|
||||
* 单点监控 服务层
|
||||
@ -12,4 +13,5 @@ public interface ISingleSiteService
|
||||
public SiteMonitorHomeVo getSiteMonitorDataVo(Long siteId);
|
||||
|
||||
|
||||
public SiteMonitorRuningInfoVo getSiteRuningInfo(Long siteId);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
import com.xzzn.ems.mapper.EmsSiteMapper;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -24,4 +25,9 @@ public class EmsSiteServiceImpl implements IEmsSiteService
|
||||
return emsSiteMapper.selectSiteList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SiteTotalInfoVo getSiteTotalInfo() {
|
||||
return emsSiteMapper.getSiteTotalInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,25 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.ems.domain.vo.SiteVo;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.vo.SingleSiteBaseInfo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorDataVo;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
import com.xzzn.ems.mapper.EmsPcsDataMapper;
|
||||
import com.xzzn.ems.mapper.EmsSiteMapper;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import com.xzzn.ems.service.IHomePageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点信息 服务层实现
|
||||
* 首页看板+站点地图 服务层实现
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@ -16,14 +28,77 @@ public class HomePageServiceImpl implements IHomePageService
|
||||
|
||||
@Autowired
|
||||
private IEmsSiteService emsSiteService;
|
||||
@Autowired
|
||||
private EmsPcsDataMapper emsPcsDataMapper;
|
||||
@Autowired
|
||||
private EmsSiteMapper emsSiteMapper;
|
||||
|
||||
@Override
|
||||
public SiteVo getSiteVo() {
|
||||
SiteVo siteVo = new SiteVo();
|
||||
siteVo.setSiteNum(emsSiteService.getAllSites().size());
|
||||
if (siteVo.getSiteNum() > 0){
|
||||
//设置其他参数
|
||||
public SiteTotalInfoVo getSiteTotalInfo() {
|
||||
return emsSiteService.getSiteTotalInfo();
|
||||
}
|
||||
return siteVo;
|
||||
|
||||
@Override
|
||||
public SingleSiteBaseInfo getSingleSiteBaseInfo(Long siteId) {
|
||||
SingleSiteBaseInfo singleSiteBaseInfo = new SingleSiteBaseInfo();
|
||||
|
||||
if (siteId != null) {
|
||||
// 站点基本信息
|
||||
EmsSite emsSite = emsSiteMapper.selectSiteById(siteId);
|
||||
if (emsSite != null) {
|
||||
singleSiteBaseInfo.setSiteLocation(emsSite.getRemark());//站点位置
|
||||
singleSiteBaseInfo.setRunningTime(DateUtils.parseDateToStr("yyyy-MM-dd",emsSite.getCreateTime()));//投运时间
|
||||
// 装机功率+装机容量 待定
|
||||
// 七天放电数据统计
|
||||
List<SiteMonitorDataVo> siteMonitorDataVoList = emsPcsDataMapper.getPcsDataBySiteId(siteId);
|
||||
singleSiteBaseInfo.setSevenDayDischargeStats(siteMonitorDataVoList);
|
||||
// 充放电基本数据处理
|
||||
dealSitePCSDate(singleSiteBaseInfo,siteMonitorDataVoList);
|
||||
}
|
||||
}
|
||||
|
||||
return singleSiteBaseInfo;
|
||||
}
|
||||
|
||||
private void dealSitePCSDate(SingleSiteBaseInfo singleSiteBaseInfo, List<SiteMonitorDataVo> siteMonitorDataVoList) {
|
||||
if (siteMonitorDataVoList != null && !siteMonitorDataVoList.isEmpty()) {
|
||||
BigDecimal dayChargeCap = new BigDecimal(0);
|
||||
BigDecimal dayDisChargeCap = new BigDecimal(0);
|
||||
BigDecimal totalChargeCap = new BigDecimal(0);
|
||||
BigDecimal totalDisChargeCap = new BigDecimal(0);
|
||||
for (SiteMonitorDataVo sitePcsData : siteMonitorDataVoList) {
|
||||
// 总充电量
|
||||
totalChargeCap = totalChargeCap.add(sitePcsData.getChargedCap());
|
||||
// 总放电量
|
||||
totalDisChargeCap = totalDisChargeCap.add(sitePcsData.getDisChargedCap());
|
||||
// 获取当天的充电量+放电量
|
||||
String pcsDate = sitePcsData.getAmmeterDate();
|
||||
boolean isToday= checkIsToday(pcsDate);
|
||||
if(isToday){
|
||||
dayChargeCap = dayChargeCap.add(sitePcsData.getChargedCap());
|
||||
dayDisChargeCap = dayDisChargeCap.add(sitePcsData.getDisChargedCap());
|
||||
}
|
||||
}
|
||||
singleSiteBaseInfo.setDayChargedCap(dayChargeCap);
|
||||
singleSiteBaseInfo.setDayDisChargedCap(dayDisChargeCap);
|
||||
singleSiteBaseInfo.setTotalChargedCap(totalChargeCap);
|
||||
singleSiteBaseInfo.setTotalDischargedCap(totalDisChargeCap);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkIsToday(String pcsDate) {
|
||||
boolean flag = false;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int todayMonth = calendar.get(Calendar.MONTH) + 1;
|
||||
int todayDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
if (StringUtils.isNotEmpty(pcsDate)){
|
||||
String[] pcsDateArray = pcsDate.split("/");
|
||||
if (todayMonth == Integer.parseInt(pcsDateArray[0]) &&
|
||||
todayDay == Integer.parseInt(pcsDateArray[1])) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorDataVo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorHomeAlarmVo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorHomeVo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorRuningInfoVo;
|
||||
import com.xzzn.ems.mapper.EmsAlarmRecordsMapper;
|
||||
import com.xzzn.ems.mapper.EmsPcsDataMapper;
|
||||
import com.xzzn.ems.service.ISingleSiteService;
|
||||
@ -11,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -35,7 +38,9 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
siteMonitorHomeVo.setSiteMonitorHomeAlarmVo(siteMonitorHomeAlarmVo);
|
||||
// 能量数据
|
||||
List<SiteMonitorDataVo> siteMonitorDataVoList = emsPcsDataMapper.getPcsDataBySiteId(siteId);
|
||||
if (!siteMonitorDataVoList.isEmpty()) {
|
||||
if (siteMonitorDataVoList != null && !siteMonitorDataVoList.isEmpty()) {
|
||||
BigDecimal dayChargeCap = new BigDecimal(0);
|
||||
BigDecimal dayDisChargeCap = new BigDecimal(0);
|
||||
BigDecimal totalChargeCap = new BigDecimal(0);
|
||||
BigDecimal totalDisChargeCap = new BigDecimal(0);
|
||||
for (SiteMonitorDataVo sitePcsData : siteMonitorDataVoList) {
|
||||
@ -44,13 +49,15 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
// 总放电量
|
||||
totalDisChargeCap = totalDisChargeCap.add(sitePcsData.getDisChargedCap());
|
||||
// 获取当天的充电量+放电量
|
||||
Date today = DateUtils.getNowDate();
|
||||
Date pcsDate = DateUtils.parseDate(sitePcsData.getAmmeterDate());
|
||||
if( DateUtils.differentDaysByMillisecond(today,pcsDate) ==0){
|
||||
siteMonitorHomeVo.setDayChargedCap(sitePcsData.getChargedCap());
|
||||
siteMonitorHomeVo.setDayDisChargedCap(sitePcsData.getDisChargedCap());
|
||||
String pcsDate = sitePcsData.getAmmeterDate();
|
||||
boolean isToday= checkIsToday(pcsDate);
|
||||
if(isToday){
|
||||
dayChargeCap = dayChargeCap.add(sitePcsData.getChargedCap());
|
||||
dayDisChargeCap = dayDisChargeCap.add(sitePcsData.getDisChargedCap());
|
||||
}
|
||||
}
|
||||
siteMonitorHomeVo.setDayChargedCap(dayChargeCap);
|
||||
siteMonitorHomeVo.setDayDisChargedCap(dayDisChargeCap);
|
||||
siteMonitorHomeVo.setTotalChargedCap(totalChargeCap);
|
||||
siteMonitorHomeVo.setTotalDischargedCap(totalDisChargeCap);
|
||||
// 储能可用电量
|
||||
@ -65,4 +72,24 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return siteMonitorHomeVo;
|
||||
}
|
||||
|
||||
private boolean checkIsToday(String pcsDate) {
|
||||
boolean flag = false;
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int todayMonth = calendar.get(Calendar.MONTH) + 1;
|
||||
int todayDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
if (StringUtils.isNotEmpty(pcsDate)){
|
||||
String[] pcsDateArray = pcsDate.split("/");
|
||||
if (todayMonth == Integer.parseInt(pcsDateArray[0]) &&
|
||||
todayDay == Integer.parseInt(pcsDateArray[1])) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SiteMonitorRuningInfoVo getSiteRuningInfo(Long siteId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,10 +38,12 @@
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="dateMonth" column="date_month" />
|
||||
<result property="dateDay" column="date_day" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsPcsDataVo">
|
||||
select id, data_update_time, work_status, grid_status, device_status, control_mode, total_active_power, daily_ac_charge_energy, a_phase_voltage, a_phase_current, total_reactive_power, daily_ac_discharge_energy, b_phase_voltage, b_phase_current, total_apparent_power, pcs_module_temperature, c_phase_voltage, c_phase_current, total_power_factor, pcs_environment_temperature, ac_frequency, branch_status, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_pcs_data
|
||||
select id, data_update_time, work_status, grid_status, device_status, control_mode, total_active_power, daily_ac_charge_energy, a_phase_voltage, a_phase_current, total_reactive_power, daily_ac_discharge_energy, b_phase_voltage, b_phase_current, total_apparent_power, pcs_module_temperature, c_phase_voltage, c_phase_current, total_power_factor, pcs_environment_temperature, ac_frequency, branch_status, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id, date_month, date_day from ems_pcs_data
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsPcsDataList" parameterType="EmsPcsData" resultMap="EmsPcsDataResult">
|
||||
@ -205,12 +207,13 @@
|
||||
</delete>
|
||||
|
||||
<select id="getPcsDataBySiteId" parameterType="Long" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
|
||||
select DATE_FORMAT(create_time, '%Y/%m/%d') as ammeterDate,
|
||||
daily_ac_charge_energy as chargedCap,
|
||||
daily_ac_discharge_energy as disChargedCap
|
||||
select CONCAT(date_month,'/',date_day) as ammeterDate,
|
||||
sum(daily_ac_charge_energy) as chargedCap,
|
||||
sum(daily_ac_discharge_energy) as disChargedCap
|
||||
from ems_pcs_data
|
||||
where site_id = #{siteId}
|
||||
group by create_time,daily_ac_charge_energy,daily_ac_discharge_energy
|
||||
and date_sub(CURDATE(), interval 6 day) <= create_time
|
||||
group by date_month,date_day
|
||||
</select>
|
||||
|
||||
<select id="getGridNrtPower" parameterType="Long" resultType="java.math.BigDecimal">
|
||||
|
@ -73,4 +73,11 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getSiteTotalInfo" resultType="com.xzzn.ems.domain.vo.SiteTotalInfoVo">
|
||||
select count(DISTINCT s.id) as siteNum,
|
||||
SUM(d.daily_ac_charge_energy) as totalChargedCap,
|
||||
SUM(d.daily_ac_discharge_energy) as totalDischargedCap
|
||||
from ems_site_setting s left join ems_pcs_data d on s.id = d.site_id
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user