Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
303c47599a

+ 15 - 16
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -277,14 +277,17 @@ namespace UAS_MES.Make
                             }
                             }
                             break;
                             break;
                         case "S":
                         case "S":
-                            sql.Clear();
-                            sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                            sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count == 0)
+                            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                             {
                             {
-                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
-                                return;
+                                sql.Clear();
+                                sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                                sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows.Count == 0)
+                                {
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                    return;
+                                }
                             }
                             }
                             break;
                             break;
                         case "":
                         case "":
@@ -411,17 +414,13 @@ namespace UAS_MES.Make
 
 
         private void Packing_Click(object sender, EventArgs e)
         private void Packing_Click(object sender, EventArgs e)
         {
         {
-            if (float.Parse(weight.Text) > MinWeight && int.Parse(weight.Text) < MaxWeight)
+            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_status<>1"))
             {
             {
-                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_status<>1"))
-                {
-                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    pa_status.Text = "1";
-                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
-                }
-                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
+                dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                pa_status.Text = "1";
+                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
             }
             }
-            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量,不允许封箱\n", Color.Red);
+            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
         }
         }
 
 
         private void SendCheck_Click(object sender, EventArgs e)
         private void SendCheck_Click(object sender, EventArgs e)

+ 39 - 28
UAS_MesInterface/MESHelper.cs

@@ -12,7 +12,7 @@ namespace BenQGuru.eMES.DLLService
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     public interface IMESHelper
     public interface IMESHelper
     {
     {
-        [DispId(10)]
+        [DispId(12)]
         bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
         bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
         bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
         bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
         bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
         bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
@@ -38,9 +38,9 @@ namespace BenQGuru.eMES.DLLService
         //用于存放批量执行的SQL
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Password=select!#%*(;User ID=MES_TEST;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
         //用户选择的数据库的连接字符串
-        private OracleConnection connection = new OracleConnection("Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));");
+        private OracleConnection connection = new OracleConnection("Password=select!#%*(;User ID=MES_TEST;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));");
         //用户选择的数据库的连接字符串
         //用户选择的数据库的连接字符串
         private OracleCommand command = null;
         private OracleCommand command = null;
 
 
@@ -425,8 +425,8 @@ namespace BenQGuru.eMES.DLLService
                     if (ms_status == "3")
                     if (ms_status == "3")
                     {
                     {
                         string nextstepcode = getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid ", "cd_nextstepcode", "cr_code='" + ms_craftcode + "' and cr_prodcode='" + ms_prodcode + "' and cd_stepcode='" + CurrentStep + "'").ToString();
                         string nextstepcode = getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid ", "cd_nextstepcode", "cr_code='" + ms_craftcode + "' and cr_prodcode='" + ms_prodcode + "' and cd_stepcode='" + CurrentStep + "'").ToString();
-                        UpdateByCondition("makeserial", "ms_status=1,ms_nextstepcode='" + nextstepcode + "'", "ms_sncode='" + iSN + "' and ms_makecode='"+iMakeCode+"'");
-                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='"+iMakeCode+"'");
+                        UpdateByCondition("makeserial", "ms_status=1,ms_nextstepcode='" + nextstepcode + "'", "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "'");
                     }
                     }
                 }
                 }
             }
             }
@@ -446,9 +446,14 @@ namespace BenQGuru.eMES.DLLService
         /// <returns></returns>
         /// <returns></returns>
         public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage)
         public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage)
         {
         {
-            string omakecode = "";
-            GetRcardMOInfo(iSN, out omakecode, out oErrorMessage);
-            return SetStepFinish(omakecode, iSourceCode, iSN, iMPKind, iResult, "", iErrCode, out oErrorMessage);
+            oErrorMessage = "";
+            string[] param = new string[] { iTSN, iSN, iSourceCode, "", iResult, iErrCode, oErrorMessage };
+            CallProcedure("CS_DLLSNCHANGE", ref param);
+            oErrorMessage = param[6];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
         }
         }
 
 
         private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
         private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
@@ -525,6 +530,31 @@ namespace BenQGuru.eMES.DLLService
                 return false;
                 return false;
         }
         }
 
 
+        public bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage)
+        {
+            oErrMessage = "";
+            string omakecode = "";
+            string[] param = new string[] { "", iResCode, iSN, "", omakecode, "", oErrMessage };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
+            oErrMessage = param[6];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return SetStepFinish(omakecode, iResCode, iSN, iOperator, iResult, "", iErrCode, out oErrMessage);
+            else
+                return false;
+        }
+
+        public bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage)
+        {
+            oErrMessage = "";
+            string[] param = new string[] { iMO, iResCode, iSN, "", "", "", oErrMessage };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
+            oErrMessage = param[6];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
         /// <summary>
         /// <summary>
         /// 获取执行步骤代码,名称和线别
         /// 获取执行步骤代码,名称和线别
         /// </summary>
         /// </summary>
@@ -905,24 +935,5 @@ namespace BenQGuru.eMES.DLLService
                 cmd.Connection.Open();
                 cmd.Connection.Open();
             }
             }
         }
         }
-
-        public bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage)
-        {
-            oErrMessage = "";
-            //SetMobileData();
-            return true;
-        }
-
-        public bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage)
-        {
-            oErrMessage = "";
-            string[] param = new string[] { iMO, iResCode, iSN, "", "", "", oErrMessage };
-            CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
-            oErrMessage = param[6];
-            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
-                return true;
-            else
-                return false;
-        }
     }
     }
-}
+}

+ 2 - 2
UAS_MesInterface/UAS_MesDllService.csproj

@@ -7,8 +7,8 @@
     <ProjectGuid>{0516B4B2-6F50-4495-8785-3B813570682B}</ProjectGuid>
     <ProjectGuid>{0516B4B2-6F50-4495-8785-3B813570682B}</ProjectGuid>
     <OutputType>Library</OutputType>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>DllService</RootNamespace>
-    <AssemblyName>DllService</AssemblyName>
+    <RootNamespace>BenQGuru.eMES.DLLService</RootNamespace>
+    <AssemblyName>BenQGuru.eMES.DLLService</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
     <TargetFrameworkProfile />