From d32f40f420cf2a53e31f5d49979ed78d5d45357f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sat, 14 Jun 2025 13:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/common/constant/ApiConstants.java | 14 + .../core/controller/BaseController.java | 8 + .../com/ruoyi/common/utils/StringUtils.java | 22 + .../domain/QuartzDevIotConfigPoint.java | 266 +++++++++ .../quartz/domain/QuartzDevIotDatas.java | 486 ++++++++++++++++ .../quartz/domain/QuartzDevIotWarning.java | 136 +++++ .../quartz/mapper/QuartzDevIotMapper.java | 60 ++ .../quartz/service/IQuartzDevIotService.java | 59 ++ .../service/impl/QuartzDevIotServiceImpl.java | 95 ++++ .../com/ruoyi/quartz/task/SadaHzDataTask.java | 265 +++++++++ .../mapper/quartz/QuartzDevIotMapper.xml | 229 ++++++++ ruoyi-ui/public/favicon.ico | Bin 9662 -> 0 bytes ruoyi-ui/src/layout/components/Navbar.vue | 1 - .../ruoyi/api/TowerCraneApiController.java | 395 ++++++++++++- .../java/com/ruoyi/domain/vo/TowerReqVo.java | 29 + .../domain/vo/TyTowerLinuxRoundReqVO.java | 37 ++ .../ruoyi/domain/vo/TyTowerLinuxRunReqVO.java | 36 ++ .../domain/vo/TyTowerLinuxWarningReqVO.java | 39 ++ .../ruoyi/domain/vo/TyTowerRoundReqVO.java | 37 ++ .../com/ruoyi/domain/vo/TyTowerRunReqVO.java | 36 ++ .../ruoyi/domain/vo/TyTowerWarningReqVO.java | 40 ++ .../controller/DevIotConfigController.java | 228 ++++++++ .../DevIotConfigPointController.java | 113 ++++ .../controller/DevIotDatasController.java | 121 ++++ .../controller/DevIotWarningController.java | 112 ++++ .../yanzhu/jh/device/domain/DevIotConfig.java | 148 +++++ .../jh/device/domain/DevIotConfigPoint.java | 288 ++++++++++ .../yanzhu/jh/device/domain/DevIotDatas.java | 525 ++++++++++++++++++ .../jh/device/domain/DevIotWarning.java | 158 ++++++ .../jh/device/domain/DevTowerDataWarning.java | 143 ++++- .../jh/device/mapper/DevIotConfigMapper.java | 62 +++ .../mapper/DevIotConfigPointMapper.java | 62 +++ .../jh/device/mapper/DevIotDatasMapper.java | 62 +++ .../jh/device/mapper/DevIotWarningMapper.java | 62 +++ .../mapper/DevTowerDataWarningMapper.java | 16 + .../service/IDevIotConfigPointService.java | 62 +++ .../device/service/IDevIotConfigService.java | 62 +++ .../device/service/IDevIotDatasService.java | 62 +++ .../device/service/IDevIotWarningService.java | 62 +++ .../impl/DevIotConfigPointServiceImpl.java | 100 ++++ .../service/impl/DevIotConfigServiceImpl.java | 123 ++++ .../service/impl/DevIotDatasServiceImpl.java | 96 ++++ .../impl/DevIotWarningServiceImpl.java | 97 ++++ .../impl/DevTowerDataRunServiceImpl.java | 24 +- .../mapper/device/DevIotConfigMapper.xml | 107 ++++ .../mapper/device/DevIotConfigPointMapper.xml | 150 +++++ .../mapper/device/DevIotDatasMapper.xml | 197 +++++++ .../mapper/device/DevIotWarningMapper.xml | 96 ++++ .../device/DevTowerDataWarningMapper.xml | 93 +++- 49 files changed, 5652 insertions(+), 69 deletions(-) create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/constant/ApiConstants.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotConfigPoint.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotDatas.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotWarning.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/QuartzDevIotMapper.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/IQuartzDevIotService.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/QuartzDevIotServiceImpl.java create mode 100644 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SadaHzDataTask.java create mode 100644 ruoyi-quartz/src/main/resources/mapper/quartz/QuartzDevIotMapper.xml delete mode 100644 ruoyi-ui/public/favicon.ico create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TowerReqVo.java create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRoundReqVO.java create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRunReqVO.java create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxWarningReqVO.java create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRoundReqVO.java create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRunReqVO.java create mode 100644 yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerWarningReqVO.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigController.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigPointController.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotDatasController.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotWarningController.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfig.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfigPoint.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotDatas.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotWarning.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigMapper.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigPointMapper.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotDatasMapper.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotWarningMapper.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigPointService.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigService.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotDatasService.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotWarningService.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigPointServiceImpl.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigServiceImpl.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotDatasServiceImpl.java create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotWarningServiceImpl.java create mode 100644 yanzhu-jh/src/main/resources/mapper/device/DevIotConfigMapper.xml create mode 100644 yanzhu-jh/src/main/resources/mapper/device/DevIotConfigPointMapper.xml create mode 100644 yanzhu-jh/src/main/resources/mapper/device/DevIotDatasMapper.xml create mode 100644 yanzhu-jh/src/main/resources/mapper/device/DevIotWarningMapper.xml diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/ApiConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ApiConstants.java new file mode 100644 index 00000000..8dba3bea --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ApiConstants.java @@ -0,0 +1,14 @@ +package com.ruoyi.common.constant; + +/** + * 接口通讯信息 + * + * @author ruoyi + */ +public class ApiConstants { + + /** + * IOT配电箱数据获取HOST&&萨达 + */ + public static final String IOT_SD_HOST = "https://api.e.v1.i-sada.net"; +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index e43873df..2c5a494e 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -61,6 +61,14 @@ public class BaseController PageUtils.startPage(); } + /** + * 设置请求分页数据 + */ + protected void startPage(Integer pageNum, Integer pageSize) + { + PageUtils.startPage(pageNum,pageSize); + } + /** * 设置请求排序数据 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java index 934349d9..48e0ba45 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java @@ -170,6 +170,28 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils return (str == null ? "" : str.trim()); } + /** + * 参数忽略类型比较 + * + * @param obj1 对象1 + * @param obj2 对象2 + * @return value 返回值 + */ + public static boolean eqObj(Object obj1, Object obj2) + { + if(obj1==null && obj2==null){ + return true; + }else{ + if(obj1==null){ + return false; + } + if(obj2==null){ + return false; + } + return obj1.toString().equals(obj2.toString()); + } + } + /** * 截取字符串 * diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotConfigPoint.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotConfigPoint.java new file mode 100644 index 00000000..7d5514fe --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotConfigPoint.java @@ -0,0 +1,266 @@ +package com.ruoyi.quartz.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 配电箱配置对象 dev_iot_config_point + * + * @author yanzhu + * @date 2025-04-04 + */ +public class QuartzDevIotConfigPoint extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 配置主键 */ + @Excel(name = "配置主键") + private Long cfgId; + + /** 公司主键 */ + @Excel(name = "公司主键") + private Long comId; + + /** 项目主键 */ + @Excel(name = "项目主键") + private Long projectId; + + /** 设备序列号 */ + @Excel(name = "设备序列号") + private String deviceSn; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + /** 厂家名称 */ + @Excel(name = "厂家名称") + private String factoryName; + + /** 联系人 */ + @Excel(name = "联系人") + private String contactPerson; + + /** 联系人电话 */ + @Excel(name = "联系人电话") + private String contactPersonPhone; + + /** 配电箱等级 */ + @Excel(name = "配电箱等级") + private String levels; + + /** 漏电电流 */ + @Excel(name = "漏电电流") + private String leakageCurrent; + + /** 额定温度 */ + @Excel(name = "额定温度") + private String ratedTemperature; + + /** 短路电流 */ + @Excel(name = "短路电流") + private String shortCircuitCurrent; + + /** 额定电流 */ + @Excel(name = "额定电流") + private String ratedCurrent; + + /** 额定电压 */ + @Excel(name = "额定电压") + private String ratedVoltage; + + /** 在线状态 */ + @Excel(name = "在线状态") + private String onlineStatus; + + /** 数据状态 */ + @Excel(name = "数据状态") + private String isDel; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCfgId(Long cfgId) + { + this.cfgId = cfgId; + } + + public Long getCfgId() + { + return cfgId; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public String getDeviceSn() + { + return deviceSn; + } + public void setDeviceName(String deviceName) + { + this.deviceName = deviceName; + } + + public String getDeviceName() + { + return deviceName; + } + public void setFactoryName(String factoryName) + { + this.factoryName = factoryName; + } + + public String getFactoryName() + { + return factoryName; + } + public void setContactPerson(String contactPerson) + { + this.contactPerson = contactPerson; + } + + public String getContactPerson() + { + return contactPerson; + } + public void setContactPersonPhone(String contactPersonPhone) + { + this.contactPersonPhone = contactPersonPhone; + } + + public String getContactPersonPhone() + { + return contactPersonPhone; + } + public void setLevels(String levels) + { + this.levels = levels; + } + + public String getLevels() + { + return levels; + } + public void setLeakageCurrent(String leakageCurrent) + { + this.leakageCurrent = leakageCurrent; + } + + public String getLeakageCurrent() + { + return leakageCurrent; + } + public void setRatedTemperature(String ratedTemperature) + { + this.ratedTemperature = ratedTemperature; + } + + public String getRatedTemperature() + { + return ratedTemperature; + } + public void setShortCircuitCurrent(String shortCircuitCurrent) + { + this.shortCircuitCurrent = shortCircuitCurrent; + } + + public String getShortCircuitCurrent() + { + return shortCircuitCurrent; + } + public void setRatedCurrent(String ratedCurrent) + { + this.ratedCurrent = ratedCurrent; + } + + public String getRatedCurrent() + { + return ratedCurrent; + } + public void setRatedVoltage(String ratedVoltage) + { + this.ratedVoltage = ratedVoltage; + } + + public String getRatedVoltage() + { + return ratedVoltage; + } + public void setOnlineStatus(String onlineStatus) + { + this.onlineStatus = onlineStatus; + } + + public String getOnlineStatus() + { + return onlineStatus; + } + public void setIsDel(String isDel) + { + this.isDel = isDel; + } + + public String getIsDel() + { + return isDel; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cfgId", getCfgId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("deviceSn", getDeviceSn()) + .append("deviceName", getDeviceName()) + .append("factoryName", getFactoryName()) + .append("contactPerson", getContactPerson()) + .append("contactPersonPhone", getContactPersonPhone()) + .append("levels", getLevels()) + .append("leakageCurrent", getLeakageCurrent()) + .append("ratedTemperature", getRatedTemperature()) + .append("shortCircuitCurrent", getShortCircuitCurrent()) + .append("ratedCurrent", getRatedCurrent()) + .append("ratedVoltage", getRatedVoltage()) + .append("onlineStatus", getOnlineStatus()) + .append("isDel", getIsDel()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotDatas.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotDatas.java new file mode 100644 index 00000000..46d66c49 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotDatas.java @@ -0,0 +1,486 @@ +package com.ruoyi.quartz.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 配电箱数据对象 dev_iot_datas + * + * @author yanzhu + * @date 2025-04-04 + */ +public class QuartzDevIotDatas extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 配置主键 */ + @Excel(name = "配置主键") + private Long cfgId; + + /** 点位主键 */ + @Excel(name = "点位主键") + private Long pointId; + + /** 公司主键 */ + @Excel(name = "公司主键") + private Long comId; + + /** 项目主键 */ + @Excel(name = "项目主键") + private Long projectId; + + /** 设备序列号 */ + @Excel(name = "设备序列号") + private String deviceSn; + + /** 开关位_交流 */ + @Excel(name = "开关位_交流") + private String switchesAc; + + /** 开关位 */ + @Excel(name = "开关位") + private String switchesSwitch; + + /** 开关位状态 */ + @Excel(name = "开关位状态") + private String switchesSwitches; + + /** 开关位安装状态 */ + @Excel(name = "开关位安装状态") + private String switchesSwitchstatus; + + /** 温度检测数据 */ + @Excel(name = "温度检测数据") + private String temperature; + + /** 漏电检测数据 */ + @Excel(name = "漏电检测数据") + private String leakage; + + /** A相电压 */ + @Excel(name = "A相电压") + private String voltageA; + + /** B相电压 */ + @Excel(name = "B相电压") + private String voltageB; + + /** C相电压 */ + @Excel(name = "C相电压") + private String voltageC; + + /** A相与B相之间的电压 */ + @Excel(name = "A相与B相之间的电压") + private String voltageAb; + + /** B相与C相之间的电压 */ + @Excel(name = "B相与C相之间的电压") + private String voltageBc; + + /** C相与A相之间的电压 */ + @Excel(name = "C相与A相之间的电压") + private String voltageCa; + + /** A相电流 */ + @Excel(name = "A相电流") + private String currentA; + + /** B相电流 */ + @Excel(name = "B相电流") + private String currentB; + + /** C相电流 */ + @Excel(name = "C相电流") + private String currentC; + + /** A相功率 */ + @Excel(name = "A相功率") + private String powerA; + + /** B相功率 */ + @Excel(name = "B相功率") + private String powerB; + + /** C相功率 */ + @Excel(name = "C相功率") + private String powerC; + + /** A相累计能量 */ + @Excel(name = "A相累计能量") + private String energyA; + + /** B相累计能量 */ + @Excel(name = "B相累计能量") + private String energyB; + + /** C相累计能量 */ + @Excel(name = "C相累计能量") + private String energyC; + + /** A相功率因数 */ + @Excel(name = "A相功率因数") + private String factorA; + + /** B相功率因数 */ + @Excel(name = "B相功率因数") + private String factorB; + + /** C相功率因数 */ + @Excel(name = "C相功率因数") + private String factorC; + + /** A相频率 */ + @Excel(name = "A相频率") + private String frequencyA; + + /** B相频率 */ + @Excel(name = "B相频率") + private String frequencyB; + + /** C相频率 */ + @Excel(name = "C相频率") + private String frequencyC; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCfgId(Long cfgId) + { + this.cfgId = cfgId; + } + + public Long getCfgId() + { + return cfgId; + } + public void setPointId(Long pointId) + { + this.pointId = pointId; + } + + public Long getPointId() + { + return pointId; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public String getDeviceSn() + { + return deviceSn; + } + public void setSwitchesAc(String switchesAc) + { + this.switchesAc = switchesAc; + } + + public String getSwitchesAc() + { + return switchesAc; + } + public void setSwitchesSwitch(String switchesSwitch) + { + this.switchesSwitch = switchesSwitch; + } + + public String getSwitchesSwitch() + { + return switchesSwitch; + } + public void setSwitchesSwitches(String switchesSwitches) + { + this.switchesSwitches = switchesSwitches; + } + + public String getSwitchesSwitches() + { + return switchesSwitches; + } + public void setSwitchesSwitchstatus(String switchesSwitchstatus) + { + this.switchesSwitchstatus = switchesSwitchstatus; + } + + public String getSwitchesSwitchstatus() + { + return switchesSwitchstatus; + } + public void setTemperature(String temperature) + { + this.temperature = temperature; + } + + public String getTemperature() + { + return temperature; + } + public void setLeakage(String leakage) + { + this.leakage = leakage; + } + + public String getLeakage() + { + return leakage; + } + public void setVoltageA(String voltageA) + { + this.voltageA = voltageA; + } + + public String getVoltageA() + { + return voltageA; + } + public void setVoltageB(String voltageB) + { + this.voltageB = voltageB; + } + + public String getVoltageB() + { + return voltageB; + } + public void setVoltageC(String voltageC) + { + this.voltageC = voltageC; + } + + public String getVoltageC() + { + return voltageC; + } + public void setVoltageAb(String voltageAb) + { + this.voltageAb = voltageAb; + } + + public String getVoltageAb() + { + return voltageAb; + } + public void setVoltageBc(String voltageBc) + { + this.voltageBc = voltageBc; + } + + public String getVoltageBc() + { + return voltageBc; + } + public void setVoltageCa(String voltageCa) + { + this.voltageCa = voltageCa; + } + + public String getVoltageCa() + { + return voltageCa; + } + public void setCurrentA(String currentA) + { + this.currentA = currentA; + } + + public String getCurrentA() + { + return currentA; + } + public void setCurrentB(String currentB) + { + this.currentB = currentB; + } + + public String getCurrentB() + { + return currentB; + } + public void setCurrentC(String currentC) + { + this.currentC = currentC; + } + + public String getCurrentC() + { + return currentC; + } + public void setPowerA(String powerA) + { + this.powerA = powerA; + } + + public String getPowerA() + { + return powerA; + } + public void setPowerB(String powerB) + { + this.powerB = powerB; + } + + public String getPowerB() + { + return powerB; + } + public void setPowerC(String powerC) + { + this.powerC = powerC; + } + + public String getPowerC() + { + return powerC; + } + public void setEnergyA(String energyA) + { + this.energyA = energyA; + } + + public String getEnergyA() + { + return energyA; + } + public void setEnergyB(String energyB) + { + this.energyB = energyB; + } + + public String getEnergyB() + { + return energyB; + } + public void setEnergyC(String energyC) + { + this.energyC = energyC; + } + + public String getEnergyC() + { + return energyC; + } + public void setFactorA(String factorA) + { + this.factorA = factorA; + } + + public String getFactorA() + { + return factorA; + } + public void setFactorB(String factorB) + { + this.factorB = factorB; + } + + public String getFactorB() + { + return factorB; + } + public void setFactorC(String factorC) + { + this.factorC = factorC; + } + + public String getFactorC() + { + return factorC; + } + public void setFrequencyA(String frequencyA) + { + this.frequencyA = frequencyA; + } + + public String getFrequencyA() + { + return frequencyA; + } + public void setFrequencyB(String frequencyB) + { + this.frequencyB = frequencyB; + } + + public String getFrequencyB() + { + return frequencyB; + } + public void setFrequencyC(String frequencyC) + { + this.frequencyC = frequencyC; + } + + public String getFrequencyC() + { + return frequencyC; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cfgId", getCfgId()) + .append("pointId", getPointId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("deviceSn", getDeviceSn()) + .append("switchesAc", getSwitchesAc()) + .append("switchesSwitch", getSwitchesSwitch()) + .append("switchesSwitches", getSwitchesSwitches()) + .append("switchesSwitchstatus", getSwitchesSwitchstatus()) + .append("temperature", getTemperature()) + .append("leakage", getLeakage()) + .append("voltageA", getVoltageA()) + .append("voltageB", getVoltageB()) + .append("voltageC", getVoltageC()) + .append("voltageAb", getVoltageAb()) + .append("voltageBc", getVoltageBc()) + .append("voltageCa", getVoltageCa()) + .append("currentA", getCurrentA()) + .append("currentB", getCurrentB()) + .append("currentC", getCurrentC()) + .append("powerA", getPowerA()) + .append("powerB", getPowerB()) + .append("powerC", getPowerC()) + .append("energyA", getEnergyA()) + .append("energyB", getEnergyB()) + .append("energyC", getEnergyC()) + .append("factorA", getFactorA()) + .append("factorB", getFactorB()) + .append("factorC", getFactorC()) + .append("frequencyA", getFrequencyA()) + .append("frequencyB", getFrequencyB()) + .append("frequencyC", getFrequencyC()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotWarning.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotWarning.java new file mode 100644 index 00000000..da1072a0 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/QuartzDevIotWarning.java @@ -0,0 +1,136 @@ +package com.ruoyi.quartz.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 配电箱预警对象 dev_iot_warning + * + * @author yanzhu + * @date 2025-04-04 + */ +public class QuartzDevIotWarning extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 配置主键 */ + @Excel(name = "配置主键") + private Long cfgId; + + /** 点位主键 */ + @Excel(name = "点位主键") + private Long pointId; + + /** 公司主键 */ + @Excel(name = "公司主键") + private Long comId; + + /** 项目主键 */ + @Excel(name = "项目主键") + private Long projectId; + + /** 设备序列号 */ + @Excel(name = "设备序列号") + private String deviceSn; + + /** 预警类型 */ + @Excel(name = "预警类型") + private String warningType; + + /** 预警内容 */ + @Excel(name = "预警内容") + private String warningContent; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCfgId(Long cfgId) + { + this.cfgId = cfgId; + } + + public Long getCfgId() + { + return cfgId; + } + public void setPointId(Long pointId) + { + this.pointId = pointId; + } + + public Long getPointId() + { + return pointId; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public String getDeviceSn() + { + return deviceSn; + } + public void setWarningType(String warningType) + { + this.warningType = warningType; + } + + public String getWarningType() + { + return warningType; + } + public void setWarningContent(String warningContent) + { + this.warningContent = warningContent; + } + + public String getWarningContent() + { + return warningContent; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cfgId", getCfgId()) + .append("pointId", getPointId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("deviceSn", getDeviceSn()) + .append("warningType", getWarningType()) + .append("warningContent", getWarningContent()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/QuartzDevIotMapper.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/QuartzDevIotMapper.java new file mode 100644 index 00000000..ff882787 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/QuartzDevIotMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.quartz.mapper; + +import com.ruoyi.quartz.domain.QuartzDevIotConfigPoint; +import com.ruoyi.quartz.domain.QuartzDevIotDatas; +import com.ruoyi.quartz.domain.QuartzDevIotWarning; + +import java.util.List; +import java.util.Map; + +/** + * 萨达配电箱数据 + */ +public interface QuartzDevIotMapper { + + /** + * 获取配电箱配置信息 + */ + public List> selectDevIotConfigList(); + + /** + * 查询配电箱配置列表 + * + * @param devIotConfigPoint 配电箱配置 + * @return 配电箱配置集合 + */ + public List selectDevIotConfigPointList(QuartzDevIotConfigPoint devIotConfigPoint); + + /** + * 新增配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int insertDevIotConfigPoint(QuartzDevIotConfigPoint devIotConfigPoint); + + /** + * 修改配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int updateDevIotConfigPoint(QuartzDevIotConfigPoint devIotConfigPoint); + + /** + * 新增配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + public int insertDevIotDatas(QuartzDevIotDatas devIotDatas); + + /** + * 新增配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + public int insertDevIotWarning(QuartzDevIotWarning devIotWarning); + +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/IQuartzDevIotService.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/IQuartzDevIotService.java new file mode 100644 index 00000000..a148287c --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/IQuartzDevIotService.java @@ -0,0 +1,59 @@ +package com.ruoyi.quartz.service; + +import com.ruoyi.quartz.domain.QuartzDevIotConfigPoint; +import com.ruoyi.quartz.domain.QuartzDevIotDatas; +import com.ruoyi.quartz.domain.QuartzDevIotWarning; + +import java.util.List; +import java.util.Map; + +/** + * 萨达配电箱数据 + */ +public interface IQuartzDevIotService { + + /** + * 获取配电箱配置信息 + */ + public List> selectDevIotConfigList(); + + /** + * 查询配电箱配置列表 + * + * @param devIotConfigPoint 配电箱配置 + * @return 配电箱配置集合 + */ + public List selectDevIotConfigPointList(QuartzDevIotConfigPoint devIotConfigPoint); + + /** + * 新增配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int insertDevIotConfigPoint(QuartzDevIotConfigPoint devIotConfigPoint); + + /** + * 修改配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int updateDevIotConfigPoint(QuartzDevIotConfigPoint devIotConfigPoint); + + /** + * 新增配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + public int insertDevIotDatas(QuartzDevIotDatas devIotDatas); + + /** + * 新增配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + public int insertDevIotWarning(QuartzDevIotWarning devIotWarning); +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/QuartzDevIotServiceImpl.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/QuartzDevIotServiceImpl.java new file mode 100644 index 00000000..94013db1 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/QuartzDevIotServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.quartz.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.quartz.domain.QuartzDevIotConfigPoint; +import com.ruoyi.quartz.domain.QuartzDevIotDatas; +import com.ruoyi.quartz.domain.QuartzDevIotWarning; +import com.ruoyi.quartz.mapper.QuartzDevIotMapper; +import com.ruoyi.quartz.service.IQuartzDevIotService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 萨达配电箱数据 + */ +@Service +public class QuartzDevIotServiceImpl implements IQuartzDevIotService { + + @Autowired + private QuartzDevIotMapper devIotMapper; + + /** + * 获取配电箱配置信息 + */ + @Override + public List> selectDevIotConfigList() { + return devIotMapper.selectDevIotConfigList(); + } + + /** + * 查询配电箱配置列表 + * + * @param devIotConfigPoint 配电箱配置 + * @return 配电箱配置集合 + */ + @Override + public List selectDevIotConfigPointList(QuartzDevIotConfigPoint devIotConfigPoint){ + return devIotMapper.selectDevIotConfigPointList(devIotConfigPoint); + } + + /** + * 新增配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + @Override + public int insertDevIotConfigPoint(QuartzDevIotConfigPoint devIotConfigPoint) + { + devIotConfigPoint.setCreateTime(DateUtils.getNowDate()); + return devIotMapper.insertDevIotConfigPoint(devIotConfigPoint); + } + + /** + * 修改配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + @Override + public int updateDevIotConfigPoint(QuartzDevIotConfigPoint devIotConfigPoint) + { + devIotConfigPoint.setUpdateTime(DateUtils.getNowDate()); + return devIotMapper.updateDevIotConfigPoint(devIotConfigPoint); + } + + /** + * 新增配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + @Override + public int insertDevIotDatas(QuartzDevIotDatas devIotDatas) + { + devIotDatas.setCreateTime(DateUtils.getNowDate()); + return devIotMapper.insertDevIotDatas(devIotDatas); + } + + /** + * 新增配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + @Override + public int insertDevIotWarning(QuartzDevIotWarning devIotWarning) + { + devIotWarning.setCreateTime(DateUtils.getNowDate()); + return devIotMapper.insertDevIotWarning(devIotWarning); + } + +} diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SadaHzDataTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SadaHzDataTask.java new file mode 100644 index 00000000..d9a78330 --- /dev/null +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SadaHzDataTask.java @@ -0,0 +1,265 @@ +package com.ruoyi.quartz.task; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.constant.ApiConstants; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.quartz.domain.QuartzDevIotConfigPoint; +import com.ruoyi.quartz.domain.QuartzDevIotDatas; +import com.ruoyi.quartz.domain.QuartzDevIotWarning; +import com.ruoyi.quartz.service.IQuartzDevIotService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description: 萨达配电箱数据定时任务 + * @Title: SadaHzDataTask + * @Package com.yanzhu.job.task + * @Author: JiangYuQi + * @CreateTime: 2024/10/26 17:05 + */ +@Component("sadaHzDataTask") +public class SadaHzDataTask { + + @Autowired + private IQuartzDevIotService devIotService; + + private static final Logger log = LoggerFactory.getLogger(SadaHzDataTask.class); + + /** + * 获取配电箱点位 + */ + public void getIotConfigPoint() { + List> configs = devIotService.selectDevIotConfigList(); + if(configs.size()>0){ + for(Map configMap:configs){ + // 判断是萨达设备 + if(StringUtils.eqObj(configMap.get("factory_name"),"SD")){ + String signalName = Convert.toStr(configMap.get("signal_name")); + String signalCode = Convert.toStr(configMap.get("signal_code")); + String projectName = Convert.toStr(configMap.get("project_name")); + String projectHashId = getSaDaProjectHashIds(signalName,signalCode,projectName); + if(StringUtils.isNotEmpty(projectHashId)){ + // 根据项目主键,查询设备信息 + findSaDaBoxByProjectHashId(configMap,projectHashId); + } + } + } + } + } + + /** + * 获取配电箱数据/预警 + */ + public void getIotPowerDatas() { + QuartzDevIotConfigPoint pointQuery = new QuartzDevIotConfigPoint(); + pointQuery.setIsDel("0"); + List configPoints = devIotService.selectDevIotConfigPointList(pointQuery); + if(configPoints.size()>0){ + for(QuartzDevIotConfigPoint configPoint:configPoints){ + // 判断是萨达设备 + if(StringUtils.eqObj(configPoint.getFactoryName(),"SD")){ + if(StringUtils.isNotEmpty(configPoint.getDeviceSn())){ + String resStr = HttpUtils.sendGet(ApiConstants.IOT_SD_HOST + "/metric/box/"+configPoint.getDeviceSn()); + JSONObject result = JSONObject.parseObject(resStr).getJSONObject("result"); + // 开关检测数据 + JSONObject switches = result.getJSONObject("switches"); + // 电能检测数据 + JSONObject metric = result.getJSONObject("metric"); + // 温度检测数据 + JSONArray temperatures = result.getJSONArray("temperatures"); + // 漏电检测数据 + JSONArray leakages = result.getJSONArray("leakages"); + // 智能报警数据 + JSONObject ticketStatus = result.getJSONObject("ticketStatus"); + QuartzDevIotDatas devIotDatas = new QuartzDevIotDatas(); + devIotDatas.setCfgId(configPoint.getCfgId()); + devIotDatas.setPointId(configPoint.getId()); + devIotDatas.setComId(configPoint.getComId()); + devIotDatas.setProjectId(configPoint.getProjectId()); + devIotDatas.setDeviceSn(configPoint.getDeviceSn()); + try { + devIotDatas.setSwitchesAc(switches.getString("ac")); + devIotDatas.setSwitchesSwitch(switches.getString("switch")); + devIotDatas.setSwitchesSwitches(switches.getString("switches")); + devIotDatas.setSwitchesSwitchstatus(switches.getString("switchStatus")); + devIotDatas.setTemperature(temperatures.getJSONObject(0).getString("temperature")); + double leakageValue = 0.00; + for (int i = 0; i < leakages.size(); i++) { + JSONObject leakage = leakages.getJSONObject(i); + if(Convert.toDouble(leakage.get("leakage"),0.00)>leakageValue){ + leakageValue = leakage.getDoubleValue("leakage"); + } + } + devIotDatas.setLeakage(Convert.toStr(leakageValue)); + devIotDatas.setVoltageA(metric.getString("voltage_a")); + devIotDatas.setVoltageB(metric.getString("voltage_b")); + devIotDatas.setVoltageC(metric.getString("voltage_c")); + devIotDatas.setVoltageAb(metric.getString("voltage_ab")); + devIotDatas.setVoltageBc(metric.getString("voltage_bc")); + devIotDatas.setVoltageCa(metric.getString("voltage_ca")); + devIotDatas.setCurrentA(metric.getString("current_a")); + devIotDatas.setCurrentB(metric.getString("current_b")); + devIotDatas.setCurrentC(metric.getString("current_c")); + devIotDatas.setPowerA(metric.getString("power_a")); + devIotDatas.setPowerB(metric.getString("power_b")); + devIotDatas.setPowerC(metric.getString("power_c")); + devIotDatas.setEnergyA(metric.getString("energy_a")); + devIotDatas.setEnergyB(metric.getString("energy_b")); + devIotDatas.setEnergyC(metric.getString("energy_c")); + devIotDatas.setFactorA(metric.getString("factor_a")); + devIotDatas.setFactorB(metric.getString("factor_b")); + devIotDatas.setFactorC(metric.getString("factor_c")); + devIotDatas.setFrequencyA(metric.getString("frequency_a")); + devIotDatas.setFrequencyB(metric.getString("frequency_b")); + devIotDatas.setFrequencyC(metric.getString("frequency_c")); + devIotService.insertDevIotDatas(devIotDatas); + + // 智能预警数据 + QuartzDevIotWarning devIotWarning = new QuartzDevIotWarning(); + devIotWarning.setCfgId(configPoint.getCfgId()); + devIotWarning.setPointId(configPoint.getId()); + devIotWarning.setComId(configPoint.getComId()); + devIotWarning.setProjectId(configPoint.getProjectId()); + devIotWarning.setDeviceSn(devIotDatas.getDeviceSn()); + if(ticketStatus.getInteger("is_blackout")>0){ + devIotWarning.setWarningType("断电预警"); + devIotWarning.setWarningContent("设备触发断电,请排查异常情况"); + devIotService.insertDevIotWarning(devIotWarning); + } + if(ticketStatus.getInteger("is_smoke")>0){ + devIotWarning.setWarningType("烟感报警"); + devIotWarning.setWarningContent("设备烟感报警,请排查异常情况"); + devIotService.insertDevIotWarning(devIotWarning); + } + if(ticketStatus.getInteger("is_overload")>0){ + devIotWarning.setWarningType("过载报警"); + devIotWarning.setWarningContent("设备过载报警,请排查异常情况"); + devIotService.insertDevIotWarning(devIotWarning); + } + if(ticketStatus.getInteger("is_disconnect")>0){ + devIotWarning.setWarningType("断开报警"); + devIotWarning.setWarningContent("设备断开报警,请排查异常情况"); + devIotService.insertDevIotWarning(devIotWarning); + } + if(ticketStatus.getInteger("is_overheat")>0){ + devIotWarning.setWarningType("高温报警"); + devIotWarning.setWarningContent("设备高温报警,请排查异常情况"); + devIotService.insertDevIotWarning(devIotWarning); + } + if(ticketStatus.getInteger("is_leakage")>0){ + devIotWarning.setWarningType("漏电报警"); + devIotWarning.setWarningContent("设备漏电报警,请排查异常情况"); + devIotService.insertDevIotWarning(devIotWarning); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + } + } + } + } + + /** + * 获取项目配置HashIds + * @param signalName 通信账号 + * @param signalCode 通信密码 + * @param proName 项目名称 + * @return + */ + private static String getSaDaProjectHashIds(String signalName, String signalCode, String proName){ + try { + Map params = new HashMap<>(); + params.put("username",signalName); + params.put("password",signalCode); + String resStr = HttpUtils.sendPost(ApiConstants.IOT_SD_HOST+"/v2/api-token-auth", JSON.toJSONString(params)); + JSONObject result = JSONObject.parseObject(resStr).getJSONObject("result"); + JSONObject accountJson = result.getJSONObject("account"); + if(StringUtils.isNotEmpty(accountJson.getString("canViewProjects"))){ + JSONArray canProjects = accountJson.getJSONArray("canViewProjects"); + if(canProjects.size()>0){ + // 使用 forEach 和 Lambda 遍历 + for(Object item:canProjects){ + JSONObject obj = (JSONObject) item; + if(StringUtils.eqObj(obj.getString("name"),proName)){ + return obj.getString("hashId"); + } + } + return accountJson.getJSONObject("currentProject").getString("hashId"); + }else{ + return accountJson.getJSONObject("currentProject").getString("hashId"); + } + }else{ + return accountJson.getJSONObject("currentProject").getString("hashId"); + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + /** + * 获取项目设备 + * @param configMap 配置信息 + * @param proHashId 点位编号 + */ + private void findSaDaBoxByProjectHashId(Map configMap, String proHashId){ + try { + Long cfgId = Convert.toLong(configMap.get("id")); + String resStr = HttpUtils.sendGet(ApiConstants.IOT_SD_HOST+"/box/project/"+proHashId); + JSONArray result = JSONObject.parseObject(resStr).getJSONArray("result"); + if(result.size()>0){ + QuartzDevIotConfigPoint pointQuery = new QuartzDevIotConfigPoint(); + pointQuery.setCfgId(cfgId); + List pointList = devIotService.selectDevIotConfigPointList(pointQuery); + result.forEach(item -> { + JSONObject obj = (JSONObject) item; + List pointItems = pointList.stream().filter(point -> StringUtils.eqObj(point.getDeviceSn(),obj.getString("hashId"))).collect(Collectors.toList()); + if(pointItems.size()>0){ + QuartzDevIotConfigPoint devIotConfigPoint = pointItems.get(0); + devIotConfigPoint.setDeviceName(obj.getString("name")); + devIotConfigPoint.setFactoryName(Convert.toStr(configMap.get("factory_name"))); + devIotConfigPoint.setLevels(obj.getString("level")); + devIotConfigPoint.setLeakageCurrent(obj.getString("leakageCurrent")); + devIotConfigPoint.setRatedTemperature(obj.getString("ratedTemperature")); + devIotConfigPoint.setShortCircuitCurrent(obj.getString("shortCircuitCurrent")); + devIotConfigPoint.setRatedCurrent(obj.getString("ratedCurrent")); + devIotConfigPoint.setRatedVoltage(obj.getString("ratedVoltage")); + devIotConfigPoint.setOnlineStatus(obj.getJSONObject("device").getString("onlineStatus")); + devIotService.updateDevIotConfigPoint(devIotConfigPoint); + }else{ + QuartzDevIotConfigPoint devIotConfigPoint = new QuartzDevIotConfigPoint(); + devIotConfigPoint.setCfgId(cfgId); + devIotConfigPoint.setComId(Convert.toLong(configMap.get("com_id"))); + devIotConfigPoint.setProjectId(Convert.toLong(configMap.get("project_id"))); + devIotConfigPoint.setDeviceSn(obj.getString("hashId")); + devIotConfigPoint.setDeviceName(obj.getString("name")); + devIotConfigPoint.setFactoryName(Convert.toStr(configMap.get("factory_name"))); + devIotConfigPoint.setLevels(obj.getString("level")); + devIotConfigPoint.setLeakageCurrent(obj.getString("leakageCurrent")); + devIotConfigPoint.setRatedTemperature(obj.getString("ratedTemperature")); + devIotConfigPoint.setShortCircuitCurrent(obj.getString("shortCircuitCurrent")); + devIotConfigPoint.setRatedCurrent(obj.getString("ratedCurrent")); + devIotConfigPoint.setRatedVoltage(obj.getString("ratedVoltage")); + devIotConfigPoint.setOnlineStatus(obj.getJSONObject("device").getString("onlineStatus")); + devIotService.insertDevIotConfigPoint(devIotConfigPoint); + } + }); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + +} diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/QuartzDevIotMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/QuartzDevIotMapper.xml new file mode 100644 index 00000000..a39969de --- /dev/null +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/QuartzDevIotMapper.xml @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, cfg_id, com_id, project_id, device_sn, device_name, factory_name, contact_person, contact_person_phone, levels, leakage_current, rated_temperature, short_circuit_current, rated_current, rated_voltage, online_status, is_del, create_by, create_time, update_by, update_time, remark from dev_iot_config_point + + + + + + insert into dev_iot_config_point + + cfg_id, + com_id, + project_id, + device_sn, + device_name, + factory_name, + contact_person, + contact_person_phone, + levels, + leakage_current, + rated_temperature, + short_circuit_current, + rated_current, + rated_voltage, + online_status, + is_del, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{cfgId}, + #{comId}, + #{projectId}, + #{deviceSn}, + #{deviceName}, + #{factoryName}, + #{contactPerson}, + #{contactPersonPhone}, + #{levels}, + #{leakageCurrent}, + #{ratedTemperature}, + #{shortCircuitCurrent}, + #{ratedCurrent}, + #{ratedVoltage}, + #{onlineStatus}, + #{isDel}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update dev_iot_config_point + + cfg_id = #{cfgId}, + com_id = #{comId}, + project_id = #{projectId}, + device_sn = #{deviceSn}, + device_name = #{deviceName}, + factory_name = #{factoryName}, + contact_person = #{contactPerson}, + contact_person_phone = #{contactPersonPhone}, + levels = #{levels}, + leakage_current = #{leakageCurrent}, + rated_temperature = #{ratedTemperature}, + short_circuit_current = #{shortCircuitCurrent}, + rated_current = #{ratedCurrent}, + rated_voltage = #{ratedVoltage}, + online_status = #{onlineStatus}, + is_del = #{isDel}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + + + insert into dev_iot_datas + + cfg_id, + point_id, + com_id, + project_id, + device_sn, + switches_ac, + switches_switch, + switches_switches, + switches_switchStatus, + temperature, + leakage, + voltage_a, + voltage_b, + voltage_c, + voltage_ab, + voltage_bc, + voltage_ca, + current_a, + current_b, + current_c, + power_a, + power_b, + power_c, + energy_a, + energy_b, + energy_c, + factor_a, + factor_b, + factor_c, + frequency_a, + frequency_b, + frequency_c, + create_time, + + + #{cfgId}, + #{pointId}, + #{comId}, + #{projectId}, + #{deviceSn}, + #{switchesAc}, + #{switchesSwitch}, + #{switchesSwitches}, + #{switchesSwitchstatus}, + #{temperature}, + #{leakage}, + #{voltageA}, + #{voltageB}, + #{voltageC}, + #{voltageAb}, + #{voltageBc}, + #{voltageCa}, + #{currentA}, + #{currentB}, + #{currentC}, + #{powerA}, + #{powerB}, + #{powerC}, + #{energyA}, + #{energyB}, + #{energyC}, + #{factorA}, + #{factorB}, + #{factorC}, + #{frequencyA}, + #{frequencyB}, + #{frequencyC}, + #{createTime}, + + + + + insert into dev_iot_warning + + cfg_id, + point_id, + com_id, + project_id, + device_sn, + warning_type, + warning_content, + create_time, + + + #{cfgId}, + #{pointId}, + #{comId}, + #{projectId}, + #{deviceSn}, + #{warningType}, + #{warningContent}, + #{createTime}, + + + + \ No newline at end of file diff --git a/ruoyi-ui/public/favicon.ico b/ruoyi-ui/public/favicon.ico deleted file mode 100644 index 0bbaf063831e316e13a47e9bea6eca65dc599e42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9662 zcmc(l32>Fw6~}K_vObcxqSLA3hPAcrxPXd?Ahv2$uwQR=?ojH8?|=obZLAskpMpjy}&V`Cx|3VVp+6CXqdshGZH3Q5;wVBcl4{h>c_%nLvhq> zdL(8xKNl_BGBy_9IzATOHZfLM|3bVVIW?ZwFe8!EI5W`|=zX2&FU!966O($eyX!wS zGu<}4BR?4)eX}VCGeU{pXFc;SPhng55ZV) zF6a(+yaze9OpP?Zq-Ipy)I1dxLcC)NGR)gLF7^@QG@EgH4;f}5!&?m{iPz|7CYTB) zf^py(@EAA>mNq-OFCp`|?A zIi3wplkW8{hgafe!~J1Xd0V%vjSoe}Zh9nQk;C7J8AhXvG3erX z78r;QY754?(U+ds{6tgd$JoIM2<{dw6dwXiRdD2Q*Sf3 z^RQuKKfyV*+Tc_)_g7u>=N;WO7ruqyKyV7U4}1*jKucM4EO}_9uQelzoZj28sgl%7 ziP(2nbt_nXd*S=K4>_DoR{aeb?nj1)(8Z%^T`<3Gt#t7mx=7np12#1TS!K6*tJi4c6PS4Agu$* z69*-`l3_ug?6eH$)1lTEE|X;Yh!<0R&|!AJcVz1_M#zjs$B z1Dw4+670XxmJG=0)(@>2;^lm~)^KzopUGNd%P$W(T~u8ALtS7~Z?Sgf0<-DC*lzLL z-J6!27|e&X90$RFPNodlgNgJF&;& z0dOA(_uu5&C8y`wFVD!c%ZIQ&u*TLC8%PfMouwD%yYnlCrgc%yykLIcj!w*qVFhMx zzxJ?d-@W)sHxJ-#K<=WxIn!nDjyq$nwLme(muKeLug=bMI`|%2SInt6P4VZ7OAD-G zu4NY&I9+hOoVjtBV#t0IUv@6n&gUAsSawOl=#{sI47xJqR~B@DQTrcR(6@{E{M1|nXM?@m zLc3jYs^gB`m;E8&2Y1C7vU|k}if?33vMbGxvh(scd^0$|4=~K__7myg6N^vIHjKN$ z&V@MkGRNCXi?Q`Kg00KXD4&omX$}5LHg-&Tk(HMt0Kc92cS9%I~%+xOgfMG6GL~dpAOLI@FU6T)EtCqabxWe!*~lr@F_{h zUA_^UZ}#zits?%B57qb+Gk=Xe9i%z}xj=`xwD&>fqSPo1aavY#dOWxGshG1}{796w z>EmX*7#!FD6a$iA;Uf7t%Y?H zV}|iI-(FfU96#O^tVvdJj$&sYuPFymE~6SjkQ0B1UkU@Wrg-1;U-f*{<c_!!N{{XW+8F>^YX+=d)y0pgx;Tf?ziH9s655zTRw;1k*m1ei#WA>-MvLUfmw6czKPv5 zCaQsndr+qu3x8L)(RxaJ|1$5-hO5EWi{L)T+q&|0*}LLtH{QOE!g{PVne$E5C$87n zFFl9nZ_C*yD##f7pRr%wFpb=bI-u56>N-`_?s}6yx%d}3?sd7kw{>50Q0?SFYA31z zrG2Pf&pGa$1@eHYymjBiaPpgh463uaJXi4y^+%VdGky;%@5a9i$1|oIn{!)VFY$FB zUrR)H)EQJ;sUmkdhP=&?AMf??Z@^~;+*Na)C;p1(70alu$=uTzF2rv3lMNwDH|(M` zBQHe?&Jfp`!$Y#rtiU~It999!Q!IzpW@Odb${ zd&JgFjG)Jun@f@j-!)wGXZa<2XZ*1f#~mH04nINM9e;d}#!j}NI6(DT#R#mwN#f4) z6ickXzbK3O{DS;bv#n1!z;1i-I9vDfakl=|<8AWw<7{$959)U5`agE~CV6$Xo?kX} z&rJxfe(d!ftitnGjZOKW>aNcJ5mTzRrWy}%+*n(6n5&<$He3$(CTA~W!nW?UQ*6_w zZ*0@n)u7TLHRpQUSQ2&P!aOJ^k3U5Azw-J$TZ`+1SRs(%ZqHq9rteWKshCVL1LLNA z_p`4D<;N7ykgp$2d{HGoyLEij)|LDM{$)0E+rD&ay55-Xw*egtX0Edi?3o|Un78}E zc|kM(Oy9#A6!;z&Ybtgom#QHj>q}jM?^CfbdiunDC(`$>$@|&uEB={D-!@gvvyHDF ziVW$RBl13LZ6AD4$9-s$waS0Hg!fROZ!2lrZ_D=(=P2e>ZAv*LIn}M`z|=flltpa% zB>trme_N599H~excyxnpN?E(T!P=%qYqza#O3fOuu5m_G_F0K-zQLMSK)tKO6Ch*k z3+VG5&s}YE+=CBSF1VI>()k{0X|Ap?C{OjPSE$K#QB1>klo&ZePilyVC11!tIQ9NT zSEN1|mQ0miW>X)4(xIu;tbxNDr-u%v|DO1a9@u9W{8ESb_dBAipR;OD1-0Vsp}42D z?@?`EwOQ4qRQn;fUqW4Lf7OWe9SHs|XKR?w_u6R%hc=c(DjH`*s8M^wMl$|^uS;-$ zO!=KVR?Oa>t)V35`Rkkb6wlkYJM%rtbyasz9fjJ;R_coVfbT1_&8DySe1AdvZ(6-C z^S<==ea^LK%izC1{k;VA&ArqEJ1Avdmg3t>@ja!hM--M4^Oxd#O7T6V*nTPX#L|U* zvd^R@AwGp*7#I%py<4sLt^mt|_9NQcfUXNSfdQI>vgP({8T>obN2mp6BtqC`Xv-M# zt;ZuFd}N4tErjn3;cr6to)C4o5VjMdE}f0v6#odA3z}_^{eJ=3`+))U+X{_Q<~@=z z2eeCu4E`;2seZH`!=K+v@Y@4^8z3K#?>F#Q?ru~Egum*du14DQCgWG)zROQ)#cd(S z?mMyTH*Gghw7N&Xx9Fkkt$#nz9)0Y|y{R-Wjl(sqxas@)3F4N43)xQruY)@FPuKPT z7k|Awz=^b#K)y^dp!h2m_t(|_5@=5Ndp5Iw1K{^LE$dseP3K}mnpteJT+0~y*66(3 zeE8A2?Gaq3O=-8kF-<{hi`f}zjGY~{)j?ZNYx(b69?a4)54x89&N^;xi<^&gg7dEB zes`a5>Bk-W{(S4-<6H4iKb}u{z^ipToAdp-&$q?Fv2Qta*Mru{&G@w0GLG&%Edj@D IjjM0}2ULi@&Hw-a diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 2804752b..52082cd9 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -86,7 +86,6 @@ export default { }, methods: { goBigScreen(){ - //window.open("//szgc.jhncidg.com:808/jhbs/") window.open("/jhbs/") }, toggleSideBar() { diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/api/TowerCraneApiController.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/api/TowerCraneApiController.java index 84756e58..2a5f5aff 100644 --- a/yanzhu-deviceApi/src/main/java/com/ruoyi/api/TowerCraneApiController.java +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/api/TowerCraneApiController.java @@ -1,7 +1,5 @@ package com.ruoyi.api; -import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONObject; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.RateLimiter; import com.ruoyi.common.constant.CacheConstants; @@ -13,6 +11,9 @@ import com.ruoyi.common.enums.LimitType; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.domain.TowerReqVo; +import com.ruoyi.domain.vo.TyTowerRoundReqVO; +import com.ruoyi.domain.vo.TyTowerRunReqVO; +import com.ruoyi.domain.vo.TyTowerWarningReqVO; import com.ruoyi.emuns.TowerTypeEnums; import com.yanzhu.jh.device.domain.*; import com.yanzhu.jh.device.service.*; @@ -25,7 +26,9 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.validation.Valid; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,9 +61,19 @@ public class TowerCraneApiController { @Autowired private IDevTowerDataCollideService devTowerDataCollideService; + @Autowired + private IDevTowerDataWarningService devTowerDataWarningService; + @Autowired private IDevTowerProjectConfigService devTowerProjectConfigService; + private String YANZHU_DEVICE_TOWER = "device.tower_cfg:"; + + /** + * 塔机限位数据 + */ + private Map staticLimitMap = new HashMap<>(); + /** * 塔吊监测++ * 限流规则[60秒内最多请求10次,限流策略IP] @@ -116,7 +129,7 @@ public class TowerCraneApiController { * 塔机上报实时数据 * @param req */ - private static void pushRunData(DevTowerProjectConfig config,TowerReqVo req){ + private void pushRunData(DevTowerProjectConfig config,TowerReqVo req){ DevTowerDataRun devTowerDataRun = new DevTowerDataRun(); Map dataContent = req.getContent().getDataContent(); devTowerDataRun.setCfgId(config.getId()); @@ -142,26 +155,18 @@ public class TowerCraneApiController { devTowerDataRun.setRangeSensorState(Convert.toStr(dataContent.get("rangeSensorState"))); devTowerDataRun.setHeightSensorState(Convert.toStr(dataContent.get("heightSensorState"))); devTowerDataRun.setBrakingStatus(Convert.toStr(dataContent.get("brakingStatus"))); - if(dataContent.get("warnings")!=null){ - List warnings = (List)dataContent.get("warnings"); + if (dataContent.get("warnings") != null) { + List warnings = (List) dataContent.get("warnings"); devTowerDataRun.setWarnings(String.join(",", warnings)); - for(String warning:warnings){ + for (String warning : warnings) { + pushWarningData(config, warning, devTowerDataRun); Integer alarm = Convert.toInt(warning); - if(alarm>100 && alarm<120){ + if (alarm > 100 && alarm < 120) { devTowerDataRun.setIsAlarm(1L); } } } - System.out.println(devTowerDataRun); - //devTowerDataRunService.insertDevTowerDataRun(devTowerDataRun); - } - - public static void main(String[] args) { - String str = "{\"type\":111,\"content\":{\"time\":1496263304,\"dataType\":113001,\"deviceKey\":\"jycw6\",\"dataContent\":{\"height\":\"4.1\",\"range\": \"21.9\",\"rotation\": \"171.0\",\"load\": \"0.0\",\"windSpeed\": \"0.0\",\"leanAngleX\":\"0.5\",\"leanAngley\":\"0.0\",\"loadPercent\":\"0\", \"mome ntPercent\":\"0\",\"windSpeedPercent\":\"0\",\"leanAnglePercent\": \"0\", \"warnings\": [\"0\"],\"rate\":\"2\",\"rotationSensorState\":\"1\",\"loadSensorState\": \"1\",\"windSpeedSensorState\": \"1\",\"leanAngleSensorState\":\"1\",\"rangeSensorState\":\"1\",\"heightSensorState\":\"1\",\"bra kingStatus\":\"0\"}}}"; - TowerReqVo req = JSON.parseObject(str,TowerReqVo.class); - System.out.println(req); - DevTowerProjectConfig config = new DevTowerProjectConfig(); - pushRunData(config,req); + devTowerDataRunService.insertDevTowerDataRun(devTowerDataRun); } /** @@ -200,15 +205,16 @@ public class TowerCraneApiController { devTowerDataRound.setEndLeanAngleX(Convert.toStr(dataContent.get("endLeanAngleX"))); devTowerDataRound.setStartLeanAngleY(Convert.toStr(dataContent.get("startleanAngleY"))); devTowerDataRound.setEndLeanAngleY(Convert.toStr(dataContent.get("endLeanAngleY"))); - if(dataContent.get("warning")!=null){ - List warnings = (List)dataContent.get("warning"); + if (dataContent.get("warning") != null) { + List warnings = (List) dataContent.get("warning"); devTowerDataRound.setWarnings(String.join(",", warnings)); - for(String warning:warnings){ + for (String warning : warnings) { + pushWarningData(config, warning,null); Integer alarm = Convert.toInt(warning); - if(alarm>6 && alarm<10){ + if (alarm > 6 && alarm < 10) { devTowerDataRound.setIsOverload(1L); } - if(alarm>100 && alarm<120){ + if (alarm > 100 && alarm < 120) { devTowerDataRound.setIsAlarm(1L); } } @@ -216,6 +222,35 @@ public class TowerCraneApiController { devTowerDataRoundService.insertDevTowerDataRound(devTowerDataRound); } + /** + * 保存预警数据 + * + * @param config + * @param warning + */ + private void pushWarningData(DevTowerProjectConfig config, Object warning, DevTowerDataRun devTowerDataRun) { + DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning(); + devTowerDataWarning.setCfgId(config.getId()); + devTowerDataWarning.setProjectId(config.getProjectId()); + devTowerDataWarning.setDeviceKey(config.getDeviceSn()); + devTowerDataWarning.setWarnType(Convert.toLong(warning)); + if(devTowerDataRun!=null){ + devTowerDataWarning.setHeight(devTowerDataRun.getHeight()); + devTowerDataWarning.setRange(devTowerDataRun.getRange()); + devTowerDataWarning.setRotation(devTowerDataRun.getRotation()); + devTowerDataWarning.setLoad(devTowerDataRun.getLoad()); + devTowerDataWarning.setWindSpeed(devTowerDataRun.getWindSpeed()); + devTowerDataWarning.setLeanAngleX(devTowerDataRun.getLeanAngleX()); + devTowerDataWarning.setLeanAngleY(devTowerDataRun.getLeanAngleY()); + devTowerDataWarning.setMomentPercent(devTowerDataRun.getMomentPercent()); + devTowerDataWarning.setRate(devTowerDataRun.getRate()); + } + if(devTowerDataWarning.getWarnType()>100){ + devTowerDataWarning.setAlarmed(1L); + } + devTowerDataWarningService.insertDevTowerDataWarning(devTowerDataWarning); + } + /** * 塔机上报碰撞信息 * @param req @@ -344,4 +379,320 @@ public class TowerCraneApiController { devTowerDataLocalService.insertDevTowerDataLocal(devTowerDataLocal); } + /** + * 塔吊监测++ + * 限流规则[60秒内最多请求10次,限流策略IP] + * + * @param req 请求信息 + * @author JiangYuQi + * @date 2024-01-13 + */ + @ApiOperation(value = "山东探越-塔吊监测-实时数据") + @RateLimiter(count = 10, limitType = LimitType.IP) + @PostMapping("/v2_ty/run/push") + public AjaxResult tyPushRunData(@RequestBody @Valid TyTowerRunReqVO req) { + log.info("desApi.towerCrane.v2_ty.run.push...{}",req.getEid()); + DevTowerProjectConfig config = redisCache.getCacheObject(YANZHU_DEVICE_TOWER + req.getEid()); + if (config == null) { + throw new ServiceException(HttpStatusEnum.ERROR.getInfo(), HttpStatusEnum.ERROR.getCode()); + } + String deviceKey = req.getEid().toString(); + DevTowerDataLimit devTowerDataLimit = staticLimitMap.get(deviceKey); + if(devTowerDataLimit==null){ + DevTowerDataLimit devTowerDataLimitQuery = new DevTowerDataLimit(); + devTowerDataLimitQuery.setDeviceKey(deviceKey); + devTowerDataLimitQuery.setProjectId(config.getProjectId()); + List limitList = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimitQuery); + if(limitList.size()>0){ + devTowerDataLimit = limitList.get(0); + staticLimitMap.put(deviceKey,devTowerDataLimit); + }else{ + devTowerDataLimit = new DevTowerDataLimit(); + } + } + + DevTowerDataRun devTowerDataRun = new DevTowerDataRun(); + devTowerDataRun.setCfgId(config.getId()); + devTowerDataRun.setProjectId(config.getProjectId()); + devTowerDataRun.setDeviceKey(config.getDeviceSn()); + devTowerDataRun.setHeight(Convert.toStr(req.getHeight())); + devTowerDataRun.setRange(Convert.toStr(req.getRange())); + devTowerDataRun.setRotation(Convert.toStr(req.getRotation_angle())); + devTowerDataRun.setLoad(String.format("%.2f", req.getLifting_weight()/1000)); + Double limitLoad = Convert.toDouble(devTowerDataLimit.getLoadAlarm(),50.0); + devTowerDataRun.setLoadPercent(String.format("%.2f", (req.getLifting_weight()/10)/limitLoad)); + devTowerDataRun.setWindSpeed(Convert.toStr(req.getWind_speed())); + devTowerDataRun.setLeanAngleX(Convert.toStr(req.getAnteversion_x())); + devTowerDataRun.setLeanAngleY(Convert.toStr(req.getAnteversion_y())); + devTowerDataRun.setMomentPercent(Convert.toStr(req.getForce_distance())); + devTowerDataRun.setRate(Convert.toStr(req.getMagnification())); + devTowerDataRunService.insertDevTowerDataRun(devTowerDataRun); + return AjaxResult.success(); + } + + /** + * 塔吊监测++ + * 限流规则[60秒内最多请求10次,限流策略IP] + * + * @param req 请求信息 + * @author JiangYuQi + * @date 2024-01-13 + */ + @ApiOperation(value = "山东探越-塔吊监测-循环数据") + @RateLimiter(count = 10, limitType = LimitType.IP) + @PostMapping("/v2_ty/round/push") + public AjaxResult tyPushRoundData(@RequestBody @Valid TyTowerRoundReqVO req) { + log.info("desApi.towerCrane.v2_ty.round.push...{}",req.getEid()); + DevTowerProjectConfig config = redisCache.getCacheObject(YANZHU_DEVICE_TOWER + req.getEid()); + if (config == null) { + throw new ServiceException(HttpStatusEnum.ERROR.getInfo(), HttpStatusEnum.ERROR.getCode()); + } + DevTowerDataRound devTowerDataRound = new DevTowerDataRound(); + devTowerDataRound.setCfgId(config.getId()); + devTowerDataRound.setProjectId(config.getProjectId()); + devTowerDataRound.setDeviceKey(config.getDeviceSn()); + devTowerDataRound.setWorkStartTime(Convert.toStr(req.getStart_time())); + devTowerDataRound.setWorkEndTime(Convert.toStr(req.getEnd_time())); + devTowerDataRound.setMinHeight(Convert.toStr(req.getStart_height())); + devTowerDataRound.setMaxHeight(Convert.toStr(req.getEnd_height())); + devTowerDataRound.setMinRange(Convert.toStr(req.getStart_range())); + devTowerDataRound.setMaxRange(Convert.toStr(req.getEnd_range())); + devTowerDataRound.setStartHeight(Convert.toStr(req.getStart_height())); + devTowerDataRound.setEndHeight(Convert.toStr(req.getEnd_height())); + devTowerDataRound.setStartRange(Convert.toStr(req.getStart_range())); + devTowerDataRound.setEndRange(Convert.toStr(req.getEnd_range())); + devTowerDataRound.setStartRotation(Convert.toStr(req.getStart_rotation_angle())); + devTowerDataRound.setEndRotation(Convert.toStr(req.getEnd_rotation_angle())); + devTowerDataRound.setMaxLoad(String.format("%.2f", req.getWeight()/1000)); + devTowerDataRound.setMaxMomentPercent(Convert.toStr(req.getMoment_percent())); + devTowerDataRoundService.insertDevTowerDataRound(devTowerDataRound); + return AjaxResult.success(); + } + + /** + * 塔吊监测++ + * 限流规则[60秒内最多请求10次,限流策略IP] + * + * @param req 请求信息 + * @author JiangYuQi + * @date 2024-01-13 + */ + @ApiOperation(value = "山东探越-塔吊监测-预警数据") + @RateLimiter(count = 10, limitType = LimitType.IP) + @PostMapping("/v2_ty/warning/push") + public AjaxResult tyPushWarningData(@RequestBody @Valid TyTowerWarningReqVO req) { + log.info("desApi.towerCrane.v2_ty.warning.push...{}",req.getEid()); + DevTowerProjectConfig config = redisCache.getCacheObject(YANZHU_DEVICE_TOWER + req.getEid()); + if (config == null) { + throw new ServiceException(HttpStatusEnum.ERROR.getInfo(), HttpStatusEnum.ERROR.getCode()); + } + DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning(); + devTowerDataWarning.setCfgId(config.getId()); + devTowerDataWarning.setProjectId(config.getProjectId()); + devTowerDataWarning.setDeviceKey(config.getDeviceSn()); + String warningType = convertTyTowerWarningType(req.getType_id().toString()); + devTowerDataWarning.setWarnType(Convert.toLong(warningType)); + devTowerDataWarning.setWarnNote(req.getType()); + devTowerDataWarning.setHeight(Convert.toStr(req.getHeight())); + devTowerDataWarning.setRange(Convert.toStr(req.getRange())); + devTowerDataWarning.setRotation(Convert.toStr(req.getRotation())); + devTowerDataWarning.setLoad(String.format("%.2f", req.getLifting_weight()/1000)); + devTowerDataWarning.setWindSpeed(Convert.toStr(req.getWind_speed())); + devTowerDataWarning.setLeanAngleX(Convert.toStr(req.getAnteversion_x())); + devTowerDataWarning.setLeanAngleY(Convert.toStr(req.getAnteversion_y())); + devTowerDataWarning.setMomentPercent(Convert.toStr(req.getForce_distance())); + devTowerDataWarning.setRate(Convert.toStr(req.getMagnification())); + if(devTowerDataWarning.getWarnType()>100){ + devTowerDataWarning.setAlarmed(1L); + } + devTowerDataWarningService.insertDevTowerDataWarning(devTowerDataWarning); + return AjaxResult.success(); + } + + /** + * 转换预警类型 + * + * @param warningType + * @return + */ + private String convertTyTowerWarningType(String warningType) { + String warningTypeEs; + switch (warningType) { + case "1": + warningTypeEs = "5"; + break; + case "2": + warningTypeEs = "6"; + break; + case "3": + case "43": + warningTypeEs = "1"; + break; + case "4": + warningTypeEs = "2"; + break; + case "5": + warningTypeEs = "3"; + break; + case "6": + warningTypeEs = "4"; + break; + case "7": + warningTypeEs = "10"; + break; + case "8": + warningTypeEs = "13"; + break; + case "9": + case "30": + case "36": + case "48": + warningTypeEs = "104"; + break; + case "10": + case "29": + case "49": + warningTypeEs = "105"; + break; + case "11": + case "12": + warningTypeEs = "101"; + break; + case "13": + warningTypeEs = "102"; + break; + case "14": + warningTypeEs = "103"; + break; + case "15": + case "44": + warningTypeEs = "107"; + break; + case "16": + warningTypeEs = "108"; + break; + case "21": + warningTypeEs = "88"; + break; + case "27": + case "33": + warningTypeEs = "188"; + break; + case "17": + case "18": + case "19": + case "20": + case "23": + case "24": + case "45": + warningTypeEs = "15"; + break; + case "25": + warningTypeEs = "89"; + break; + case "26": + warningTypeEs = "90"; + break; + case "31": + case "37": + warningTypeEs = "189"; + break; + case "32": + case "38": + warningTypeEs = "190"; + break; + case "40": + case "50": + warningTypeEs = "106"; + break; + case "41": + case "42": + case "47": + warningTypeEs = "109"; + break; + case "46": + warningTypeEs = "108"; + break; + case "51": + case "52": + case "53": + case "54": + warningTypeEs = "14"; + break; + default: + warningTypeEs = warningType; + break; + } + return warningTypeEs; + } + + /** + * 转换预警类型【Linux】 + * + * @param warningType + * @return + */ + private String convertTyTowerLinuxWarningType(String warningType) { + String warningTypeEs; + switch (warningType) { + case "1": + warningTypeEs = "1"; + break; + case "2": + warningTypeEs = "101"; + break; + case "3": + warningTypeEs = "4"; + break; + case "4": + warningTypeEs = "103"; + break; + case "5": + warningTypeEs = "3"; + break; + case "6": + warningTypeEs = "102"; + break; + case "7": + warningTypeEs = "7"; + break; + case "8": + warningTypeEs = "106"; + break; + case "9": + warningTypeEs = "10"; + break; + case "10": + warningTypeEs = "107"; + break; + case "11": + warningTypeEs = "13"; + break; + case "12": + warningTypeEs = "108"; + break; + case "13": + warningTypeEs = "5"; + break; + case "14": + warningTypeEs = "104"; + break; + case "15": + warningTypeEs = "6"; + break; + case "16": + warningTypeEs = "105"; + break; + case "17": + warningTypeEs = "14"; + break; + case "18": + warningTypeEs = "109"; + break; + default: + warningTypeEs = "0"; + break; + } + return warningTypeEs; + } } diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TowerReqVo.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TowerReqVo.java new file mode 100644 index 00000000..bfe8267d --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TowerReqVo.java @@ -0,0 +1,29 @@ +package com.ruoyi.domain.vo; + +import com.yanzhu.manage.domain.TowerContentReqVo; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 塔吊检测推送信息 请求参数 + * + * @author: JiangYuQi + * @date: 2024/01/13 12:21 + */ +@Data +public class TowerReqVo { + + /** + * 上报类型 + */ + @NotNull(message = "上报类型不能为空") + private int type; + + /** + * 上报内容 + */ + @NotNull(message = "上报内容不能为空") + private TowerContentReqVo content; + +} diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRoundReqVO.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRoundReqVO.java new file mode 100644 index 00000000..9b9a5b92 --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRoundReqVO.java @@ -0,0 +1,37 @@ +package com.ruoyi.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 山东探越塔机请求-循环数据【Linux】 + */ +@Data +public class TyTowerLinuxRoundReqVO { + + /** 设备ID */ + @NotNull + private Integer eid; + /** 开始高度 */ + private Float start_height; + /** 开始幅度 */ + private Float start_range; + /** 开始回转角度 */ + private Float start_rotation_angle; + /** 结束高度 */ + private Float end_height; + /** 结束幅度 */ + private Float end_range; + /** 结束回转角度 */ + private Float end_rotation_angle; + /** 重量 */ + private Float weight; + /** 力矩百分比 */ + private Float moment_percent; + /** 开始时间 */ + private String start_time; + /** 结束时间 */ + private String end_time; + +} diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRunReqVO.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRunReqVO.java new file mode 100644 index 00000000..38a22b11 --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxRunReqVO.java @@ -0,0 +1,36 @@ +package com.ruoyi.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 山东探越塔机请求-实时数据【Linux】 + */ +@Data +public class TyTowerLinuxRunReqVO { + + /** 设备ID */ + @NotNull + private Integer eid; + /** 高度(米) */ + private Float height; + /** 重量(kg) */ + private Float weight; + /** 回转(°) */ + private Float round; + /** 幅度(°) */ + private Float amplitude; + /** 风速(米/秒) */ + private Float wind_speed; + /** 力矩 */ + private Float moment; + /** 力矩百分比(%) */ + private Float moment_percent; + /** 倍率(正整数) */ + private Integer override; + /** 倾角X(°) */ + private Float angle_x; + /** 倾角Y(°) */ + private Float angle_y; +} diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxWarningReqVO.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxWarningReqVO.java new file mode 100644 index 00000000..e383e9d5 --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerLinuxWarningReqVO.java @@ -0,0 +1,39 @@ +package com.ruoyi.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 山东探越塔机请求-报警数据【Linux】 + */ +@Data +public class TyTowerLinuxWarningReqVO { + + /** 设备ID */ + @NotNull + private Integer eid; + /** 高度 */ + private Float height; + /** 重量 */ + private Float weight; + /** 回转 */ + private Float round; + /** 幅度 */ + private Float amplitude; + /** 风速 */ + private Float wind_speed; + /** 力矩 */ + private Float moment; + /** 力矩百分比 */ + private Float moment_percent; + /** 倍率 */ + private Integer override; + /** 倾角X */ + private Float angle_x; + /** 倾角Y */ + private Float angle_y; + /** 报警type,报警内容由报警编号决定 */ + private Integer alarm_type; + +} diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRoundReqVO.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRoundReqVO.java new file mode 100644 index 00000000..e24e2c3e --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRoundReqVO.java @@ -0,0 +1,37 @@ +package com.ruoyi.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 山东探越塔机请求-循环数据【Android】 + */ +@Data +public class TyTowerRoundReqVO { + + /** 设备ID */ + @NotNull + private Integer eid; + /** 开始高度 */ + private Float start_height; + /** 开始幅度 */ + private Float start_range; + /** 开始回转角度 */ + private Float start_rotation_angle; + /** 结束高度 */ + private Float end_height; + /** 结束幅度 */ + private Float end_range; + /** 结束回转角度 */ + private Float end_rotation_angle; + /** 重量 */ + private Float weight; + /** 力矩百分比 */ + private Float moment_percent; + /** 开始时间 */ + private String start_time; + /** 结束时间 */ + private String end_time; + +} diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRunReqVO.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRunReqVO.java new file mode 100644 index 00000000..c5baddc5 --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerRunReqVO.java @@ -0,0 +1,36 @@ +package com.ruoyi.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 山东探越塔机请求-实时数据【Android】 + */ +@Data +public class TyTowerRunReqVO { + + /** 设备ID */ + @NotNull + private Integer eid; + /** 高度 */ + private Float height; + /** 幅度 */ + private Float range; + /** 回转角度 */ + private Float rotation_angle; + /** 吊重 */ + private Float lifting_weight; + /** 力距 */ + private Float force; + /** 力距百分比 */ + private Float force_distance; + /** 风速 */ + private Float wind_speed; + /** 倍率 */ + private String magnification; + /** 倾角X */ + private Float anteversion_x; + /** 倾角Y */ + private Float anteversion_y; +} diff --git a/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerWarningReqVO.java b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerWarningReqVO.java new file mode 100644 index 00000000..012ca8db --- /dev/null +++ b/yanzhu-deviceApi/src/main/java/com/ruoyi/domain/vo/TyTowerWarningReqVO.java @@ -0,0 +1,40 @@ +package com.ruoyi.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 山东探越塔机请求-报警数据【Android】 + */ +@Data +public class TyTowerWarningReqVO { + + /** 设备ID */ + @NotNull + private Integer eid; + /** 报警内容 */ + private String type; + /** 报警编号 */ + private Integer type_id; + /** 高度 */ + private Float height; + /** 幅度 */ + private Float range; + /** 回转角度 */ + private Float rotation; + /** 吊重 */ + private Float lifting_weight; + /** 力距 */ + private Float force; + /** 力距百分比 */ + private Float force_distance; + /** 风速 */ + private Float wind_speed; + /** 倍率 */ + private String magnification; + /** 倾角X */ + private Float anteversion_x; + /** 倾角Y */ + private Float anteversion_y; +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigController.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigController.java new file mode 100644 index 00000000..accd057b --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigController.java @@ -0,0 +1,228 @@ +package com.yanzhu.jh.device.controller; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.ApiConstants; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.enums.ShiFouEnum; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.yanzhu.jh.device.domain.DevIotConfig; +import com.yanzhu.jh.device.domain.DevIotConfigPoint; +import com.yanzhu.jh.device.service.IDevIotConfigPointService; +import com.yanzhu.jh.device.service.IDevIotConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 配电箱配置Controller + * + * @author yanzhu + * @date 2025-04-04 + */ +@RestController +@RequestMapping("/iotConfig") +public class DevIotConfigController extends BaseController +{ + @Autowired + private IDevIotConfigService devIotConfigService; + + @Autowired + private IDevIotConfigPointService devIotConfigPointService; + + /** + * 查询配电箱配置列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:list')") + @GetMapping("/list") + public TableDataInfo list(DevIotConfig devIotConfig) + { + startPage(); + List list = devIotConfigService.selectDevIotConfigList(devIotConfig); + return getDataTable(list); + } + + /** + * 导出配电箱配置列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:export')") + @Log(title = "配电箱配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DevIotConfig devIotConfig) + { + List list = devIotConfigService.selectDevIotConfigList(devIotConfig); + ExcelUtil util = new ExcelUtil(DevIotConfig.class); + util.exportExcel(response, list, "配电箱配置数据"); + } + + /** + * 获取配电箱配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(devIotConfigService.selectDevIotConfigById(id)); + } + + /** + * 新增配电箱配置 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:add')") + @Log(title = "配电箱配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DevIotConfig devIotConfig) + { + int res = devIotConfigService.insertDevIotConfig(devIotConfig); + if(res>0){ + return success(devIotConfig); + }else{ + return error(); + } + } + + /** + * 修改配电箱配置 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:edit')") + @Log(title = "配电箱配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DevIotConfig devIotConfig) + { + return toAjax(devIotConfigService.updateDevIotConfig(devIotConfig)); + } + + /** + * 删除配电箱配置 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:remove')") + @Log(title = "配电箱配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(devIotConfigService.deleteDevIotConfigByIds(ids)); + } + + /** + * 获取配电箱配的点位信息 + * @return + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfig:query')") + @GetMapping(value = "/findIotConfigPoint/{id}") + public AjaxResult findIotConfigPoint(@PathVariable("id") Long id) { + DevIotConfig devIotConfig = devIotConfigService.selectDevIotConfigById(id); + String projectHashId = getSaDaProjectHashIds(devIotConfig.getSignalName(),devIotConfig.getSignalCode(), devIotConfig.getProjectName()); + if(StringUtils.isNotEmpty(projectHashId)){ + devIotConfig.setIsDel(ShiFouEnum.FOU.getCode()); + devIotConfigService.updateDevIotConfig(devIotConfig); + // 根据项目主键,查询设备信息 + findSaDaBoxByProjectHashId(devIotConfig,projectHashId); + return success(); + }else{ + return error(); + } + } + + /** + * 获取项目配置HashIds + * @param signalName + * @param signalCode + * @param proName + * @return + */ + private static String getSaDaProjectHashIds(String signalName, String signalCode, String proName){ + try { + Map params = new HashMap<>(); + params.put("username",signalName); + params.put("password",signalCode); + String resStr = HttpUtils.sendPost(ApiConstants.IOT_SD_HOST+"/v2/api-token-auth", JSON.toJSONString(params)); + JSONObject result = JSONObject.parseObject(resStr).getJSONObject("result"); + JSONObject accountJson = result.getJSONObject("account"); + if(StringUtils.isNotEmpty(accountJson.getString("canViewProjects"))){ + JSONArray canProjects = accountJson.getJSONArray("canViewProjects"); + if(canProjects.size()>0){ + // 使用 forEach 和 Lambda 遍历 + for(Object item:canProjects){ + JSONObject obj = (JSONObject) item; + if(StringUtils.eqObj(obj.getString("name"),proName)){ + return obj.getString("hashId"); + } + } + return accountJson.getJSONObject("currentProject").getString("hashId"); + }else{ + return accountJson.getJSONObject("currentProject").getString("hashId"); + } + }else{ + return accountJson.getJSONObject("currentProject").getString("hashId"); + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + /** + * 获取项目设备 + * @param devIotConfig + * @param proHashId + */ + private void findSaDaBoxByProjectHashId(DevIotConfig devIotConfig, String proHashId){ + try { + String resStr = HttpUtils.sendGet(ApiConstants.IOT_SD_HOST+"/box/project/"+proHashId); + JSONArray result = JSONObject.parseObject(resStr).getJSONArray("result"); + if(result.size()>0){ + DevIotConfigPoint pointQuery = new DevIotConfigPoint(); + pointQuery.setCfgId(devIotConfig.getId()); + List pointList = devIotConfigPointService.selectDevIotConfigPointList(pointQuery); + result.forEach(item -> { + JSONObject obj = (JSONObject) item; + List pointItems = pointList.stream().filter(point -> StringUtils.eqObj(point.getDeviceSn(),obj.getString("hashId"))).collect(Collectors.toList()); + if(pointItems.size()>0){ + DevIotConfigPoint devIotConfigPoint = pointItems.get(0); + devIotConfigPoint.setDeviceName(obj.getString("name")); + devIotConfigPoint.setFactoryName(devIotConfig.getFactoryName()); + devIotConfigPoint.setLevels(obj.getString("level")); + devIotConfigPoint.setLeakageCurrent(obj.getString("leakageCurrent")); + devIotConfigPoint.setRatedTemperature(obj.getString("ratedTemperature")); + devIotConfigPoint.setShortCircuitCurrent(obj.getString("shortCircuitCurrent")); + devIotConfigPoint.setRatedCurrent(obj.getString("ratedCurrent")); + devIotConfigPoint.setRatedVoltage(obj.getString("ratedVoltage")); + devIotConfigPoint.setOnlineStatus(obj.getJSONObject("device").getString("onlineStatus")); + devIotConfigPointService.updateDevIotConfigPoint(devIotConfigPoint); + }else{ + DevIotConfigPoint devIotConfigPoint = new DevIotConfigPoint(); + devIotConfigPoint.setCfgId(devIotConfig.getId()); + devIotConfigPoint.setComId(devIotConfig.getComId()); + devIotConfigPoint.setProjectId(devIotConfig.getProjectId()); + devIotConfigPoint.setDeviceSn(obj.getString("hashId")); + devIotConfigPoint.setDeviceName(obj.getString("name")); + devIotConfigPoint.setFactoryName(devIotConfig.getFactoryName()); + devIotConfigPoint.setLevels(obj.getString("level")); + devIotConfigPoint.setLeakageCurrent(obj.getString("leakageCurrent")); + devIotConfigPoint.setRatedTemperature(obj.getString("ratedTemperature")); + devIotConfigPoint.setShortCircuitCurrent(obj.getString("shortCircuitCurrent")); + devIotConfigPoint.setRatedCurrent(obj.getString("ratedCurrent")); + devIotConfigPoint.setRatedVoltage(obj.getString("ratedVoltage")); + devIotConfigPoint.setOnlineStatus(obj.getJSONObject("device").getString("onlineStatus")); + devIotConfigPointService.insertDevIotConfigPoint(devIotConfigPoint); + } + }); + } + }catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigPointController.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigPointController.java new file mode 100644 index 00000000..d463e7e4 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotConfigPointController.java @@ -0,0 +1,113 @@ +package com.yanzhu.jh.device.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.enums.ShiFouEnum; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.yanzhu.jh.device.domain.DevIotConfigPoint; +import com.yanzhu.jh.device.service.IDevIotConfigPointService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 配电箱配置Controller + * + * @author yanzhu + * @date 2025-04-04 + */ +@RestController +@RequestMapping("/iotConfigPoint") +public class DevIotConfigPointController extends BaseController +{ + @Autowired + private IDevIotConfigPointService devIotConfigPointService; + + /** + * 查询配电箱配置列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfigPoint:list')") + @GetMapping("/list") + public TableDataInfo list(DevIotConfigPoint devIotConfigPoint) + { + startPage(); + List list = devIotConfigPointService.selectDevIotConfigPointList(devIotConfigPoint); + return getDataTable(list); + } + + /** + * 导出配电箱配置列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfigPoint:export')") + @Log(title = "配电箱配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DevIotConfigPoint devIotConfigPoint) + { + List list = devIotConfigPointService.selectDevIotConfigPointList(devIotConfigPoint); + ExcelUtil util = new ExcelUtil(DevIotConfigPoint.class); + util.exportExcel(response, list, "配电箱配置数据"); + } + + /** + * 获取配电箱配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfigPoint:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(devIotConfigPointService.selectDevIotConfigPointById(id)); + } + + /** + * 新增配电箱配置 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfigPoint:add')") + @Log(title = "配电箱配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DevIotConfigPoint devIotConfigPoint) + { + return toAjax(devIotConfigPointService.insertDevIotConfigPoint(devIotConfigPoint)); + } + + /** + * 修改配电箱配置 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfigPoint:edit')") + @Log(title = "配电箱配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DevIotConfigPoint devIotConfigPoint) + { + return toAjax(devIotConfigPointService.updateDevIotConfigPoint(devIotConfigPoint)); + } + + /** + * 删除配电箱配置 + */ + @PreAuthorize("@ss.hasPermi('manage:iotConfigPoint:remove')") + @Log(title = "配电箱配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(devIotConfigPointService.deleteDevIotConfigPointByIds(ids)); + } + + /** + * 查询配电箱配置列表 + */ + @GetMapping("/findProAllConfigPoint/{proId}") + public AjaxResult findProAllConfigPoint(@PathVariable("proId") Long proId) + { + DevIotConfigPoint configPointQuery = new DevIotConfigPoint(); + configPointQuery.setProjectId(proId); + configPointQuery.setIsDel(ShiFouEnum.FOU.getCode()); + List list = devIotConfigPointService.selectDevIotConfigPointList(configPointQuery); + return success(list); + } + +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotDatasController.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotDatasController.java new file mode 100644 index 00000000..e9532c67 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotDatasController.java @@ -0,0 +1,121 @@ +package com.yanzhu.jh.device.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.yanzhu.jh.device.domain.DevIotDatas; +import com.yanzhu.jh.device.service.IDevIotDatasService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 配电箱数据Controller + * + * @author yanzhu + * @date 2025-04-04 + */ +@RestController +@RequestMapping("/iotDatas") +public class DevIotDatasController extends BaseController +{ + @Autowired + private IDevIotDatasService devIotDatasService; + + /** + * 查询配电箱数据列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotDatas:list')") + @GetMapping("/list") + public TableDataInfo list(DevIotDatas devIotDatas) + { + startPage(); + List list = devIotDatasService.selectDevIotDatasList(devIotDatas); + return getDataTable(list); + } + + /** + * 导出配电箱数据列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotDatas:export')") + @Log(title = "配电箱数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DevIotDatas devIotDatas) + { + List list = devIotDatasService.selectDevIotDatasList(devIotDatas); + ExcelUtil util = new ExcelUtil(DevIotDatas.class); + util.exportExcel(response, list, "配电箱数据数据"); + } + + /** + * 获取配电箱数据详细信息 + */ + @PreAuthorize("@ss.hasPermi('manage:iotDatas:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(devIotDatasService.selectDevIotDatasById(id)); + } + + /** + * 新增配电箱数据 + */ + @PreAuthorize("@ss.hasPermi('manage:iotDatas:add')") + @Log(title = "配电箱数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DevIotDatas devIotDatas) + { + return toAjax(devIotDatasService.insertDevIotDatas(devIotDatas)); + } + + /** + * 修改配电箱数据 + */ + @PreAuthorize("@ss.hasPermi('manage:iotDatas:edit')") + @Log(title = "配电箱数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DevIotDatas devIotDatas) + { + return toAjax(devIotDatasService.updateDevIotDatas(devIotDatas)); + } + + /** + * 删除配电箱数据 + */ + @PreAuthorize("@ss.hasPermi('manage:iotDatas:remove')") + @Log(title = "配电箱数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(devIotDatasService.deleteDevIotDatasByIds(ids)); + } + + /** + * 查询配电箱数据统计 + */ + @GetMapping("/findIotDatasMonitor/{proId}") + public AjaxResult findProAllConfigPoint(@PathVariable("proId") Long proId, Long pointId, Integer date) + { + // 获取当前日期 + LocalDate today = LocalDate.now(); + // 获取最近${X}天的日期 + LocalDate todayAgo = today.minusDays(date); + DevIotDatas datasQuery = new DevIotDatas(); + datasQuery.setPointId(pointId); + datasQuery.setProjectId(proId); + Map params = new HashMap<>(); + params.put("beginCreateTime",today); + params.put("endCreateTime",todayAgo); + List list = devIotDatasService.selectDevIotDatasList(datasQuery); + return success(list); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotWarningController.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotWarningController.java new file mode 100644 index 00000000..7f4ecf66 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/controller/DevIotWarningController.java @@ -0,0 +1,112 @@ +package com.yanzhu.jh.device.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.yanzhu.jh.device.domain.DevIotWarning; +import com.yanzhu.jh.device.service.IDevIotWarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 配电箱预警Controller + * + * @author yanzhu + * @date 2025-04-04 + */ +@RestController +@RequestMapping("/iotWarning") +public class DevIotWarningController extends BaseController +{ + @Autowired + private IDevIotWarningService devIotWarningService; + + /** + * 查询配电箱预警列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotWarning:list')") + @GetMapping("/list") + public TableDataInfo list(DevIotWarning devIotWarning) + { + startPage(); + List list = devIotWarningService.selectDevIotWarningList(devIotWarning); + return getDataTable(list); + } + + /** + * 导出配电箱预警列表 + */ + @PreAuthorize("@ss.hasPermi('manage:iotWarning:export')") + @Log(title = "配电箱预警", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DevIotWarning devIotWarning) + { + List list = devIotWarningService.selectDevIotWarningList(devIotWarning); + ExcelUtil util = new ExcelUtil(DevIotWarning.class); + util.exportExcel(response, list, "配电箱预警数据"); + } + + /** + * 获取配电箱预警详细信息 + */ + @PreAuthorize("@ss.hasPermi('manage:iotWarning:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(devIotWarningService.selectDevIotWarningById(id)); + } + + /** + * 新增配电箱预警 + */ + @PreAuthorize("@ss.hasPermi('manage:iotWarning:add')") + @Log(title = "配电箱预警", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DevIotWarning devIotWarning) + { + return toAjax(devIotWarningService.insertDevIotWarning(devIotWarning)); + } + + /** + * 修改配电箱预警 + */ + @PreAuthorize("@ss.hasPermi('manage:iotWarning:edit')") + @Log(title = "配电箱预警", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DevIotWarning devIotWarning) + { + return toAjax(devIotWarningService.updateDevIotWarning(devIotWarning)); + } + + /** + * 删除配电箱预警 + */ + @PreAuthorize("@ss.hasPermi('manage:iotWarning:remove')") + @Log(title = "配电箱预警", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(devIotWarningService.deleteDevIotWarningByIds(ids)); + } + + /** + * 查询配电箱预警数据 + */ + @GetMapping("/findIotWarnings/{proId}") + public AjaxResult findIotWarnings(@PathVariable("proId") Long proId, Long pointId) + { + startPage(1,20); + DevIotWarning warningQuery = new DevIotWarning(); + warningQuery.setPointId(pointId); + warningQuery.setProjectId(proId); + List list = devIotWarningService.selectDevIotWarningList(warningQuery); + return success(list); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfig.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfig.java new file mode 100644 index 00000000..7ecb30aa --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfig.java @@ -0,0 +1,148 @@ +package com.yanzhu.jh.device.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 配电箱配置对象 dev_iot_config + * + * @author yanzhu + * @date 2025-04-04 + */ +public class DevIotConfig extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 公司主键 */ + private Long comId; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String comName; + + /** 项目主键 */ + private Long projectId; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 通信账号 */ + @Excel(name = "通信账号") + private String signalName; + + /** 通信密码 */ + @Excel(name = "通信密码") + private String signalCode; + + /** 厂家名称 */ + @Excel(name = "厂家名称") + private String factoryName; + + /** 数据状态 */ + @Excel(name = "数据状态") + private String isDel; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setSignalName(String signalName) + { + this.signalName = signalName; + } + + public String getSignalName() + { + return signalName; + } + public void setSignalCode(String signalCode) + { + this.signalCode = signalCode; + } + + public String getSignalCode() + { + return signalCode; + } + public void setFactoryName(String factoryName) + { + this.factoryName = factoryName; + } + + public String getFactoryName() + { + return factoryName; + } + public void setIsDel(String isDel) + { + this.isDel = isDel; + } + + public String getIsDel() + { + return isDel; + } + + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("signalName", getSignalName()) + .append("signalCode", getSignalCode()) + .append("factoryName", getFactoryName()) + .append("isDel", getIsDel()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfigPoint.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfigPoint.java new file mode 100644 index 00000000..695c1270 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotConfigPoint.java @@ -0,0 +1,288 @@ +package com.yanzhu.jh.device.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 配电箱配置对象 dev_iot_config_point + * + * @author yanzhu + * @date 2025-04-04 + */ +public class DevIotConfigPoint extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 配置主键 */ + @Excel(name = "配置主键") + private Long cfgId; + + /** 公司主键 */ + private Long comId; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String comName; + + /** 项目主键 */ + private Long projectId; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 设备序列号 */ + @Excel(name = "设备序列号") + private String deviceSn; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + /** 厂家名称 */ + @Excel(name = "厂家名称") + private String factoryName; + + /** 联系人 */ + @Excel(name = "联系人") + private String contactPerson; + + /** 联系人电话 */ + @Excel(name = "联系人电话") + private String contactPersonPhone; + + /** 配电箱等级 */ + @Excel(name = "配电箱等级") + private String levels; + + /** 漏电电流 */ + @Excel(name = "漏电电流") + private String leakageCurrent; + + /** 额定温度 */ + @Excel(name = "额定温度") + private String ratedTemperature; + + /** 短路电流 */ + @Excel(name = "短路电流") + private String shortCircuitCurrent; + + /** 额定电流 */ + @Excel(name = "额定电流") + private String ratedCurrent; + + /** 额定电压 */ + @Excel(name = "额定电压") + private String ratedVoltage; + + /** 在线状态 */ + @Excel(name = "在线状态") + private String onlineStatus; + + /** 数据状态 */ + @Excel(name = "数据状态") + private String isDel; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCfgId(Long cfgId) + { + this.cfgId = cfgId; + } + + public Long getCfgId() + { + return cfgId; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public String getDeviceSn() + { + return deviceSn; + } + public void setDeviceName(String deviceName) + { + this.deviceName = deviceName; + } + + public String getDeviceName() + { + return deviceName; + } + public void setFactoryName(String factoryName) + { + this.factoryName = factoryName; + } + + public String getFactoryName() + { + return factoryName; + } + public void setContactPerson(String contactPerson) + { + this.contactPerson = contactPerson; + } + + public String getContactPerson() + { + return contactPerson; + } + public void setContactPersonPhone(String contactPersonPhone) + { + this.contactPersonPhone = contactPersonPhone; + } + + public String getContactPersonPhone() + { + return contactPersonPhone; + } + public void setLevels(String levels) + { + this.levels = levels; + } + + public String getLevels() + { + return levels; + } + public void setLeakageCurrent(String leakageCurrent) + { + this.leakageCurrent = leakageCurrent; + } + + public String getLeakageCurrent() + { + return leakageCurrent; + } + public void setRatedTemperature(String ratedTemperature) + { + this.ratedTemperature = ratedTemperature; + } + + public String getRatedTemperature() + { + return ratedTemperature; + } + public void setShortCircuitCurrent(String shortCircuitCurrent) + { + this.shortCircuitCurrent = shortCircuitCurrent; + } + + public String getShortCircuitCurrent() + { + return shortCircuitCurrent; + } + public void setRatedCurrent(String ratedCurrent) + { + this.ratedCurrent = ratedCurrent; + } + + public String getRatedCurrent() + { + return ratedCurrent; + } + public void setRatedVoltage(String ratedVoltage) + { + this.ratedVoltage = ratedVoltage; + } + + public String getRatedVoltage() + { + return ratedVoltage; + } + public void setOnlineStatus(String onlineStatus) + { + this.onlineStatus = onlineStatus; + } + + public String getOnlineStatus() + { + return onlineStatus; + } + public void setIsDel(String isDel) + { + this.isDel = isDel; + } + + public String getIsDel() + { + return isDel; + } + + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cfgId", getCfgId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("deviceSn", getDeviceSn()) + .append("deviceName", getDeviceName()) + .append("factoryName", getFactoryName()) + .append("contactPerson", getContactPerson()) + .append("contactPersonPhone", getContactPersonPhone()) + .append("levels", getLevels()) + .append("leakageCurrent", getLeakageCurrent()) + .append("ratedTemperature", getRatedTemperature()) + .append("shortCircuitCurrent", getShortCircuitCurrent()) + .append("ratedCurrent", getRatedCurrent()) + .append("ratedVoltage", getRatedVoltage()) + .append("onlineStatus", getOnlineStatus()) + .append("isDel", getIsDel()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotDatas.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotDatas.java new file mode 100644 index 00000000..15bdafdb --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotDatas.java @@ -0,0 +1,525 @@ +package com.yanzhu.jh.device.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 配电箱数据对象 dev_iot_datas + * + * @author yanzhu + * @date 2025-04-04 + */ +public class DevIotDatas extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 配置主键 */ + @Excel(name = "配置主键") + private Long cfgId; + + /** 点位主键 */ + @Excel(name = "点位主键") + private Long pointId; + + /** 公司主键 */ + private Long comId; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String comName; + + /** 项目主键 */ + private Long projectId; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 设备序列号 */ + @Excel(name = "设备序列号") + private String deviceSn; + + /** 开关位_交流 */ + @Excel(name = "开关位_交流") + private String switchesAc; + + /** 开关位 */ + @Excel(name = "开关位") + private String switchesSwitch; + + /** 开关位状态 */ + @Excel(name = "开关位状态") + private String switchesSwitches; + + /** 开关位安装状态 */ + @Excel(name = "开关位安装状态") + private String switchesSwitchstatus; + + /** 温度检测数据 */ + @Excel(name = "温度检测数据") + private String temperature; + + /** 漏电检测数据 */ + @Excel(name = "漏电检测数据") + private String leakage; + + /** A相电压 */ + @Excel(name = "A相电压") + private String voltageA; + + /** B相电压 */ + @Excel(name = "B相电压") + private String voltageB; + + /** C相电压 */ + @Excel(name = "C相电压") + private String voltageC; + + /** A相与B相之间的电压 */ + @Excel(name = "A相与B相之间的电压") + private String voltageAb; + + /** B相与C相之间的电压 */ + @Excel(name = "B相与C相之间的电压") + private String voltageBc; + + /** C相与A相之间的电压 */ + @Excel(name = "C相与A相之间的电压") + private String voltageCa; + + /** A相电流 */ + @Excel(name = "A相电流") + private String currentA; + + /** B相电流 */ + @Excel(name = "B相电流") + private String currentB; + + /** C相电流 */ + @Excel(name = "C相电流") + private String currentC; + + /** A相功率 */ + @Excel(name = "A相功率") + private String powerA; + + /** B相功率 */ + @Excel(name = "B相功率") + private String powerB; + + /** C相功率 */ + @Excel(name = "C相功率") + private String powerC; + + /** A相累计能量 */ + @Excel(name = "A相累计能量") + private String energyA; + + /** B相累计能量 */ + @Excel(name = "B相累计能量") + private String energyB; + + /** C相累计能量 */ + @Excel(name = "C相累计能量") + private String energyC; + + /** A相功率因数 */ + @Excel(name = "A相功率因数") + private String factorA; + + /** B相功率因数 */ + @Excel(name = "B相功率因数") + private String factorB; + + /** C相功率因数 */ + @Excel(name = "C相功率因数") + private String factorC; + + /** A相频率 */ + @Excel(name = "A相频率") + private String frequencyA; + + /** B相频率 */ + @Excel(name = "B相频率") + private String frequencyB; + + /** C相频率 */ + @Excel(name = "C相频率") + private String frequencyC; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private Date createTime; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCfgId(Long cfgId) + { + this.cfgId = cfgId; + } + + public Long getCfgId() + { + return cfgId; + } + public void setPointId(Long pointId) + { + this.pointId = pointId; + } + + public Long getPointId() + { + return pointId; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public String getDeviceSn() + { + return deviceSn; + } + public void setSwitchesAc(String switchesAc) + { + this.switchesAc = switchesAc; + } + + public String getSwitchesAc() + { + return switchesAc; + } + public void setSwitchesSwitch(String switchesSwitch) + { + this.switchesSwitch = switchesSwitch; + } + + public String getSwitchesSwitch() + { + return switchesSwitch; + } + public void setSwitchesSwitches(String switchesSwitches) + { + this.switchesSwitches = switchesSwitches; + } + + public String getSwitchesSwitches() + { + return switchesSwitches; + } + public void setSwitchesSwitchstatus(String switchesSwitchstatus) + { + this.switchesSwitchstatus = switchesSwitchstatus; + } + + public String getSwitchesSwitchstatus() + { + return switchesSwitchstatus; + } + public void setTemperature(String temperature) + { + this.temperature = temperature; + } + + public String getTemperature() + { + return temperature; + } + public void setLeakage(String leakage) + { + this.leakage = leakage; + } + + public String getLeakage() + { + return leakage; + } + public void setVoltageA(String voltageA) + { + this.voltageA = voltageA; + } + + public String getVoltageA() + { + return voltageA; + } + public void setVoltageB(String voltageB) + { + this.voltageB = voltageB; + } + + public String getVoltageB() + { + return voltageB; + } + public void setVoltageC(String voltageC) + { + this.voltageC = voltageC; + } + + public String getVoltageC() + { + return voltageC; + } + public void setVoltageAb(String voltageAb) + { + this.voltageAb = voltageAb; + } + + public String getVoltageAb() + { + return voltageAb; + } + public void setVoltageBc(String voltageBc) + { + this.voltageBc = voltageBc; + } + + public String getVoltageBc() + { + return voltageBc; + } + public void setVoltageCa(String voltageCa) + { + this.voltageCa = voltageCa; + } + + public String getVoltageCa() + { + return voltageCa; + } + public void setCurrentA(String currentA) + { + this.currentA = currentA; + } + + public String getCurrentA() + { + return currentA; + } + public void setCurrentB(String currentB) + { + this.currentB = currentB; + } + + public String getCurrentB() + { + return currentB; + } + public void setCurrentC(String currentC) + { + this.currentC = currentC; + } + + public String getCurrentC() + { + return currentC; + } + public void setPowerA(String powerA) + { + this.powerA = powerA; + } + + public String getPowerA() + { + return powerA; + } + public void setPowerB(String powerB) + { + this.powerB = powerB; + } + + public String getPowerB() + { + return powerB; + } + public void setPowerC(String powerC) + { + this.powerC = powerC; + } + + public String getPowerC() + { + return powerC; + } + public void setEnergyA(String energyA) + { + this.energyA = energyA; + } + + public String getEnergyA() + { + return energyA; + } + public void setEnergyB(String energyB) + { + this.energyB = energyB; + } + + public String getEnergyB() + { + return energyB; + } + public void setEnergyC(String energyC) + { + this.energyC = energyC; + } + + public String getEnergyC() + { + return energyC; + } + public void setFactorA(String factorA) + { + this.factorA = factorA; + } + + public String getFactorA() + { + return factorA; + } + public void setFactorB(String factorB) + { + this.factorB = factorB; + } + + public String getFactorB() + { + return factorB; + } + public void setFactorC(String factorC) + { + this.factorC = factorC; + } + + public String getFactorC() + { + return factorC; + } + public void setFrequencyA(String frequencyA) + { + this.frequencyA = frequencyA; + } + + public String getFrequencyA() + { + return frequencyA; + } + public void setFrequencyB(String frequencyB) + { + this.frequencyB = frequencyB; + } + + public String getFrequencyB() + { + return frequencyB; + } + public void setFrequencyC(String frequencyC) + { + this.frequencyC = frequencyC; + } + + public String getFrequencyC() + { + return frequencyC; + } + + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cfgId", getCfgId()) + .append("pointId", getPointId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("deviceSn", getDeviceSn()) + .append("switchesAc", getSwitchesAc()) + .append("switchesSwitch", getSwitchesSwitch()) + .append("switchesSwitches", getSwitchesSwitches()) + .append("switchesSwitchstatus", getSwitchesSwitchstatus()) + .append("temperature", getTemperature()) + .append("leakage", getLeakage()) + .append("voltageA", getVoltageA()) + .append("voltageB", getVoltageB()) + .append("voltageC", getVoltageC()) + .append("voltageAb", getVoltageAb()) + .append("voltageBc", getVoltageBc()) + .append("voltageCa", getVoltageCa()) + .append("currentA", getCurrentA()) + .append("currentB", getCurrentB()) + .append("currentC", getCurrentC()) + .append("powerA", getPowerA()) + .append("powerB", getPowerB()) + .append("powerC", getPowerC()) + .append("energyA", getEnergyA()) + .append("energyB", getEnergyB()) + .append("energyC", getEnergyC()) + .append("factorA", getFactorA()) + .append("factorB", getFactorB()) + .append("factorC", getFactorC()) + .append("frequencyA", getFrequencyA()) + .append("frequencyB", getFrequencyB()) + .append("frequencyC", getFrequencyC()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotWarning.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotWarning.java new file mode 100644 index 00000000..25e4c067 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevIotWarning.java @@ -0,0 +1,158 @@ +package com.yanzhu.jh.device.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 配电箱预警对象 dev_iot_warning + * + * @author yanzhu + * @date 2025-04-04 + */ +public class DevIotWarning extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 配置主键 */ + @Excel(name = "配置主键") + private Long cfgId; + + /** 点位主键 */ + @Excel(name = "点位主键") + private Long pointId; + + /** 公司主键 */ + private Long comId; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String comName; + + /** 项目主键 */ + private Long projectId; + + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + + /** 设备序列号 */ + @Excel(name = "设备序列号") + private String deviceSn; + + /** 预警类型 */ + @Excel(name = "预警类型") + private String warningType; + + /** 预警内容 */ + @Excel(name = "预警内容") + private String warningContent; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCfgId(Long cfgId) + { + this.cfgId = cfgId; + } + + public Long getCfgId() + { + return cfgId; + } + public void setPointId(Long pointId) + { + this.pointId = pointId; + } + + public Long getPointId() + { + return pointId; + } + public void setComId(Long comId) + { + this.comId = comId; + } + + public Long getComId() + { + return comId; + } + public void setProjectId(Long projectId) + { + this.projectId = projectId; + } + + public Long getProjectId() + { + return projectId; + } + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public String getDeviceSn() + { + return deviceSn; + } + public void setWarningType(String warningType) + { + this.warningType = warningType; + } + + public String getWarningType() + { + return warningType; + } + public void setWarningContent(String warningContent) + { + this.warningContent = warningContent; + } + + public String getWarningContent() + { + return warningContent; + } + + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("cfgId", getCfgId()) + .append("pointId", getPointId()) + .append("comId", getComId()) + .append("projectId", getProjectId()) + .append("deviceSn", getDeviceSn()) + .append("warningType", getWarningType()) + .append("warningContent", getWarningContent()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevTowerDataWarning.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevTowerDataWarning.java index 6e85f878..1e1daf14 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevTowerDataWarning.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/domain/DevTowerDataWarning.java @@ -59,13 +59,45 @@ public class DevTowerDataWarning extends BaseEntity @Excel(name = "预警内容") private String warnNote; - /** 预警值 */ - @Excel(name = "预警值") - private String warnData; + /** 当前高度 */ + @Excel(name = "当前高度") + private String height; - /** 实际值 */ - @Excel(name = "实际值") - private String realData; + /** 当前幅度 */ + @Excel(name = "当前幅度") + private String range; + + /** 回转 */ + @Excel(name = "回转") + private String rotation; + + /** 当前吊重 */ + @Excel(name = "当前吊重") + private String load; + + /** 风速 */ + @Excel(name = "风速") + private String windSpeed; + + /** 水平倾角 */ + @Excel(name = "水平倾角") + private String leanAngleX; + + /** 垂直倾角 */ + @Excel(name = "垂直倾角") + private String leanAngleY; + + /** 力矩百分比 */ + @Excel(name = "力矩百分比") + private String momentPercent; + + /** 报警标识 */ + @Excel(name = "报警标识") + private Long alarmed; + + /** 倍率 */ + @Excel(name = "倍率") + private String rate; /** 是否有效 */ @Excel(name = "是否有效") @@ -161,24 +193,7 @@ public class DevTowerDataWarning extends BaseEntity { return warnNote; } - public void setWarnData(String warnData) - { - this.warnData = warnData; - } - public String getWarnData() - { - return warnData; - } - public void setRealData(String realData) - { - this.realData = realData; - } - - public String getRealData() - { - return realData; - } public void setIsDel(Long isDel) { this.isDel = isDel; @@ -205,6 +220,86 @@ public class DevTowerDataWarning extends BaseEntity this.deptName = deptName; } + public String getHeight() { + return height; + } + + public void setHeight(String height) { + this.height = height; + } + + public String getRange() { + return range; + } + + public void setRange(String range) { + this.range = range; + } + + public String getRotation() { + return rotation; + } + + public void setRotation(String rotation) { + this.rotation = rotation; + } + + public String getLoad() { + return load; + } + + public void setLoad(String load) { + this.load = load; + } + + public String getWindSpeed() { + return windSpeed; + } + + public void setWindSpeed(String windSpeed) { + this.windSpeed = windSpeed; + } + + public String getLeanAngleX() { + return leanAngleX; + } + + public void setLeanAngleX(String leanAngleX) { + this.leanAngleX = leanAngleX; + } + + public String getLeanAngleY() { + return leanAngleY; + } + + public void setLeanAngleY(String leanAngleY) { + this.leanAngleY = leanAngleY; + } + + public String getMomentPercent() { + return momentPercent; + } + + public void setMomentPercent(String momentPercent) { + this.momentPercent = momentPercent; + } + + public Long getAlarmed() { + return alarmed; + } + + public void setAlarmed(Long alarmed) { + this.alarmed = alarmed; + } + + public String getRate() { + return rate; + } + + public void setRate(String rate) { + this.rate = rate; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -217,8 +312,6 @@ public class DevTowerDataWarning extends BaseEntity .append("warnType", getWarnType()) .append("warnName", getWarnName()) .append("warnNote", getWarnNote()) - .append("warnData", getWarnData()) - .append("realData", getRealData()) .append("isDel", getIsDel()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigMapper.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigMapper.java new file mode 100644 index 00000000..ea441abb --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigMapper.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.mapper; + +import com.yanzhu.jh.device.domain.DevIotConfig; + +import java.util.List; + +/** + * 配电箱配置Mapper接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface DevIotConfigMapper +{ + /** + * 查询配电箱配置 + * + * @param id 配电箱配置主键 + * @return 配电箱配置 + */ + public DevIotConfig selectDevIotConfigById(Long id); + + /** + * 查询配电箱配置列表 + * + * @param devIotConfig 配电箱配置 + * @return 配电箱配置集合 + */ + public List selectDevIotConfigList(DevIotConfig devIotConfig); + + /** + * 新增配电箱配置 + * + * @param devIotConfig 配电箱配置 + * @return 结果 + */ + public int insertDevIotConfig(DevIotConfig devIotConfig); + + /** + * 修改配电箱配置 + * + * @param devIotConfig 配电箱配置 + * @return 结果 + */ + public int updateDevIotConfig(DevIotConfig devIotConfig); + + /** + * 删除配电箱配置 + * + * @param id 配电箱配置主键 + * @return 结果 + */ + public int deleteDevIotConfigById(Long id); + + /** + * 批量删除配电箱配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDevIotConfigByIds(Long[] ids); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigPointMapper.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigPointMapper.java new file mode 100644 index 00000000..9e1b2e21 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotConfigPointMapper.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.mapper; + +import com.yanzhu.jh.device.domain.DevIotConfigPoint; + +import java.util.List; + +/** + * 配电箱配置Mapper接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface DevIotConfigPointMapper +{ + /** + * 查询配电箱配置 + * + * @param id 配电箱配置主键 + * @return 配电箱配置 + */ + public DevIotConfigPoint selectDevIotConfigPointById(Long id); + + /** + * 查询配电箱配置列表 + * + * @param devIotConfigPoint 配电箱配置 + * @return 配电箱配置集合 + */ + public List selectDevIotConfigPointList(DevIotConfigPoint devIotConfigPoint); + + /** + * 新增配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int insertDevIotConfigPoint(DevIotConfigPoint devIotConfigPoint); + + /** + * 修改配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int updateDevIotConfigPoint(DevIotConfigPoint devIotConfigPoint); + + /** + * 删除配电箱配置 + * + * @param id 配电箱配置主键 + * @return 结果 + */ + public int deleteDevIotConfigPointById(Long id); + + /** + * 批量删除配电箱配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDevIotConfigPointByIds(Long[] ids); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotDatasMapper.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotDatasMapper.java new file mode 100644 index 00000000..a14f5728 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotDatasMapper.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.mapper; + +import com.yanzhu.jh.device.domain.DevIotDatas; + +import java.util.List; + +/** + * 配电箱数据Mapper接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface DevIotDatasMapper +{ + /** + * 查询配电箱数据 + * + * @param id 配电箱数据主键 + * @return 配电箱数据 + */ + public DevIotDatas selectDevIotDatasById(Long id); + + /** + * 查询配电箱数据列表 + * + * @param devIotDatas 配电箱数据 + * @return 配电箱数据集合 + */ + public List selectDevIotDatasList(DevIotDatas devIotDatas); + + /** + * 新增配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + public int insertDevIotDatas(DevIotDatas devIotDatas); + + /** + * 修改配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + public int updateDevIotDatas(DevIotDatas devIotDatas); + + /** + * 删除配电箱数据 + * + * @param id 配电箱数据主键 + * @return 结果 + */ + public int deleteDevIotDatasById(Long id); + + /** + * 批量删除配电箱数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDevIotDatasByIds(Long[] ids); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotWarningMapper.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotWarningMapper.java new file mode 100644 index 00000000..20dabcee --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevIotWarningMapper.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.mapper; + +import com.yanzhu.jh.device.domain.DevIotWarning; + +import java.util.List; + +/** + * 配电箱预警Mapper接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface DevIotWarningMapper +{ + /** + * 查询配电箱预警 + * + * @param id 配电箱预警主键 + * @return 配电箱预警 + */ + public DevIotWarning selectDevIotWarningById(Long id); + + /** + * 查询配电箱预警列表 + * + * @param devIotWarning 配电箱预警 + * @return 配电箱预警集合 + */ + public List selectDevIotWarningList(DevIotWarning devIotWarning); + + /** + * 新增配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + public int insertDevIotWarning(DevIotWarning devIotWarning); + + /** + * 修改配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + public int updateDevIotWarning(DevIotWarning devIotWarning); + + /** + * 删除配电箱预警 + * + * @param id 配电箱预警主键 + * @return 结果 + */ + public int deleteDevIotWarningById(Long id); + + /** + * 批量删除配电箱预警 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDevIotWarningByIds(Long[] ids); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevTowerDataWarningMapper.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevTowerDataWarningMapper.java index d44272a7..9b368865 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevTowerDataWarningMapper.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/mapper/DevTowerDataWarningMapper.java @@ -58,4 +58,20 @@ public interface DevTowerDataWarningMapper * @return 结果 */ public int deleteDevTowerDataWarningByIds(Long[] ids); + + /** + * 查询塔机预警数据 + * + * @param devTowerDataWarning 设备预警信息 + * @return 结果 + */ + public int findWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning); + + /** + * 查询塔机超载预警数据 + * + * @param devTowerDataWarning 设备预警信息 + * @return 结果 + */ + public int findOverloadWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning); } diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigPointService.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigPointService.java new file mode 100644 index 00000000..5976b52c --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigPointService.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.service; + +import com.yanzhu.jh.device.domain.DevIotConfigPoint; + +import java.util.List; + +/** + * 配电箱配置Service接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface IDevIotConfigPointService +{ + /** + * 查询配电箱配置 + * + * @param id 配电箱配置主键 + * @return 配电箱配置 + */ + public DevIotConfigPoint selectDevIotConfigPointById(Long id); + + /** + * 查询配电箱配置列表 + * + * @param devIotConfigPoint 配电箱配置 + * @return 配电箱配置集合 + */ + public List selectDevIotConfigPointList(DevIotConfigPoint devIotConfigPoint); + + /** + * 新增配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int insertDevIotConfigPoint(DevIotConfigPoint devIotConfigPoint); + + /** + * 修改配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + public int updateDevIotConfigPoint(DevIotConfigPoint devIotConfigPoint); + + /** + * 批量删除配电箱配置 + * + * @param ids 需要删除的配电箱配置主键集合 + * @return 结果 + */ + public int deleteDevIotConfigPointByIds(Long[] ids); + + /** + * 删除配电箱配置信息 + * + * @param id 配电箱配置主键 + * @return 结果 + */ + public int deleteDevIotConfigPointById(Long id); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigService.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigService.java new file mode 100644 index 00000000..24b1f3e2 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotConfigService.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.service; + +import com.yanzhu.jh.device.domain.DevIotConfig; + +import java.util.List; + +/** + * 配电箱配置Service接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface IDevIotConfigService +{ + /** + * 查询配电箱配置 + * + * @param id 配电箱配置主键 + * @return 配电箱配置 + */ + public DevIotConfig selectDevIotConfigById(Long id); + + /** + * 查询配电箱配置列表 + * + * @param devIotConfig 配电箱配置 + * @return 配电箱配置集合 + */ + public List selectDevIotConfigList(DevIotConfig devIotConfig); + + /** + * 新增配电箱配置 + * + * @param devIotConfig 配电箱配置 + * @return 结果 + */ + public int insertDevIotConfig(DevIotConfig devIotConfig); + + /** + * 修改配电箱配置 + * + * @param devIotConfig 配电箱配置 + * @return 结果 + */ + public int updateDevIotConfig(DevIotConfig devIotConfig); + + /** + * 批量删除配电箱配置 + * + * @param ids 需要删除的配电箱配置主键集合 + * @return 结果 + */ + public int deleteDevIotConfigByIds(Long[] ids); + + /** + * 删除配电箱配置信息 + * + * @param id 配电箱配置主键 + * @return 结果 + */ + public int deleteDevIotConfigById(Long id); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotDatasService.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotDatasService.java new file mode 100644 index 00000000..1273df88 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotDatasService.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.service; + +import com.yanzhu.jh.device.domain.DevIotDatas; + +import java.util.List; + +/** + * 配电箱数据Service接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface IDevIotDatasService +{ + /** + * 查询配电箱数据 + * + * @param id 配电箱数据主键 + * @return 配电箱数据 + */ + public DevIotDatas selectDevIotDatasById(Long id); + + /** + * 查询配电箱数据列表 + * + * @param devIotDatas 配电箱数据 + * @return 配电箱数据集合 + */ + public List selectDevIotDatasList(DevIotDatas devIotDatas); + + /** + * 新增配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + public int insertDevIotDatas(DevIotDatas devIotDatas); + + /** + * 修改配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + public int updateDevIotDatas(DevIotDatas devIotDatas); + + /** + * 批量删除配电箱数据 + * + * @param ids 需要删除的配电箱数据主键集合 + * @return 结果 + */ + public int deleteDevIotDatasByIds(Long[] ids); + + /** + * 删除配电箱数据信息 + * + * @param id 配电箱数据主键 + * @return 结果 + */ + public int deleteDevIotDatasById(Long id); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotWarningService.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotWarningService.java new file mode 100644 index 00000000..f1713d7d --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/IDevIotWarningService.java @@ -0,0 +1,62 @@ +package com.yanzhu.jh.device.service; + +import com.yanzhu.jh.device.domain.DevIotWarning; + +import java.util.List; + +/** + * 配电箱预警Service接口 + * + * @author yanzhu + * @date 2025-04-04 + */ +public interface IDevIotWarningService +{ + /** + * 查询配电箱预警 + * + * @param id 配电箱预警主键 + * @return 配电箱预警 + */ + public DevIotWarning selectDevIotWarningById(Long id); + + /** + * 查询配电箱预警列表 + * + * @param devIotWarning 配电箱预警 + * @return 配电箱预警集合 + */ + public List selectDevIotWarningList(DevIotWarning devIotWarning); + + /** + * 新增配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + public int insertDevIotWarning(DevIotWarning devIotWarning); + + /** + * 修改配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + public int updateDevIotWarning(DevIotWarning devIotWarning); + + /** + * 批量删除配电箱预警 + * + * @param ids 需要删除的配电箱预警主键集合 + * @return 结果 + */ + public int deleteDevIotWarningByIds(Long[] ids); + + /** + * 删除配电箱预警信息 + * + * @param id 配电箱预警主键 + * @return 结果 + */ + public int deleteDevIotWarningById(Long id); +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigPointServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigPointServiceImpl.java new file mode 100644 index 00000000..c52fee9c --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigPointServiceImpl.java @@ -0,0 +1,100 @@ +package com.yanzhu.jh.device.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.yanzhu.jh.device.domain.DevIotConfigPoint; +import com.yanzhu.jh.device.mapper.DevIotConfigPointMapper; +import com.yanzhu.jh.device.service.IDevIotConfigPointService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 配电箱配置Service业务层处理 + * + * @author yanzhu + * @date 2025-04-04 + */ +@Service +public class DevIotConfigPointServiceImpl implements IDevIotConfigPointService +{ + @Autowired + private DevIotConfigPointMapper devIotConfigPointMapper; + + /** + * 查询配电箱配置 + * + * @param id 配电箱配置主键 + * @return 配电箱配置 + */ + @Override + public DevIotConfigPoint selectDevIotConfigPointById(Long id) + { + return devIotConfigPointMapper.selectDevIotConfigPointById(id); + } + + /** + * 查询配电箱配置列表 + * + * @param devIotConfigPoint 配电箱配置 + * @return 配电箱配置 + */ + @Override + public List selectDevIotConfigPointList(DevIotConfigPoint devIotConfigPoint) + { + return devIotConfigPointMapper.selectDevIotConfigPointList(devIotConfigPoint); + } + + /** + * 新增配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + @Override + public int insertDevIotConfigPoint(DevIotConfigPoint devIotConfigPoint) + { + devIotConfigPoint.setCreateBy(SecurityUtils.getUsername()); + devIotConfigPoint.setCreateTime(DateUtils.getNowDate()); + return devIotConfigPointMapper.insertDevIotConfigPoint(devIotConfigPoint); + } + + /** + * 修改配电箱配置 + * + * @param devIotConfigPoint 配电箱配置 + * @return 结果 + */ + @Override + public int updateDevIotConfigPoint(DevIotConfigPoint devIotConfigPoint) + { + devIotConfigPoint.setUpdateBy(SecurityUtils.getUsername()); + devIotConfigPoint.setUpdateTime(DateUtils.getNowDate()); + return devIotConfigPointMapper.updateDevIotConfigPoint(devIotConfigPoint); + } + + /** + * 批量删除配电箱配置 + * + * @param ids 需要删除的配电箱配置主键 + * @return 结果 + */ + @Override + public int deleteDevIotConfigPointByIds(Long[] ids) + { + return devIotConfigPointMapper.deleteDevIotConfigPointByIds(ids); + } + + /** + * 删除配电箱配置信息 + * + * @param id 配电箱配置主键 + * @return 结果 + */ + @Override + public int deleteDevIotConfigPointById(Long id) + { + return devIotConfigPointMapper.deleteDevIotConfigPointById(id); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigServiceImpl.java new file mode 100644 index 00000000..b51fe6db --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotConfigServiceImpl.java @@ -0,0 +1,123 @@ +package com.yanzhu.jh.device.service.impl; + +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.yanzhu.jh.device.domain.DevIotConfig; +import com.yanzhu.jh.device.mapper.DevIotConfigMapper; +import com.yanzhu.jh.device.service.IDevIotConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 配电箱配置Service业务层处理 + * + * @author yanzhu + * @date 2025-04-04 + */ +@Service +public class DevIotConfigServiceImpl implements IDevIotConfigService +{ + @Autowired + private DevIotConfigMapper devIotConfigMapper; + + /** + * 查询配电箱配置 + * + * @param id 配电箱配置主键 + * @return 配电箱配置 + */ + @Override + public DevIotConfig selectDevIotConfigById(Long id) + { + return devIotConfigMapper.selectDevIotConfigById(id); + } + + /** + * 查询配电箱配置列表 + * + * @param devIotConfig 配电箱配置 + * @return 配电箱配置 + */ + @Override + public List selectDevIotConfigList(DevIotConfig devIotConfig) + { + return devIotConfigMapper.selectDevIotConfigList(devIotConfig); + } + + /** + * 新增配电箱配置 + * + * @param devIotConfig 配电箱配置 + * @return 结果 + */ + @Override + public int insertDevIotConfig(DevIotConfig devIotConfig) + { + // 判断设备是否重复 + DevIotConfig configQuery = new DevIotConfig(); + configQuery.setProjectId(devIotConfig.getProjectId()); + configQuery.setSignalName(devIotConfig.getSignalName()); + configQuery.setSignalCode(devIotConfig.getSignalCode()); + List list = devIotConfigMapper.selectDevIotConfigList(configQuery); + if(list.size()>0){ + throw new ServiceException("配置信息重复添加!"); + } + devIotConfig.setIsDel("99"); + devIotConfig.setCreateBy(SecurityUtils.getUsername()); + devIotConfig.setCreateTime(DateUtils.getNowDate()); + return devIotConfigMapper.insertDevIotConfig(devIotConfig); + } + + /** + * 修改配电箱配置 + * + * @param devIotConfig 配电箱配置 + * @return 结果 + */ + @Override + public int updateDevIotConfig(DevIotConfig devIotConfig) + { + // 判断设备是否重复 + if(StringUtils.isNotEmpty(devIotConfig.getSignalName()) && StringUtils.isNotEmpty(devIotConfig.getSignalCode())){ + DevIotConfig configQuery = new DevIotConfig(); + configQuery.setProjectId(devIotConfig.getProjectId()); + configQuery.setSignalName(devIotConfig.getSignalName()); + configQuery.setSignalCode(devIotConfig.getSignalCode()); + List list = devIotConfigMapper.selectDevIotConfigList(configQuery); + if(list.size()>0 && list.get(0).getId()!=devIotConfig.getId()){ + throw new ServiceException("配置信息重复添加!"); + } + } + devIotConfig.setUpdateBy(SecurityUtils.getUsername()); + devIotConfig.setUpdateTime(DateUtils.getNowDate()); + return devIotConfigMapper.updateDevIotConfig(devIotConfig); + } + + /** + * 批量删除配电箱配置 + * + * @param ids 需要删除的配电箱配置主键 + * @return 结果 + */ + @Override + public int deleteDevIotConfigByIds(Long[] ids) + { + return devIotConfigMapper.deleteDevIotConfigByIds(ids); + } + + /** + * 删除配电箱配置信息 + * + * @param id 配电箱配置主键 + * @return 结果 + */ + @Override + public int deleteDevIotConfigById(Long id) + { + return devIotConfigMapper.deleteDevIotConfigById(id); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotDatasServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotDatasServiceImpl.java new file mode 100644 index 00000000..a7e2a505 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotDatasServiceImpl.java @@ -0,0 +1,96 @@ +package com.yanzhu.jh.device.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.yanzhu.jh.device.domain.DevIotDatas; +import com.yanzhu.jh.device.mapper.DevIotDatasMapper; +import com.yanzhu.jh.device.service.IDevIotDatasService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 配电箱数据Service业务层处理 + * + * @author yanzhu + * @date 2025-04-04 + */ +@Service +public class DevIotDatasServiceImpl implements IDevIotDatasService +{ + @Autowired + private DevIotDatasMapper devIotDatasMapper; + + /** + * 查询配电箱数据 + * + * @param id 配电箱数据主键 + * @return 配电箱数据 + */ + @Override + public DevIotDatas selectDevIotDatasById(Long id) + { + return devIotDatasMapper.selectDevIotDatasById(id); + } + + /** + * 查询配电箱数据列表 + * + * @param devIotDatas 配电箱数据 + * @return 配电箱数据 + */ + @Override + public List selectDevIotDatasList(DevIotDatas devIotDatas) + { + return devIotDatasMapper.selectDevIotDatasList(devIotDatas); + } + + /** + * 新增配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + @Override + public int insertDevIotDatas(DevIotDatas devIotDatas) + { + devIotDatas.setCreateTime(DateUtils.getNowDate()); + return devIotDatasMapper.insertDevIotDatas(devIotDatas); + } + + /** + * 修改配电箱数据 + * + * @param devIotDatas 配电箱数据 + * @return 结果 + */ + @Override + public int updateDevIotDatas(DevIotDatas devIotDatas) + { + return devIotDatasMapper.updateDevIotDatas(devIotDatas); + } + + /** + * 批量删除配电箱数据 + * + * @param ids 需要删除的配电箱数据主键 + * @return 结果 + */ + @Override + public int deleteDevIotDatasByIds(Long[] ids) + { + return devIotDatasMapper.deleteDevIotDatasByIds(ids); + } + + /** + * 删除配电箱数据信息 + * + * @param id 配电箱数据主键 + * @return 结果 + */ + @Override + public int deleteDevIotDatasById(Long id) + { + return devIotDatasMapper.deleteDevIotDatasById(id); + } +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotWarningServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotWarningServiceImpl.java new file mode 100644 index 00000000..c437ac27 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevIotWarningServiceImpl.java @@ -0,0 +1,97 @@ +package com.yanzhu.jh.device.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.yanzhu.jh.device.domain.DevIotWarning; +import com.yanzhu.jh.device.mapper.DevIotWarningMapper; +import com.yanzhu.jh.device.service.IDevIotWarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 配电箱预警Service业务层处理 + * + * @author yanzhu + * @date 2025-04-04 + */ +@Service +public class DevIotWarningServiceImpl implements IDevIotWarningService +{ + @Autowired + private DevIotWarningMapper devIotWarningMapper; + + /** + * 查询配电箱预警 + * + * @param id 配电箱预警主键 + * @return 配电箱预警 + */ + @Override + public DevIotWarning selectDevIotWarningById(Long id) + { + return devIotWarningMapper.selectDevIotWarningById(id); + } + + /** + * 查询配电箱预警列表 + * + * @param devIotWarning 配电箱预警 + * @return 配电箱预警 + */ + @Override + public List selectDevIotWarningList(DevIotWarning devIotWarning) + { + return devIotWarningMapper.selectDevIotWarningList(devIotWarning); + } + + /** + * 新增配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + @Override + public int insertDevIotWarning(DevIotWarning devIotWarning) + { + devIotWarning.setCreateTime(DateUtils.getNowDate()); + return devIotWarningMapper.insertDevIotWarning(devIotWarning); + } + + /** + * 修改配电箱预警 + * + * @param devIotWarning 配电箱预警 + * @return 结果 + */ + @Override + public int updateDevIotWarning(DevIotWarning devIotWarning) + { + return devIotWarningMapper.updateDevIotWarning(devIotWarning); + } + + /** + * 批量删除配电箱预警 + * + * @param ids 需要删除的配电箱预警主键 + * @return 结果 + */ + @Override + public int deleteDevIotWarningByIds(Long[] ids) + { + return devIotWarningMapper.deleteDevIotWarningByIds(ids); + } + + /** + * 删除配电箱预警信息 + * + * @param id 配电箱预警主键 + * @return 结果 + */ + @Override + public int deleteDevIotWarningById(Long id) + { + return devIotWarningMapper.deleteDevIotWarningById(id); + } + +} diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevTowerDataRunServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevTowerDataRunServiceImpl.java index 3e676f71..c8f4b446 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevTowerDataRunServiceImpl.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/device/service/impl/DevTowerDataRunServiceImpl.java @@ -5,8 +5,10 @@ import java.util.*; import com.ruoyi.common.utils.DateUtils; import com.yanzhu.jh.device.domain.DevTowerDataRound; +import com.yanzhu.jh.device.domain.DevTowerDataWarning; import com.yanzhu.jh.device.mapper.DevTowerDataCollideMapper; import com.yanzhu.jh.device.mapper.DevTowerDataRoundMapper; +import com.yanzhu.jh.device.mapper.DevTowerDataWarningMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.yanzhu.jh.device.mapper.DevTowerDataRunMapper; @@ -31,6 +33,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService @Autowired private DevTowerDataCollideMapper devTowerDataCollideMapper; + @Autowired + private DevTowerDataWarningMapper devTowerDataWarningMapper; + /** * 查询塔机实时数据 * @@ -118,13 +123,11 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService devTowerDataRound.setDeviceKey(deviceSn); int a0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); dataMap.put("a0",a0); - devTowerDataRound.setActiveName("cz"); - int b0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); + DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning(); + devTowerDataWarning.setDeviceKey(deviceSn); + int b0 = devTowerDataWarningMapper.findOverloadWarningCountByDeviceKey(devTowerDataWarning); dataMap.put("b0",b0); - devTowerDataRound.setActiveName("gj"); - int c0 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound); - //int d0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); - //int e0 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound); + int c0 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning); dataMap.put("c0",c0); Calendar cale = Calendar.getInstance(); // 获取当月第一天和最后一天 @@ -145,15 +148,12 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService params.put("beginCreateTime",firstDay); params.put("endCreateTime",lastDay); devTowerDataRound.setParams(params); + devTowerDataWarning.setParams(params); int a1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); dataMap.put("a1",a1); - devTowerDataRound.setActiveName("cz"); - int b1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); + int b1 = devTowerDataWarningMapper.findOverloadWarningCountByDeviceKey(devTowerDataWarning); dataMap.put("b1",b1); - devTowerDataRound.setActiveName("gj"); - int c1 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound); - //int d1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); - //int e1 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound); + int c1 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning); dataMap.put("c1",c1); return dataMap; } diff --git a/yanzhu-jh/src/main/resources/mapper/device/DevIotConfigMapper.xml b/yanzhu-jh/src/main/resources/mapper/device/DevIotConfigMapper.xml new file mode 100644 index 00000000..5ef9e899 --- /dev/null +++ b/yanzhu-jh/src/main/resources/mapper/device/DevIotConfigMapper.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + select dic.id, dic.com_id, dic.project_id, sd.dept_name as com_name, pi.projectName as project_name, dic.signal_name, dic.signal_code, dic.factory_name, dic.is_del, dic.create_by, dic.create_time, dic.update_by, dic.update_time, dic.remark from dev_iot_config dic + left join sur_project pi on pi.id = dic.project_id + left join sys_dept sd on sd.dept_id = dic.com_id + + + + + + + + insert into dev_iot_config + + com_id, + project_id, + signal_name, + signal_code, + factory_name, + is_del, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{comId}, + #{projectId}, + #{signalName}, + #{signalCode}, + #{factoryName}, + #{isDel}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update dev_iot_config + + com_id = #{comId}, + project_id = #{projectId}, + signal_name = #{signalName}, + signal_code = #{signalCode}, + factory_name = #{factoryName}, + is_del = #{isDel}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + update dev_iot_config set is_del = '2' where id = #{id} + + + + update dev_iot_config set is_del = '2' where id in + + #{id} + + + \ No newline at end of file diff --git a/yanzhu-jh/src/main/resources/mapper/device/DevIotConfigPointMapper.xml b/yanzhu-jh/src/main/resources/mapper/device/DevIotConfigPointMapper.xml new file mode 100644 index 00000000..3a00eaaa --- /dev/null +++ b/yanzhu-jh/src/main/resources/mapper/device/DevIotConfigPointMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select dicp.id, dicp.cfg_id, dicp.com_id, dicp.project_id, sd.dept_name as com_name, pi.projectName as project_name, dicp.device_sn, dicp.device_name, dicp.factory_name, dicp.contact_person, dicp.contact_person_phone, dicp.levels, dicp.leakage_current, dicp.rated_temperature, + dicp.short_circuit_current, dicp.rated_current, dicp.rated_voltage, dicp.online_status, dicp.is_del, dicp.create_by, dicp.create_time, dicp.update_by, dicp.update_time, dicp.remark from dev_iot_config_point dicp + left join sur_project pi on pi.id = dicp.project_id + left join sys_dept sd on sd.dept_id = dicp.com_id + + + + + + + + insert into dev_iot_config_point + + cfg_id, + com_id, + project_id, + device_sn, + device_name, + factory_name, + contact_person, + contact_person_phone, + levels, + leakage_current, + rated_temperature, + short_circuit_current, + rated_current, + rated_voltage, + online_status, + is_del, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{cfgId}, + #{comId}, + #{projectId}, + #{deviceSn}, + #{deviceName}, + #{factoryName}, + #{contactPerson}, + #{contactPersonPhone}, + #{levels}, + #{leakageCurrent}, + #{ratedTemperature}, + #{shortCircuitCurrent}, + #{ratedCurrent}, + #{ratedVoltage}, + #{onlineStatus}, + #{isDel}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update dev_iot_config_point + + cfg_id = #{cfgId}, + com_id = #{comId}, + project_id = #{projectId}, + device_sn = #{deviceSn}, + device_name = #{deviceName}, + factory_name = #{factoryName}, + contact_person = #{contactPerson}, + contact_person_phone = #{contactPersonPhone}, + levels = #{levels}, + leakage_current = #{leakageCurrent}, + rated_temperature = #{ratedTemperature}, + short_circuit_current = #{shortCircuitCurrent}, + rated_current = #{ratedCurrent}, + rated_voltage = #{ratedVoltage}, + online_status = #{onlineStatus}, + is_del = #{isDel}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + update dev_iot_config_point set is_del = '2' where id = #{id} + + + + update dev_iot_config_point set is_del = '2' where id in + + #{id} + + + \ No newline at end of file diff --git a/yanzhu-jh/src/main/resources/mapper/device/DevIotDatasMapper.xml b/yanzhu-jh/src/main/resources/mapper/device/DevIotDatasMapper.xml new file mode 100644 index 00000000..d515d3b3 --- /dev/null +++ b/yanzhu-jh/src/main/resources/mapper/device/DevIotDatasMapper.xml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select did.id, did.cfg_id, did.point_id, did.com_id, did.project_id, sd.dept_name as com_name, pi.projectName as project_name, did.device_sn, did.switches_ac, did.switches_switch, did.switches_switches, did.switches_switchStatus, did.temperature, did.leakage, did.voltage_a, did.voltage_b, did.voltage_c, did.voltage_ab, did.voltage_bc, did.voltage_ca, did.current_a, did.current_b, did.current_c, did.power_a, power_b, power_c, + did.energy_a, did.energy_b, did.energy_c, did.factor_a, did.factor_b, did.factor_c, did.frequency_a, did.frequency_b, did.frequency_c, did.create_time from dev_iot_datas did + left join sur_project pi on pi.id = did.project_id + left join sys_dept sd on sd.dept_id = did.com_id + + + + + + + + insert into dev_iot_datas + + cfg_id, + point_id, + com_id, + project_id, + device_sn, + switches_ac, + switches_switch, + switches_switches, + switches_switchStatus, + temperature, + leakage, + voltage_a, + voltage_b, + voltage_c, + voltage_ab, + voltage_bc, + voltage_ca, + current_a, + current_b, + current_c, + power_a, + power_b, + power_c, + energy_a, + energy_b, + energy_c, + factor_a, + factor_b, + factor_c, + frequency_a, + frequency_b, + frequency_c, + create_time, + + + #{cfgId}, + #{pointId}, + #{comId}, + #{projectId}, + #{deviceSn}, + #{switchesAc}, + #{switchesSwitch}, + #{switchesSwitches}, + #{switchesSwitchstatus}, + #{temperature}, + #{leakage}, + #{voltageA}, + #{voltageB}, + #{voltageC}, + #{voltageAb}, + #{voltageBc}, + #{voltageCa}, + #{currentA}, + #{currentB}, + #{currentC}, + #{powerA}, + #{powerB}, + #{powerC}, + #{energyA}, + #{energyB}, + #{energyC}, + #{factorA}, + #{factorB}, + #{factorC}, + #{frequencyA}, + #{frequencyB}, + #{frequencyC}, + #{createTime}, + + + + + update dev_iot_datas + + cfg_id = #{cfgId}, + point_id = #{pointId}, + com_id = #{comId}, + project_id = #{projectId}, + device_sn = #{deviceSn}, + switches_ac = #{switchesAc}, + switches_switch = #{switchesSwitch}, + switches_switches = #{switchesSwitches}, + switches_switchStatus = #{switchesSwitchstatus}, + temperature = #{temperature}, + leakage = #{leakage}, + voltage_a = #{voltageA}, + voltage_b = #{voltageB}, + voltage_c = #{voltageC}, + voltage_ab = #{voltageAb}, + voltage_bc = #{voltageBc}, + voltage_ca = #{voltageCa}, + current_a = #{currentA}, + current_b = #{currentB}, + current_c = #{currentC}, + power_a = #{powerA}, + power_b = #{powerB}, + power_c = #{powerC}, + energy_a = #{energyA}, + energy_b = #{energyB}, + energy_c = #{energyC}, + factor_a = #{factorA}, + factor_b = #{factorB}, + factor_c = #{factorC}, + frequency_a = #{frequencyA}, + frequency_b = #{frequencyB}, + frequency_c = #{frequencyC}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dev_iot_datas where id = #{id} + + + + delete from dev_iot_datas where id in + + #{id} + + + \ No newline at end of file diff --git a/yanzhu-jh/src/main/resources/mapper/device/DevIotWarningMapper.xml b/yanzhu-jh/src/main/resources/mapper/device/DevIotWarningMapper.xml new file mode 100644 index 00000000..59279ca7 --- /dev/null +++ b/yanzhu-jh/src/main/resources/mapper/device/DevIotWarningMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + select diw.id, diw.cfg_id, diw.point_id, diw.com_id, diw.project_id, sd.dept_name as com_name, pi.projectName as project_name, diw.device_sn, diw.warning_type, diw.warning_content, diw.create_time from dev_iot_warning diw + left join sur_project pi on pi.id = diw.project_id + left join sys_dept sd on sd.dept_id = diw.com_id + + + + + + + + insert into dev_iot_warning + + cfg_id, + point_id, + com_id, + project_id, + device_sn, + warning_type, + warning_content, + create_time, + + + #{cfgId}, + #{pointId}, + #{comId}, + #{projectId}, + #{deviceSn}, + #{warningType}, + #{warningContent}, + #{createTime}, + + + + + update dev_iot_warning + + cfg_id = #{cfgId}, + point_id = #{pointId}, + com_id = #{comId}, + project_id = #{projectId}, + device_sn = #{deviceSn}, + warning_type = #{warningType}, + warning_content = #{warningContent}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dev_iot_warning where id = #{id} + + + + delete from dev_iot_warning where id in + + #{id} + + + \ No newline at end of file diff --git a/yanzhu-jh/src/main/resources/mapper/device/DevTowerDataWarningMapper.xml b/yanzhu-jh/src/main/resources/mapper/device/DevTowerDataWarningMapper.xml index de5a402a..f5bfc05e 100644 --- a/yanzhu-jh/src/main/resources/mapper/device/DevTowerDataWarningMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/device/DevTowerDataWarningMapper.xml @@ -17,8 +17,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + + + + + + + + + @@ -28,7 +36,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select dtdw.id, dtdw.cfg_id, dtdw.project_id, dtdw.dept_id, sp.projectName, sd.dept_name, dtdw.device_key, dtdw.device_source, dtdw.tower_id, dtdw.warn_type, dtdw.warn_name, dtdw.warn_note, dtdw.warn_data, dtdw.real_data, dtdw.is_del, dtdw.create_by, dtdw.create_time, dtdw.update_by, dtdw.update_time, dtdw.remark from dev_tower_data_warning dtdw + select dtdw.id, dtdw.cfg_id, dtdw.project_id, dtdw.dept_id, sp.projectName, sd.dept_name, + dtdw.device_key, + dtdw.device_source, + dtdw.tower_id, + dtdw.warn_type, + dtdw.warn_name, + IFNULL(dtdw.warn_note,sdd.dict_label) as warn_note, + dtdw.height, + dtdw.range, + dtdw.rotation, + dtdw.load, + dtdw.wind_speed, + dtdw.lean_angle_x, + dtdw.lean_angle_y, + dtdw.moment_percent, + dtdw.rate, + dtdw.alarmed, + dtdw.is_del, + dtdw.create_by, + dtdw.create_time, + dtdw.update_by, + dtdw.update_time, + dtdw.remark + from dev_tower_data_warning dtdw left join sur_project sp on sp.id = dtdw.project_id left join sys_dept sd on sd.dept_id = dtdw.dept_id @@ -46,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and dtdw.tower_id = #{towerId} and dtdw.warn_type = #{warnType} and dtdw.create_time between #{params.beginCreateTime} and #{params.endCreateTime} + and dtdw.is_del=0 order by dtdw.id desc @@ -67,8 +99,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" warn_type, warn_name, warn_note, - warn_data, - real_data, + height, + `range`, + rotation, + `load`, + wind_speed, + lean_angle_x, + lean_angle_y, + moment_percent, + rate, + alarmed, is_del, create_by, create_time, @@ -86,8 +126,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{warnType}, #{warnName}, #{warnNote}, - #{warnData}, - #{realData}, + #{height}, + #{range}, + #{rotation}, + #{load}, + #{windSpeed}, + #{leanAngleX}, + #{leanAngleY}, + #{momentPercent}, + #{rate}, + #{alarmed}, #{isDel}, #{createBy}, #{createTime}, @@ -109,8 +157,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" warn_type = #{warnType}, warn_name = #{warnName}, warn_note = #{warnNote}, - warn_data = #{warnData}, - real_data = #{realData}, + height = #{height}, + `range` = #{range}, + rotation = #{rotation}, + `load` = #{load}, + wind_speed = #{windSpeed}, + lean_angle_x = #{leanAngleX}, + lean_angle_y = #{leanAngleY}, + moment_percent = #{momentPercent}, + rate = #{rate}, + alarmed = #{alarmed}, is_del = #{isDel}, create_by = #{createBy}, create_time = #{createTime}, @@ -131,4 +187,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + + + \ No newline at end of file