callm 5 жил өмнө
parent
commit
3b677d5cec

+ 17 - 2
UAS_MES_MAXMADE/PublicMethod/LogicHandler.cs

@@ -1,11 +1,13 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Drawing;
 using System.Text;
 using System.Windows;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicForm;
 
 namespace UAS_MES_NEW.PublicMethod
 {
@@ -691,7 +693,20 @@ namespace UAS_MES_NEW.PublicMethod
 
         public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
-            return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
+            bool result = CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
+            if (result)
+            {
+                SetCheck set = new SetCheck("NG", Color.Green);
+                BaseUtil.SetFormCenter(set);
+                set.ShowDialog();
+            }
+            else
+            {
+                SetCheck set = new SetCheck("NG", Color.Red);
+                BaseUtil.SetFormCenter(set);
+                set.ShowDialog();
+            }
+            return result;
         }
 
         public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
@@ -776,7 +791,7 @@ namespace UAS_MES_NEW.PublicMethod
                 string ifng = dh.getFieldDataByCondition("oqcbatchdetail", "obd_ifng", "obd_sncode='" + iSnCode + "'").ToString();
                 if (ifng == "-1")
                 {
-                    dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + iSnCode + "'","select");
+                    dh.ExecuteSql("delete OQCITEMSAMPLES where ois_sncode = '" + iSnCode + "'", "select");
                     dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1,ob_ngqty =  ob_ngqty -1 where ob_checkno='" + checkno + "'", "update");
                 }
                 dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");

+ 27 - 1
UAS_MesInterface(ODLF)/MesHelper.cs

@@ -88,7 +88,8 @@ namespace UMES.DLLService
             string stepcode = GetStepCodeBySource(iResCode);
             if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
             {
-                oErrMessage = "当前序列号下一工序" + ms_nextstepcode;
+                string step = GetStepName(ms_nextstepcode);
+                oErrMessage = "当前序列号下一工序" + step;
                 return false;
             }
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && stepcode == ms_stepcode))
@@ -353,6 +354,21 @@ namespace UMES.DLLService
                 oErrMessage = "SN不能为空";
                 return false;
             }
+            Dictionary<string, string> MacInfo = new Dictionary<string, string>();
+            if (!GetAddressRangeByMO(iSN, out MacInfo, out oErrMessage))
+            {
+                if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                    return true;
+                else
+                    return false;
+            }
+            if (!SetAddressInfo(iSN, MacInfo["MAC"] == "null" ? "" : MacInfo["MAC"], MacInfo["BT"] == "null" ? "" : MacInfo["BT"], MacInfo["Code1"]=="null"?"": MacInfo["Code1"], MacInfo["Code2"] == "null" ? "" : MacInfo["Code2"], MacInfo["Code3"] == "null" ? "" : MacInfo["Code3"], out oErrMessage))
+            {
+                if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                    return true;
+                else
+                    return false;
+            }
             //通过序列号获取最近操作的工单号
             string ms_id = getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + iSN + "'").ToString();
             if (ms_id != "")
@@ -782,6 +798,16 @@ namespace UMES.DLLService
             return getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
         }
 
+        /// <summary>
+        /// 获取步骤代码
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <returns></returns>
+        private string GetStepName(string st_code)
+        {
+            return getFieldDataByCondition("step", "st_name", "st_code='" + st_code + "'").ToString();
+        }
+
         /// <summary>
         /// 获取第一行第一列的信息
         /// </summary>