Browse Source

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

章政 8 years ago
parent
commit
41d6aecca6

+ 11 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -35,6 +35,7 @@ namespace UAS_MES.Make
         //是否通过串口获取数据
         bool GetData = true;
         string LastSncode;
+        bool WeightChange = false;
 
         string ErrorMessage;
 
@@ -121,6 +122,10 @@ namespace UAS_MES.Make
                                 }
                             }
                             //如果未打开串口设置为0
+                            if (pr_colorboxunit.Text == "kg" && !WeightChange)
+                            {
+                                weight.Text = (float.Parse(weight.Text) / 1000).ToString();
+                            }
                             double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
                             if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                             {
@@ -173,7 +178,13 @@ namespace UAS_MES.Make
                             {
                                 weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
                                 if (pr_colorboxunit.Text == "kg")
+                                {
                                     weight.Text = (float.Parse(weight.Text) / 1000).ToString();
+                                    WeightChange = true;
+                                }
+                                else {
+                                    WeightChange = false;
+                                }
                             }
                             catch (Exception)
                             {

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -211,7 +211,7 @@ namespace UAS_MES.Make
 
         private void Make_FuselageLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
-            lbl.Quit();
+            BaseUtil.ClosePrint(lbl);
         }
 
         private void Make_FuselageLabelPrint_SizeChanged(object sender, EventArgs e)

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs

@@ -89,6 +89,7 @@ namespace UAS_MES.Make
         private void Make_RePrintLabel_FormClosing(object sender, FormClosingEventArgs e)
         {
             //窗口关闭的时候
+            BaseUtil.ClosePrint(lbl);
         }
 
         private void radioButton_CheckedChange(object sender, EventArgs e)

+ 1 - 1
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -98,10 +98,10 @@ namespace UAS_MES.Packing
         {
             if (e.KeyCode == Keys.Enter)
             {
-
                 string ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode = '" + sn_code.Text + "'").ToString();
                 if (ms_id != "")
                 {
+                    OperateResult.AppendText(">>序列号:" + sn_code.Text + "\n", Color.Black);
                     sql.Clear();
                     sql.Append("select ms_id,ms_prodcode,ms_outboxcode,ms_makecode ms_msmakecode, ms_sccode,");
                     sql.Append("nvl(ms_currentstepcode,ms_stepcode ) laststepcode, ms_sccode lastsccode,");

+ 1 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -1403,7 +1403,7 @@ namespace UAS_MES.PublicMethod
                     break;
                 case "RULE":
                     int sp_length = int.Parse(iLength != "" ? iLength : "0");
-                    if (iSN.Substring(0, iPrefix.Length) == iPrefix || iPrefix == "")
+                    if (iSN.StartsWith(iPrefix) || iPrefix == "")
                     {
                         //进行长度匹配
                         if (iSN.Length == sp_length || sp_length == 0)