From ebd9f0bd44a76a0fba4f82f799b349cdab2b21ca Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 26 十二月 2023 14:52:26 +0800
Subject: [PATCH] fix: 修改监测值

---
 monitor/singlePoint/index.js |   24 +++++++++---
 map/index.js                 |   17 ++------
 monitor/station/index.js     |   55 +++++++++++++++------------
 project.private.config.json  |    8 ++--
 4 files changed, 58 insertions(+), 46 deletions(-)

diff --git a/map/index.js b/map/index.js
index 265129b..e6090b8 100644
--- a/map/index.js
+++ b/map/index.js
@@ -583,21 +583,14 @@
     })
     console.log(stationLastRecord,id,528)
     if(stationLastRecord.LastRecordList==null){
-
+      return
     }
-    if(stationLastRecord.LastRecordList!=null){
-        for (let j = 0; j < stationLastRecord.LastRecordList.length; j++) {
-          let record = stationLastRecord.LastRecordList[j];
-        console.log(record.DataValue,591)
-        }
-      }
     // console.log(markers,540)
     for (var i = 0; i < markers.length; i++) {
       console.log(markers[i].markerInfo,598)
-      if (markers[i].markerInfo.ObjectType == '娉电珯' && id == markers[i].StationID) {
-
+      if ( id == markers[i].StationID) {
         markerTipInfo = markers[i];
-        markerTipInfo.markerInfo.Records = Record
+        markerTipInfo.markerInfo.Records = stationLastRecord.LastRecordList
         that.setData({
           markerTipInfo: markerTipInfo
         })
@@ -605,8 +598,8 @@
       } else if (id == markers[i].id) {
         // console.log("ddd")
         markerTipInfo = markers[i];
-        //  console.log(markerTipInfo)
-        var ids = markerTipInfo.markerInfo.ObjectID
+         console.log(markerTipInfo)
+        var ids = markerTipInfo.markerInfo.StationID
         // console.log(ids,520)
         //console.log(markerTipInfo)
         that.refreshMonitorRecords(ids)
diff --git a/monitor/singlePoint/index.js b/monitor/singlePoint/index.js
index 4c79733..1469a28 100644
--- a/monitor/singlePoint/index.js
+++ b/monitor/singlePoint/index.js
@@ -514,17 +514,19 @@
   refreshRealAlarmRecord() {
     var that = this;
     var real_time_records = that.data.real_time_records
+    var real_data_time=real_time_records[real_time_records.length-1].DataTime
+    console.log(real_time_records,real_data_time,517)
     that.setData({
       loadingHidden: false,
       loadingInfo: "鍒锋柊涓�,璇风◢绛�..."
     });
     //console.log(that.data.pointID)
     Request({
-      url: Constant.BASE_SERVER_URL + "Run/MonitorAlarmRecord/Mobile/GetLastRecordListByMonitorPointID@V1.0",
+      url: Constant.BASE_SERVER_URL + "Monitor/Value/Alarm/Record/Std/GetBySignalIDOfTime@V1.0",
       method: 'GET',
       data: {
-        CorpID: Constant.CorpID,
-        MonitorPointID: that.data.pointID,
+        Time: real_data_time,
+        SignalID : that.data.pointID,
       },
       header: {
         'content-type': 'application/json'
@@ -1357,11 +1359,11 @@
     })
 
     Request({
-      url: Constant.BASE_SERVER_URL + "Run/MonitorAlarmRecord/Mobile/GetPageListByMonitorPointID@V1.1",
+      url: Constant.BASE_SERVER_URL + "Monitor/Value/Alarm/Record/Std/GetPageListBySignalID@V1.0",
       method: 'GET',
       data: {
-        CorpID: Constant.CorpID,
-        MonitorPointID: that.data.pointID,
+
+        SignalID : that.data.pointID,
         StartTime: that.data.startAlarmDate,
         EndTime: that.data.endAlarmDate,
         PageIndex: that.data.PageIndex,
@@ -1393,6 +1395,16 @@
           });
           return;
         }
+        if(res.data.Data.List==null)
+        {
+          wx.showToast({
+            title: '褰撳墠鏃犳姤璀︽暟鎹�',
+          });
+          that.setData({
+            hasAlarmData: false
+          });
+          return;
+        }
         if (res.data.Data.List.length == 0) {
           wx.showToast({
             title: '褰撳墠鏃ユ湡,娌℃湁鑾峰彇鍒扮洃鎺у��',
diff --git a/monitor/station/index.js b/monitor/station/index.js
index dcbf4a0..d44fcca 100644
--- a/monitor/station/index.js
+++ b/monitor/station/index.js
@@ -297,7 +297,7 @@
     var machineList = this.data.machineList;
     var userInfo = app.globalData.userInfo;
     Request({
-      url: Constant.BASE_SERVER_URL + 'Run/RunSpan/Mobile/GetByStationIDOfDay@V1.0',
+      url: Constant.BASE_SERVER_URL + 'SZJT/Run/Analy/Mobile/GetSpanListByStationIDOfDay@V1.0',
       method: 'GET',
       data: {
         StationID :that.data.stationID,
@@ -313,16 +313,23 @@
           return;
         }
         // 
-        var run_time_array = result.Data;
-        //
-         console.log('291琛�   ', that.data.historyDate + '鐨勫紑鍋滄満:', run_time_array);
-
-        for (var i = 0; i < machineList.length; i++) {
-          console.log()
-
+        var run_time_array = result.Data; 
+        //  console.log('291琛�   ', that.data.historyDate + '鐨勫紑鍋滄満:', run_time_array); 
+         run_time_array.forEach(item => { 
+          item.runTimeSum=0
+           item.ChunkList.forEach(chunkItem=>{
+            //  console.log(chunkItem,321)
+             if (chunkItem.RunStatus == 1) {
+               item.runTimeSum += chunkItem.Duration;              
+             }
+           })
+           
+         })
+        //  console.log(run_time_array,328)
+        for (var i = 0; i < machineList.length; i++) {         
           run_time_array.forEach(item => {
             if(machineList[i].TitleName == item.Name){
-              machineList[i].WorkTime = (item.RumTime / 60 / 60).toFixed(1)
+              machineList[i].WorkTime = (item.runTimeSum/ 60 / 60).toFixed(1)
             }
           });
         }
@@ -347,7 +354,7 @@
       var machineListNode = []
       records.forEach(item => {
         if(item.Name == machineList[i].MachineName){
-          machineListNode.push(item.Spans)
+          machineListNode.push(item.ChunkList)
         }
       });
         // console.log('machineListNode', machineListNode)
@@ -693,26 +700,16 @@
   getAlarmData: function () {
     var that = this;
     var alarmListInfo = that.data.alarmListInfo
-    var userInfo = app.globalData.userInfo;
     wx.showLoading({
       title: '鍔犺浇涓�...',
     })
-
-    let data = {
-      CorpID:Constant.CorpID,
-      StationID: that.data.stationID,
-      StartTime : that.data.startAlarmDate,
-      EndTime : that.data.endAlarmDate,
-      PageIndex: that.data.PageIndex,
-      PageSize: that.data.PageSize
-    }
-    // console.log(data,697)
+console.log(that.data.stationID,706)
     Request({
-      url: Constant.BASE_SERVER_URL + "Run/MonitorAlarmRecord/Mobile/GetPageListByStationID@V1.1",
+      url: Constant.BASE_SERVER_URL + "Monitor/Value/Alarm/Record/Std/GetPageListBySignalID@V1.0",
       method: 'GET',
       data: {
-        CorpID:Constant.CorpID,
-        StationID: that.data.stationID,
+      
+        SignalID : that.data.stationID,
         StartTime: that.data.startAlarmDate,
         EndTime: that.data.endAlarmDate,
         PageIndex: that.data.PageIndex,
@@ -745,6 +742,16 @@
           return;
         }
         let result = res.data.Data
+        if(result.List==null)
+        {
+          wx.showToast({
+            title: '褰撳墠鏃犳姤璀︽暟鎹�',
+          });
+          that.setData({
+            hasAlarmData: false
+          });
+          return;
+        }
         if (result.List.length == 0) {
           wx.showToast({
             title: '褰撳墠鏃犳姤璀︽暟鎹�',
diff --git a/project.private.config.json b/project.private.config.json
index a0e56fa..b211db8 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -11,15 +11,15 @@
       "list": [
         {
           "name": "",
-          "pathName": "monitor/station/index",
-          "query": "id=23&name=%E5%87%AF%E6%B3%89%E4%B8%80%E4%BD%93%E5%8C%96%E5%A2%9E%E5%8E%8B%E6%B3%B5%E7%AB%99",
+          "pathName": "map/index",
+          "query": "",
           "launchMode": "default",
           "scene": null
         },
         {
           "name": "",
-          "pathName": "station/list/index",
-          "query": "",
+          "pathName": "monitor/station/index",
+          "query": "id=23&name=%E5%87%AF%E6%B3%89%E4%B8%80%E4%BD%93%E5%8C%96%E5%A2%9E%E5%8E%8B%E6%B3%B5%E7%AB%99",
           "launchMode": "default",
           "scene": null
         }

--
Gitblit v1.9.3