From 2b05362eba2f989b7857349cc9a3a1c12f8181b6 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周五, 26 9月 2025 11:35:50 +0800
Subject: [PATCH] 222

---
 DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs |  137 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 137 insertions(+), 0 deletions(-)

diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs
index 87ff0d4..5117e74 100644
--- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs
+++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs
@@ -3,8 +3,10 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
 using System.Text;
 using System.Threading.Tasks;
+using System.Web.UI.WebControls;
 
 namespace iWare_SCADA_BusinessLogical.Utils
 {
@@ -13,6 +15,141 @@
     /// </summary>
     public class SystemBussinessHelper
     {
+
+        /// <summary>
+        /// 鑾峰彇澶瑰叿宸ヤ綅
+        /// </summary>
+        /// <param name="str"></param>
+        /// <param name="workingProcedure"></param>
+        /// <returns></returns>
+        public static string GetJiaJuGongWei(string str, string workingProcedure)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(str))
+                {
+                    return "";
+                }
+
+                if (workingProcedure == "OP20")
+                {
+                    if (str.Length == "OP2002C2".Length)
+                    {
+                        int length = str.Length;
+                        string lastTwoCharacters = str.Substring(length - 2, 2);
+                        return lastTwoCharacters;
+                    }
+                }
+                else if (workingProcedure == "OP50")
+                {
+                    if (str.Length == "OP5001A3".Length)
+                    {
+                        int length = str.Length;
+                        string lastTwoCharacters = str.Substring(length - 2, 2);
+                        return lastTwoCharacters;
+                    }
+                }
+            }
+            catch (Exception)
+            {
+                return "";
+            }
+            return "";
+        }
+
+
+        /// <summary>
+        /// 妯℃嫙鏃堕棿锛堣繑鍥炵锛�
+        /// </summary>
+        /// <param name="workingProcedure"></param>
+        /// <returns></returns>
+        public static int MoNiTimeForWorkingProcedure(string workingProcedure)
+        {
+            switch (workingProcedure)
+            {
+                case "OP10":
+                case "OP40":
+                    return 4;
+                case "OP20":
+                    return 2 * 60;
+                case "OP30":
+                    return 2 * 60;
+                case "OP35":
+                    return 1 * 60;
+                case "OP50":
+                    return 3 * 60;
+                case "OP60":
+                    return 4 * 60;
+                case "OP70":
+                    return 9 * 60;//9鍒嗛挓
+                default:
+                    return 1 * 60;
+            }
+        }
+
+        /// <summary>
+        /// 鏍¢獙璇诲彇鐨勪簩缁寸爜鏄惁姝g‘
+        /// </summary>
+        /// <param name="workPieceID"></param>
+        /// <returns></returns>
+        public static bool ValidateIsRightWorkPieceID(string workPieceID)
+        {
+            if (string.IsNullOrEmpty(workPieceID))
+            {
+                return false;
+            }
+            if (workPieceID.Length == 22)
+            {
+                var n_workPieceID = workPieceID.Trim();
+                if (n_workPieceID.Length == 22)
+                {
+                    if (n_workPieceID.ToUpper().IndexOf("ERROR") > -1)
+                    {
+                        return false;
+                    }
+                    if (n_workPieceID.ToUpper().IndexOf("ERR") > -1)
+                    {
+                        return false;
+                    }
+                    if (n_workPieceID.ToUpper().IndexOf('\0') > -1)
+                    {
+                        return false;
+                    }
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 璁剧疆 WorkPieceInfo 鐨凞ataCapturePointCname
+        /// </summary>
+        /// <param name="workPieceLog"></param>
+        /// <param name="_DataCapturePointCode"></param>
+        /// <param name="_DataCapturePointName"></param>
+        public static void SetWorkPieceInfoMiddleForCreatedUserName(ref WorkPieceInfo workPiece, string _DataCapturePointName)
+        {
+            workPiece.DataCapturePointCname = _DataCapturePointName;
+        }
+
+        /// <summary>
+        /// 璁剧疆 WorkPieceInfo 鐨刄pdateDataCapturePointCname
+        /// </summary>
+        /// <param name="workPieceLog"></param>
+        /// <param name="_DataCapturePointCode"></param>
+        /// <param name="_DataCapturePointName"></param>
+        public static void SetWorkPieceInfoMiddleForUpdateDataCapturePointCname(ref WorkPieceInfo workPiece, string _DataCapturePointName)
+        {
+            workPiece.UpdateDataCapturePointCname = _DataCapturePointName;
+        }
+
         /// <summary>
         /// 璁剧疆WorkPieceLog 鐨勫垱寤轰汉
         /// </summary>

--
Gitblit v1.9.3