diff --git a/ruoyi-admin/src/main/resources/templates/ems/pointElectricloss/pointElectricloss.html b/ruoyi-admin/src/main/resources/templates/ems/pointElectricloss/pointElectricloss.html index 7464aca..05ba67a 100644 --- a/ruoyi-admin/src/main/resources/templates/ems/pointElectricloss/pointElectricloss.html +++ b/ruoyi-admin/src/main/resources/templates/ems/pointElectricloss/pointElectricloss.html @@ -52,7 +52,7 @@
  • -  搜索 +  搜索  重置
  • @@ -119,10 +119,10 @@ function queryArchivesList() { var formData = new FormData(); formData.append("monitorId",$("#monitorId").val()); - /*formData.append("pMonitor",$("#pMonitor").val()); - formData.append("monitorType",2); - formData.append("beginTime",$("#startTime").val()); - formData.append("endTime",$("#endTime").val());*/ + formData.append("pMonitor",$("#pMonitor").val()); + /*formData.append("monitorType",2);*/ + formData.append("beginCollectTime",$("#startTime").val()); + formData.append("endCollectTime",$("#endTime").val()); $.ajax({ type: "post", url: prefix + "/jsonList", diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaEmsPointElectricloss.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaEmsPointElectricloss.java index 977ebed..9017d0c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaEmsPointElectricloss.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/ScadaEmsPointElectricloss.java @@ -66,6 +66,10 @@ public class ScadaEmsPointElectricloss extends BaseEntity @Excel(name = "整点") private Long pointNumber; + private Date beginCollectTime; + + private Date endCollectTime; + public void setUuid(String uuid) { this.uuid = uuid; @@ -156,6 +160,22 @@ public class ScadaEmsPointElectricloss extends BaseEntity this.pMonitorId = pMonitorId; } + public Date getBeginCollectTime() { + return beginCollectTime; + } + + public void setBeginCollectTime(Date beginCollectTime) { + this.beginCollectTime = beginCollectTime; + } + + public Date getEndCollectTime() { + return endCollectTime; + } + + public void setEndCollectTime(Date endCollectTime) { + this.endCollectTime = endCollectTime; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaEmsPointElectriclossServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaEmsPointElectriclossServiceImpl.java index 3206192..140b152 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaEmsPointElectriclossServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScadaEmsPointElectriclossServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service.impl; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -55,6 +56,24 @@ public class ScadaEmsPointElectriclossServiceImpl implements IScadaEmsPointElect */ @Override public String selectPointElectriclossJson(ScadaEmsPointElectricloss scadaEmsPointElectricloss){ + + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Calendar cal = Calendar.getInstance(); + cal.setTime(new Date()); + cal.add(Calendar.DATE,-20); + + if(scadaEmsPointElectricloss.getBeginCollectTime() == null){ + scadaEmsPointElectricloss.setBeginCollectTime(cal.getTime()); + } + if(scadaEmsPointElectricloss.getEndCollectTime() == null){ + scadaEmsPointElectricloss.setEndCollectTime(new Date()); + } + + Map collectTimeMap = new HashMap<>(); + collectTimeMap.put("beginCollectTime",scadaEmsPointElectricloss.getBeginCollectTime()); + collectTimeMap.put("endCollectTime",scadaEmsPointElectricloss.getEndCollectTime()); + scadaEmsPointElectricloss.setParams(collectTimeMap); + List list = scadaEmsPointElectriclossMapper.selectScadaEmsPointElectriclossList(scadaEmsPointElectricloss); List monitorInfoList = new ArrayList<>(); List recordDateList = new ArrayList<>(); diff --git a/ruoyi-system/src/main/resources/mapper/system/ScadaEmsPointElectriclossMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ScadaEmsPointElectriclossMapper.xml index 987e5fe..6530f75 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ScadaEmsPointElectriclossMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ScadaEmsPointElectriclossMapper.xml @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and t1.monitor_id = #{monitorId} and t2.p_monitor_id = #{pMonitorId} - and t1.collect_time between #{params.beginCollectTime} and #{params.endCollectTime} + and t1.collect_time between #{params.beginCollectTime} and #{params.endCollectTime} and t1.record_date = #{recordDate} and t1.point_number = #{pointNumber}