Browse Source

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

Hcsy 8 years ago
parent
commit
9850df3ca6

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

@@ -144,7 +144,7 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    dt = (DataTable)dh.ExecuteSql("select ms_status from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
                     {
                         if (oMsID == "" || oMsID == "null")

+ 8 - 5
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -38,6 +38,8 @@ namespace UAS_MES.Make
         //最小重量
         double MinWeight;
 
+        string ActWeigh;
+
         decimal StandardQTY = 0;
 
         string oOutBoxCode = "";
@@ -115,6 +117,7 @@ namespace UAS_MES.Make
                             try
                             {
                                 weight.Text = serialPort1.ReadLine();
+                                ActWeigh = weight.Text.Replace("kg", "").Trim();
                                 //if (pr_cartonunit.Text == "kg")
                                 //    weight.Text = (double.Parse(weight.Text) / 1000).ToString();
                             }
@@ -227,7 +230,7 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    dt = (DataTable)dh.ExecuteSql("select ms_status from makeserial where ms_sncode ='" + sn_code.Text + "'  order by ms_id desc", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id from makeserial where ms_sncode ='" + sn_code.Text + "'  order by ms_id desc", "select");
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
                     {
                         if (oMsID == "" || oMsID == "null")
@@ -357,7 +360,7 @@ namespace UAS_MES.Make
                                     sn_code.Clear();
                                     if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                     {
-                                        float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
+                                        float weigh = float.Parse(ActWeigh);
                                         dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weigh + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         pa_standardqty.Text = "";
                                         pa_status.Text = "1";
@@ -445,10 +448,10 @@ namespace UAS_MES.Make
                     pa_standardqty.Text = "";
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "封箱成功", pa_outboxcode.Text, "");
                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
-                    if (PR_CHECKCARTONW != "0"&& pa_standardqty.Text == pa_currentqty.Text)
+                    if (PR_CHECKCARTONW != "0" && pa_standardqty.Text == pa_currentqty.Text)
                     {
-                        float weigh = float.Parse(weight.Text.Replace("kg", "").Trim());
-                        if (!(weigh > MinWeight && weigh < MaxWeight))
+                        float weigh = float.Parse(ActWeigh);
+                        if (!(weigh >= MinWeight && weigh <= MaxWeight))
                         {
                             OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量,不能完成工序过站\n", Color.Red);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不符合要求:" + weight.Text.Trim(), pa_outboxcode.Text, "");