Эх сурвалжийг харах

Merge repos.ubtob.net:usoft/mes-client

callm 9 цаг өмнө
parent
commit
5b7367a4e2

+ 2 - 2
UAS_MES_WEIP/FunctionCode/Make/Make_BakingManage.cs

@@ -305,7 +305,7 @@ namespace UAS_MES_NEW.Make
             //BackingVal.Text = "";
             //EstimateVal.Text = "";
             ReelNoVal.Text = "";
-            UpdateMaterial("C");
+            //UpdateMaterial("C");
             LoadBaking();
             MessageBox.Show($"条码号:{ReelNoVal.Text} 入烘烤箱成功");
         }
@@ -335,7 +335,7 @@ namespace UAS_MES_NEW.Make
             dh.ExecuteSql($@"UPDATE baking_log SET status = '已烘烤',out_date = sysdate,baking_time = trunc((sysdate - in_date) * 24) || ':' || lpad(trunc(MOD((sysdate - in_date) * 24 * 60, 60)),2,'0') || ':' || lpad(trunc(MOD((sysdate - in_date) * 24 * 60 * 60, 60)),2,'0'),out_name = '{EmployeeVal1.Text.Trim()}' WHERE status = '烘烤中' and reel_no = '{ReelNoVal1.Text.Trim()}'", "insert");
             //EmployeeVal1.Text = "";
             ReelNoVal1.Text = "";
-            UpdateMaterial("C");
+            //UpdateMaterial("C");
             LoadBaking();
             MessageBox.Show($"条码号:{ReelNoVal1.Text} 出烘烤箱成功");
         }

+ 8 - 5
UAS_MES_WEIP/FunctionCode/Make/Make_EquiConnect.Designer.cs

@@ -140,36 +140,39 @@
             // 
             this.SnType2.AutoSize = true;
             this.SnType2.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.SnType2.Location = new System.Drawing.Point(227, 107);
+            this.SnType2.Location = new System.Drawing.Point(775, 131);
             this.SnType2.Name = "SnType2";
             this.SnType2.Size = new System.Drawing.Size(90, 28);
             this.SnType2.TabIndex = 183;
             this.SnType2.Text = "序列号";
             this.SnType2.UseVisualStyleBackColor = true;
+            this.SnType2.Visible = false;
             this.SnType2.Click += new System.EventHandler(this.SnType2_Click);
             // 
             // SnType1
             // 
             this.SnType1.AutoSize = true;
             this.SnType1.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.SnType1.Location = new System.Drawing.Point(131, 107);
+            this.SnType1.Location = new System.Drawing.Point(679, 131);
             this.SnType1.Name = "SnType1";
             this.SnType1.Size = new System.Drawing.Size(90, 28);
             this.SnType1.TabIndex = 181;
             this.SnType1.Text = "拼板号";
             this.SnType1.UseVisualStyleBackColor = true;
+            this.SnType1.Visible = false;
             this.SnType1.Click += new System.EventHandler(this.SnType1_Click);
             // 
             // SnTypeLab
             // 
             this.SnTypeLab.AutoSize = true;
             this.SnTypeLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SnTypeLab.Location = new System.Drawing.Point(30, 106);
+            this.SnTypeLab.Location = new System.Drawing.Point(578, 130);
             this.SnTypeLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.SnTypeLab.Name = "SnTypeLab";
             this.SnTypeLab.Size = new System.Drawing.Size(122, 28);
             this.SnTypeLab.TabIndex = 182;
             this.SnTypeLab.Text = "序列号类型:";
+            this.SnTypeLab.Visible = false;
             // 
             // OkBox
             // 
@@ -360,7 +363,7 @@
             // 
             // SNVal
             // 
-            this.SNVal.Location = new System.Drawing.Point(118, 145);
+            this.SNVal.Location = new System.Drawing.Point(118, 103);
             this.SNVal.Name = "SNVal";
             this.SNVal.Size = new System.Drawing.Size(243, 31);
             this.SNVal.TabIndex = 164;
@@ -370,7 +373,7 @@
             // 
             this.SNLab.AutoSize = true;
             this.SNLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SNLab.Location = new System.Drawing.Point(60, 146);
+            this.SNLab.Location = new System.Drawing.Point(60, 104);
             this.SNLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.SNLab.Name = "SNLab";
             this.SNLab.Size = new System.Drawing.Size(80, 28);

+ 59 - 27
UAS_MES_WEIP/FunctionCode/Make/Make_EquiConnect.cs

@@ -54,7 +54,7 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            InsertLog("OK");
+            //InsertLog("OK");
         }
 
         private void NG_Click(object sender, EventArgs e)
@@ -77,19 +77,41 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            InsertLog("NG");
+            //InsertLog("NG");
         }
 
