Ver Fonte

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

Hcsy há 8 anos atrás
pai
commit
008336bfad

+ 0 - 2
.gitignore

@@ -6,7 +6,6 @@
 *.user
 *.userosscache
 *.sln.docstates
-*.csproj
 
 # User-specific files (MonoDevelop/Xamarin Studio)
 *.userprefs
@@ -22,7 +21,6 @@ build/
 bld/
 [Bb]in/
 [Oo]bj/
-/UAS-MES/UAS-MES.csproj
 
 # Visual Studio 2015 cache/options directory
 .vs/

+ 9 - 9
UAS-MES/DataOperate/DataHelper.cs

@@ -61,7 +61,6 @@ namespace UAS_MES.DataOperate
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
-            Console.WriteLine(sql);
             try
             {
                 ad.Fill(dt);
@@ -256,7 +255,7 @@ namespace UAS_MES.DataOperate
             string sql = "select ";
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition;
-
+            
             command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
@@ -480,7 +479,7 @@ namespace UAS_MES.DataOperate
         {
             string sql = "select count(1) from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
-            Console.WriteLine(sql);
+            
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             DataTable dt = new DataTable();
@@ -514,7 +513,7 @@ namespace UAS_MES.DataOperate
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ',')
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
                         {
                             addpar[i].Append(c[j]);
                         }
@@ -527,7 +526,7 @@ namespace UAS_MES.DataOperate
                 for (int i = 0; i < addpar.Length; i++)
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
-            Console.WriteLine(SQL);
+            
             switch (Type.ToUpper())
             {
                 case "SELECT":
@@ -681,10 +680,10 @@ namespace UAS_MES.DataOperate
         /// </summary>
         /// <param name="SeqName"></param>
         /// <returns></returns>
-        public string[] GetSEQ(string SeqName,string TableName, int Num)
+        public string[] GetSEQ(string SeqName, string TableName, int Num)
         {
             DataTable dt = new DataTable();
-            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from "+ TableName + " where rownum<" + (Num + 1) + ")", "select");
+            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from " + TableName + " where rownum<" + (Num + 1) + ")", "select");
             string[] SerialNum = new string[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {
@@ -802,7 +801,7 @@ namespace UAS_MES.DataOperate
             command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ArrayBindCount = names[1].Length;
-            Console.WriteLine(sql);
+            
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
             //将第一个数组的下标固定为0作为循环添加的参数的名称
             for (int i = 1; i <= names[0].Length; i++)
@@ -912,7 +911,7 @@ namespace UAS_MES.DataOperate
         {
             string sql = "update " + TableName + " set " + update + " where " + condition;
             command = new OracleCommand(sql, connection);
-            Console.WriteLine(sql);
+            
             Reconnect(command);
             try
             {
@@ -971,6 +970,7 @@ namespace UAS_MES.DataOperate
             {
                 foreach (string sql in SQL)
                 {
+                    
                     if (!String.IsNullOrEmpty(sql))
                     {
                         command.CommandText = sql;

+ 4 - 3
UAS-MES/FunctionCode/Make/Make_NewBigBox.Designer.cs

@@ -28,7 +28,7 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewPallet));
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewBigBox));
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pa_packageqty_label = new System.Windows.Forms.Label();
             this.pa_outboxcode_label = new System.Windows.Forms.Label();
@@ -94,6 +94,7 @@
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
             this.pa_outboxcode.ProdCode = null;
+            this.pa_outboxcode.ShowClickIcon = true;
             this.pa_outboxcode.Size = new System.Drawing.Size(235, 26);
             this.pa_outboxcode.TabIndex = 10;
             this.pa_outboxcode.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode.OnTextChange(this.pa_outboxcode_UserControlTextChanged);
@@ -165,7 +166,7 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // Make_NewPallet
+            // Make_NewBigBox
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -181,7 +182,7 @@
             this.Controls.Add(this.pr_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "Make_NewPallet";
+            this.Name = "Make_NewBigBox";
             this.Tag = "ShowDialogWindow";
             this.Text = "新增栈板";
             this.Load += new System.EventHandler(this.新增栈板_Load);

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_NewPallet.Designer.cs

@@ -81,6 +81,7 @@
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
             this.pa_outboxcode.ProdCode = null;
+            this.pa_outboxcode.ShowClickIcon = true;
             this.pa_outboxcode.Size = new System.Drawing.Size(235, 26);
             this.pa_outboxcode.TabIndex = 10;
             this.pa_outboxcode.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode.OnTextChange(this.pa_outboxcode_UserControlTextChanged);

+ 3 - 3
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -152,7 +152,7 @@ namespace UAS_MES.Make
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
-                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Green);
+                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
@@ -303,9 +303,9 @@ namespace UAS_MES.Make
                             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                         }
                     }
-                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                 }
-                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
             }
         }
 

