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

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

callm 1 долоо хоног өмнө
parent
commit
09b0a5bead

+ 63 - 2
UAS_MES_YTDZ/FunctionCode/Make/Make_BodyTest.cs

@@ -124,14 +124,75 @@ namespace UAS_MES_NEW.Make
                     DateTime.TryParse(EventTime, out DateTime dtHour);
                     string timeType = dtHour.Hour < 11 ? "上午" : "下午";
 
+                    JObject ESDResult = JObject.Parse(item["ESDResult"].ToString());
+                    string BT_HANDRES = ESDResult.Value<string>("Hand");
+                    string BT_DHANDRES = ESDResult.Value<string>("DHand");
+                    string BT_LEFTSHOESRES = ESDResult.Value<string>("LeftShoes");
+                    string BT_RIGHTSHOESRES = ESDResult.Value<string>("RightShoes");
+
+
+                    JObject ESDResistance = JObject.Parse(item["ESDResistance"].ToString());
+                    string BT_HAND = ESDResistance.Value<string>("Hand");
+                    string BT_DHAND = ESDResistance.Value<string>("DHand");
+                    string BT_LEFTSHOES = ESDResistance.Value<string>("LeftShoes");
+                    string BT_RIGHTSHOES = ESDResistance.Value<string>("RightShoes");
+
+                    string testType = "";
+                    switch (item["ESDMode"].ToString())
+                    {
+                        case "0":
+                            testType = "免检";
+                            break;
+
+                        case "1":
+                            testType = "单线手";
+                            break;
+                        case "2":
+                            testType = "双线手";
+                            break;
+                        case "3":
+                            testType = "左鞋";
+                            break;
+                        case "4":
+                            testType = "右鞋";
+                            break;
+                        case "5":
+                            testType = "单线手 + 左鞋";
+                            break;
+                        case "6":
+                            testType = "双线手 + 左鞋";
+                            break;
+                        case "7":
+                            testType = "单线手 + 右鞋";
+                            break;
+                        case "8":
+                            testType = "双线手 + 右鞋";
+                            break;
+                        case "9":
+                            testType = "双鞋";
+                            break;
+                        case "10":
+                            testType = "单线手全测";
+                            break;
+                        case "11":
+                            testType = "双线手全测";
+                            break;
+                        default:
+                            break;
+                    }
 
                     dt = (DataTable)dh.ExecuteSql($"select * from bodytest where BT_EVENTID = '{EventID}'", "select");
+                    Console.WriteLine();
                     if (dt.Rows.Count == 0)
                     {
                         string sql = $@"INSERT INTO BODYTEST (BT_ID,BT_DEPTNAME,BT_EMPNO,BT_EMP,BT_TYPE,BT_TIMETYPE,
-                            BT_HAND,BT_DHAND,BT_LEFTSHOES,BT_RIGHTSHOES,BT_CONTROLNAME,BT_EVENTID,BT_INDATE) VALUES 
+                            BT_CONTROLNAME,BT_EVENTID,BT_INDATE,BT_TESTTYPE,
+                            BT_HAND, BT_DHAND, BT_LEFTSHOES, BT_RIGHTSHOES,
+                            BT_HANDRES,BT_DHANDRES,BT_LEFTSHOESRES,BT_RIGHTSHOESRES) VALUES 
                             (BODYTEST_SEQ.NEXTVAL,'{DeptName}','{EmployeeCode}','{EmployeeName}','{EventName}','{timeType}',
-                            '','','','','{ControlName}','{EventID}',to_date('{EventTime}', 'YYYY-MM-DD HH24:MI:SS'))";
+                            '{ControlName}','{EventID}',to_date('{EventTime}', 'YYYY-MM-DD HH24:MI:SS'),'{testType}',
+                            '{BT_HAND}','{BT_DHAND}','{BT_LEFTSHOES}','{BT_RIGHTSHOES}',
+                            '{BT_HANDRES}','{BT_DHANDRES}','{BT_LEFTSHOESRES}','{BT_RIGHTSHOESRES}')";
 
                         dh.ExecuteSql(sql, "insert");
                         InsertNum += 1;

+ 2 - 2
UAS_MES_YTDZ/FunctionCode/Make/Make_ParseLog.cs

