Selaa lähdekoodia

修复连续测试时,NTF类未实时读取LastSN的问题。

sat23 3 vuotta sitten
vanhempi
commit
86cbf1b320
1 muutettua tiedostoa jossa 2 lisäystä ja 75 poistoa
  1. 2 75
      BLL/NTFBLL.cs

+ 2 - 75
BLL/NTFBLL.cs

@@ -19,7 +19,6 @@ namespace MOKA_Factory_Tools.BLL
         /// 订单类型:0=试产订单、1=量产订单;
         /// </summary>
         public static int nCurOrderType;
-        private static string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");
         // 连续测试中累计失败的次数
         private static int nSNCount = Convert.ToInt32(CommonMethod.ReadProfileString("MOKAFactoryTools", "GFailCount", "0"));
         protected readonly DAL_AMResult dalAMResult = new DAL_AMResult();
@@ -65,8 +64,6 @@ namespace MOKA_Factory_Tools.BLL
                     aMResult.SN = strSN;
                     #endregion
 
-                    Log.WriteInfoLog(string.Format("上一次SN={0},当前SN={1}", strLastSN, aMResult.SN));
-
                     if (IsRecordExist(aMResult))
                     {
                         if (!UpdateAMResults(aMResult, bResult, strErrMsg))
@@ -113,8 +110,6 @@ namespace MOKA_Factory_Tools.BLL
                     aMResult.SN = strSN;
                     #endregion
 
-                    Log.WriteInfoLog(string.Format("上一次SN={0},当前SN={1}", strLastSN, aMResult.SN));
-
                     if (IsRecordExist(aMResult))
                     {
                         if (!UpdateAMResults(aMResult, bResult, strErrMsg))
@@ -151,52 +146,6 @@ namespace MOKA_Factory_Tools.BLL
             return dalAMResult.Exists(string.Format("Station='{0}' and SN='{1}'", model.Station, model.SN));
         }
 
-        /// <summary>
-        /// 查询记录是否存在,不存在返回0,存在且没有累计2次出现fail返回1否则返回2;
-        /// 返回2的,不允许再测试;
-        /// </summary>
-        /// <param name="model"></param>
-        /// <returns></returns>
-        public int IsRecordExist2(AMResult model)
-        {
-            if (!dalAMResult.Exists(string.Format("Station='{0}' and SN='{1}'", model.Station, model.SN)))
-                return 0;
-
-            // 上次失败SN;
-            string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");
-            // 连续测试中累计失败的次数;
-            int nSNCount = Convert.ToInt32(CommonMethod.ReadProfileString("MOKAFactoryTools", "GFailCount", "0"));
-            if (strLastSN.Equals(model.SN, StringComparison.OrdinalIgnoreCase))
-            {
-                #region 5种累计出现2次fail的,不允许再测试;
-                if (model.Test01.ToLower() == "fail" && model.Test02.ToLower() == "fail" && model.FinalTest.ToLower() == "fail" && nSNCount == 2)
-                    return 2;
-
-                // 失败3次以上;
-                if (nSNCount > 2)
-                {
-                    if (model.Test01.ToLower() == "pass" && model.Test02.ToLower() == "fail" && model.FinalTest.ToLower() == "fail")
-                        return 2;
-
-                    if (model.Test01.ToLower() == "fail" && model.Test02.ToLower() == "pass" && model.FinalTest.ToLower() == "fail")
-                        return 2;
-
-                    if (model.Test01.ToLower() == "fail" && model.Test02.ToLower() == "fail" && model.FinalTest.ToLower() == "pass")
-                        return 2;
-
-                    if (model.Test01.ToLower() == "fail" && model.Test02.ToLower() == "fail" && model.FinalTest.ToLower() == "fail")
-                        return 2;
-                }
-                #endregion
-            }
-            else
-            {
-                // 重流SN,当新机处理;
-            }
-
-            return 1;
-        }
-
         /// <summary>
         /// 新增记录;
         /// </summary>
@@ -217,6 +166,7 @@ namespace MOKA_Factory_Tools.BLL
         public bool UpdateAMResults(AMResult model, bool TestResult, string strErrMsg)
         {
             // 先获取ReDo="0"的记录;
+            string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");
             AMResult redo0Model = dalAMResult.GetModel(string.Format("Station='{0}' and SN='{1}' and ReDo='{2}'", model.Station, model.SN, "0"));
             if (strLastSN == model.SN)
             {// 连续抄写数据,更新ReDo="0"的记录;
@@ -426,30 +376,6 @@ namespace MOKA_Factory_Tools.BLL
             return dalAMResultTR.Exists(string.Format("Station='{0}' and SN='{1}'", model.Station, model.SN));
         }
 
-        public int IsRecordExist2(AMResult_TR model)
-        {
-            if (!dalAMResult.Exists(string.Format("Station='{0}' and SN='{1}'", model.Station, model.SN)))
-                return 0;
-
-            #region 需要连续2次pass才能上传AMTest,提示操作员再测试一次;
-            if (model.Test01.ToLower() == "fail" && model.Test02.ToLower() == "pass" && model.Test03.ToLower() == "null" && model.FinalTest.ToLower() == "fail")
-                return 3;
-
-            if (model.Test01.ToLower() == "pass" && model.Test02.ToLower() == "fail" && model.Test03.ToLower() == "pass" && model.FinalTest.ToLower() == "pass")
-                return 3;
-            #endregion
-
-            #region 累计出现2次fail的,不允许再测试;
-            if (model.Test01.ToLower() == "pass" && model.Test02.ToLower() == "fail" && model.Test03.ToLower() == "fail" && model.FinalTest.ToLower() == "fail")
-                return 2;
-
-            if (model.Test01.ToLower() == "fail" && model.Test02.ToLower() == "fail" && model.Test03.ToLower() == "null" && model.FinalTest.ToLower() == "fail")
-                return 2;
-            #endregion
-
-            return 1;
-        }
-
         /// <summary>
         /// 新增记录;
         /// </summary>
@@ -471,6 +397,7 @@ namespace MOKA_Factory_Tools.BLL
         public bool UpdateAMResults(AMResult_TR model, bool TestResult, string strErrMsg)
         {
             // 先获取ReDo="0"的记录;
+            string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");
             AMResult_TR redo0Model = dalAMResultTR.GetModel(string.Format("Station='{0}' and SN='{1}' and ReDo='{2}'", model.Station, model.SN, "0"));
             if (strLastSN == model.SN)
             {// 连接抄写数据,更新ReDo="0"的记录;