+ 3 - 3
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -231,7 +231,7 @@ namespace UAS_MES.Make
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
-                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Green);
+                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
@@ -378,9 +378,9 @@ namespace UAS_MES.Make
                             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                         }
                     }
-                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                 }
-                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
             }
         }
 

+ 0 - 1
UAS_KanBan/UAS_KanBan.csproj

@@ -150,7 +150,6 @@
       <DependentUpon>Settings.settings</DependentUpon>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
-    <None Include="UAS_KanBan_TemporaryKey.pfx" />
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />

BIN
UAS_MesDllService(4.0)/key.sn.snk


+ 6 - 16
UAS_MesDllService(4.0)/MESHelper.cs → UAS_MesInterface(4.0)/MesHelper.cs

@@ -1,7 +1,7 @@
-using System;
+using Oracle.ManagedDataAccess.Client;
+using System;
 using System.Collections.Generic;
 using System.Data;
-using System.Data.OracleClient;
 using System.Runtime.InteropServices;
 using System.Text;
 
@@ -25,7 +25,6 @@ namespace BenQGuru.eMES.DLLService
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
-        string Test(string Test);
     }
 
     [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
@@ -39,7 +38,7 @@ namespace BenQGuru.eMES.DLLService
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Data Source=117.25.180.218/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
+        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
         //用户选择的数据库的连接字符串
         private OracleConnection connection;
         //用户选择的数据库的连接字符串
@@ -782,7 +781,7 @@ namespace BenQGuru.eMES.DLLService
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ',')
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
                         {
                             addpar[i].Append(c[j]);
                         }
@@ -914,8 +913,8 @@ namespace BenQGuru.eMES.DLLService
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
             {
-                command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
-                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
+                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
+                command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
             }
             try
             {
@@ -959,14 +958,5 @@ namespace BenQGuru.eMES.DLLService
                 cmd.Connection.Open();
             }
         }
-
-        public string Test(string Test)
-        {
-            connection = new OracleConnection(ConnectionStrings);
-            connection.Open();
-            command = new OracleCommand("insert into AAAAA(Table_name) values('eqrekjhfbkjbd')",connection);
-            command.ExecuteNonQuery();
-            return connection.ServerVersion;
-        }
     }
 }

+ 3 - 3
UAS_MesDllService(4.0)/Properties/AssemblyInfo.cs → UAS_MesInterface(4.0)/Properties/AssemblyInfo.cs

@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("UAS_MesDllService(4.0)")]
+[assembly: AssemblyTitle("UAS_MesInterface(4.0)")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("UAS_MesDllService(4.0)")]
+[assembly: AssemblyProduct("UAS_MesInterface(4.0)")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible(true)]
 
 // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
-[assembly: Guid("5c1f3f7f-67ed-4c54-9e35-9392c3518e88")]
+[assembly: Guid("a35f767d-0858-4061-af7c-c5c594034668")]
 
 // 程序集的版本信息由下列四个值组成: 
 //

+ 0 - 0
UAS_MesDllService(4.0)/tool/Oracle.ManagedDataAccess.dll → UAS_MesInterface(4.0)/tool/Oracle.ManagedDataAccess.dll


+ 5 - 3
UAS_MesInterface/MESHelper.cs

@@ -556,7 +556,7 @@ namespace BenQGuru.eMES.DLLService
             sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
             sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
             sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_rescode)");
-            ExecuteSql(sql.ToString(), "select", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iResCode);
+            ExecuteSql(sql.ToString(), "insert", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iResCode);
             return true;
         }
 
@@ -605,7 +605,7 @@ namespace BenQGuru.eMES.DLLService
             }
             oErrMessage = "";
             string omakecode = "";
-            string[] param = new string[] { "", iResCode, iSN, "", omakecode, "", oErrMessage };
+            string[] param = new string[] { "", iResCode, iSN, iOperator, omakecode, "", oErrMessage };
             string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
             CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
             oErrMessage = param[6];
@@ -848,7 +848,7 @@ namespace BenQGuru.eMES.DLLService
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ',')
+                        if (c[j] != ' ' && c[j] != ','&&c[j]!=')')
                         {
                             addpar[i].Append(c[j]);
                         }
@@ -859,7 +859,9 @@ namespace BenQGuru.eMES.DLLService
                     }
                 }
                 for (int i = 0; i < addpar.Length; i++)
+                {
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), names[i]));
+                }
             }
             switch (Type.ToUpper())
             {

+ 2 - 1
UAS_MesInterface/UAS_MesDllService(3.5).csproj

@@ -38,7 +38,7 @@
     <SignAssembly>true</SignAssembly>
   </PropertyGroup>
   <PropertyGroup>
-    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
+    <AssemblyOriginatorKeyFile>Sec.pfx</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
@@ -57,6 +57,7 @@
   <ItemGroup>
     <None Include="bin\Debug\DllService.snk" />
     <None Include="key.snk" />
+    <None Include="Sec.pfx" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.