From 55b1f87ce71cc4f73f8e9bef4d40359945897abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E4=BC=9F?= Date: Tue, 22 Oct 2024 13:50:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=83=BD=E6=BA=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E7=9A=84=E5=AE=9E=E6=97=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=90=8E=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmsBaseCollectDeviceInfoController.java | 103 ++++++ .../EmsBaseEnergyTypeController.java | 118 +++++++ .../EmsBaseMonitorInfoController.java | 103 ++++++ .../base/domain/EmsBaseCollectDeviceInfo.java | 194 +++++++++++ .../hw/ems/base/domain/EmsBaseEnergyType.java | 89 +++++ .../ems/base/domain/EmsBaseMonitorInfo.java | 326 ++++++++++++++++++ .../com/hw/ems/base/domain/TreeSelects.java | 101 ++++++ .../EmsBaseCollectDeviceInfoMapper.java | 61 ++++ .../base/mapper/EmsBaseEnergyTypeMapper.java | 69 ++++ .../base/mapper/EmsBaseMonitorInfoMapper.java | 70 ++++ .../IEmsBaseCollectDeviceInfoService.java | 62 ++++ .../service/IEmsBaseEnergyTypeService.java | 69 ++++ .../service/IEmsBaseMonitorInfoService.java | 92 +++++ .../EmsBaseCollectDeviceInfoServiceImpl.java | 90 +++++ .../impl/EmsBaseEnergyTypeServiceImpl.java | 107 ++++++ .../impl/EmsBaseMonitorInfoServiceImpl.java | 203 +++++++++++ .../TWTempertureDataController.java | 176 ++++++++++ .../com/hw/ems/record/domain/EmsIOTData.java | 98 ++++++ .../ems/record/domain/TWTempertureData.java | 230 ++++++++++++ .../record/mapper/TWTempertureDataMapper.java | 78 +++++ .../service/ITWTempertureDataService.java | 77 +++++ .../impl/TWTempertureDataServiceImpl.java | 114 ++++++ .../base/EmsBaseCollectDeviceInfoMapper.xml | 140 ++++++++ .../mapper/base/EmsBaseEnergyTypeMapper.xml | 104 ++++++ .../mapper/base/EmsBaseMonitorInfoMapper.xml | 174 ++++++++++ .../mapper/record/TWTempertureDataMapper.xml | 155 +++++++++ 26 files changed, 3203 insertions(+) create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseCollectDeviceInfoController.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseEnergyTypeController.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseMonitorInfoController.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseCollectDeviceInfo.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseEnergyType.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseMonitorInfo.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/TreeSelects.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseCollectDeviceInfoMapper.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseEnergyTypeMapper.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseMonitorInfoMapper.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseCollectDeviceInfoService.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseEnergyTypeService.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseMonitorInfoService.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseCollectDeviceInfoServiceImpl.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseEnergyTypeServiceImpl.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/EmsIOTData.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/TWTempertureData.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/TWTempertureDataMapper.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/ITWTempertureDataService.java create mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/TWTempertureDataServiceImpl.java create mode 100644 hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseCollectDeviceInfoMapper.xml create mode 100644 hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseEnergyTypeMapper.xml create mode 100644 hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseMonitorInfoMapper.xml create mode 100644 hw-modules/hw-ems/src/main/resources/mapper/record/TWTempertureDataMapper.xml diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseCollectDeviceInfoController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseCollectDeviceInfoController.java new file mode 100644 index 0000000..8fcdecb --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseCollectDeviceInfoController.java @@ -0,0 +1,103 @@ +package com.hw.ems.base.controller; + +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.web.page.TableDataInfo; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo; +import com.hw.ems.base.service.IEmsBaseCollectDeviceInfoService; + +import org.springframework.beans.factory.annotation.Autowired; + +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 采集设备信息Controller + * + * @author Yinq + * @date 2024-05-20 + */ +@RestController +@RequestMapping("/base/baseCollectDeviceInfo") +public class EmsBaseCollectDeviceInfoController extends BaseController { + @Autowired + private IEmsBaseCollectDeviceInfoService emsBaseCollectDeviceInfoService; + + /** + * 查询采集设备信息列表 + */ + + @GetMapping("/list") + public TableDataInfo list(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { + startPage(); + List list = emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo); + return getDataTable(list); + } + + /** + * 查询采集设备信息下拉框列表 + */ + @GetMapping("/getCollectDeviceInfo") + public AjaxResult getCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { + List list = emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo); + return success(list); + } + + /** + * 导出采集设备信息列表 + */ + + @Log(title = "采集设备信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { + List list = emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo); + ExcelUtil util = new ExcelUtil(EmsBaseCollectDeviceInfo.class); + util.exportExcel(response, list, "采集设备信息数据"); + } + + /** + * 获取采集设备信息详细信息 + */ + + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoByObjId(objId)); + } + + /** + * 新增采集设备信息 + */ + + @Log(title = "采集设备信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { +// emsBaseCollectDeviceInfo.setCreateBy(getUsername()); + return toAjax(emsBaseCollectDeviceInfoService.insertEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo)); + } + + /** + * 修改采集设备信息 + */ + + @Log(title = "采集设备信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { +// emsBaseCollectDeviceInfo.setUpdateBy(getUsername()); + return toAjax(emsBaseCollectDeviceInfoService.updateEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo)); + } + + /** + * 删除采集设备信息 + */ + + @Log(title = "采集设备信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(emsBaseCollectDeviceInfoService.deleteEmsBaseCollectDeviceInfoByObjIds(objIds)); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseEnergyTypeController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseEnergyTypeController.java new file mode 100644 index 0000000..08bedfd --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseEnergyTypeController.java @@ -0,0 +1,118 @@ +package com.hw.ems.base.controller; + +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.web.page.TableDataInfo; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.ems.base.domain.EmsBaseEnergyType; +import com.hw.ems.base.service.IEmsBaseEnergyTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 能源类型信息Controller + * + * @author Yinq + * @date 2024-05-08 + */ +@RestController +@RequestMapping("/base/baseEnergyType") +public class EmsBaseEnergyTypeController extends BaseController +{ + @Autowired + private IEmsBaseEnergyTypeService emsBaseEnergyTypeService; + + /** + * 查询能源类型信息列表 + */ + + @GetMapping("/list") + public TableDataInfo list(EmsBaseEnergyType emsBaseEnergyType) + { + startPage(); + List list = emsBaseEnergyTypeService.selectEmsBaseEnergyTypeList(emsBaseEnergyType); + return getDataTable(list); + } + +// /** +// * 根据能源类型id查询能源类型名称 +// * @param energyTypeId +// * @return +// */ +// public AjaxResult queryEnergyNameByEnergyTypeId(int energyTypeId) +// { +// String energyName = emsBaseEnergyTypeService.queryEnergyNameByEnergyTypeId(energyTypeId); +// return success(energyName); +// } + + /** + * 查询能源类型信息下拉框列表 + */ + @GetMapping("/getBaseEnergyTypeList") + public AjaxResult baseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType) + { + List list = emsBaseEnergyTypeService.selectEmsBaseEnergyTypeList(emsBaseEnergyType); + return success(list); + } + + /** + * 导出能源类型信息列表 + */ + + @Log(title = "能源类型信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EmsBaseEnergyType emsBaseEnergyType) + { + List list = emsBaseEnergyTypeService.selectEmsBaseEnergyTypeList(emsBaseEnergyType); + ExcelUtil util = new ExcelUtil(EmsBaseEnergyType.class); + util.exportExcel(response, list, "能源类型信息数据"); + } + + /** + * 获取能源类型信息详细信息 + */ + + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) + { + return success(emsBaseEnergyTypeService.selectEmsBaseEnergyTypeByObjId(objId)); + } + + /** + * 新增能源类型信息 + */ + + @Log(title = "能源类型信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EmsBaseEnergyType emsBaseEnergyType) + { + return toAjax(emsBaseEnergyTypeService.insertEmsBaseEnergyType(emsBaseEnergyType)); + } + + /** + * 修改能源类型信息 + */ + + @Log(title = "能源类型信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EmsBaseEnergyType emsBaseEnergyType) + { + return toAjax(emsBaseEnergyTypeService.updateEmsBaseEnergyType(emsBaseEnergyType)); + } + + /** + * 删除能源类型信息 + */ + + @Log(title = "能源类型信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) + { + return toAjax(emsBaseEnergyTypeService.deleteEmsBaseEnergyTypeByObjIds(objIds)); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseMonitorInfoController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseMonitorInfoController.java new file mode 100644 index 0000000..8ceb901 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/EmsBaseMonitorInfoController.java @@ -0,0 +1,103 @@ +package com.hw.ems.base.controller; + +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.ems.base.domain.EmsBaseMonitorInfo; +import com.hw.ems.base.domain.TreeSelects; +import com.hw.ems.base.service.IEmsBaseMonitorInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 计量设备信息Controller + * + * @author Yinq + * @date 2024-05-08 + */ +@RestController +@RequestMapping("/base/baseMonitorInfo") +public class EmsBaseMonitorInfoController extends BaseController +{ + @Autowired + private IEmsBaseMonitorInfoService emsBaseMonitorInfoService; + + /** + * 查询计量设备信息列表 + */ + + @GetMapping("/list") + public AjaxResult list(EmsBaseMonitorInfo emsBaseMonitorInfo) + { + List list = emsBaseMonitorInfoService.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo); + return success(list); + } + + /** + * 查询计量设备信息下拉树结构 + * */ + @PostMapping("/monitorInfoTree") + public AjaxResult getMonitorInfoTree(@RequestBody EmsBaseMonitorInfo baseMonitorInfo) { + List list = emsBaseMonitorInfoService.selectBaseMonitorInfoTreeList(baseMonitorInfo); + return success(list); + } + + /** + * 导出计量设备信息列表 + */ + + @Log(title = "计量设备信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EmsBaseMonitorInfo emsBaseMonitorInfo) + { + List list = emsBaseMonitorInfoService.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo); + ExcelUtil util = new ExcelUtil(EmsBaseMonitorInfo.class); + util.exportExcel(response, list, "计量设备信息数据"); + } + + /** + * 获取计量设备信息详细信息 + */ + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) + { + return success(emsBaseMonitorInfoService.selectEmsBaseMonitorInfoByObjId(objId)); + } + + /** + * 新增计量设备信息 + */ + @Log(title = "计量设备信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EmsBaseMonitorInfo emsBaseMonitorInfo) + { +// emsBaseMonitorInfo.setCreateBy(getUsername()); + return toAjax(emsBaseMonitorInfoService.insertEmsBaseMonitorInfo(emsBaseMonitorInfo)); + } + + /** + * 修改计量设备信息 + */ + @Log(title = "计量设备信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EmsBaseMonitorInfo emsBaseMonitorInfo) + { +// emsBaseMonitorInfo.setUpdateBy(getUsername()); + return toAjax(emsBaseMonitorInfoService.updateEmsBaseMonitorInfo(emsBaseMonitorInfo)); + } + + /** + * 删除计量设备信息 + */ + @Log(title = "计量设备信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) + { + return toAjax(emsBaseMonitorInfoService.deleteEmsBaseMonitorInfoByObjIds(objIds)); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseCollectDeviceInfo.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseCollectDeviceInfo.java new file mode 100644 index 0000000..5cffba0 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseCollectDeviceInfo.java @@ -0,0 +1,194 @@ +package com.hw.ems.base.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 采集设备信息对象 ems_base_collect_device_info + * + * @author Yinq + * @date 2024-05-20 + */ +public class EmsBaseCollectDeviceInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 自增标识 + */ + private Long objId; + + /** + * 采集设备编号 + */ + @Excel(name = "采集设备编号") + private String collectDeviceId; + + /** + * 采集设备名称 + */ + @Excel(name = "采集设备名称") + private String collectDeviceName; + + /** + * 能源类型 + */ + @Excel(name = "能源类型") + private Long energyTypeId; + + /** + * 能源类型名称 + */ + @Excel(name = "能源类型名称") + private String energyTypeName; + + /** + * 型号 + */ + @Excel(name = "型号") + private String model; + + /** + * 生产厂家 + */ + @Excel(name = "生产厂家") + private String manufacturer; + + /** + * 通讯地址 + */ + @Excel(name = "通讯地址") + private String ipAddress; + + /** + * 生产日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date produceDate; + + /** + * 安装地址 + */ + @Excel(name = "安装地址") + private String settingAddress; + + /** + * 启用标识(0启用 1停用) + */ + @Excel(name = "启用标识", readConverterExp = "0=启用,1=停用") + private String isFlag; + + public String getEnergyTypeName() { + return energyTypeName; + } + + public void setEnergyTypeName(String energyTypeName) { + this.energyTypeName = energyTypeName; + } + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setCollectDeviceId(String collectDeviceId) { + this.collectDeviceId = collectDeviceId; + } + + public String getCollectDeviceId() { + return collectDeviceId; + } + + public void setCollectDeviceName(String collectDeviceName) { + this.collectDeviceName = collectDeviceName; + } + + public String getCollectDeviceName() { + return collectDeviceName; + } + + public void setEnergyTypeId(Long energyTypeId) { + this.energyTypeId = energyTypeId; + } + + public Long getEnergyTypeId() { + return energyTypeId; + } + + public void setModel(String model) { + this.model = model; + } + + public String getModel() { + return model; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public String getIpAddress() { + return ipAddress; + } + + public void setProduceDate(Date produceDate) { + this.produceDate = produceDate; + } + + public Date getProduceDate() { + return produceDate; + } + + public void setSettingAddress(String settingAddress) { + this.settingAddress = settingAddress; + } + + public String getSettingAddress() { + return settingAddress; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String getIsFlag() { + return isFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("collectDeviceId", getCollectDeviceId()) + .append("collectDeviceName", getCollectDeviceName()) + .append("energyTypeId", getEnergyTypeId()) + .append("model", getModel()) + .append("manufacturer", getManufacturer()) + .append("ipAddress", getIpAddress()) + .append("produceDate", getProduceDate()) + .append("settingAddress", getSettingAddress()) + .append("isFlag", getIsFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseEnergyType.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseEnergyType.java new file mode 100644 index 0000000..4045013 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseEnergyType.java @@ -0,0 +1,89 @@ +package com.hw.ems.base.domain; + +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; + +/** + * 能源类型信息对象 ems_base_energy_type + * + * @author Yinq + * @date 2024-05-08 + */ +public class EmsBaseEnergyType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + + /** 能源类型编号 */ + @Excel(name = "能源类型编号") + private Long energyTypeId; + + /** 能源类型名称 */ + @Excel(name = "能源类型名称") + private String energyName; + + /** 单位 */ + @Excel(name = "单位") + private String measureUnit; + + /** 单价 */ + @Excel(name = "单价") + private BigDecimal price; + + + public void setEnergyTypeId(Long energyTypeId) + { + this.energyTypeId = energyTypeId; + } + + public Long getEnergyTypeId() + { + return energyTypeId; + } + public void setEnergyName(String energyName) + { + this.energyName = energyName; + } + + public String getEnergyName() + { + return energyName; + } + public void setMeasureUnit(String measureUnit) + { + this.measureUnit = measureUnit; + } + + public String getMeasureUnit() + { + return measureUnit; + } + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public BigDecimal getPrice() + { + return price; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("energyTypeId", getEnergyTypeId()) + .append("energyName", getEnergyName()) + .append("measureUnit", getMeasureUnit()) + .append("price", getPrice()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseMonitorInfo.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseMonitorInfo.java new file mode 100644 index 0000000..e006827 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/EmsBaseMonitorInfo.java @@ -0,0 +1,326 @@ +package com.hw.ems.base.domain; + +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.ArrayList; +import java.util.List; + +/** + * 计量设备信息对象 ems_base_monitor_info + * + * @author Yinq + * @date 2024-05-08 + */ +public class EmsBaseMonitorInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 自增标识 */ + private Long objId; + + /** 计量设备编号 */ + @Excel(name = "计量设备编号") + private String monitorCode; + + /** 计量设备名称 */ + @Excel(name = "计量设备名称") + private String monitorName; + + /** 计量设备位置 */ + @Excel(name = "计量设备位置") + private String monitorAddr; + + /** 计量设备类型 */ + @Excel(name = "能源类型") + private Long monitorType; + + /** 计量设备状态(0启用 1停用) */ + @Excel(name = "计量设备状态", readConverterExp = "0=启用,1=停用") + private Long monitorStatus; + + /** 采集设备编号F */ + @Excel(name = "采集设备编号") + private String collectDeviceId; + + /** 等级 */ + @Excel(name = "等级") + private Long grade; + + /** 传感器仪表 */ + @Excel(name = "传感器仪表") + private String meterTypeId; + + /** 修正值 */ + @Excel(name = "修正值") + private Long correctValue; + + /** PT值 */ + @Excel(name = "PT值") + private Long pt; + + /** CT值 */ + @Excel(name = "CT值") + private Long ct; + + /** 是否虚拟(0是 1否) */ + @Excel(name = "是否虚拟", readConverterExp = "0=是,1=否") + private String isAmmeter; + + /** 通断复位 */ + @Excel(name = "通断复位") + private Long isKeyMonitor; + + /** 是否断路 */ + @Excel(name = "是否断路") + private Long isCircuit; + + /** 公摊表类型 */ + @Excel(name = "公摊表类型") + private Long publicShareType; + + /** 表具层级 */ + @Excel(name = "表具层级") + private Long monitorHierarchy; + + private List children = new ArrayList(); + + private String parentName; + + private Long parentId; + + private Integer orderNum; + + private String ancestors; + + private List monitorTypeList; + + public List getMonitorTypeList() { + return monitorTypeList; + } + + public void setMonitorTypeList(List monitorTypeList) { + this.monitorTypeList = monitorTypeList; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Integer getOrderNum() { + return orderNum; + } + + public void setOrderNum(Integer orderNum) { + this.orderNum = orderNum; + } + + public String getAncestors() { + return ancestors; + } + + public void setAncestors(String ancestors) { + this.ancestors = ancestors; + } + + public void setObjId(Long objId) + { + this.objId = objId; + } + + public Long getObjId() + { + return objId; + } + + public String getMonitorCode() { + return monitorCode; + } + + public void setMonitorCode(String monitorCode) { + this.monitorCode = monitorCode; + } + + public void setMonitorName(String monitorName) + { + this.monitorName = monitorName; + } + + public String getMonitorName() + { + return monitorName; + } + public void setMonitorAddr(String monitorAddr) + { + this.monitorAddr = monitorAddr; + } + + public String getMonitorAddr() + { + return monitorAddr; + } + public void setMonitorType(Long monitorType) + { + this.monitorType = monitorType; + } + + public Long getMonitorType() + { + return monitorType; + } + public void setMonitorStatus(Long monitorStatus) + { + this.monitorStatus = monitorStatus; + } + + public Long getMonitorStatus() + { + return monitorStatus; + } + public void setCollectDeviceId(String collectDeviceId) + { + this.collectDeviceId = collectDeviceId; + } + + public String getCollectDeviceId() + { + return collectDeviceId; + } + public void setGrade(Long grade) + { + this.grade = grade; + } + + public Long getGrade() + { + return grade; + } + public void setMeterTypeId(String meterTypeId) + { + this.meterTypeId = meterTypeId; + } + + public String getMeterTypeId() + { + return meterTypeId; + } + public void setCorrectValue(Long correctValue) + { + this.correctValue = correctValue; + } + + public Long getCorrectValue() + { + return correctValue; + } + public void setPt(Long pt) + { + this.pt = pt; + } + + public Long getPt() + { + return pt; + } + public void setCt(Long ct) + { + this.ct = ct; + } + + public Long getCt() + { + return ct; + } + public void setIsAmmeter(String isAmmeter) + { + this.isAmmeter = isAmmeter; + } + + public String getIsAmmeter() + { + return isAmmeter; + } + public void setIsKeyMonitor(Long isKeyMonitor) + { + this.isKeyMonitor = isKeyMonitor; + } + + public Long getIsKeyMonitor() + { + return isKeyMonitor; + } + public void setIsCircuit(Long isCircuit) + { + this.isCircuit = isCircuit; + } + + public Long getIsCircuit() + { + return isCircuit; + } + public void setPublicShareType(Long publicShareType) + { + this.publicShareType = publicShareType; + } + + public Long getPublicShareType() + { + return publicShareType; + } + public void setMonitorHierarchy(Long monitorHierarchy) + { + this.monitorHierarchy = monitorHierarchy; + } + + public Long getMonitorHierarchy() + { + return monitorHierarchy; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("monitorName", getMonitorName()) + .append("monitorAddr", getMonitorAddr()) + .append("monitorType", getMonitorType()) + .append("monitorStatus", getMonitorStatus()) + .append("collectDeviceId", getCollectDeviceId()) + .append("grade", getGrade()) + .append("meterTypeId", getMeterTypeId()) + .append("correctValue", getCorrectValue()) + .append("pt", getPt()) + .append("ct", getCt()) + .append("isAmmeter", getIsAmmeter()) + .append("isKeyMonitor", getIsKeyMonitor()) + .append("isCircuit", getIsCircuit()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("publicShareType", getPublicShareType()) + .append("monitorHierarchy", getMonitorHierarchy()) + .toString(); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/TreeSelects.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/TreeSelects.java new file mode 100644 index 0000000..ddc64d5 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/domain/TreeSelects.java @@ -0,0 +1,101 @@ +package com.hw.ems.base.domain; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.hw.system.api.domain.SysDept; + +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Treeselect树结构实体类 + * + * @author ruoyi + */ +public class TreeSelects implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 节点ID */ + private Long id; + + /** 节点名称 */ + private String label; + + private String code; + + /** 子节点 */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public TreeSelects() + { + + } + + public TreeSelects(SysDept dept) + { + this.id = dept.getDeptId(); + this.label = dept.getDeptName(); + this.children = dept.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList()); + } + + public TreeSelects(EmsBaseMonitorInfo baseMonitorInfo){ +// this.id = baseMonitorInfo.getObjId(); + this.label = baseMonitorInfo.getMonitorName(); + this.code = baseMonitorInfo.getMonitorCode(); + this.children = baseMonitorInfo.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList()); + } + +// public TreeSelects(EmsBaseWorkUnit baseWorkUnit){ +// this.id = baseWorkUnit.getObjId(); +// this.label = baseWorkUnit.getWorkUnitName(); +// this.code = baseWorkUnit.getWorkUnitCode(); +// this.children = baseWorkUnit.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList()); +// } +// +// public TreeSelects(SysMenu menu) +// { +// this.id = menu.getMenuId(); +// this.label = menu.getMenuName(); +// this.children = menu.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList()); +// } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getLabel() + { + return label; + } + + public void setLabel(String label) + { + this.label = label; + } + + public List getChildren() + { + return children; + } + + public void setChildren(List children) + { + this.children = children; + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseCollectDeviceInfoMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseCollectDeviceInfoMapper.java new file mode 100644 index 0000000..ded5f3f --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseCollectDeviceInfoMapper.java @@ -0,0 +1,61 @@ +package com.hw.ems.base.mapper; + +import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo; + +import java.util.List; + +/** + * 采集设备信息Mapper接口 + * + * @author Yinq + * @date 2024-05-20 + */ +public interface EmsBaseCollectDeviceInfoMapper { + /** + * 查询采集设备信息 + * + * @param objId 采集设备信息主键 + * @return 采集设备信息 + */ + public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId); + + /** + * 查询采集设备信息列表 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 采集设备信息集合 + */ + public List selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo); + + /** + * 新增采集设备信息 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 结果 + */ + public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo); + + /** + * 修改采集设备信息 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 结果 + */ + public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo); + + /** + * 删除采集设备信息 + * + * @param objId 采集设备信息主键 + * @return 结果 + */ + public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId); + + /** + * 批量删除采集设备信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseEnergyTypeMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseEnergyTypeMapper.java new file mode 100644 index 0000000..79c6163 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseEnergyTypeMapper.java @@ -0,0 +1,69 @@ +package com.hw.ems.base.mapper; + +import com.hw.ems.base.domain.EmsBaseEnergyType; + +import java.util.List; + +/** + * 能源类型信息Mapper接口 + * + * @author Yinq + * @date 2024-05-08 + */ +public interface EmsBaseEnergyTypeMapper +{ + /** + * 查询能源类型信息 + * + * @param objId 能源类型信息主键 + * @return 能源类型信息 + */ + public EmsBaseEnergyType selectEmsBaseEnergyTypeByObjId(Long objId); + + /** + * 查询能源类型信息列表 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 能源类型信息集合 + */ + public List selectEmsBaseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType); + + /** + * 新增能源类型信息 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 结果 + */ + public int insertEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType); + + /** + * 修改能源类型信息 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 结果 + */ + public int updateEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType); + + /** + * 删除能源类型信息 + * + * @param objId 能源类型信息主键 + * @return 结果 + */ + public int deleteEmsBaseEnergyTypeByObjId(Long objId); + + /** + * 批量删除能源类型信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsBaseEnergyTypeByObjIds(Long[] objIds); + + /** + * 根据能源类型id查询能源类型名称 + * @param energyTypeId + * @return + */ + public String selectEmsBaseEnergyNameByEnergyTypeId(int energyTypeId); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseMonitorInfoMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseMonitorInfoMapper.java new file mode 100644 index 0000000..1c92e84 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/EmsBaseMonitorInfoMapper.java @@ -0,0 +1,70 @@ +package com.hw.ems.base.mapper; + + +import com.hw.ems.base.domain.EmsBaseMonitorInfo; + +import java.util.List; + +/** + * 计量设备信息Mapper接口 + * + * @author Yinq + * @date 2024-05-08 + */ +public interface EmsBaseMonitorInfoMapper +{ + /** + * 查询计量设备信息 + * + * @param objId 计量设备信息主键 + * @return 计量设备信息 + */ + public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId); + + /** + * 查询计量设备信息列表 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 计量设备信息集合 + */ + public List selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo); + + /** + * 新增计量设备信息 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 结果 + */ + public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo); + + /** + * 修改计量设备信息 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 结果 + */ + public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo); + + /** + * 删除计量设备信息 + * + * @param objId 计量设备信息主键 + * @return 结果 + */ + public int deleteEmsBaseMonitorInfoByObjId(Long objId); + + /** + * 批量删除计量设备信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds); + + /** + * 根据设备编码查询本设备的能源类型 + * @param monitorCode + * @return + */ + public String selectEmsBaseMonitorTypeByMonitorCode(String monitorCode); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseCollectDeviceInfoService.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseCollectDeviceInfoService.java new file mode 100644 index 0000000..2a82d15 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseCollectDeviceInfoService.java @@ -0,0 +1,62 @@ +package com.hw.ems.base.service; + +import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo; + + +import java.util.List; + +/** + * 采集设备信息Service接口 + * + * @author Yinq + * @date 2024-05-20 + */ +public interface IEmsBaseCollectDeviceInfoService { + /** + * 查询采集设备信息 + * + * @param objId 采集设备信息主键 + * @return 采集设备信息 + */ + public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId); + + /** + * 查询采集设备信息列表 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 采集设备信息集合 + */ + public List selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo); + + /** + * 新增采集设备信息 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 结果 + */ + public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo); + + /** + * 修改采集设备信息 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 结果 + */ + public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo); + + /** + * 批量删除采集设备信息 + * + * @param objIds 需要删除的采集设备信息主键集合 + * @return 结果 + */ + public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds); + + /** + * 删除采集设备信息信息 + * + * @param objId 采集设备信息主键 + * @return 结果 + */ + public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseEnergyTypeService.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseEnergyTypeService.java new file mode 100644 index 0000000..126a39b --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseEnergyTypeService.java @@ -0,0 +1,69 @@ +package com.hw.ems.base.service; + +import com.hw.ems.base.domain.EmsBaseEnergyType; + +import java.util.List; + +/** + * 能源类型信息Service接口 + * + * @author Yinq + * @date 2024-05-08 + */ +public interface IEmsBaseEnergyTypeService +{ + /** + * 查询能源类型信息 + * + * @param objId 能源类型信息主键 + * @return 能源类型信息 + */ + public EmsBaseEnergyType selectEmsBaseEnergyTypeByObjId(Long objId); + + /** + * 查询能源类型信息列表 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 能源类型信息集合 + */ + public List selectEmsBaseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType); + + /** + * 新增能源类型信息 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 结果 + */ + public int insertEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType); + + /** + * 修改能源类型信息 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 结果 + */ + public int updateEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType); + + /** + * 批量删除能源类型信息 + * + * @param objIds 需要删除的能源类型信息主键集合 + * @return 结果 + */ + public int deleteEmsBaseEnergyTypeByObjIds(Long[] objIds); + + /** + * 删除能源类型信息信息 + * + * @param objId 能源类型信息主键 + * @return 结果 + */ + public int deleteEmsBaseEnergyTypeByObjId(Long objId); + + /** + * 根据能源类型id查询能源类型名称 + * @param energyTypeId + * @return + */ + String queryEnergyNameByEnergyTypeId(int energyTypeId); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseMonitorInfoService.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseMonitorInfoService.java new file mode 100644 index 0000000..73d7274 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/IEmsBaseMonitorInfoService.java @@ -0,0 +1,92 @@ +package com.hw.ems.base.service; + + + +import com.hw.ems.base.domain.EmsBaseMonitorInfo; +import com.hw.ems.base.domain.TreeSelects; + +import java.util.List; + +/** + * 计量设备信息Service接口 + * + * @author Yinq + * @date 2024-05-08 + */ +public interface IEmsBaseMonitorInfoService +{ + /** + * 查询计量设备信息 + * + * @param objId 计量设备信息主键 + * @return 计量设备信息 + */ + public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId); + + /** + * 查询计量设备信息列表 + * @param emsBaseMonitorInfo 计量设备信息 + * @return 计量设备信息集合 + */ + public List selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo); + + /** + * 根据设备编号查询本设备能源类型 + * @param monitorCode + * @return + */ + public String selectEmsBaseMonitorTypeByMonitorCode(String monitorCode); + + /** + * 新增计量设备信息 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 结果 + */ + public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo); + + /** + * 修改计量设备信息 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 结果 + */ + public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo); + + /** + * 批量删除计量设备信息 + * + * @param objIds 需要删除的计量设备信息主键集合 + * @return 结果 + */ + public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds); + + /** + * 删除计量设备信息信息 + * + * @param objId 计量设备信息主键 + * @return 结果 + */ + public int deleteEmsBaseMonitorInfoByObjId(Long objId); + + /** + * 查询计量设备信息下拉树结构 + * */ + List selectBaseMonitorInfoTreeList(EmsBaseMonitorInfo baseMonitorInfo); + + /** + * 构建前端所需要下拉树结构 + * + * @param + * @return 下拉树结构列表 + */ + public List buildMonitorInfoTreeSelect(List baseMonitorInfos); + + /** + * 构建前端所需要树结构 + * + * @param + * @return 树结构列表 + */ + public List buildMonitorInfoTree(List baseMonitorInfos); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseCollectDeviceInfoServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseCollectDeviceInfoServiceImpl.java new file mode 100644 index 0000000..6ea4fd6 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseCollectDeviceInfoServiceImpl.java @@ -0,0 +1,90 @@ +package com.hw.ems.base.service.impl; + +import com.hw.common.core.utils.DateUtils; +import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo; +import com.hw.ems.base.mapper.EmsBaseCollectDeviceInfoMapper; +import com.hw.ems.base.service.IEmsBaseCollectDeviceInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 采集设备信息Service业务层处理 + * + * @author Yinq + * @date 2024-05-20 + */ +@Service +public class EmsBaseCollectDeviceInfoServiceImpl implements IEmsBaseCollectDeviceInfoService { + @Autowired + private EmsBaseCollectDeviceInfoMapper emsBaseCollectDeviceInfoMapper; + + /** + * 查询采集设备信息 + * + * @param objId 采集设备信息主键 + * @return 采集设备信息 + */ + @Override + public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId) { + return emsBaseCollectDeviceInfoMapper.selectEmsBaseCollectDeviceInfoByObjId(objId); + } + + /** + * 查询采集设备信息列表 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 采集设备信息 + */ + @Override + public List selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { + return emsBaseCollectDeviceInfoMapper.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo); + } + + /** + * 新增采集设备信息 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 结果 + */ + @Override + public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { + emsBaseCollectDeviceInfo.setCreateTime(DateUtils.getNowDate()); + return emsBaseCollectDeviceInfoMapper.insertEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo); + } + + /** + * 修改采集设备信息 + * + * @param emsBaseCollectDeviceInfo 采集设备信息 + * @return 结果 + */ + @Override + public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) { + emsBaseCollectDeviceInfo.setUpdateTime(DateUtils.getNowDate()); + return emsBaseCollectDeviceInfoMapper.updateEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo); + } + + /** + * 批量删除采集设备信息 + * + * @param objIds 需要删除的采集设备信息主键 + * @return 结果 + */ + @Override + public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds) { + return emsBaseCollectDeviceInfoMapper.deleteEmsBaseCollectDeviceInfoByObjIds(objIds); + } + + /** + * 删除采集设备信息信息 + * + * @param objId 采集设备信息主键 + * @return 结果 + */ + @Override + public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId) { + return emsBaseCollectDeviceInfoMapper.deleteEmsBaseCollectDeviceInfoByObjId(objId); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseEnergyTypeServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseEnergyTypeServiceImpl.java new file mode 100644 index 0000000..4152c31 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseEnergyTypeServiceImpl.java @@ -0,0 +1,107 @@ +package com.hw.ems.base.service.impl; + +import com.hw.common.core.utils.DateUtils; +import com.hw.ems.base.domain.EmsBaseEnergyType; +import com.hw.ems.base.mapper.EmsBaseEnergyTypeMapper; +import com.hw.ems.base.service.IEmsBaseEnergyTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 能源类型信息Service业务层处理 + * + * @author Yinq + * @date 2024-05-08 + */ +@Service +public class EmsBaseEnergyTypeServiceImpl implements IEmsBaseEnergyTypeService +{ + @Autowired + private EmsBaseEnergyTypeMapper emsBaseEnergyTypeMapper; + + /** + * 查询能源类型信息 + * + * @param objId 能源类型信息主键 + * @return 能源类型信息 + */ + @Override + public EmsBaseEnergyType selectEmsBaseEnergyTypeByObjId(Long objId) + { + return emsBaseEnergyTypeMapper.selectEmsBaseEnergyTypeByObjId(objId); + } + + /** + * 查询能源类型信息列表 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 能源类型信息 + */ + @Override + public List selectEmsBaseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType) + { + return emsBaseEnergyTypeMapper.selectEmsBaseEnergyTypeList(emsBaseEnergyType); + } + + /** + * 新增能源类型信息 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 结果 + */ + @Override + public int insertEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType) + { + emsBaseEnergyType.setCreateTime(DateUtils.getNowDate()); + return emsBaseEnergyTypeMapper.insertEmsBaseEnergyType(emsBaseEnergyType); + } + + /** + * 修改能源类型信息 + * + * @param emsBaseEnergyType 能源类型信息 + * @return 结果 + */ + @Override + public int updateEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType) + { + emsBaseEnergyType.setUpdateTime(DateUtils.getNowDate()); + return emsBaseEnergyTypeMapper.updateEmsBaseEnergyType(emsBaseEnergyType); + } + + /** + * 批量删除能源类型信息 + * + * @param objIds 需要删除的能源类型信息主键 + * @return 结果 + */ + @Override + public int deleteEmsBaseEnergyTypeByObjIds(Long[] objIds) + { + return emsBaseEnergyTypeMapper.deleteEmsBaseEnergyTypeByObjIds(objIds); + } + + /** + * 删除能源类型信息信息 + * + * @param objId 能源类型信息主键 + * @return 结果 + */ + @Override + public int deleteEmsBaseEnergyTypeByObjId(Long objId) + { + return emsBaseEnergyTypeMapper.deleteEmsBaseEnergyTypeByObjId(objId); + } + + /** + * 根据能源类型id查询能源类型名称 + * @param energyTypeId + * @return + */ + @Override + public String queryEnergyNameByEnergyTypeId(int energyTypeId) { + return emsBaseEnergyTypeMapper.selectEmsBaseEnergyNameByEnergyTypeId(energyTypeId); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java new file mode 100644 index 0000000..c7f2d5a --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java @@ -0,0 +1,203 @@ +package com.hw.ems.base.service.impl; + +import com.hw.common.core.utils.DateUtils; +import com.hw.common.core.utils.StringUtils; +import com.hw.ems.base.domain.EmsBaseMonitorInfo; +import com.hw.ems.base.domain.TreeSelects; +import com.hw.ems.base.mapper.EmsBaseMonitorInfoMapper; +import com.hw.ems.base.service.IEmsBaseMonitorInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 计量设备信息Service业务层处理 + * + * @author Yinq + * @date 2024-05-08 + */ +@Service +public class EmsBaseMonitorInfoServiceImpl implements IEmsBaseMonitorInfoService +{ + @Autowired + private EmsBaseMonitorInfoMapper emsBaseMonitorInfoMapper; + + /** + * 查询计量设备信息 + * + * @param objId 计量设备信息主键 + * @return 计量设备信息 + */ + @Override + public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId) + { + return emsBaseMonitorInfoMapper.selectEmsBaseMonitorInfoByObjId(objId); + } + + /** + * 查询计量设备信息列表 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 计量设备信息 + */ + @Override + public List selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo) + { + return emsBaseMonitorInfoMapper.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo); + } + + /** + * 根据设备编号查询本设备能源类型 + * @param monitorCode + * @return + */ + @Override + public String selectEmsBaseMonitorTypeByMonitorCode(String monitorCode) { + return emsBaseMonitorInfoMapper.selectEmsBaseMonitorTypeByMonitorCode(monitorCode); + } + + /** + * 新增计量设备信息 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 结果 + */ + @Override + public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo) + { + emsBaseMonitorInfo.setCreateTime(DateUtils.getNowDate()); + return emsBaseMonitorInfoMapper.insertEmsBaseMonitorInfo(emsBaseMonitorInfo); + } + + /** + * 修改计量设备信息 + * + * @param emsBaseMonitorInfo 计量设备信息 + * @return 结果 + */ + @Override + public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo) + { + emsBaseMonitorInfo.setUpdateTime(DateUtils.getNowDate()); + return emsBaseMonitorInfoMapper.updateEmsBaseMonitorInfo(emsBaseMonitorInfo); + } + + /** + * 批量删除计量设备信息 + * + * @param objIds 需要删除的计量设备信息主键 + * @return 结果 + */ + @Override + public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds) + { + return emsBaseMonitorInfoMapper.deleteEmsBaseMonitorInfoByObjIds(objIds); + } + + /** + * 删除计量设备信息信息 + * + * @param objId 计量设备信息主键 + * @return 结果 + */ + @Override + public int deleteEmsBaseMonitorInfoByObjId(Long objId) + { + return emsBaseMonitorInfoMapper.deleteEmsBaseMonitorInfoByObjId(objId); + } + + /** + * 查询计量设备信息下拉树结构 + * */ + @Override + public List selectBaseMonitorInfoTreeList(EmsBaseMonitorInfo baseMonitorInfo) { + List baseMonitorInfos = selectEmsBaseMonitorInfoList(baseMonitorInfo); + return buildMonitorInfoTreeSelect(baseMonitorInfos); + } + + /** + * 构建前端所需要下拉树结构 + * + * @param + * @return 下拉树结构列表 + */ + @Override + public List buildMonitorInfoTreeSelect(List baseMonitorInfos) + { + List deptTrees = buildMonitorInfoTree(baseMonitorInfos); + return deptTrees.stream().map(TreeSelects::new).collect(Collectors.toList()); + } + + /** + * 构建前端所需要树结构 + * + * @param + * @return 树结构列表 + */ + @Override + public List buildMonitorInfoTree(List baseMonitorInfos) + { + List returnList = new ArrayList(); + List tempList = baseMonitorInfos.stream().map(EmsBaseMonitorInfo::getObjId).collect(Collectors.toList()); + for (EmsBaseMonitorInfo baseMonitorInfo : baseMonitorInfos) + { + // 如果是顶级节点, 遍历该父节点的所有子节点 + if (!tempList.contains(baseMonitorInfo.getParentId())) + { + recursionFn(baseMonitorInfos, baseMonitorInfo); + returnList.add(baseMonitorInfo); + } + } + if (returnList.isEmpty()) + { + returnList = baseMonitorInfos; + } + return returnList; + } + /** + * 递归列表 + */ + private void recursionFn(List list, EmsBaseMonitorInfo t) + { + // 得到子节点列表 + List childList = getChildList(list, t); + t.setChildren(childList); + for (EmsBaseMonitorInfo tChild : childList) + { + if (hasChild(list, tChild)) + { + recursionFn(list, tChild); + } + } + } + /** + * 得到子节点列表 + */ + private List getChildList(List list, EmsBaseMonitorInfo t) + { + List tlist = new ArrayList(); + Iterator it = list.iterator(); + while (it.hasNext()) + { + EmsBaseMonitorInfo n = (EmsBaseMonitorInfo) it.next(); + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getObjId().longValue()) + { + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List list, EmsBaseMonitorInfo t) + { + return getChildList(list, t).size() > 0; + } + +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java new file mode 100644 index 0000000..48b4077 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/TWTempertureDataController.java @@ -0,0 +1,176 @@ +package com.hw.ems.record.controller; + +import com.alibaba.fastjson2.JSONArray; +import com.hw.common.core.utils.StringUtils; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.web.page.TableDataInfo; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.ems.base.service.IEmsBaseEnergyTypeService; +import com.hw.ems.base.service.IEmsBaseMonitorInfoService; +import com.hw.ems.record.domain.EmsIOTData; +import com.hw.ems.record.domain.TWTempertureData; +import com.hw.ems.record.service.ITWTempertureDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 物联网实时数据Controller + * + * @author Caoql + * @date 2024-08-21 + */ +@RestController +@RequestMapping("/record/recordIOTInstant") +public class TWTempertureDataController extends BaseController +{ + @Autowired + private ITWTempertureDataService tWTempertureDataService; + @Autowired + private IEmsBaseMonitorInfoService emsBaseMonitorInfoService; + @Autowired + private IEmsBaseEnergyTypeService emsBaseEnergyTypeService; + + private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + /** + * 查询物联网实时数据列表 + */ +// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:list')") + @GetMapping("/list") + public TableDataInfo list(TWTempertureData tWTempertureData) + { + startPage(); + List list = tWTempertureDataService.selectTWTempertureDataList(tWTempertureData); + return getDataTable(list); + } + + /** + * 查询物联网设备实时数据 + * @param tWTempertureData + * @return + */ + @GetMapping("/iotInstantList") + public AjaxResult iotInstantList(TWTempertureData tWTempertureData){ + EmsIOTData emsIOTData = new EmsIOTData(); + int energyTypeid = Integer.parseInt(emsBaseMonitorInfoService.selectEmsBaseMonitorTypeByMonitorCode(tWTempertureData.getMonitorId())); + String energyName = emsBaseEnergyTypeService.queryEnergyNameByEnergyTypeId(energyTypeid); + if("温湿度".equals(energyName)){ + emsIOTData.monitorTypeArr.add("温度"); + emsIOTData.monitorTypeArr.add("湿度"); + } + else{ + emsIOTData.monitorTypeArr.add(energyName); + } + emsIOTData.setType("line"); + emsIOTData.setSmooth(true); + emsIOTData.setShowAllSymbol(true); + emsIOTData.setSymbol("circle"); + emsIOTData.setSymbolSize(2); + List list = tWTempertureDataService.selectIotInstantList(tWTempertureData); + emsIOTData.setDataList(list); + return success(emsIOTData); + } + + /** + * 查询物联网设备实时监控数据 + * @param monitorCodeList + * @return + */ + @GetMapping("/iotInstantMonitoring") + public AjaxResult iotInstantMonitoring(String monitorCodeList){ + List list = new ArrayList(); + if(StringUtils.isNotEmpty(monitorCodeList)){ + String[] split = monitorCodeList.split(","); + for (String monitorId : split) { + + TWTempertureData tWTempertureData = new TWTempertureData(); + tWTempertureData.setMonitorId(monitorId); + Map params = new HashMap<>(); + + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MINUTE,-5); + Calendar startTime = (Calendar) calendar.clone(); + params.put("beginRecordTime",sdf.format(startTime.getTime())); + params.put("endRecordTime",sdf.format(new Date())); + tWTempertureData.setParams(params); + + List twTempertureData = tWTempertureDataService.selectIotInstantList(tWTempertureData); + if(twTempertureData.size()>0){ + Optional first = twTempertureData.stream().sorted(Comparator.comparing(TWTempertureData::getRecodeTime)).findFirst(); + + list.add(first.get()); + } + + + } + } + + System.out.println(JSONArray.toJSONString(list)); + return success(list); + } + + /** + * 导出物联网实时数据列表 + */ +// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:export')") + @Log(title = "物联网实时数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TWTempertureData tWTempertureData) + { + List list = tWTempertureDataService.selectTWTempertureDataList(tWTempertureData); + ExcelUtil util = new ExcelUtil(TWTempertureData.class); + util.exportExcel(response, list, "物联网实时数据数据"); + } + + /** + * 获取物联网实时数据详细信息 + */ +// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:query')") + @GetMapping(value = "/{objid}") + public AjaxResult getInfo(@PathVariable("objid") Long objid) + { + return success(tWTempertureDataService.selectTWTempertureDataByObjid(objid)); + } + + /** + * 新增物联网实时数据 + */ +// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:add')") + @Log(title = "物联网实时数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TWTempertureData tWTempertureData) + { +// tWTempertureData.setCreateBy(getUsername()); + return toAjax(tWTempertureDataService.insertTWTempertureData(tWTempertureData)); + } + + /** + * 修改物联网实时数据 + */ +// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:edit')") + @Log(title = "物联网实时数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TWTempertureData tWTempertureData) + { +// tWTempertureData.setUpdateBy(getUsername()); + return toAjax(tWTempertureDataService.updateTWTempertureData(tWTempertureData)); + } + + /** + * 删除物联网实时数据 + */ +// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:remove')") + @Log(title = "物联网实时数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{objids}") + public AjaxResult remove(@PathVariable Long[] objids) + { + return toAjax(tWTempertureDataService.deleteTWTempertureDataByObjids(objids)); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/EmsIOTData.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/EmsIOTData.java new file mode 100644 index 0000000..2935f57 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/EmsIOTData.java @@ -0,0 +1,98 @@ +package com.hw.ems.record.domain; + +import java.util.ArrayList; +import java.util.List; + +public class EmsIOTData { + + /** + * 能源类型 + */ + public ArrayList monitorTypeArr; + private String name; + private String type; + private boolean smooth; + private boolean showAllSymbol; + private String symbol; + private int symbolSize; + private String symbolType; + private List dataList; + + public EmsIOTData() { + this.monitorTypeArr = new ArrayList<>(); + } + + public ArrayList getMonitorTypeArr() { + return monitorTypeArr; + } + + public void setMonitorTypeArr(ArrayList monitorTypeArr) { + this.monitorTypeArr = monitorTypeArr; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public boolean isSmooth() { + return smooth; + } + + public void setSmooth(boolean smooth) { + this.smooth = smooth; + } + + public boolean isShowAllSymbol() { + return showAllSymbol; + } + + public void setShowAllSymbol(boolean showAllSymbol) { + this.showAllSymbol = showAllSymbol; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public int getSymbolSize() { + return symbolSize; + } + + public void setSymbolSize(int symbolSize) { + this.symbolSize = symbolSize; + } + + public String getSymbolType() { + return symbolType; + } + + public void setSymbolType(String symbolType) { + this.symbolType = symbolType; + } + +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/TWTempertureData.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/TWTempertureData.java new file mode 100644 index 0000000..3e17247 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/TWTempertureData.java @@ -0,0 +1,230 @@ +package com.hw.ems.record.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 物联网实时数据对象 T_W_TempertureData + * + * @author Caoql + * @date 2024-08-21 + */ +@Data +public class TWTempertureData extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long objid; + + /** 计量设备编号 */ + @Excel(name = "计量设备编号") + private String monitorId; + + /**计量设备名称**/ + @Excel(name = "计量设备名称") + private String monitorName; + + /** 采集时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date collectTime; + + /** 温度 */ + @Excel(name = "温度") + private BigDecimal tempreture; + + /** 湿度 */ + @Excel(name = "湿度") + private BigDecimal humidity; + + /** 照度 */ + @Excel(name = "照度") + private BigDecimal illuminance; + + /** 噪声 */ + @Excel(name = "噪声") + private BigDecimal noise; + + /** 硫化氢浓度 */ + @Excel(name = "硫化氢浓度") + private BigDecimal concentration; + + /** 记录时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date recodeTime; + private BigDecimal pm1; + private BigDecimal pm2; + private BigDecimal pm10; + private BigDecimal standby; + + /** 报警类型 */ + @Excel(name = "报警类型") + private Long alarmType; + + /** */ + @Excel(name = " ") + private Long confirmPersonID; + + /** */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = " ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date confirmTime; + + /** */ + @Excel(name = " ") + private Long confirmFlag; + + public void setObjid(Long objid) + { + this.objid = objid; + } + + public Long getObjid() + { + return objid; + } + public void setMonitorId(String monitorId) + { + this.monitorId = monitorId; + } + + public String getMonitorId() + { + return monitorId; + } + public void setCollectTime(Date collectTime) + { + this.collectTime = collectTime; + } + + public Date getCollectTime() + { + return collectTime; + } + public void setTempreture(BigDecimal tempreture) + { + this.tempreture = tempreture; + } + + public BigDecimal getTempreture() + { + return tempreture; + } + public void setHumidity(BigDecimal humidity) + { + this.humidity = humidity; + } + + public BigDecimal getHumidity() + { + return humidity; + } + public void setIlluminance(BigDecimal illuminance) + { + this.illuminance = illuminance; + } + + public String getMonitorName() { + return monitorName; + } + + public void setMonitorName(String monitorName) { + this.monitorName = monitorName; + } + + public BigDecimal getIlluminance() + { + return illuminance; + } + public void setNoise(BigDecimal noise) + { + this.noise = noise; + } + + public BigDecimal getNoise() + { + return noise; + } + public void setConcentration(BigDecimal concentration) + { + this.concentration = concentration; + } + + public BigDecimal getConcentration() + { + return concentration; + } + public void setRecodeTime(Date recodeTime) + { + this.recodeTime = recodeTime; + } + + public Date getRecodeTime() + { + return recodeTime; + } + public void setAlarmType(Long alarmType) + { + this.alarmType = alarmType; + } + + public Long getAlarmType() + { + return alarmType; + } + public void setConfirmPersonID(Long confirmPersonID) + { + this.confirmPersonID = confirmPersonID; + } + + public Long getConfirmPersonID() + { + return confirmPersonID; + } + public void setConfirmTime(Date confirmTime) + { + this.confirmTime = confirmTime; + } + + public Date getConfirmTime() + { + return confirmTime; + } + public void setConfirmFlag(Long confirmFlag) + { + this.confirmFlag = confirmFlag; + } + + public Long getConfirmFlag() + { + return confirmFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objid", getObjid()) + .append("monitorId", getMonitorId()) + .append("collectTime", getCollectTime()) + .append("tempreture", getTempreture()) + .append("humidity", getHumidity()) + .append("illuminance", getIlluminance()) + .append("noise", getNoise()) + .append("concentration", getConcentration()) + .append("recodeTime", getRecodeTime()) + .append("alarmType", getAlarmType()) + .append("confirmPersonID", getConfirmPersonID()) + .append("confirmTime", getConfirmTime()) + .append("confirmFlag", getConfirmFlag()) + .toString(); + } +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/TWTempertureDataMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/TWTempertureDataMapper.java new file mode 100644 index 0000000..f02cef1 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/TWTempertureDataMapper.java @@ -0,0 +1,78 @@ +package com.hw.ems.record.mapper; + + + +import com.hw.ems.record.domain.TWTempertureData; + +import java.util.List; + +/** + * 物联网实时数据Mapper接口 + * + * @author Caoql + * @date 2024-08-21 + */ +public interface TWTempertureDataMapper +{ + /** + * 查询物联网实时数据 + * + * @param objid 物联网实时数据主键 + * @return 物联网实时数据 + */ + public TWTempertureData selectTWTempertureDataByObjid(Long objid); + + /** + * 查询物联网实时数据列表 + * + * @param tWTempertureData 物联网实时数据 + * @return 物联网实时数据集合 + */ + public List selectTWTempertureDataList(TWTempertureData tWTempertureData); + + /** + * 新增物联网实时数据 + * + * @param tWTempertureData 物联网实时数据 + * @return 结果 + */ + public int insertTWTempertureData(TWTempertureData tWTempertureData); + + /** + * 修改物联网实时数据 + * + * @param tWTempertureData 物联网实时数据 + * @return 结果 + */ + public int updateTWTempertureData(TWTempertureData tWTempertureData); + + /** + * 删除物联网实时数据 + * + * @param objid 物联网实时数据主键 + * @return 结果 + */ + public int deleteTWTempertureDataByObjid(Long objid); + + /** + * 批量删除物联网实时数据 + * + * @param objids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTWTempertureDataByObjids(Long[] objids); + + /** + * 查询物联网实时数据 + * @param tWTempertureData + * @return + */ + List selectIotInstantList(TWTempertureData tWTempertureData); + + /** + * 根据设备编号查询实时物联网设备监控数据 + * @param monitorId + * @return + */ + TWTempertureData selectIotInstantMinitoringData(String monitorId); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/ITWTempertureDataService.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/ITWTempertureDataService.java new file mode 100644 index 0000000..7716558 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/ITWTempertureDataService.java @@ -0,0 +1,77 @@ +package com.hw.ems.record.service; + + +import com.hw.ems.record.domain.TWTempertureData; + +import java.util.List; + +/** + * 物联网实时数据Service接口 + * + * @author Caoql + * @date 2024-08-21 + */ +public interface ITWTempertureDataService +{ + /** + * 查询物联网实时数据 + * + * @param objid 物联网实时数据主键 + * @return 物联网实时数据 + */ + public TWTempertureData selectTWTempertureDataByObjid(Long objid); + + /** + * 查询物联网实时数据列表 + * + * @param tWTempertureData 物联网实时数据 + * @return 物联网实时数据集合 + */ + public List selectTWTempertureDataList(TWTempertureData tWTempertureData); + + /** + * 新增物联网实时数据 + * + * @param tWTempertureData 物联网实时数据 + * @return 结果 + */ + public int insertTWTempertureData(TWTempertureData tWTempertureData); + + /** + * 修改物联网实时数据 + * + * @param tWTempertureData 物联网实时数据 + * @return 结果 + */ + public int updateTWTempertureData(TWTempertureData tWTempertureData); + + /** + * 批量删除物联网实时数据 + * + * @param objids 需要删除的物联网实时数据主键集合 + * @return 结果 + */ + public int deleteTWTempertureDataByObjids(Long[] objids); + + /** + * 删除物联网实时数据信息 + * + * @param objid 物联网实时数据主键 + * @return 结果 + */ + public int deleteTWTempertureDataByObjid(Long objid); + + /** + * 查询实时物联网数据 + * @param tWTempertureData + * @return + */ + List selectIotInstantList(TWTempertureData tWTempertureData); + + /** + * 根据设备编号查询实时物联网设备监控数据 + * @param monitorId + * @return + */ + TWTempertureData selectIotInstantMinitoringData(String monitorId); +} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/TWTempertureDataServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/TWTempertureDataServiceImpl.java new file mode 100644 index 0000000..c957c15 --- /dev/null +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/TWTempertureDataServiceImpl.java @@ -0,0 +1,114 @@ +package com.hw.ems.record.service.impl; + +import com.hw.ems.record.domain.TWTempertureData; +import com.hw.ems.record.mapper.TWTempertureDataMapper; +import com.hw.ems.record.service.ITWTempertureDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 物联网实时数据Service业务层处理 + * + * @author Caoql + * @date 2024-08-21 + */ +@Service +public class TWTempertureDataServiceImpl implements ITWTempertureDataService +{ + @Autowired + private TWTempertureDataMapper tWTempertureDataMapper; + + /** + * 查询物联网实时数据 + * + * @param objid 物联网实时数据主键 + * @return 物联网实时数据 + */ + @Override + public TWTempertureData selectTWTempertureDataByObjid(Long objid) + { + return tWTempertureDataMapper.selectTWTempertureDataByObjid(objid); + } + + /** + * 查询物联网实时数据列表 + * + * @param tWTempertureData 物联网实时数据 + * @return 物联网实时数据 + */ + @Override + public List selectTWTempertureDataList(TWTempertureData tWTempertureData) + { + return tWTempertureDataMapper.selectTWTempertureDataList(tWTempertureData); + } + + /** + * 新增物联网实时数据 + * + * @param tWTempertureData 物联网实时数据 + * @return 结果 + */ + @Override + public int insertTWTempertureData(TWTempertureData tWTempertureData) + { + return tWTempertureDataMapper.insertTWTempertureData(tWTempertureData); + } + + /** + * 修改物联网实时数据 + * + * @param tWTempertureData 物联网实时数据 + * @return 结果 + */ + @Override + public int updateTWTempertureData(TWTempertureData tWTempertureData) + { + return tWTempertureDataMapper.updateTWTempertureData(tWTempertureData); + } + + /** + * 批量删除物联网实时数据 + * + * @param objids 需要删除的物联网实时数据主键 + * @return 结果 + */ + @Override + public int deleteTWTempertureDataByObjids(Long[] objids) + { + return tWTempertureDataMapper.deleteTWTempertureDataByObjids(objids); + } + + /** + * 删除物联网实时数据信息 + * + * @param objid 物联网实时数据主键 + * @return 结果 + */ + @Override + public int deleteTWTempertureDataByObjid(Long objid) + { + return tWTempertureDataMapper.deleteTWTempertureDataByObjid(objid); + } + + /** + * 查询实时物联网数据 + * @param tWTempertureData + * @return + */ + @Override + public List selectIotInstantList(TWTempertureData tWTempertureData) { + return tWTempertureDataMapper.selectIotInstantList(tWTempertureData); + } + + /** + * 根据设备编号查询实时物联网设备监控数据 + * @param monitorId + * @return + */ + @Override + public TWTempertureData selectIotInstantMinitoringData(String monitorId) { + return tWTempertureDataMapper.selectIotInstantMinitoringData(monitorId); + } +} diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseCollectDeviceInfoMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseCollectDeviceInfoMapper.xml new file mode 100644 index 0000000..f6d99db --- /dev/null +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseCollectDeviceInfoMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select ebcdi.collect_device_id, + ebcdi.collect_device_name, + ebcdi.energy_type_id, + ebet.energy_name, + ebcdi.model, + ebcdi.manufacturer, + ebcdi.ip_address, + ebcdi.produce_date, + ebcdi.setting_address, + ebcdi.is_flag, + ebcdi.create_by, + ebcdi.create_time, + ebcdi.update_by, + ebcdi.update_time, + ebcdi.remark + from ems_base_collect_device_info ebcdi + left join ems_base_energy_type ebet on ebcdi.energy_type_id = ebet.energy_type_id + + + + + + + + insert into ems_base_collect_device_info + + collect_device_id, + collect_device_name, + energy_type_id, + model, + manufacturer, + ip_address, + produce_date, + setting_address, + is_flag, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{collectDeviceId}, + #{collectDeviceName}, + #{energyTypeId}, + #{model}, + #{manufacturer}, + #{ipAddress}, + #{produceDate}, + #{settingAddress}, + #{isFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update ems_base_collect_device_info + + collect_device_id = #{collectDeviceId}, + collect_device_name = #{collectDeviceName}, + energy_type_id = #{energyTypeId}, + model = #{model}, + manufacturer = #{manufacturer}, + ip_address = #{ipAddress}, + produce_date = #{produceDate}, + setting_address = #{settingAddress}, + is_flag = #{isFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where obj_id = #{objId} + + + + delete + from ems_base_collect_device_info + where obj_id = #{objId} + + + + delete from ems_base_collect_device_info where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseEnergyTypeMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseEnergyTypeMapper.xml new file mode 100644 index 0000000..141eeb1 --- /dev/null +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseEnergyTypeMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + select energy_type_id, + energy_name, + measure_unit, + price, + create_by, + create_time, + update_by, + update_time + from ems_base_energy_type + + + + + + + + + + insert into ems_base_energy_type + + energy_type_id, + energy_name, + measure_unit, + price, + create_by, + create_time, + update_by, + update_time, + + + #{energyTypeId}, + #{energyName}, + #{measureUnit}, + #{price}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update ems_base_energy_type + + energy_type_id = #{energyTypeId}, + energy_name = #{energyName}, + measure_unit = #{measureUnit}, + price = #{price}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where obj_id = #{objId} + + + + delete + from ems_base_energy_type + where obj_id = #{objId} + + + + delete from ems_base_energy_type where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseMonitorInfoMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseMonitorInfoMapper.xml new file mode 100644 index 0000000..8235bd6 --- /dev/null +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/EmsBaseMonitorInfoMapper.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select obj_id, parent_id, monitor_code, monitor_name, monitor_addr, monitor_type, monitor_status, collect_device_id, ancestors, grade, meter_type_id, correct_value, pt, ct, is_ammeter, is_key_monitor, is_circuit, create_by, create_time, update_by, update_time, public_share_type, monitor_hierarchy from ems_base_monitor_info + + + + + + + + + + + insert into ems_base_monitor_info + + parent_id, + monitor_code, + monitor_name, + monitor_addr, + monitor_type, + monitor_status, + collect_device_id, + ancestors, + grade, + meter_type_id, + correct_value, + pt, + ct, + is_ammeter, + is_key_monitor, + is_circuit, + create_by, + create_time, + update_by, + update_time, + public_share_type, + monitor_hierarchy, + + + #{parentId}, + #{monitorCode}, + #{monitorName}, + #{monitorAddr}, + #{monitorType}, + #{monitorStatus}, + #{collectDeviceId}, + #{ancestors}, + #{grade}, + #{meterTypeId}, + #{correctValue}, + #{pt}, + #{ct}, + #{isAmmeter}, + #{isKeyMonitor}, + #{isCircuit}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{publicShareType}, + #{monitorHierarchy}, + + + + + update ems_base_monitor_info + + parent_id = #{parentId}, + monitor_code = #{monitorCode}, + monitor_name = #{monitorName}, + monitor_addr = #{monitorAddr}, + monitor_type = #{monitorType}, + monitor_status = #{monitorStatus}, + collect_device_id = #{collectDeviceId}, + ancestors = #{ancestors}, + grade = #{grade}, + meter_type_id = #{meterTypeId}, + correct_value = #{correctValue}, + pt = #{pt}, + ct = #{ct}, + is_ammeter = #{isAmmeter}, + is_key_monitor = #{isKeyMonitor}, + is_circuit = #{isCircuit}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + public_share_type = #{publicShareType}, + monitor_hierarchy = #{monitorHierarchy}, + + where obj_id = #{objId} + + + + delete from ems_base_monitor_info where obj_id = #{objId} + + + + delete from ems_base_monitor_info where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/hw-modules/hw-ems/src/main/resources/mapper/record/TWTempertureDataMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/record/TWTempertureDataMapper.xml new file mode 100644 index 0000000..8343163 --- /dev/null +++ b/hw-modules/hw-ems/src/main/resources/mapper/record/TWTempertureDataMapper.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + select twtd.objid, + twtd.monitorId, + twtd.collectTime, + twtd.tempreture, + twtd.humidity, + twtd.illuminance, + twtd.noise, + twtd.concentration, + twtd.recodeTime, + twtd.pm1, + twtd.pm2, + twtd.pm10, + twtd.standBy, +-- twtd.alarmType, +-- twtd.confirmPersonID, +-- twtd.confirmTime, +-- twtd.confirmFlag, + ebmi.monitor_name + from record_iotenv_instant twtd + left join ems_base_monitor_info ebmi on twtd.monitorId = ebmi.monitor_code + + + + + + + + + + + insert into T_W_TempertureData + + monitorId, + collectTime, + tempreture, + humidity, + illuminance, + noise, + concentration, + recodeTime, + alarmType, + confirmPersonID, + confirmTime, + confirmFlag, + + + #{monitorId}, + #{collectTime}, + #{tempreture}, + #{humidity}, + #{illuminance}, + #{noise}, + #{concentration}, + #{recodeTime}, + #{alarmType}, + #{confirmPersonID}, + #{confirmTime}, + #{confirmFlag}, + + + + + update T_W_TempertureData + + monitorId = #{monitorId}, + collectTime = #{collectTime}, + tempreture = #{tempreture}, + humidity = #{humidity}, + illuminance = #{illuminance}, + noise = #{noise}, + concentration = #{concentration}, + recodeTime = #{recodeTime}, + alarmType = #{alarmType}, + confirmPersonID = #{confirmPersonID}, + confirmTime = #{confirmTime}, + confirmFlag = #{confirmFlag}, + + where objid = #{objid} + + + + delete from T_W_TempertureData where objid = #{objid} + + + + delete from T_W_TempertureData where objid in + + #{objid} + + + \ No newline at end of file