From ece80c5d44458eb482467ffafdff68fbc1e6dc94 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 25 12月 2024 09:50:01 +0800
Subject: [PATCH] 接口 多 并发模式

---
 CC/iWareCC_ASRS/WCF/CCWcfService.cs |   86 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/CC/iWareCC_ASRS/WCF/CCWcfService.cs b/CC/iWareCC_ASRS/WCF/CCWcfService.cs
index a67adc4..3ee62ad 100644
--- a/CC/iWareCC_ASRS/WCF/CCWcfService.cs
+++ b/CC/iWareCC_ASRS/WCF/CCWcfService.cs
@@ -23,6 +23,7 @@
 namespace iWareCC.WCF
 {
     // 娉ㄦ剰: 浣跨敤鈥滈噸鏋勨�濊彍鍗曚笂鐨勨�滈噸鍛藉悕鈥濆懡浠わ紝鍙互鍚屾椂鏇存敼浠g爜鍜岄厤缃枃浠朵腑鐨勭被鍚嶁�淐CWcfService鈥濄��
+    [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
     public class CCWcfService : ICCWcfService
     {
 
@@ -61,6 +62,91 @@
         }
 
 
+        /// <summary>
+        /// 楠岃瘉妯″紡
+        /// </summary>
+        /// <param name="flag"></param>
+        /// <returns></returns>
+        public FunRetEntity ValidateMode(int flag)
+        {
+            try
+            {
+                var rgvLocation = StationLocationEnum.BZ39.ToString();
+                var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
+                if (flag == 1)
+                {//瑕佸己鍒跺嚭搴�
+                    if (obj.R_ForceOutboundMode == false)
+                    {
+                        return FunRetEntity.Fail("PLC涓嶆槸寮哄埗鍑哄簱妯″紡");
+                    }
+                }
+                else
+                {
+                    if (obj.R_OutboundMode == false)
+                    {
+                        return FunRetEntity.Fail("PLC涓嶆槸鍑哄簱妯″紡");
+                    }
+                }
+                return FunRetEntity.Success("鎴愬姛", "");
+            }
+            catch (Exception ex)
+            {
+                return FunRetEntity.Fail("寮傚父:" + ex.Message);
+            }
+        }
+
+
+        /// <summary>
+        /// 鎵爜璁板綍娓呴櫎
+        /// </summary>
+        /// <returns></returns>
+        public FunRetEntity WriteStation_PartClear()
+        {
+            try
+            {
+                using (StationServiceClient client = new StationServiceClient())
+                {
+                    var res = client.PartClear((int)EDevice.Station, true, StationLocationEnum.棣栨鎵爜宸ヤ綅.ToString());
+                    if (!res.result)
+                    {
+                        return FunRetEntity.Fail(res.resMsg);
+                    }
+                }
+
+                return FunRetEntity.Success("鎴愬姛", "");
+            }
+            catch (Exception ex)
+            {
+                return FunRetEntity.Fail("寮傚父:" + ex.Message);
+            }
+        }
+
+
+        /// <summary>
+        /// 涓嬬嚎鏀捐鏂瑰悜
+        /// </summary>
+        /// <param name="iscomplete"></param>
+        /// <returns></returns>
+        public FunRetEntity WriteQiTaoInfo(bool iscomplete)
+        {
+            try
+            {
+                using (StationServiceClient client = new StationServiceClient())
+                {
+                    var res = client.WriteQiTaoInfo((int)EDevice.Station, StationLocationEnum.BZ30.ToString(), iscomplete);
+                    if (!res.result)
+                    {
+                        return FunRetEntity.Fail(res.resMsg);
+                    }
+                }
+
+                return FunRetEntity.Success("鎴愬姛", "");
+            }
+            catch (Exception ex)
+            {
+                return FunRetEntity.Fail("寮傚父:" + ex.Message);
+            }
+        }
 
     }
 }

--
Gitblit v1.9.3