From dfbe7cb2992df2d4195b12026d1f9e0a7423460e Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周三, 11 9月 2024 18:48:13 +0800 Subject: [PATCH] 增加 JiaJuGongWei --- DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 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 57497b6..5117e74 100644 --- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs +++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/Utils/SystemBussinessHelper.cs @@ -17,6 +17,48 @@ { /// <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> -- Gitblit v1.9.3