From a36faf95b4bee06626f33a82448f93e364b29ec5 Mon Sep 17 00:00:00 2001
From: tangxu <76880903@qq.com>
Date: 星期六, 08 十月 2022 10:55:01 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/IStation/Service.V4.1

---
 Application/IStation.Application.Monitor/monitor_point_mapping/MonitorPointMapping_Controller.cs |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/Application/IStation.Application.Monitor/monitor_point_mapping/MonitorPointMapping_Controller.cs b/Application/IStation.Application.Monitor/monitor_point_mapping/MonitorPointMapping_Controller.cs
index a9fcf8f..7bc7a4d 100644
--- a/Application/IStation.Application.Monitor/monitor_point_mapping/MonitorPointMapping_Controller.cs
+++ b/Application/IStation.Application.Monitor/monitor_point_mapping/MonitorPointMapping_Controller.cs
@@ -240,16 +240,21 @@
         [HttpPost]
         public bool SetOfObject([Required] SetObjectMonitorPointMappingInput input)
         {
-            var list = input.Items.Select(x => new Model.MonitorPointMapping()
+            var list = new List<Model.MonitorPointMapping>();
+            if (input.Items != null && input.Items.Count > 0)
             {
-                ID = x.ID,
-                CorpID = input.CorpID,
-                ObjectType = input.ObjectType,
-                ObjectID = input.ObjectID,
-                MonitorPointID=x.MonitorPointID,
-                SortCode = x.SortCode,
-                AccordParas = x.AccordParas
-            }).ToList();
+                list = input.Items.Select(x => new Model.MonitorPointMapping()
+                {
+                    ID = x.ID,
+                    CorpID = input.CorpID,
+                    ObjectType = input.ObjectType,
+                    ObjectID = input.ObjectID,
+                    MonitorPointID = x.MonitorPointID,
+                    SortCode = x.SortCode,
+                    AccordParas = x.AccordParas
+                }).ToList();
+            }
+
             var bol = _service.SetOfObject(input.CorpID, input.ObjectType, input.ObjectID, list);
             return bol;
         }
@@ -269,6 +274,18 @@
             return new DeleteReasonOutput() { Success = bol, Reason = Msg };
         }
 
+
+        /// <summary>
+        /// 鍒犻櫎
+        /// </summary>
+        [Route("DeleteByMonitorPointID@V1.0")]
+        [HttpDelete]
+        public DeleteReasonOutput DeleteByMonitorPointID([FromQuery][Required] MonitorPointIDUnderCorpInput input)
+        {
+            var bol = _service.DeleteByMonitorPointID(input.CorpID, input.MonitorPointID, out string Msg);
+            return new DeleteReasonOutput() { Success = bol, Reason = Msg };
+        }
+
         #endregion
 
     }

--
Gitblit v1.9.3