策略配置-曲线图模型修改
This commit is contained in:
@ -46,6 +46,10 @@ public class EmsStrategyCurve extends BaseEntity
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 模板id */
|
||||
@Excel(name = "模板id")
|
||||
private String templateId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -116,6 +120,14 @@ public class EmsStrategyCurve extends BaseEntity
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -131,6 +143,7 @@ public class EmsStrategyCurve extends BaseEntity
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("templateId", getTemplateId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.xzzn.ems.domain.EmsStrategyCurve;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*策略模块曲线图
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-13
|
||||
*/
|
||||
public class StrategyCurveVo
|
||||
{
|
||||
|
||||
/** 模板名称 */
|
||||
private String templateName;
|
||||
|
||||
/** 模板id */
|
||||
private String templateId;
|
||||
|
||||
List<EmsStrategyCurve> cureList;
|
||||
|
||||
public String getTemplateName() {
|
||||
return templateName;
|
||||
}
|
||||
|
||||
public void setTemplateName(String templateName) {
|
||||
this.templateName = templateName;
|
||||
}
|
||||
|
||||
public List<EmsStrategyCurve> getCureList() {
|
||||
return cureList;
|
||||
}
|
||||
|
||||
public void setCureList(List<EmsStrategyCurve> cureList) {
|
||||
this.cureList = cureList;
|
||||
}
|
||||
|
||||
public String getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
}
|
||||
@ -58,4 +58,11 @@ public interface EmsStrategyCurveMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyCurveByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据模板id获取曲线图数据
|
||||
* @param templateId
|
||||
* @return
|
||||
*/
|
||||
public List<EmsStrategyCurve> getTemplateCurve(String templateId);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package com.xzzn.ems.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsStrategyCurve;
|
||||
import com.xzzn.ems.domain.EmsStrategyTemp;
|
||||
import com.xzzn.ems.domain.vo.StrategyCurveVo;
|
||||
|
||||
/**
|
||||
* 策曲线Service接口
|
||||
@ -58,4 +60,7 @@ public interface IEmsStrategyCurveService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsStrategyCurveById(Long id);
|
||||
|
||||
// 获取站点策略的运行曲线数据
|
||||
public List<StrategyCurveVo> getStrategyCurveList(EmsStrategyTemp tempConfig);
|
||||
}
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsStrategyTemp;
|
||||
import com.xzzn.ems.domain.vo.StrategyCurveVo;
|
||||
import com.xzzn.ems.mapper.EmsStrategyTempMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xzzn.ems.mapper.EmsStrategyCurveMapper;
|
||||
@ -19,6 +26,8 @@ public class EmsStrategyCurveServiceImpl implements IEmsStrategyCurveService
|
||||
{
|
||||
@Autowired
|
||||
private EmsStrategyCurveMapper emsStrategyCurveMapper;
|
||||
@Autowired
|
||||
private EmsStrategyTempMapper emsStrategyTempMapper;
|
||||
|
||||
/**
|
||||
* 查询策曲线
|
||||
@ -93,4 +102,30 @@ public class EmsStrategyCurveServiceImpl implements IEmsStrategyCurveService
|
||||
{
|
||||
return emsStrategyCurveMapper.deleteEmsStrategyCurveById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StrategyCurveVo> getStrategyCurveList(EmsStrategyTemp tempConfig) {
|
||||
List<StrategyCurveVo> dataList = new ArrayList();
|
||||
String siteId = tempConfig.getSiteId();
|
||||
Long strategyId = tempConfig.getStrategyId();
|
||||
// 获取该策略的所有模板配置
|
||||
List<Map<String,String>> tempList = emsStrategyTempMapper.getTempNameList(strategyId, siteId);
|
||||
|
||||
if (tempList != null && !tempList.isEmpty()) {
|
||||
for (Map<String,String> map : tempList) {
|
||||
StrategyCurveVo vo = new StrategyCurveVo();
|
||||
String tempName = map.get("templateName");
|
||||
String tempId = map.get("templateId");
|
||||
vo.setTemplateName(tempName);
|
||||
vo.setTemplateId(tempId);
|
||||
|
||||
if (StringUtils.isNotEmpty(tempId)) {
|
||||
List<EmsStrategyCurve> taskList = emsStrategyCurveMapper.getTemplateCurve(tempId);
|
||||
vo.setCureList(taskList);
|
||||
}
|
||||
dataList.add(vo);
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +197,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
for (Map<String, Object> pcsDevice : pcsIds) {
|
||||
PcsDetailInfoVo pcsDetailInfoVo = new PcsDetailInfoVo();
|
||||
pcsDetailInfoVo.setDeviceName(pcsDevice.get("deviceName").toString());
|
||||
pcsDetailInfoVo.setCommunicationStatus(pcsDevice.get("communicationStatus").toString());
|
||||
pcsDetailInfoVo.setCommunicationStatus(pcsDevice.get("communicationStatus") == null ?
|
||||
"" :pcsDevice.get("communicationStatus").toString());
|
||||
// 从redis取pcs单个详细数据
|
||||
String pcsId = pcsDevice.get("id").toString();
|
||||
EmsPcsData pcsData = redisCache.getCacheObject(RedisKeyConstants.PCS +siteId+"_"+pcsId);
|
||||
@ -395,7 +396,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
if (AMMETER_DEVICE_LOAD.equals(ammeterId)) {
|
||||
AmmeterLoadDataVo ammeterLoadDataVo = new AmmeterLoadDataVo();
|
||||
ammeterLoadDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
|
||||
ammeterLoadDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus").toString());
|
||||
ammeterLoadDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
||||
ammeterDevice.get("communicationStatus").toString());
|
||||
// 处理总表数据
|
||||
dealAmmeterLoadData(ammeterData,ammeterLoadDataVo);
|
||||
ammeterResponse.setAmmeterLoadDataVoList(ammeterLoadDataVo);
|
||||
|
||||
Reference in New Issue
Block a user