@@ -431,7 +431,7 @@ namespace UAS_MES_NEW.Make
                                     if (UploadImageToFtp(floderFileItem, SN))
                                     {
                                         string time = File.GetCreationTime(floderFileItem).ToString("yyyy:MM:dd HH:mm:ss");
-                                        dh.ExecuteSql($@"UPDATE xraytest SET xt_url = 'http://192.168.41.232:8098/ftp/Xray/{DateTime.Now.ToString("yyyyMMdd")}/{SN}/{Path.GetFileName(floderFileItem)}',
+                                        dh.ExecuteSql($@"UPDATE xraytest SET xt_url = 'http://192.168.41.232:8098/Xray/{DateTime.Now.ToString("yyyyMMdd")}/{SN}/{Path.GetFileName(floderFileItem)}',
                                             xt_macode = '{ma_code.Text.Trim()}' WHERE checkdate = to_date('{time}','YYYY:MM:DD HH24:MI:SS')", "update");
                                     }
                                 }
@@ -439,7 +439,7 @@ namespace UAS_MES_NEW.Make
                                 {
                                     if (UploadImageToFtp(floderFileItem, SN))
                                     {
-                                        dh.ExecuteSql($@"UPDATE xraytest SET xt_url = 'http://192.168.41.232:8098/ftp/Xray/{DateTime.Now.ToString("yyyyMMdd")}/{SN}/{Path.GetFileName(floderFileItem)}',
+                                        dh.ExecuteSql($@"UPDATE xraytest SET xt_url = 'http://192.168.41.232:8098/Xray/{DateTime.Now.ToString("yyyyMMdd")}/{SN}/{Path.GetFileName(floderFileItem)}',
                                             xt_macode = '{ma_code.Text.Trim()}' WHERE barcode = '{SN}'", "update");
                                     }
                                 }

+ 1 - 0
UAS_MES_YTDZ/FunctionCode/Make/Make_ToolingManager.Designer.cs

@@ -200,6 +200,7 @@
             this.toolingVal.Size = new System.Drawing.Size(204, 31);
             this.toolingVal.TabIndex = 1;
             this.toolingVal.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.toolingVal_KeyPress);
+            this.toolingVal.Leave += new System.EventHandler(this.toolingVal_Leave);
             // 
             // toolingLab
             // 

+ 40 - 1
UAS_MES_YTDZ/FunctionCode/Make/Make_ToolingManager.cs

@@ -64,6 +64,12 @@ namespace UAS_MES_NEW.Make
             //Confirm.PerformClick();
         }
 
+        private void toolingVal_Leave(object sender, EventArgs e)
+        {
+            KeyPressEventArgs newEvent = new KeyPressEventArgs((char)Keys.Enter);
+            toolingVal_KeyPress(toolingVal, newEvent);
+        }
+
         private void toolingVal_KeyPress(object sender, KeyPressEventArgs e)
         {
             if (e.KeyChar != (char)Keys.Enter) return;
@@ -219,7 +225,7 @@ namespace UAS_MES_NEW.Make
             {
                 //ShowMsg(MsgBox, 2, "Warning,钢网:" + toolingVal.Text + "使用次数接近上限");
                 DialogResult result = MessageBox.Show(this.ParentForm, $"Warning,{typeVal.Text}:{toolingVal.Text}使用次数接近上限,已使用{useCount},距离上限还有{(maxCount - useCount)}次", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
-                if (result == DialogResult.No) return;
+                if (result == DialogResult.No || result == DialogResult.Cancel) return;
             }
 
             dt = (DataTable)dh.ExecuteSql($"select ma_prodcode from make where ma_code='{ma_code.Text}'", "select");
@@ -280,6 +286,33 @@ namespace UAS_MES_NEW.Make
             empVal.Text = "";
 
             ShowMsg(MsgBox, 1, $"OK,{typeVal.Text}编号:{toolingVal.Text},已领用成功");
+
+            CleanDetail("Receive");
+
+            KeyPressEventArgs newEvent = new KeyPressEventArgs((char)Keys.Enter);
+            toolingVal_KeyPress(toolingVal, newEvent);
+        }
+
+        private void CleanDetail(string type)
+        {
+            // Stencil Scraper
+            if (type == "Receive")
+            {
+                ma_code.Text = "";
+                sideVal.SelectedIndex = -1;
+                empVal.Text = "";
+            }
+            else if (type == "Return")
+            {
+                stA.Text = "";
+                stB.Text = "";
+                stC.Text = "";
+                stD.Text = "";
+                stE.Text = "";
+                empVal1.Text = "";
+                useCountVal.Text = "";
+                IsClean.Checked = false;
+            }
         }
 
         private void Return_Click(object sender, EventArgs e)
@@ -359,11 +392,17 @@ namespace UAS_MES_NEW.Make
             empVal1.Text = "";
             IsClean.Checked = false;
             ShowMsg(MsgBox, 1, $"OK,{typeVal.Text}编号:{toolingVal.Text},已归还成功");
+
+            CleanDetail("Receive");
+
+            KeyPressEventArgs newEvent = new KeyPressEventArgs((char)Keys.Enter);
+            toolingVal_KeyPress(toolingVal, newEvent);
         }
 
         private void Scrap_Click(object sender, EventArgs e)
         {
 
         }
+
     }
 }

+ 3 - 0
UAS_MES_YTDZ/FunctionCode/Query/Query_LoadMake.cs

@@ -29,6 +29,9 @@ namespace UAS_MES_NEW.Query
 
         private void Query_LoadMake_Load(object sender, EventArgs e)
         {
+            output.Visible = false;
+            label3.Visible = false;
+
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,ma_softversion # 软件版本";
             ma_code.FormName = Name;