From f1795b5f6307f2c5a0feec48ee6f2c91b2324574 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 21 Oct 2024 09:47:01 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=AE=E6=94=B9=E7=94=B5?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E3=80=81=E6=95=B4=E7=82=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CbsMonitorReportController.java | 99 ------ .../base/mapper/CbsMonitorReportMapper.java | 82 ----- .../service/ICbsMonitorReportService.java | 80 ----- .../impl/CbsMonitorReportServiceImpl.java | 132 -------- .../RecordDnbInstantController.java | 31 +- .../hw/ems/record/domain/RecordAlarmData.java | 122 +++++-- .../record/mapper/RecordDnbInstantMapper.java | 17 +- .../service/IRecordDnbInstantService.java | 9 +- .../impl/RecordDnbInstantServiceImpl.java | 313 +----------------- .../mapper/base/BaseLineMonitorMapper.xml | 230 +++++++++---- .../mapper/base/BaseMonitorInfo1Mapper.xml | 57 +++- .../mapper/base/BaseMonitorInfoMapper.xml | 1 - .../mapper/base/BasePublicUserMapper.xml | 2 +- .../base/BasePublicUserRecordMapper.xml | 8 +- .../mapper/base/BaseTypeRelationMapper.xml | 11 +- .../mapper/base/CbsMonitorReportMapper.xml | 212 ------------ .../mapper/base/SysDatasourceMapper.xml | 2 +- .../mapper/record/RecordAlarmDataMapper.xml | 55 ++- .../mapper/record/RecordDnbInstantMapper.xml | 74 ++++- .../record/RecordWaterInstantMapper.xml | 7 +- .../mapper/report/ReportPointDnbMapper.xml | 163 +++++---- .../mapper/report/ReportPointWaterMapper.xml | 54 ++- .../api/ems/powerUse/ElectricityPreview.js | 50 +++ .../src/api/ems/powerUse/Energystatistics.js | 55 +++ .../api/ems/powerUse/HistoryElectricity.js | 26 ++ hw-ui/src/api/ems/powerUse/RealTime.js | 51 +++ hw-ui/src/api/ems/powerUse/RingCounty.js | 19 ++ hw-ui/src/api/ems/powerUse/WholePointData.js | 45 +++ .../api/ems/powerUse/additionalRecording.js | 61 ++++ hw-ui/src/api/ems/powerUse/dianChaoData.js | 27 ++ hw-ui/src/api/ems/powerUse/tongBianalyse.js | 19 ++ hw-ui/src/api/ems/powerUse/xiansunanalysis.js | 28 ++ .../ems/base/HistoryElectricity/index.vue | 295 +++++++++-------- 33 files changed, 1185 insertions(+), 1252 deletions(-) delete mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/CbsMonitorReportController.java delete mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/CbsMonitorReportMapper.java delete mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/ICbsMonitorReportService.java delete mode 100644 hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/CbsMonitorReportServiceImpl.java delete mode 100644 hw-modules/hw-ems/src/main/resources/mapper/base/CbsMonitorReportMapper.xml create mode 100644 hw-ui/src/api/ems/powerUse/ElectricityPreview.js create mode 100644 hw-ui/src/api/ems/powerUse/Energystatistics.js create mode 100644 hw-ui/src/api/ems/powerUse/HistoryElectricity.js create mode 100644 hw-ui/src/api/ems/powerUse/RealTime.js create mode 100644 hw-ui/src/api/ems/powerUse/RingCounty.js create mode 100644 hw-ui/src/api/ems/powerUse/WholePointData.js create mode 100644 hw-ui/src/api/ems/powerUse/additionalRecording.js create mode 100644 hw-ui/src/api/ems/powerUse/dianChaoData.js create mode 100644 hw-ui/src/api/ems/powerUse/tongBianalyse.js create mode 100644 hw-ui/src/api/ems/powerUse/xiansunanalysis.js diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/CbsMonitorReportController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/CbsMonitorReportController.java deleted file mode 100644 index 2d96901..0000000 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/controller/CbsMonitorReportController.java +++ /dev/null @@ -1,99 +0,0 @@ -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.common.security.annotation.RequiresPermissions; -import com.hw.ems.base.domain.CbsMonitorReport; -import com.hw.ems.base.service.ICbsMonitorReportService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * CBS抄报Controller - * - * @author YinQ - * @date 2023-10-20 - */ -@RestController -@RequestMapping("/base/cbsMonitorReport") -public class CbsMonitorReportController extends BaseController -{ - @Autowired - private ICbsMonitorReportService cbsMonitorReportService; - - /** - * 查询CBS抄报列表 - */ - @RequiresPermissions("base:cbsMonitorReport:list") - @GetMapping("/list") - public TableDataInfo list(CbsMonitorReport cbsMonitorReport) - { - startPage(); - List list = cbsMonitorReportService.selectCbsMonitorReportList(cbsMonitorReport); - return getDataTable(list); - } - - /** - * 导出CBS抄报列表 - */ - @RequiresPermissions("base:cbsMonitorReport:export") - @Log(title = "CBS抄报", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, CbsMonitorReport cbsMonitorReport) - { - List list = cbsMonitorReportService.selectCbsMonitorReportList(cbsMonitorReport); - ExcelUtil util = new ExcelUtil(CbsMonitorReport.class); - util.exportExcel(response, list, "CBS抄报数据"); - } - - /** - * 获取CBS抄报详细信息 - */ - @RequiresPermissions("base:cbsMonitorReport:query") - @GetMapping(value = "/{objId}") - public AjaxResult getInfo(@PathVariable("objId") Long objId) - { - return success(cbsMonitorReportService.selectCbsMonitorReportByObjId(objId)); - } - - /** - * 新增CBS抄报 - */ - @RequiresPermissions("base:cbsMonitorReport:add") - @Log(title = "CBS抄报", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody CbsMonitorReport cbsMonitorReport) - { - return toAjax(cbsMonitorReportService.insertCbsMonitorReport(cbsMonitorReport)); - } - - /** - * 修改CBS抄报 - */ - @RequiresPermissions("base:cbsMonitorReport:edit") - @Log(title = "CBS抄报", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody CbsMonitorReport cbsMonitorReport) - { - return toAjax(cbsMonitorReportService.updateCbsMonitorReport(cbsMonitorReport)); - } - - /** - * 删除CBS抄报 - */ - @RequiresPermissions("base:cbsMonitorReport:remove") - @Log(title = "CBS抄报", businessType = BusinessType.DELETE) - @DeleteMapping("/{objIds}") - public AjaxResult remove(@PathVariable Long[] objIds) - { - return toAjax(cbsMonitorReportService.deleteCbsMonitorReportByObjIds(objIds)); - } -} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/CbsMonitorReportMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/CbsMonitorReportMapper.java deleted file mode 100644 index f8dd70e..0000000 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/mapper/CbsMonitorReportMapper.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.hw.ems.base.mapper; - - - -import com.hw.ems.base.domain.CbsMonitorReport; - -import java.util.List; - -/** - * CBS抄报Mapper接口 - * - * @author YinQ - * @date 2023-10-20 - */ -public interface CbsMonitorReportMapper -{ - /** - * 查询CBS抄报 - * - * @param objId CBS抄报主键 - * @return CBS抄报 - */ - public CbsMonitorReport selectCbsMonitorReportByObjId(Long objId); - - /** - * 查询CBS抄报列表 - * - * @param cbsMonitorReport CBS抄报 - * @return CBS抄报集合 - */ - public List selectCbsMonitorReportList(CbsMonitorReport cbsMonitorReport); - - /** - * 新增CBS抄报 - * - * @param cbsMonitorReport CBS抄报 - * @return 结果 - */ - public int insertCbsMonitorReport(CbsMonitorReport cbsMonitorReport); - - /** - * 修改CBS抄报 - * - * @param cbsMonitorReport CBS抄报 - * @return 结果 - */ - public int updateCbsMonitorReport(CbsMonitorReport cbsMonitorReport); - - /** - * 删除CBS抄报 - * - * @param objId CBS抄报主键 - * @return 结果 - */ - public int deleteCbsMonitorReportByObjId(Long objId); - - /** - * 批量删除CBS抄报 - * - * @param objIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteCbsMonitorReportByObjIds(Long[] objIds); - - -// /** -// * 查询电实时数据 -// * -// * @param emsApiVo CBS抄报 -// * @return CBS抄报集合 -// */ -// public List selectRealTimeMonitorList(EmsApiVo emsApiVo); - - /** - * 查询上次CBS抄表数据 - * - * @param cbsMonitorReport CBS抄报主键 - * @return CBS抄报 - */ - public CbsMonitorReport selectLastTimeCbsMonitorReport(CbsMonitorReport cbsMonitorReport); - -} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/ICbsMonitorReportService.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/ICbsMonitorReportService.java deleted file mode 100644 index e9fffd3..0000000 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/ICbsMonitorReportService.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.hw.ems.base.service; - - -import com.hw.ems.base.domain.CbsMonitorReport; - -import java.util.List; - -/** - * CBS抄报Service接口 - * - * @author YinQ - * @date 2023-10-20 - */ -public interface ICbsMonitorReportService -{ - /** - * 查询CBS抄报 - * - * @param objId CBS抄报主键 - * @return CBS抄报 - */ - public CbsMonitorReport selectCbsMonitorReportByObjId(Long objId); - - /** - * 查询CBS抄报列表 - * - * @param cbsMonitorReport CBS抄报 - * @return CBS抄报集合 - */ - public List selectCbsMonitorReportList(CbsMonitorReport cbsMonitorReport); - - /** - * 新增CBS抄报 - * - * @param cbsMonitorReport CBS抄报 - * @return 结果 - */ - public int insertCbsMonitorReport(CbsMonitorReport cbsMonitorReport); - - /** - * 修改CBS抄报 - * - * @param cbsMonitorReport CBS抄报 - * @return 结果 - */ - public int updateCbsMonitorReport(CbsMonitorReport cbsMonitorReport); - - /** - * 批量删除CBS抄报 - * - * @param objIds 需要删除的CBS抄报主键集合 - * @return 结果 - */ - public int deleteCbsMonitorReportByObjIds(Long[] objIds); - - /** - * 删除CBS抄报信息 - * - * @param objId CBS抄报主键 - * @return 结果 - */ - public int deleteCbsMonitorReportByObjId(Long objId); - -// /** -// * 查询实时数据 -// * -// * @param emsApiVo CBS抄报 -// * @return CBS抄报集合 -// */ -// public List selectRealTimeMonitorList(EmsApiVo emsApiVo); - - /** - * 查询上次CBS抄表数据 - * - * @param cbsMonitorReport CBS抄报主键 - * @return CBS抄报 - */ - public CbsMonitorReport selectLastTimeCbsMonitorReport(CbsMonitorReport cbsMonitorReport); - -} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/CbsMonitorReportServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/CbsMonitorReportServiceImpl.java deleted file mode 100644 index 302d9c4..0000000 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/base/service/impl/CbsMonitorReportServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.hw.ems.base.service.impl; - -import com.hw.common.core.utils.DateUtils; -import com.hw.ems.base.domain.CbsMonitorReport; -import com.hw.ems.base.mapper.CbsMonitorReportMapper; -import com.hw.ems.base.service.ICbsMonitorReportService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * CBS抄报Service业务层处理 - * - * @author YinQ - * @date 2023-10-20 - */ -@Service -public class CbsMonitorReportServiceImpl implements ICbsMonitorReportService -{ - @Autowired - private CbsMonitorReportMapper cbsMonitorReportMapper; - - /** - * 查询CBS抄报 - * - * @param objId CBS抄报主键 - * @return CBS抄报 - */ - @Override -// @DS("#header.poolName") - public CbsMonitorReport selectCbsMonitorReportByObjId(Long objId) - { - return cbsMonitorReportMapper.selectCbsMonitorReportByObjId(objId); - } - - /** - * 查询CBS抄报列表 - * - * @param cbsMonitorReport CBS抄报 - * @return CBS抄报 - */ - @Override -// @DS("#header.poolName") - public List selectCbsMonitorReportList(CbsMonitorReport cbsMonitorReport) - { - return cbsMonitorReportMapper.selectCbsMonitorReportList(cbsMonitorReport); - } - - /** - * 新增CBS抄报 - * - * @param cbsMonitorReport CBS抄报 - * @return 结果 - */ - @Override -// @DS("#header.poolName") - public int insertCbsMonitorReport(CbsMonitorReport cbsMonitorReport) - { - cbsMonitorReport.setCreateTime(DateUtils.getNowDate()); - return cbsMonitorReportMapper.insertCbsMonitorReport(cbsMonitorReport); - } - - /** - * 修改CBS抄报 - * - * @param cbsMonitorReport CBS抄报 - * @return 结果 - */ - @Override -// @DS("#header.poolName") - public int updateCbsMonitorReport(CbsMonitorReport cbsMonitorReport) - { - cbsMonitorReport.setUpdateTime(DateUtils.getNowDate()); - return cbsMonitorReportMapper.updateCbsMonitorReport(cbsMonitorReport); - } - - /** - * 批量删除CBS抄报 - * - * @param objIds 需要删除的CBS抄报主键 - * @return 结果 - */ - @Override -// @DS("#header.poolName") - public int deleteCbsMonitorReportByObjIds(Long[] objIds) - { - return cbsMonitorReportMapper.deleteCbsMonitorReportByObjIds(objIds); - } - - /** - * 删除CBS抄报信息 - * - * @param objId CBS抄报主键 - * @return 结果 - */ - @Override -// @DS("#header.poolName") - public int deleteCbsMonitorReportByObjId(Long objId) - { - return cbsMonitorReportMapper.deleteCbsMonitorReportByObjId(objId); - } - -// - - -// /** -// * 查询实时数据 -// * @param emsApiVo CBS抄报 -// * @return -// */ -// @Override -// @DS("#header.poolName") -// public List selectRealTimeMonitorList(EmsApiVo emsApiVo) -// { -// return cbsMonitorReportMapper.selectRealTimeMonitorList(emsApiVo); -// } - - /** - * 查询上次CBS抄表数据 - * - * @param cbsMonitorReport CBS抄报主键 - * @return CBS抄报 - */ - @Override -// @DS("#header.poolName") - public CbsMonitorReport selectLastTimeCbsMonitorReport(CbsMonitorReport cbsMonitorReport) - { - return cbsMonitorReportMapper.selectLastTimeCbsMonitorReport(cbsMonitorReport); - } - -} diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/RecordDnbInstantController.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/RecordDnbInstantController.java index d129f7e..dfcccc3 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/RecordDnbInstantController.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/controller/RecordDnbInstantController.java @@ -40,13 +40,6 @@ public class RecordDnbInstantController extends BaseController { return prefix + "/dnbInstant"; } - /** - * 获取电实时数据 定时任务用 - * */ - @PostMapping("/getDnbInstant") - public void getDnbInstant(){ - recordDnbInstantService.getDnbInstantByJob(); - } /** * 点钞数据 * @return @@ -79,13 +72,11 @@ public class RecordDnbInstantController extends BaseController { @RequiresPermissions("record:dnbInstant:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(@RequestBody RecordDnbInstant recordDnbInstant) + public TableDataInfo list(@RequestBody RecordDnbInstant recordDnbInstant) { startPage(); - RecordDnbInstantDataVo recordDnbInstantDataVo = recordDnbInstantService.selectRecordDnbInstantList(recordDnbInstant); - List records = recordDnbInstantDataVo.getRecordDnbInstants(); - int count = recordDnbInstantDataVo.getCount(); - return getDataTable(records,count); + List list = recordDnbInstantService.selectRecordDnbInstantList(recordDnbInstant); + return getDataTable(list); } /** @@ -122,9 +113,8 @@ public class RecordDnbInstantController extends BaseController { @ResponseBody public void export(HttpServletResponse response,RecordDnbInstant recordDnbInstant) { - RecordDnbInstantDataVo recordDnbInstantDataVo = recordDnbInstantService.selectRecordDnbInstantList(recordDnbInstant); - List list = recordDnbInstantDataVo.getRecordDnbInstants(); - ExcelUtil util = new ExcelUtil<>(RecordDnbInstant.class); + List list = recordDnbInstantService.selectRecordDnbInstantList(recordDnbInstant); + ExcelUtil util = new ExcelUtil(RecordDnbInstant.class); util.exportExcel(response,list, "电实时数据数据"); } @@ -144,7 +134,7 @@ public class RecordDnbInstantController extends BaseController { @Log(title = "电实时数据", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(@RequestBody RecordDnbInstant recordDnbInstant) + public AjaxResult addSave(RecordDnbInstant recordDnbInstant) { return toAjax(recordDnbInstantService.insertRecordDnbInstant(recordDnbInstant)); } @@ -176,13 +166,11 @@ public class RecordDnbInstantController extends BaseController { /** * 删除电实时数据 */ - @RequiresPermissions("record:dnbInstant:remove") @Log(title = "电实时数据", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) + @GetMapping("/dnbRemove/{objids}") + public AjaxResult remove(@PathVariable Long[] objids) { - return toAjax(recordDnbInstantService.deleteRecordDnbInstantByObjids(ids)); + return toAjax(recordDnbInstantService.deleteRecordDnbInstantByObjids(objids)); } /** @@ -207,5 +195,4 @@ public class RecordDnbInstantController extends BaseController { public AjaxResult voltageCurrentCurve(RecordDnbInstant baseDnbInstant) { return AjaxResult.success(recordDnbInstantService.voltageCurrentCurve(baseDnbInstant)); } - } diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmData.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmData.java index ae3989b..8c64853 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmData.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/domain/RecordAlarmData.java @@ -31,16 +31,16 @@ public class RecordAlarmData extends BaseEntity @Excel(name = "采集设备编号") private String collectDeviceId; - /** 记录时间 */ + /** 告警时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "告警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date collectTime; - /** 异常类型 */ + /** 异常类型 (0-超过阈值,1-设备离线,2-瞬时流量告警,3-线损告警,4-日耗量告警,5-表具离线) */ @Excel(name = "异常类型") private Long alarmType; - /** 异常状态 */ + /** 异常状态 (0-已处理;1-未处理;2-已读未处理)*/ @Excel(name = "异常状态") private Long alarmStatus; @@ -65,10 +65,62 @@ public class RecordAlarmData extends BaseEntity @Excel(name = "通知用户") private String notifyUser; + /** 园区编号 poolName */ + private String parkName; + /** 权限标识(部门) */ @Excel(name = "权限标识", readConverterExp = "部=门") private Long deptId; + /** 权限标识(用户) */ + @Excel(name = "权限标识", readConverterExp = "用=户") + private Long userId; + + /** + * 消息批次 + */ + private String batchId; + + /** + * 原因分析 + */ + @Excel(name = "原因分析") + private String problemCauses; + + /** 采集设备名称 */ + private String collectDeviceName; + + /** 安装位置 */ + @Excel(name = "安装位置") + private String address; + + + private String alarmStatusName; + + public String getAlarmStatusName() { + return alarmStatusName; + } + + public void setAlarmStatusName(String alarmStatusName) { + this.alarmStatusName = alarmStatusName; + } + + public String getCollectDeviceName() { + return collectDeviceName; + } + + public void setCollectDeviceName(String collectDeviceName) { + this.collectDeviceName = collectDeviceName; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + public Long[] getObjIds() { return objIds; } @@ -77,9 +129,29 @@ public class RecordAlarmData extends BaseEntity this.objIds = objIds; } - /** 权限标识(用户) */ - @Excel(name = "权限标识", readConverterExp = "用=户") - private Long userId; + public String getBatchId() { + return batchId; + } + + public void setBatchId(String batchId) { + this.batchId = batchId; + } + + public String getProblemCauses() { + return problemCauses; + } + + public void setProblemCauses(String problemCauses) { + this.problemCauses = problemCauses; + } + + public String getParkName() { + return parkName; + } + + public void setParkName(String parkName) { + this.parkName = parkName; + } public void setObjId(Long objId) { @@ -210,23 +282,23 @@ public class RecordAlarmData extends BaseEntity @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("objId", getObjId()) - .append("monitorId", getMonitorId()) - .append("collectDeviceId", getCollectDeviceId()) - .append("collectTime", getCollectTime()) - .append("alarmType", getAlarmType()) - .append("alarmStatus", getAlarmStatus()) - .append("alarmData", getAlarmData()) - .append("operationName", getOperationName()) - .append("operationTime", getOperationTime()) - .append("cause", getCause()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("notifyUser", getNotifyUser()) - .append("deptId", getDeptId()) - .append("userId", getUserId()) - .toString(); + .append("objId", getObjId()) + .append("monitorId", getMonitorId()) + .append("collectDeviceId", getCollectDeviceId()) + .append("collectTime", getCollectTime()) + .append("alarmType", getAlarmType()) + .append("alarmStatus", getAlarmStatus()) + .append("alarmData", getAlarmData()) + .append("operationName", getOperationName()) + .append("operationTime", getOperationTime()) + .append("cause", getCause()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("notifyUser", getNotifyUser()) + .append("deptId", getDeptId()) + .append("userId", getUserId()) + .toString(); } } diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java index 47a81a3..1882d98 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/mapper/RecordDnbInstantMapper.java @@ -3,6 +3,7 @@ package com.hw.ems.record.mapper; import com.hw.ems.record.domain.RecordDnbInstant; import java.util.List; +import java.util.Map; /** @@ -59,7 +60,7 @@ public interface RecordDnbInstantMapper * @param objids 需要删除的数据主键集合 * @return 结果 */ - public int deleteRecordDnbInstantByObjids(String[] objids); + public int deleteRecordDnbInstantByObjids(Long[] objids); /** * 实时数据 @@ -74,4 +75,18 @@ public interface RecordDnbInstantMapper * @return */ List selectRealTimeParentList(RecordDnbInstant baseDnbInstant); + + /** + * 实时数据 + * @param paramMap + * @return + */ + List tablewareDetailsInfo(Map paramMap); + + /** + * 电表离线告警 + * @param recordDnbInstant + * @return + */ + List offlineAlerts(RecordDnbInstant recordDnbInstant); } diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/IRecordDnbInstantService.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/IRecordDnbInstantService.java index c8b9e5a..20d00e2 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/IRecordDnbInstantService.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/IRecordDnbInstantService.java @@ -29,7 +29,7 @@ public interface IRecordDnbInstantService { * @param recordDnbInstant 电实时数据 * @return 电实时数据集合 */ - public RecordDnbInstantDataVo selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant); + public List selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant); /** * 新增电实时数据 @@ -53,7 +53,7 @@ public interface IRecordDnbInstantService { * @param objids 需要删除的电实时数据主键集合 * @return 结果 */ - public int deleteRecordDnbInstantByObjids(String objids); + public int deleteRecordDnbInstantByObjids(Long[] objids); /** * 删除电实时数据信息 @@ -88,9 +88,4 @@ public interface IRecordDnbInstantService { RecordDnbInstant tablewareDetailsInfo(RecordDnbInstant dnbInstant); List voltageCurrentCurve(RecordDnbInstant baseDnbInstant); - - /** - * 定时任务:通过tde获取电实时数据 - * */ - void getDnbInstantByJob(); } diff --git a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java index dabc750..8f63eb2 100644 --- a/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java +++ b/hw-modules/hw-ems/src/main/java/com/hw/ems/record/service/impl/RecordDnbInstantServiceImpl.java @@ -1,34 +1,19 @@ package com.hw.ems.record.service.impl; import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; -import com.alibaba.fastjson2.JSONObject; -import com.hw.common.core.constant.SecurityConstants; -import com.hw.common.core.constant.TdEngineConstants; -import com.hw.common.core.domain.R; -import com.hw.common.core.text.Convert; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; -import com.hw.ems.base.domain.BaseEnergyType; import com.hw.ems.base.domain.BaseMonitorInfo; -import com.hw.ems.base.service.IBaseEnergyTypeService; import com.hw.ems.base.service.IBaseMonitorInfoService; import com.hw.ems.record.domain.RecordDnbInstant; -import com.hw.ems.record.domain.vo.RecordDnbInstantDataVo; import com.hw.ems.record.mapper.RecordDnbInstantMapper; import com.hw.ems.record.service.IRecordDnbInstantService; -import com.hw.ems.report.domain.ReportPointDnb; -import com.hw.ems.report.service.IReportPointDnbService; -import com.hw.tdengine.api.RemoteTdEngineService; -import com.hw.tdengine.api.domain.*; -import com.hw.tdengine.api.domain.ems.TdSuperTableEmsSelectVo; -import io.swagger.models.auth.In; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -46,15 +31,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { @Autowired private IBaseMonitorInfoService baseMonitorInfoService; - @Autowired - private RemoteTdEngineService remoteTdEngineService; - - @Autowired - private IBaseEnergyTypeService baseEnergyTypeService; - @Autowired - private IReportPointDnbService reportPointDnbService; - - /** * 查询电实时数据 * @@ -62,10 +38,8 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return 电实时数据 */ @Override - //@DS("#header.poolName") public RecordDnbInstant selectRecordDnbInstantByObjid(Long objid) { -// return recordDnbInstantMapper.selectRecordDnbInstantByObjid(objid); - return new RecordDnbInstant(); + return recordDnbInstantMapper.selectRecordDnbInstantByObjid(objid); } /** @@ -74,144 +48,9 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @param recordDnbInstant 电实时数据 * @return 电实时数据 */ -// @Override -// @DS("#header.poolName") -//// @DataScope(deptAlias = "null") -// public List selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant) { -// return recordDnbInstantMapper.selectRecordDnbInstantList(recordDnbInstant); -// } @Override - //@DS("#header.poolName") -// @DataScope(deptAlias = "null") - public RecordDnbInstantDataVo selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant) { - RecordDnbInstantDataVo recordDnbInstantDataVo = new RecordDnbInstantDataVo(); -// recordDnbInstant.setMonitorId(recordDnbInstant.getMonitorSubset()); - try { - -// Integer pageNum = Integer.valueOf((String) recordDnbInstant.getParams().get("pageNum")); - Integer pageNum = null; - Integer pageSize = null; - if (recordDnbInstant.getParams().get("pageNum")!=null){ - Object pageNum1 = recordDnbInstant.getParams().get("pageNum"); - pageNum = Integer.valueOf(String.valueOf(pageNum1)); -// pageNum = (Integer) recordDnbInstant.getParams().get("pageNum"); - } - if (recordDnbInstant.getParams().get("pageSize")!=null){ - //一步转出会导致导出时出现无法转换的错误 - Object pageSize1 = recordDnbInstant.getParams().get("pageSize"); - pageSize = Integer.valueOf(String.valueOf(pageSize1)); -// pageSize = (Integer) recordDnbInstant.getParams().get("pageSize"); - } -// Integer pageSize = Integer.valueOf((String) recordDnbInstant.getParams().get("pageSize")); - Integer offset = (pageNum - 1) * pageSize; - List records = new ArrayList(); - BaseMonitorInfo queryMonitorInfo = new BaseMonitorInfo(); - queryMonitorInfo.setMonitorId(recordDnbInstant.getMonitorId()); -// List baseMonitorInfos = baseMonitorInfoService.selectBaseMonitorInfoList(queryMonitorInfo); - String stratTime = (String) recordDnbInstant.getParams().get("beginTime"); - String endTime = (String) recordDnbInstant.getParams().get("endTime"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //todo 因为手动补录采集时间默认为空,且手动补录页面初始化需要展示出所有的历史数据 - if (stratTime==null||stratTime == ""){ - //开始事件设置的足够远,确保可以查询到所有数据 - stratTime ="2023-01-01 00:00:00"; - } - if (endTime==null || endTime == ""){ - //结束事件设置为当前时间 - endTime = sdf.format(new Date(System.currentTimeMillis())); - } - Date dateStrat = sdf.parse(stratTime); - Date dateEnd = sdf.parse(endTime); - - TdSuperTableEmsSelectVo tdSuperTableCommonSelectVo = new TdSuperTableEmsSelectVo(); - tdSuperTableCommonSelectVo.setDatabaseName("db_hwmes"); - tdSuperTableCommonSelectVo.setSuperTableName("st_electricity"); - tdSuperTableCommonSelectVo.setStartTime(dateStrat.getTime()); - tdSuperTableCommonSelectVo.setEndTime(dateEnd.getTime()); - tdSuperTableCommonSelectVo.setFirstFieldName("ts"); - tdSuperTableCommonSelectVo.setOrderByFieldName("ts"); - tdSuperTableCommonSelectVo.setSort("desc"); - tdSuperTableCommonSelectVo.setOffset(offset); - tdSuperTableCommonSelectVo.setLimit(pageSize); - -// Object monitorObjidValue = recordDnbInstant.getParams().get("monitorObjid"); - Object monitorObjidValue = recordDnbInstant.getObjid(); - if (monitorObjidValue != null&&monitorObjidValue !="") { - tdSuperTableCommonSelectVo.setMonitorObjid(Long.valueOf(String.valueOf(monitorObjidValue))); - } - - TdReturnDataVo tdReturnDataVo = remoteTdEngineService.getSuperTableHistoryData(tdSuperTableCommonSelectVo, SecurityConstants.INNER).getData(); - if (tdReturnDataVo == null) { - return recordDnbInstantDataVo; - } - List> dataList = tdReturnDataVo.getDataList(); - //用于记录返回条数来正确分页 - Integer flag = 0; - for (Map data : dataList) { - RecordDnbInstant recordDnbInstant1 = new RecordDnbInstant(); - - recordDnbInstant1.setMonitorId(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORID))); - recordDnbInstant1.setObjid(Long.valueOf(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITOROBJID)))); - recordDnbInstant1.setMonitorName(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORNAME))); - if (data.get("volatagea")!=null ){ - recordDnbInstant1.setVA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagea"))))); - } - if (data.get("volatageb")!=null ){ - recordDnbInstant1.setVB(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatageb"))))); - } - if (data.get("volatagec")!=null ){ - recordDnbInstant1.setVC(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagec"))))); - } - if (data.get("currenta")!=null ){ - recordDnbInstant1.setIA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currenta"))))); - } - if (data.get("currentb")!=null ){ - recordDnbInstant1.setIB(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currentb"))))); - } - if (data.get("currentc")!=null ){ - recordDnbInstant1.setIC(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currentc"))))); - } - if (data.get("glys")!=null ){ - recordDnbInstant1.setGlys(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("glys"))))); - } - if (data.get("zxyg")!=null ){ - recordDnbInstant1.setZxyg(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("zxyg"))))); - } - if (data.get("activepower")!=null ){ - recordDnbInstant1.setActivePower(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("activepower"))))); - } - if (data.get("reactivepower")!=null ){ - recordDnbInstant1.setReactivePower(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("reactivepower"))))); - } - - //调整时间格式 - String substring = String.valueOf(data.get("ts")).replaceAll("T", " ").substring(0, 19); - recordDnbInstant1.setCollectTime(sdf.parse(substring)); -// recordDnbInstant.setConsumption(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("consumption"))))); - if (data.get("collecttype")!=null ){ - recordDnbInstant1.setCollectType(Long.valueOf(String.valueOf(data.get("collecttype")))); - } - //从手动补录进入时,会传入一个参数,如果时从手动补录进入,就过滤自动的数据 - //目前定义 状态为1是自动的其他都是手动 - if (recordDnbInstant.getCollectType()!=null){ - if (data.get("collecttype")!=null && recordDnbInstant.getCollectType()==0) - { - if (recordDnbInstant1.getCollectType()!=1){ records.add(recordDnbInstant1);flag+=1;} - } - } - else{ - flag+=1; - records.add(recordDnbInstant1); - } - - } - recordDnbInstantDataVo.setCount(flag); - recordDnbInstantDataVo.setRecordDnbInstants(records); - return recordDnbInstantDataVo; - } catch (ParseException e) { - e.printStackTrace(); - } - return recordDnbInstantDataVo; + public List selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant) { + return recordDnbInstantMapper.selectRecordDnbInstantList(recordDnbInstant); } /** @@ -221,7 +60,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return 结果 */ @Override - //@DS("#header.poolName") public int insertRecordDnbInstant(RecordDnbInstant recordDnbInstant) { /*if (StringUtils.isNotEmpty(recordDnbInstant.getMonitorId())){ RecordDnbInstant dnbInstant = new RecordDnbInstant(); @@ -235,49 +73,9 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { } } }*/ - BaseMonitorInfo baseMonitorInfo = new BaseMonitorInfo(); - baseMonitorInfo.setMonitorId(recordDnbInstant.getMonitorId()); - List baseMonitorInfos = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date collectTime = recordDnbInstant.getCollectTime(); - TdTableVo tdTableVo = new TdTableVo(); - tdTableVo.setDatabaseName("db_hwmes"); - tdTableVo.setSuperTableName("st_electricity"); - tdTableVo.setTableName(TdEngineConstants.getEmsTableName(baseMonitorInfos.get(0).getMonitorId())); - List fields = new ArrayList(); - List field2s = new ArrayList(); - TdField field = new TdField(); - TdField field2 = new TdField(); - TdField field3 = new TdField(); - TdField field4 = new TdField(); - field.setFieldName(TdEngineConstants.ST_TAG_EMS_BUILDID); - field.setFieldValue(baseMonitorInfos.get(0).getBuildId()); - field2.setFieldName(TdEngineConstants.ST_TAG_EMS_MONITORNAME); - field2.setFieldValue(baseMonitorInfos.get(0).getMonitorName()); - field3.setFieldName(TdEngineConstants.ST_TAG_EMS_MONITOROBJID); - field3.setFieldValue(baseMonitorInfos.get(0).getObjid()); - field4.setFieldName(TdEngineConstants.ST_TAG_EMS_MONITORID); - field4.setFieldValue(baseMonitorInfos.get(0).getMonitorId()); - fields.add(field); - fields.add(field2); - fields.add(field3); - fields.add(field4); - tdTableVo.setTagsFieldValues(fields); - TdField field5 = new TdField(); - TdField field6 = new TdField(); - field5.setFieldName(TdEngineConstants.DEFAULT_FIRST_FIELD_NAME); - - field5.setFieldValue(sdf.format(collectTime)); - field6.setFieldName("zxyg"); - field6.setFieldValue(recordDnbInstant.getZxyg()); - field2s.add(field5); - field2s.add(field6); - tdTableVo.setSchemaFields(field2s); - R r = remoteTdEngineService.insertTable(tdTableVo, SecurityConstants.INNER); -// recordDnbInstant.setRecordTime(new Date()); -// recordDnbInstant.setCollectType(0L); -// return recordDnbInstantMapper.insertRecordDnbInstant(recordDnbInstant); - return 1; + recordDnbInstant.setRecordTime(new Date()); + recordDnbInstant.setCollectType(0L); + return recordDnbInstantMapper.insertRecordDnbInstant(recordDnbInstant); } /** @@ -287,7 +85,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return 结果 */ @Override - //@DS("#header.poolName") public int updateRecordDnbInstant(RecordDnbInstant recordDnbInstant) { recordDnbInstant.setRecordTime(new Date()); return recordDnbInstantMapper.updateRecordDnbInstant(recordDnbInstant); @@ -300,9 +97,8 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return 结果 */ @Override - //@DS("#header.poolName") - public int deleteRecordDnbInstantByObjids(String objids) { - return recordDnbInstantMapper.deleteRecordDnbInstantByObjids(Convert.toStrArray(objids)); + public int deleteRecordDnbInstantByObjids(Long[] objids) { + return recordDnbInstantMapper.deleteRecordDnbInstantByObjids(objids); } /** @@ -312,7 +108,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return 结果 */ @Override - //@DS("#header.poolName") public int deleteRecordDnbInstantByObjid(Long objid) { return recordDnbInstantMapper.deleteRecordDnbInstantByObjid(objid); } @@ -324,19 +119,15 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return */ @Override - //@DS("#header.poolName") public List instantList(RecordDnbInstant recordDnbInstant) { - //是空 直接添加 if (StringUtils.isEmpty(recordDnbInstant.getMonitorSubset())) { return recordDnbInstantMapper.instantList(new RecordDnbInstant()); } List dnbInstantList = new ArrayList<>(); BaseMonitorInfo monitorInfo = new BaseMonitorInfo(); - //查询子集加入到父id中 monitorInfo.setParentId(Long.valueOf(recordDnbInstant.getMonitorSubset())); monitorInfo.setParams(null); recordDnbInstant.setParams(null); - //查询id为getMonitorSubset的子集 List baseMonitorInfos = baseMonitorInfoService.selectBaseMonitorInfoList(monitorInfo); for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfos) { RecordDnbInstant dnbInstant = new RecordDnbInstant(); @@ -358,13 +149,11 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { /** * 获取最新实时电数据 - * 需要先排序在查询出每个设备的最新数据 * * @param baseDnbInstant * @return */ @Override - //@DS("#header.poolName") public List selectRealTimeParentList(RecordDnbInstant baseDnbInstant) { List dnbInstantList = new ArrayList<>(); if (StringUtils.isEmpty(baseDnbInstant.getMonitorSubset())) { @@ -376,7 +165,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { baseDnbInstant.setParams(null); List baseMonitorInfos = baseMonitorInfoService.selectBaseMonitorInfoList(monitorInfo); if (baseMonitorInfos.size() > 0) { - List dnbInstantListOld = recordDnbInstantMapper.instantList(baseDnbInstant); dnbInstant.setMonitorId(baseMonitorInfos.get(0).getMonitorId()); dnbInstant.setMonitorName(baseMonitorInfos.get(0).getMonitorName()); @@ -408,7 +196,6 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { * @return */ @Override - //@DS("#header.poolName") public RecordDnbInstant tablewareDetailsInfo(RecordDnbInstant dnbInstant) { if (StringUtils.isEmpty(dnbInstant.getMonitorId())) { return null; @@ -421,12 +208,11 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { } @Override - //@DS("#header.poolName") public List voltageCurrentCurve(RecordDnbInstant dnbInstant) { - if (StringUtils.isEmpty(dnbInstant.getMonitorId())) { + if (StringUtils.isEmpty(dnbInstant.getMonitorId())){ return null; } - if (StringUtils.isEmpty(dnbInstant.getStartTime()) || StringUtils.isEmpty(dnbInstant.getEndTime())) { + if (StringUtils.isEmpty(dnbInstant.getStartTime()) || StringUtils.isEmpty(dnbInstant.getEndTime())){ String nowTime = DateUtils.getTime(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); LocalDateTime modifiedDateTime = LocalDateTime.parse(nowTime, formatter).minusMinutes(30); @@ -437,82 +223,5 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService { return recordDnbInstantMapper.selectRecordDnbInstantList(dnbInstant); } - /** - * 定时任务用:通过定时任务获取电实时数据 - */ - //todo 通过tde 将电实时数据存入到电整点数据中 - @Override - public void getDnbInstantByJob() { - TdHistorySelectDto tdHistorySelectDto = new TdHistorySelectDto(); - tdHistorySelectDto.setFirstFieldName("ts"); - tdHistorySelectDto.setDatabaseName(TdEngineConstants.EMS_DATABASE_NAME); - List baseEnergyTypes = baseEnergyTypeService.selectBaseEnergyTypeList(new BaseEnergyType()); - - //获取当前时间与一小时前时间 - long endTime = System.currentTimeMillis(); - //从一小时前开始,十点的话就是从九点开始,不是九点零一,开始就 - long startTime = System.currentTimeMillis() - 60 * 60 * 1000 - 10; - tdHistorySelectDto.setStartTime(startTime); - tdHistorySelectDto.setEndTime(endTime); - Date date = new Date(); - int hours = date.getHours(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - //获取所有的计量设备 - List baseMonitorInfos = baseMonitorInfoService.selectBaseMonitorInfoList(new BaseMonitorInfo()); - List reportPoints = new ArrayList(); - //根据计量设备id获取能源表名称 - if (!baseMonitorInfos.isEmpty()) { - for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfos) { - try { - String emsTableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getMonitorId()); - //获取当前数据以及一小时前的数据 - tdHistorySelectDto.setTableName(emsTableName); - List> dnbInstant = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER).getData().getDataList(); - if (dnbInstant.size()==0){ - return; - } - R historyData = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER); - ReportPointDnb report = new ReportPointDnb(); - report.setMonitorId(baseMonitorInfo.getMonitorId()); - report.setMonitorName(baseMonitorInfo.getMonitorName()); - report.setpMonitorId(String.valueOf(baseMonitorInfo.getParentId())); - report.setAddress(baseMonitorInfo.getMonitorAddr()); - - - BigDecimal MaxZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(dnbInstant.size() - 1).get("zxyg")))); - BigDecimal MinZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(0).get("zxyg")))); - - - //pt ct值暂时无用,默认为1 需要时从计量设备信息中根据id获取 - int pt = 1; - int ct = 1; - //乘ct值和pt值 - /** - * (MAX(ifnull(t1.zxyg,0)) - MIN(ifnull(t1.zxyg,0))) * ifnull(t2.pt,1) * ifnull(t2.ct,1)as expend, - * 0 as price, - * hour(date_sub(@nowDate, interval 1 hour)) as point_time, - * DATE_FORMAT(date_sub(@nowDate, interval 1 hour),'%Y-%m-%d %H:00:00') as begin_time, - * DATE_FORMAT(@nowDate,'%Y-%m-%d %H:00:00') as end_time, - * DATE_FORMAT(date_sub(@nowDate,interval 1 hour),'%Y-%m-%d %H:00:00') as record_time*/ - report.setExpend(MaxZXYG.subtract(MinZXYG).multiply(new BigDecimal(pt)).multiply(new BigDecimal(ct))); - report.setPrice(new BigDecimal(0)); - report.setPointTime(String.valueOf(hours - 1)); - report.setMeterValue(MaxZXYG.subtract(MinZXYG)); - report.setRecordTime(sdf.parse(sdf.format(startTime))); - report.setBeginTime(sdf.parse(sdf.format(startTime))); - report.setEndTime(sdf.parse(sdf.format(endTime))); - reportPoints.add(report); - } catch (ParseException e) { - e.printStackTrace(); - } - } - } - //将获取到的数据存入到实时数据中 - for (ReportPointDnb p : reportPoints) { - reportPointDnbService.insertReportPointDnb(p); - } - - } } - diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseLineMonitorMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseLineMonitorMapper.xml index 72d2f42..e36ad26 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseLineMonitorMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseLineMonitorMapper.xml @@ -5,68 +5,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - select objid, parent_id, monitor_id, monitor_name, monitor_addr, monitor_type, monitor_status, collect_device_id, build_id, ancestors, grade, correct_value, is_ammeter, line_name, line_length, line_status, power_capacity, water_capacity, dept_id, user_id, create_by, create_time, update_by, update_time from base_line_monitor + select blm.objid, + blm.parent_id, + blm.monitor_id, + bmi.monitor_name, + bmi.monitor_addr, + blm.monitor_type, + blm.monitor_status, + blm.collect_device_id, + blm.build_id, + blm.ancestors, + blm.grade, + blm.correct_value, + blm.is_ammeter, + blm.line_name, + blm.line_length, + blm.line_status, + blm.power_capacity, + blm.water_capacity, + blm.dept_id, + blm.user_id, + blm.create_by, + blm.create_time, + blm.update_by, + blm.update_time + from base_line_monitor blm + left join base_monitor_info bmi on blm.monitor_id = bmi.monitor_id insert into base_line_monitor @@ -94,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, - + #{parentId}, #{monitorId}, @@ -119,7 +175,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - + @@ -153,7 +209,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from base_line_monitor where objid = #{objid} + delete + from base_line_monitor + where objid = #{objid} @@ -163,24 +221,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select m1.monitor_id oneMonitorId, + m1.monitor_name oneMonitorName, + m2.monitor_id twoMonitorId, + m2.monitor_name twoMonitorName, + m3.monitor_id threeMonitorId, + m3.monitor_name threeMonitorName, + m4.monitor_id fourMonitorId, + m4.monitor_name fourMonitorName, + m5.monitor_id fiveMonitorId, + m5.monitor_name fiveMonitorName from base_line_monitor m1 - left join base_line_monitor m2 on m2.parent_id = m1.objid - left join base_line_monitor m3 on m3.parent_id = m2.objid - left join base_line_monitor m4 on m4.parent_id = m3.objid - left join base_line_monitor m5 on m5.parent_id = m4.objid + left join base_line_monitor m2 on m2.parent_id = m1.objid + left join base_line_monitor m3 on m3.parent_id = m2.objid + left join base_line_monitor m4 on m4.parent_id = m3.objid + left join base_line_monitor m5 on m5.parent_id = m4.objid where m1.grade = 1 - and m1.monitor_type = #{monitorType} + and m1.monitor_type = #{monitorType} order by oneMonitorName, twoMonitorName, threeMonitorName,fourMonitorName,fiveMonitorName + diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml index 473eb6a..a93919b 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml @@ -37,12 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + select objid, parent_id, monitor_id, monitor_name, monitor_addr, monitor_type, monitor_status, collect_device_id, ancestors, grade, build_id, subentry_id, business_id, meter_type_id, - meter_id, correct_value, pt, ct, is_ammeter, is_key_monitor, is_circuit, dept_id, user_id, + meter_id, correct_value, pt, ct, is_ammeter, is_key_monitor, is_circuit, dept_id, user_id,fee_type, create_by, create_time, update_by, update_time, public_share_type,monitor_hierarchy,room_code,room_name,physical_code from base_monitor_info @@ -51,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and parent_id = #{parentId} and monitor_name like concat('%', #{monitorName}, '%') + and monitor_id like concat('%', #{monitorId}, '%') and monitor_addr = #{monitorAddr} and monitor_type = #{monitorType} and monitor_status = #{monitorStatus} @@ -61,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and subentry_id = #{subentryId} and business_id = #{businessId} and meter_type_id = #{meterTypeId} + and fee_type = #{feeType} and meter_id = #{meterId} and correct_value = #{correctValue} and pt = #{pt} @@ -81,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where objid = #{objid} - select t.objid, t.parent_id, t.monitor_id, t.monitor_name, t.monitor_addr, t.monitor_type from base_monitor_info t @@ -92,7 +97,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select * from base_monitor_info where find_in_set(#{monitorId}, ancestors) update base_monitor_info set ancestors = @@ -140,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" room_code, room_name, physical_code, + fee_type, #{parentId}, @@ -173,6 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{roomCode}, #{roomName}, #{physicalCode}, + #{feeType}, @@ -206,10 +253,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, public_share_type = #{publicShareType}, - monitor_hierarchy = #{monitorHierarchy}, room_code = #{roomCode}, room_name = #{roomName}, physical_code = #{physicalCode}, + fee_type = #{feeType}, + submit_flag = #{submitFlag}, + monitor_hierarchy = #{monitorHierarchy}, where objid = #{objid} diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfoMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfoMapper.xml index 8dbfa7d..b0c2390 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfoMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseMonitorInfoMapper.xml @@ -83,7 +83,6 @@ and t.monitor_id like concat('%', #{monitorId}, '%') - diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserMapper.xml index 91fce6c..9a0a1e3 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserMapper.xml @@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN base_monitor_info bmi ON bmp.monitor_id = bmi.monitor_id where bpu.id = #{id} - SELECT bmp.monitor_id AS monitorId, bmi.monitor_name AS monitorName, bmp.public_share_type publicShareType diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserRecordMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserRecordMapper.xml index 82b444e..6ecf148 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserRecordMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/BasePublicUserRecordMapper.xml @@ -44,12 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and base_public_user_record.start_time <= #{endTime} - + - + insert into base_public_user_record @@ -110,9 +110,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from base_public_user_record where objid in + delete from base_public_user_record where objid in #{objid} - + \ No newline at end of file diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseTypeRelationMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseTypeRelationMapper.xml index 8f9da0b..9add8dd 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/BaseTypeRelationMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/BaseTypeRelationMapper.xml @@ -35,12 +35,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" m.monitor_name, case when base_type_relation.type = 0 then bi.build_name + when base_type_relation.type = 1 then bt.business_name + when base_type_relation.type = 2 then st.subentry_name end unit_name, base_type_relation.rate, base_type_relation.formula_mode from base_type_relation left join base_monitor_info m on m.monitor_id = base_type_relation.monitor_id left join base_build_info bi on base_type_relation.relation_id = bi.objid - + left join base_business_type bt on base_type_relation.relation_id = bt.objid + left join base_subentry_type st on base_type_relation.relation_id = st.objid + - - - and monitor_id = #{monitorId} - and monitor_name like concat('%', #{monitorName}, '%') - and monitor_type = #{monitorType} - and public_share_type = #{publicShareType} - and room_name like concat('%', #{roomName}, '%') - and build_code = #{buildCode} - and build_name like concat('%', #{buildName}, '%') - and is_bind = #{isBind} - and last_monitor_time = #{lastMonitorTime} - and last_monitor_expend = #{lastMonitorExpend} - and this_monitor_time = #{thisMonitorTime} - and this_monitor_expend = #{thisMonitorExpend} - and last_flag = #{lastFlag} - and this_flag = #{thisFlag} - - and room_code IN - - #{item} - - - - order by create_time desc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into cbs_monitor_report - - monitor_id, - monitor_name, - monitor_type, - public_share_type, - room_code, - room_name, - build_code, - build_name, - is_bind, - last_monitor_time, - last_monitor_expend, - this_monitor_time, - this_monitor_expend, - last_flag, - this_flag, - remark, - create_by, - create_time, - update_by, - update_time, - physical_code, - - - #{monitorId}, - #{monitorName}, - #{monitorType}, - #{publicShareType}, - #{roomCode}, - #{roomName}, - #{buildCode}, - #{buildName}, - #{isBind}, - #{lastMonitorTime}, - #{lastMonitorExpend}, - #{thisMonitorTime}, - #{thisMonitorExpend}, - #{lastFlag}, - #{thisFlag}, - #{remark}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{physicalCode}, - - - - - update cbs_monitor_report - - monitor_id = #{monitorId}, - monitor_name = #{monitorName}, - monitor_type = #{monitorType}, - public_share_type = #{publicShareType}, - room_code = #{roomCode}, - room_name = #{roomName}, - build_code = #{buildCode}, - build_name = #{buildName}, - is_bind = #{isBind}, - last_monitor_time = #{lastMonitorTime}, - last_monitor_expend = #{lastMonitorExpend}, - this_monitor_time = #{thisMonitorTime}, - this_monitor_expend = #{thisMonitorExpend}, - last_flag = #{lastFlag}, - this_flag = #{thisFlag}, - remark = #{remark}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - physical_code = #{physicalCode}, - - where obj_id = #{objId} - - - - delete from cbs_monitor_report where obj_id = #{objId} - - - - delete from cbs_monitor_report where obj_id in - - #{objId} - - - diff --git a/hw-modules/hw-ems/src/main/resources/mapper/base/SysDatasourceMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/base/SysDatasourceMapper.xml index 3005d53..c2d2bed 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/base/SysDatasourceMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/base/SysDatasourceMapper.xml @@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - select id, url, user_name, password, drive_class_name, pool_name, status, del_flag, create_by, create_time, update_by, update_time, remark, cbs_park_code, cbs_park_name diff --git a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmDataMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmDataMapper.xml index 5118a23..a85de90 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmDataMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordAlarmDataMapper.xml @@ -23,6 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + select record_alarm_data.objId, @@ -31,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" record_alarm_data.collect_device_id,collect_time,alarm_type,alarmStatus, alarmData,operation_name,operation_time,cause,record_alarm_data.create_by,record_alarm_data.create_time, record_alarm_data.update_by,record_alarm_data.update_time,notify_user, - record_alarm_data.dept_id,record_alarm_data.user_id + record_alarm_data.dept_id,record_alarm_data.user_id,record_alarm_data.batch_id,record_alarm_data.problem_causes from record_alarm_data left join base_monitor_info m on m.monitor_id = record_alarm_data.monitor_id left join base_collect_device_info cdi on cdi.collect_device_id = record_alarm_data.collect_device_id @@ -40,9 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select sd.pool_name, sd.park_name, su.user_name, su.phonenumber + from sys_datasource sd + join sys_user_datasource sud on sud.datasource_id = sd.id + join sys_user su on sud.user_id = su.user_id + join sys_user_role sur on sur.user_id = su.user_id + join sys_role sr on sr.role_id = sur.role_id AND sr.role_key = 'sf_massage' + where su.phonenumber IS NOT NULL + # and su.phonenumber != '' + and sd.pool_name = #{parkName} + group by sd.pool_name, sd.park_name, su.user_name, su.phonenumber + + + + + + diff --git a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordDnbInstantMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordDnbInstantMapper.xml index e98392b..22afc57 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordDnbInstantMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordDnbInstantMapper.xml @@ -27,6 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -40,7 +43,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and record_dnb_instant.monitor_id = #{monitorId} - and collect_time between #{params.beginCollectTime} and #{params.endCollectTime} + and record_dnb_instant.collect_time between #{params.beginCollectTime} and #{params.endCollectTime} + + + and record_dnb_instant.record_time between #{params.beginRecordTime} and #{params.endRecordTime} + + + and record_dnb_instant.collect_time between #{beginTime} and #{endTime} and (record_dnb_instant.monitor_id = #{monitorSubset} OR record_dnb_instant.monitor_id IN @@ -68,9 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where record_dnb_instant.objid = #{objid} - - - + + + + + insert into record_dnb_instant diff --git a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordWaterInstantMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordWaterInstantMapper.xml index e9b0f15..673c8c8 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/record/RecordWaterInstantMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/record/RecordWaterInstantMapper.xml @@ -35,6 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and (record_water_instant.monitor_id = #{monitorSubset} OR record_water_instant.monitor_id IN (SELECT t.monitor_id FROM base_monitor_info t WHERE FIND_IN_SET(#{monitorSubset}, ancestors))) + + and record_water_instant.record_time between #{params.beginRecordTime} and #{params.endRecordTime} + and flux_flow = #{fluxFlow} and water_flow = #{waterFlow} and record_water_instant.record_time = #{recordTime} @@ -54,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.collect_time,d.flux_flow, d.water_flow, d.record_time,d.collect_type, pd.consumption consumption,bcdi.online_state onlineState from record_water_instant d join ( - select rdi.monitor_id, max(rdi.collect_time) collect_time + select rdi.monitor_id, max(rdi.objid) objid from record_water_instant rdi and rdi.monitor_id = #{monitorId} @@ -69,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - group by rdi.monitor_id) md on md.monitor_id = d.monitor_id and md.collect_time = d.collect_time + group by rdi.monitor_id) md on md.objid = d.objid left join base_monitor_info m on m.monitor_id = d.monitor_id left join (select rpd.monitor_id, ifnull(sum(rpd.expend), 0) consumption from report_point_dnb rpd diff --git a/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointDnbMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointDnbMapper.xml index 84aa191..81d2ad7 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointDnbMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointDnbMapper.xml @@ -191,78 +191,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by ert.monitor_id, ert.monitor_name, ert.pointTime desc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -363,4 +324,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + diff --git a/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointWaterMapper.xml b/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointWaterMapper.xml index 10859a7..88010ab 100644 --- a/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointWaterMapper.xml +++ b/hw-modules/hw-ems/src/main/resources/mapper/report/ReportPointWaterMapper.xml @@ -204,24 +204,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" max(rpd.meter_value) meterValue, GROUP_CONCAT(DISTINCT bpu.user_name SEPARATOR ',') owningUser, concat(#{beginCollectTime},' 至 ',#{endCollectTime}) timeRange, + m.public_share_type publicShareType, m.monitor_hierarchy monitorHierarchy, + m.room_code roomCode, + m.room_name roomName, m.grade - from report_point_water rpd - left join (SELECT blm.monitor_id parentMonitorId, + from (SELECT blm.monitor_id parentMonitorId, blm.monitor_name parentName, bmi.monitor_id, bmi.monitor_name, bmi.monitor_addr, + bmi.public_share_type, bmi.monitor_hierarchy, + bmi.room_code, + bmi.room_name, bl.grade, CASE WHEN bmi.is_ammeter = 'true' THEN '是' ELSE '否' END is_ammeter FROM base_monitor_info bmi LEFT JOIN base_line_monitor bl ON bl.monitor_id = bmi.monitor_id LEFT JOIN base_line_monitor blm ON blm.objid = bl.parent_id) m - on m.monitor_id = rpd.monitor_id + left join report_point_water rpd on m.monitor_id = rpd.monitor_id left join base_monitor_public bmp on m.monitor_id = bmp.monitor_id left join base_public_user bpu on bmp.public_share_id = bpu.id + m.monitor_name is not null and left(rpd.begin_time,10) between #{beginCollectTime} and #{endCollectTime} @@ -235,8 +241,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and m.monitor_hierarchy = #{monitorHierarchy} group by m.parentMonitorId, m.parentName, m.is_ammeter, - rpd.monitor_id, m.monitor_name, m.monitor_addr, m.monitor_hierarchy, m.grade - order by m.parentName, m.monitor_name + rpd.monitor_id, m.monitor_name, m.monitor_addr, m.public_share_type, m.monitor_hierarchy, m.grade, m.room_code, m.room_name + order by m.parentName, m.monitor_name, m.monitor_hierarchy, m.public_share_type @@ -333,4 +339,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/hw-ui/src/api/ems/powerUse/ElectricityPreview.js b/hw-ui/src/api/ems/powerUse/ElectricityPreview.js new file mode 100644 index 0000000..3d76f76 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/ElectricityPreview.js @@ -0,0 +1,50 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; +// 查询用户列表1 +export function listUser(data) { + return request({ + url: '/ems/report/preview/consumptionReport/2', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} + +export function consumptionAll(data) { + return request({ + url: '/ems/report/preview/consumptionAll/2', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} +// 真查询部门下拉树结构 建筑 +export function treeDat() { + return request({ + url: '/ems/buildInfo/treeData', + method: 'get' + }) +} +//业态 +export function treeDattwo() { + return request({ + url: '/ems/businessType/treeData', + method: 'get' + }) +} +//分页 +export function treeDatthree() { + return request({ + url: '/ems/subentryType/treeData', + method: 'get' + }) +} diff --git a/hw-ui/src/api/ems/powerUse/Energystatistics.js b/hw-ui/src/api/ems/powerUse/Energystatistics.js new file mode 100644 index 0000000..91128bf --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/Energystatistics.js @@ -0,0 +1,55 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; + +// 查询用户列表 +export function listUser(data) { + return request({ + url: '/ems/report/analysis/emsStatisticsData', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + //formdata:true, + }) +} +// 查询底部列表 +export function instantLis(data) { + return request({ + url: '/ems/record/dnbInstant/instantList', + method: 'get', + params: data + }) +} + +// 真查询部门下拉树结构 +export function treeDat() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} +// +// // 一键秒表 +// export function editMeterReading(data) { +// return request({ +// url: '/ems/config/editMeterReading', +// method: 'post', +// data: data, +// //contentType:'application/x-www-form-urlencoded', +// }) +// } +export function previewPolyline(params) { + return request({ + url: '/ems/report/board/previewPolyline', + method: 'get', + params: params + }) +} + +export function dailyLossReport(params) { + return request({ + url: '/ems/report/board/dailyLossReport', + method: 'get', + params: params + }) +} diff --git a/hw-ui/src/api/ems/powerUse/HistoryElectricity.js b/hw-ui/src/api/ems/powerUse/HistoryElectricity.js new file mode 100644 index 0000000..f4d53da --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/HistoryElectricity.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; +// 查询用户列表1 +export function listUser(data) { + return request({ + url: '/ems/record/dnbInstant/list', + method: 'post', + data: data, + }) +} +// 查询部门下拉树结构 +export function treeDat() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} + +// 删除电实时数据 +export function delDnbRemoveInstant(objid) { + return request({ + url: '/ems/record/dnbInstant/dnbRemove/' + objid, + method: 'get' + }) +} diff --git a/hw-ui/src/api/ems/powerUse/RealTime.js b/hw-ui/src/api/ems/powerUse/RealTime.js new file mode 100644 index 0000000..eea8cc2 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/RealTime.js @@ -0,0 +1,51 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; + +// 查询用户列表 +export function listUser(data) { + return request({ + url: '/ems/record/dnbInstant/selectRealTimeList', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + timeout: 1000 * 60, + //formdata:true, + }) +} +// 查询底部列表 +export function instantLis(data) { + return request({ + url: '/ems/record/dnbInstant/instantList', + method: 'get', + params: data, + timeout: 1000 * 60, + }) +} + +// 真查询部门下拉树结构 +export function treeDat() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} +// +// 一键秒表 +export function editMeterReading(data) { + return request({ + url: '/ems/config/editMeterReading', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} +// 一键秒表 +export function voltageCurrentCurve(data) { + return request({ + url: '/ems/record/dnbInstant/voltageCurrentCurve', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} diff --git a/hw-ui/src/api/ems/powerUse/RingCounty.js b/hw-ui/src/api/ems/powerUse/RingCounty.js new file mode 100644 index 0000000..186bcf7 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/RingCounty.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; + +// 柱状图1 +export function dnbCountingData(query) { + return request({ + url: '/ems/report/analysis/emsMomAnalysisData', + method: 'get', + params: query + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} diff --git a/hw-ui/src/api/ems/powerUse/WholePointData.js b/hw-ui/src/api/ems/powerUse/WholePointData.js new file mode 100644 index 0000000..e64676e --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/WholePointData.js @@ -0,0 +1,45 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; + +// 查询列表1 +export function listUser(data) { + return request({ + url: '/ems/report/pointDnb/list', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} +//日月年列表查询接口 +export function listUser2(data) { + return request({ + url: '/ems/report/pointDnb/datePointDnbList', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} +// 柱状图1 +export function dnbCountingData(query) { + return request({ + url: '/ems/report/board/dnbCountingData', + method: 'get', + params: query + }) +} +// 真查询部门下拉树结构 +export function treeDat() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/user/deptTree', + method: 'get' + }) +} diff --git a/hw-ui/src/api/ems/powerUse/additionalRecording.js b/hw-ui/src/api/ems/powerUse/additionalRecording.js new file mode 100644 index 0000000..737ecc1 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/additionalRecording.js @@ -0,0 +1,61 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; + +// 查询用户列表 +export function listUser(data) { + return request({ + url: '/ems/record/dnbInstant/list', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} + +// 新增 +export function addUser(data) { + return request({ + url: '/ems/record/dnbInstant/add', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} + +// 修改 +export function updateUser(data) { + return request({ + url: '/ems/record/dnbInstant/edit', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} + +// 删除用户 +export function delUser(data) { + return request({ + url: '/ems/record/dnbInstant/remove', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} + +// 新增光伏发电整点数据 +export function addReportPointDnb(data) { + return request({ + url: '/ems/report/pointDnb/addPhotovoltaicPower', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} diff --git a/hw-ui/src/api/ems/powerUse/dianChaoData.js b/hw-ui/src/api/ems/powerUse/dianChaoData.js new file mode 100644 index 0000000..5ad9a61 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/dianChaoData.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; +// 查询用户列表1 +export function listUser(data) { + return request({ + url: '/ems/record/dnbInstant/list', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} +// 柱状图1 +export function dnbCountingData(query) { + return request({ + url: '/report/board/dnbCountingData', + method: 'get', + params: query + }) +} +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} diff --git a/hw-ui/src/api/ems/powerUse/tongBianalyse.js b/hw-ui/src/api/ems/powerUse/tongBianalyse.js new file mode 100644 index 0000000..335c5e4 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/tongBianalyse.js @@ -0,0 +1,19 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; + +// 柱状图1 +export function dnbCountingData(query) { + return request({ + url: '/ems/report/analysis/emsYoyAnalysisData', + method: 'get', + params: query + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} diff --git a/hw-ui/src/api/ems/powerUse/xiansunanalysis.js b/hw-ui/src/api/ems/powerUse/xiansunanalysis.js new file mode 100644 index 0000000..26d2778 --- /dev/null +++ b/hw-ui/src/api/ems/powerUse/xiansunanalysis.js @@ -0,0 +1,28 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +import qs from 'qs'; +// 查询用户列表1 +export function listUser(data) { + return request({ + url: '/ems/report/analysis/lineLossAnalysisData', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} +// 查询部门下拉树结构 +export function treeDat() { + return request({ + url: '/ems/base/monitorInfo/treeData/2', + method: 'get' + }) +} +//report/analysis/lineLossAnalysisDetailsData +export function listUser2(data) { + return request({ + url: '/ems/report/analysis/lineLossAnalysisDetailsData', + method: 'post', + data: qs.stringify(data), + contentType:'application/x-www-form-urlencoded', + }) +} diff --git a/hw-ui/src/views/ems/base/HistoryElectricity/index.vue b/hw-ui/src/views/ems/base/HistoryElectricity/index.vue index b070475..b6439e3 100644 --- a/hw-ui/src/views/ems/base/HistoryElectricity/index.vue +++ b/hw-ui/src/views/ems/base/HistoryElectricity/index.vue @@ -5,25 +5,25 @@
@@ -33,86 +33,110 @@
-
- + + + + 搜索 - 重置 + 重置
删除 + + + 导出 - + - - - - - - - - - - - + + + + + + + + + + + + + + @@ -120,10 +144,11 @@