فهرست منبع

优化限制逻辑

callm 2 هفته پیش
والد
کامیت
2aa0afe81b
2فایلهای تغییر یافته به همراه13 افزوده شده و 5 حذف شده
  1. 4 0
      UAS_MES_YDCY/.workbuddy/memory/2026-11-11.md
  2. 9 5
      UAS_MES_YDCY/PublicMethod/LogicHandler.cs

+ 4 - 0
UAS_MES_YDCY/.workbuddy/memory/2026-11-11.md

@@ -14,3 +14,7 @@
 - `PostEisHelper` 已改:`ContentType = "multipart/form-data; boundary=..."`,body 为 `--boundary / Content-Disposition: form-data; name="data" / 空行 / JSON / --boundary--`;5 个鉴权 Header 不变。
 - `PostEisHelper` 已改:`ContentType = "multipart/form-data; boundary=..."`,body 为 `--boundary / Content-Disposition: form-data; name="data" / 空行 / JSON / --boundary--`;5 个鉴权 Header 不变。
 - catch 拆出 `WebException`:500 等非 200 时读取 `wex.Response` 流,把服务端返回报文拼进错误信息,便于排查。
 - catch 拆出 `WebException`:500 等非 200 时读取 `wex.Response` 流,把服务端返回报文拼进错误信息,便于排查。
 - 签名算法仍未确认(MD5(Accesskey+AccessSecret+Timestamp) 占位),接口这次 500 是请求格式问题不是签名问题。
 - 签名算法仍未确认(MD5(Accesskey+AccessSecret+Timestamp) 占位),接口这次 500 是请求格式问题不是签名问题。
+
+## CheckMDMRegistrationLog 触发条件扩展
+- 触发调接口的条件改为二选一:SN 在 `MDMREGISTRATIONLOG.MRL_SNCODE` 中,**或** `makeserial.ms_stepcode='Z_MDMRegistration'`(按 ms_sncode 查)。
+- 两个 count(1) 分别查,都不命中才免检直接 true;命中任一走 CheckMDMRegistration。6 个界面无需改动。

+ 9 - 5
UAS_MES_YDCY/PublicMethod/LogicHandler.cs

@@ -200,7 +200,7 @@ namespace UAS_MES_NEW.PublicMethod
         /// </summary>
         /// </summary>
         public static void RecordLogInfo(string iUserCode, string iUserName, string iVersion, string iType, string iIP)
         public static void RecordLogInfo(string iUserCode, string iUserName, string iVersion, string iType, string iIP)
         {
         {
-            dh.ExecuteSql("insert into LogInfo(id,sip,usname,indate,uscode,versioncode,terminaltype,machine) values (LogInfo_seq.nextval,'" + iIP + "','" + iUserName + "',sysdate,'" + iUserCode + "','" + iVersion + "','" + iType + "','"+Environment.MachineName+"')", "insert");
+            dh.ExecuteSql("insert into LogInfo(id,sip,usname,indate,uscode,versioncode,terminaltype,machine) values (LogInfo_seq.nextval,'" + iIP + "','" + iUserName + "',sysdate,'" + iUserCode + "','" + iVersion + "','" + iType + "','" + Environment.MachineName + "')", "insert");
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -2297,14 +2297,18 @@ namespace UAS_MES_NEW.PublicMethod
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// MDM 注册前置校验:SN 存在于 MDMREGISTRATIONLOG 表 MRL_SNCODE 字段中时,才调用 CheckMDMRegistration 接口校验
-        /// 未登记或接口校验通过返回 true;接口校验不通过返回 false 并给出接口实际错误信息
+        /// MDM 注册前置校验:SN 存在于 MDMREGISTRATIONLOG 表 MRL_SNCODE 字段中,
+        /// 或 makeserial 表 ms_stepcode 为 Z_MDMRegistration 时,调用 CheckMDMRegistration 接口校验
+        /// 两种情况都不满足或接口校验通过返回 true;接口校验不通过返回 false 并给出接口实际错误信息
         /// </summary>
         /// </summary>
         public static bool CheckMDMRegistrationLog(string iSN, string iMakeCode, out string oErrorMessage)
         public static bool CheckMDMRegistrationLog(string iSN, string iMakeCode, out string oErrorMessage)
         {
         {
             oErrorMessage = "";
             oErrorMessage = "";
-            //SN 不在 MDMREGISTRATIONLOG 中登记,无需调接口校验
-            if (dh.getFieldDataByCondition("MDMREGISTRATIONLOG", "count(1)", "MRL_SNCODE='" + iSN + "'").ToString() == "0")
+            //SN 在 MDMREGISTRATIONLOG 中登记过
+            bool inLog = dh.getFieldDataByCondition("MDMREGISTRATIONLOG", "count(1)", "MRL_SNCODE='" + iSN + "'").ToString() != "0";
+            //SN 当前处于 MDM 注册工序
+            bool inStep = dh.getFieldDataByCondition("makeserial", "count(1)", "ms_stepcode='Z_MDMRegistration' and ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'").ToString() != "0";
+            if (!inLog && !inStep)
             {
             {
                 return true;
                 return true;
             }
             }