diff --git a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java index 50d2276..5951959 100644 --- a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java +++ b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java @@ -7,8 +7,10 @@ import com.xzzn.common.core.page.TableDataInfo; import com.xzzn.common.utils.file.FileUploadUtils; import com.xzzn.common.utils.file.MimeTypeUtils; import com.xzzn.ems.domain.EmsDevicesSetting; +import com.xzzn.ems.domain.EmsPointMatch; import com.xzzn.ems.domain.EmsSiteSetting; import com.xzzn.ems.domain.vo.SiteDeviceListVo; +import com.xzzn.ems.mapper.EmsPointMatchMapper; import com.xzzn.ems.service.IEmsDeviceSettingService; import com.xzzn.ems.service.IEmsSiteService; import org.springframework.beans.factory.annotation.Autowired; @@ -31,6 +33,8 @@ public class EmsSiteConfigController extends BaseController{ @Autowired private IEmsDeviceSettingService iEmsDeviceSettingService; + @Autowired + private EmsPointMatchMapper emsPointMatchMapper; /** * 获取站点列表 @@ -136,4 +140,15 @@ public class EmsSiteConfigController extends BaseController{ { return toAjax(iEmsDeviceSettingService.deleteEmsDevicesSettingById(id)); } + + /** + * 单个站点单个设备点位查询 + */ + @GetMapping("/getDevicePointList") + public TableDataInfo getDevicePointList(@RequestParam String siteId,@RequestParam String deviceCategory) + { + startPage(); + List pointList = emsPointMatchMapper.getSingleSiteDevicePoints(siteId,deviceCategory); + return getDataTable(pointList); + } } diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/EmsPointMatch.java b/ems-system/src/main/java/com/xzzn/ems/domain/EmsPointMatch.java index afe534b..0bc2052 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/EmsPointMatch.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/EmsPointMatch.java @@ -9,7 +9,7 @@ import com.xzzn.common.annotation.Excel; * 点位匹配对象 ems_point_match * * @author xzzn - * @date 2025-09-02 + * @date 2025-09-13 */ public class EmsPointMatch extends BaseEntity { @@ -38,6 +38,18 @@ public class EmsPointMatch extends BaseEntity @Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”") private String deviceCategory; + /** 数据点位 */ + @Excel(name = "数据点位") + private String dataPoint; + + /** 数据点位名称 */ + @Excel(name = "数据点位名称") + private String dataPointName; + + /** 数据点位来源设备 */ + @Excel(name = "数据点位来源设备") + private String dataDevice; + public void setId(Long id) { this.id = id; @@ -98,6 +110,36 @@ public class EmsPointMatch extends BaseEntity return deviceCategory; } + public void setDataPoint(String dataPoint) + { + this.dataPoint = dataPoint; + } + + public String getDataPoint() + { + return dataPoint; + } + + public void setDataPointName(String dataPointName) + { + this.dataPointName = dataPointName; + } + + public String getDataPointName() + { + return dataPointName; + } + + public void setDataDevice(String dataDevice) + { + this.dataDevice = dataDevice; + } + + public String getDataDevice() + { + return dataDevice; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -107,6 +149,9 @@ public class EmsPointMatch extends BaseEntity .append("matchField", getMatchField()) .append("siteId", getSiteId()) .append("deviceCategory", getDeviceCategory()) + .append("dataPoint", getDataPoint()) + .append("dataPointName", getDataPointName()) + .append("dataDevice", getDataDevice()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterLoadDataVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterLoadDataVo.java index f443390..103eebc 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterLoadDataVo.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterLoadDataVo.java @@ -13,6 +13,9 @@ public class AmmeterLoadDataVo { /** 电表名称 */ private String deviceName; + /** 设备id */ + private String deviceId; + /** 通信状态 */ private String emsCommunicationStatus; @@ -54,4 +57,12 @@ public class AmmeterLoadDataVo { public void setLoadDataDetailInfo(List loadDataDetailInfo) { this.loadDataDetailInfo = loadDataDetailInfo; } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } } diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterMeteDataVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterMeteDataVo.java index a9a941d..6d29576 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterMeteDataVo.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterMeteDataVo.java @@ -12,7 +12,8 @@ public class AmmeterMeteDataVo { /** 电表名称 */ private String deviceName; - + /** 设备id */ + private String deviceId; /** 通信状态 */ private String emsCommunicationStatus; @@ -54,4 +55,12 @@ public class AmmeterMeteDataVo { public void setMeteDataDetailInfo(List meteDataDetailInfo) { this.meteDataDetailInfo = meteDataDetailInfo; } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } } diff --git a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPointMatchMapper.java b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPointMatchMapper.java index 78aabdc..d402fba 100644 --- a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPointMatchMapper.java +++ b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPointMatchMapper.java @@ -116,4 +116,7 @@ public interface EmsPointMatchMapper @Param("startDate")Date startDate, @Param("endDate")Date endDate, @Param("deviceId")String deviceId); + + // 单个站点单个设备点位查询 + public List getSingleSiteDevicePoints(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory); } diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java index 3915c6e..583b73d 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java @@ -456,6 +456,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService { if (AMMETER_DEVICE_LOAD.equals(ammeterId)) { AmmeterLoadDataVo ammeterLoadDataVo = new AmmeterLoadDataVo(); ammeterLoadDataVo.setDeviceName(ammeterDevice.get("deviceName").toString()); + ammeterLoadDataVo.setDeviceId(ammeterDevice.get("id").toString()); ammeterLoadDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" : ammeterDevice.get("communicationStatus").toString()); // 处理总表数据 @@ -464,6 +465,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService { } else if (AMMETER_DEVICE_METE.equals(ammeterId)) { AmmeterMeteDataVo ammeterMeteDataVo = new AmmeterMeteDataVo(); ammeterMeteDataVo.setDeviceName(ammeterDevice.get("deviceName").toString()); + ammeterMeteDataVo.setDeviceId(ammeterDevice.get("id").toString()); ammeterMeteDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" : ammeterDevice.get("communicationStatus").toString()); // 处理储能表数据 diff --git a/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml b/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml index 85e0a9c..307a44f 100644 --- a/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml +++ b/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml @@ -348,7 +348,7 @@ SELECT p.device_id, MAX(p.data_update_time) AS max_update_time FROM ems_pcs_data p where p.site_id = #{siteId} - and p.data_update_time >= CURDATE() + and p.data_update_time <= CURDATE() GROUP BY p.device_id ) latest inner join ems_pcs_data t ON latest.device_id = t.device_id AND latest.max_update_time = t.data_update_time diff --git a/ems-system/src/main/resources/mapper/ems/EmsPointMatchMapper.xml b/ems-system/src/main/resources/mapper/ems/EmsPointMatchMapper.xml index 853e524..753e95e 100644 --- a/ems-system/src/main/resources/mapper/ems/EmsPointMatchMapper.xml +++ b/ems-system/src/main/resources/mapper/ems/EmsPointMatchMapper.xml @@ -11,6 +11,9 @@ + + + @@ -19,7 +22,7 @@ - select id, point_name, match_table, match_field, site_id, device_category, create_by, create_time, update_by, update_time, remark from ems_point_match + select id, point_name, match_table, match_field, site_id, device_category, data_point, data_point_name, data_device, create_by, create_time, update_by, update_time, remark from ems_point_match @@ -46,6 +52,9 @@ match_field, site_id, device_category, + data_point, + data_point_name, + data_device, create_by, create_time, update_by, @@ -58,6 +67,9 @@ #{matchField}, #{siteId}, #{deviceCategory}, + #{dataPoint}, + #{dataPointName}, + #{dataDevice}, #{createBy}, #{createTime}, #{updateBy}, @@ -74,6 +86,9 @@ match_field = #{matchField}, site_id = #{siteId}, device_category = #{deviceCategory}, + data_point = #{dataPoint}, + data_point_name = #{dataPointName}, + data_device = #{dataDevice}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, @@ -302,4 +317,15 @@ WHERE t.${tableField} is not null ORDER BY t.site_id, t.device_id, valueDate ASC + + \ No newline at end of file