-        private void InsertLog(string resType)
+        private void InsertLog(string sn, string resType, string main_sn = "")
         {
-            UpdateSN("L", SNVal.Text.Trim());
+            dt = (DataTable)dh.ExecuteSql($@"select * from steptestdetail where std_class = 'Xray抽检' and std_sn = '{sn}'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                if (string.IsNullOrEmpty(main_sn))
+                {
+                    ShowMsg(0, $"序列号:{sn} 已采集Xray信息");
+                    return;
+                }
+                else
+                {
+                    ShowMsg(0, $"拼板号:{main_sn} 中序列号:{sn} ,已采集Xray信息");
+                    return;
+                }
+            }
+
+            UpdateSN("L", sn);
 
             SQL.Clear();
             SQL.Append($@"INSERT INTO steptestdetail (std_id,std_sn,std_makecode,std_class,std_testresult,std_indate,STD_SUBCLASS1,STD_SUBCLASS2) 
-                VALUES (steptestdetail_seq.NEXTVAL, '{SNVal.Text.Trim()}','{workOrder.Text.Trim()}','Xray抽检','{resType}',sysdate, '{LineVal.Text}','{EmployeeVal.Text.Trim()}')");
+                VALUES (steptestdetail_seq.NEXTVAL, '{sn}','{workOrder.Text.Trim()}','Xray抽检','{resType}',sysdate, '{LineVal.Text}','{EmployeeVal.Text.Trim()}')");
             dh.ExecuteSql(SQL.ToString(), "insert");
 
-            ShowMsg(1, $"已记录 {SNVal.Text.Trim()},测试结果为 {resType}");
+            if (string.IsNullOrEmpty(main_sn))
+            {
+                ShowMsg(1, $"已记录 {sn},测试结果为 {resType}");
+            }
+            else
+            {
+                ShowMsg(1, $"拼板号:{main_sn} 已记录序列号:{sn} ,测试结果为 {resType}");
+            }
         }
 
         private void ShowMsg(int type, string msg)
@@ -212,11 +234,11 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            if (!SnType1.Checked && !SnType2.Checked)
+            /*if (!SnType1.Checked && !SnType2.Checked)
             {
                 ShowMsg(0, "请勾选序列号类型");
                 return;
-            }
+            }*/
 
             if (string.IsNullOrEmpty(SNVal.Text))
             {
@@ -224,19 +246,16 @@ namespace UAS_MES_NEW.Make
                 return;
             }
 
-            if (SnType1.Checked)
+            List<string> snList = new List<string>();
+            dt = (DataTable)dh.ExecuteSql($@"select * from smtbind where sb_maincode = '{SNVal.Text.Trim()}'", "select");
+            if (dt.Rows.Count > 0)
             {
-                List<string> snList = new List<string>();
-                dt = (DataTable)dh.ExecuteSql($@"select * from smtbind where sb_maincode = '{SNVal.Text}'", "select");
-                if (dt.Rows.Count > 0)
+                foreach (DataRow dr in dt.Rows)
                 {
-                    foreach (DataRow dr in dt.Rows)
-                    {
-                        snList.Add(dr["sb_maincode"].ToString());
-                    }
+                    snList.Add(dr["sb_barcode"].ToString());
                 }
 
-                foreach(string str in snList)
+                foreach (string str in snList)
                 {
                     dt = (DataTable)dh.ExecuteSql($@"SELECT ms_makecode,ms_prodcode,cd_stepcode,cd_stepname,cd_stepno FROM makeserial,craft,craftdetail
                         WHERE ms_sncode = '{str}' AND ms_prodcode = cr_prodcode AND cr_id = cd_crid AND cd_stepno = 1 ORDER BY cd_stepno", "select");
@@ -252,6 +271,19 @@ namespace UAS_MES_NEW.Make
                         ShowMsg(0, $"拼板号:{SNVal.Text} 中序列号:{str} 无投入过站记录,请过投入站后再采集Xray信息");
                         return;
                     }
+
+                    for (int i = 0; i <= LineVal.Items.Count; i++)
+                    {
+                        string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
+                        string allLine = LineVal.Items[i].ToString();
+                        if (mplinecode == allLine)
+                        {
+                            LineVal.SelectedIndex = i;
+                            break;
+                        }
+                    }
+
+                    InsertLog(str, OkBox.Checked ? "OK" : "NG", SNVal.Text.Trim());
                 }
             }
             else
@@ -270,17 +302,19 @@ namespace UAS_MES_NEW.Make
                     ShowMsg(0, $"序列号:{SNVal.Text} 无投入过站记录,请过投入站后再采集Xray信息");
                     return;
                 }
-            }
 
-            for (int i = 0; i <= LineVal.Items.Count; i++)
-            {
-                string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
-                string allLine = LineVal.Items[i].ToString();
-                if (mplinecode == allLine)
+                for (int i = 0; i <= LineVal.Items.Count; i++)
                 {
-                    LineVal.SelectedIndex = i;
-                    break;
+                    string mplinecode = dt.Rows[0]["mp_linecode"].ToString();
+                    string allLine = LineVal.Items[i].ToString();
+                    if (mplinecode == allLine)
+                    {
+                        LineVal.SelectedIndex = i;
+                        break;
+                    }
                 }
+
+                InsertLog(SNVal.Text.Trim(), OkBox.Checked ? "OK" : "NG");
             }
 
             //if (string.IsNullOrEmpty(LineVal.Text))
@@ -289,8 +323,6 @@ namespace UAS_MES_NEW.Make
             //    return;
             //}
 
-            InsertLog(OkBox.Checked ? "OK" : "NG");
-
             SNVal.Focus();
             SNVal.SelectAll();
             SNVal.Text = "";

+ 3 - 3
UAS_MES_XMW/DataOperate/DataHelper.cs

@@ -10,11 +10,11 @@ namespace UAS_MES_NEW.DataOperate
     class DataHelper
     {
         //系统默认的的连接字符串 
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES_XMW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.86)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES_XMW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.200.40.243)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
-        //public static readonly string ERPAddesss = "http://192.168.1.86:8099/mes/";
+        //public static readonly string ERPAddesss = "http://10.200.40.243:8099/mes/";
 
-        public static readonly string ERPAddesss = "http://192.168.1.86:8099/mes/";
+        public static readonly string ERPAddesss = "http://10.200.40.243:8099/mes/";
 
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;

+ 2 - 2
UAS_MES_XMW/Login.cs

@@ -47,7 +47,7 @@ namespace UAS_MES_NEW
         {
             BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
-            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES_XMW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.86)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES_XMW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.200.40.243)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);
@@ -94,7 +94,7 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.86)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.200.40.243)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;