فهرست منبع

修改重量检测模块

callm 3 روز پیش
والد
کامیت
14e70ce089
1فایلهای تغییر یافته به همراه14 افزوده شده و 24 حذف شده
  1. 14 24
      UAS_MES_YDCY/FunctionCode/Packing/Packing_PalletWightCollection.cs

+ 14 - 24
UAS_MES_YDCY/FunctionCode/Packing/Packing_PalletWightCollection.cs

@@ -175,31 +175,7 @@ namespace UAS_MES_NEW.Packing
                             pr_palletweight.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_cartonunit"].ToString();
                         else
                             pr_palletweight.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_cartonunit"].ToString();
-                        double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim());
                         //需要检查称重重量
-                        if (PA_STANDARDQTY == PA_CURRENTQTY)
-                        {
-                            //称量合格或不合格都记录重量
-                            if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight && ActualWeight != 0)
-                            {
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格:" + weight.Text.Trim(), outboxcode.Text, "");
-                                LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
-                                OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
-                            }
-                            else
-                            {
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不合格:" + weight.Text.Trim(), outboxcode.Text, "");
-                                LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
-                                OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red, outboxcode);
-                                return;
-                            }
-                        }
-                        else
-                        {
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), outboxcode.Text, "");
-                            LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
-                        }
-                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "称重完成\n", Color.Green);
                         if (LogicHandler.CartonBoxStepPass(ma_code.Text, User.UserSourceCode, outboxcode.Text, User.UserCode, "卡通箱:" + outboxcode.Text + "整箱过站", out ErrorMessage))
                         {
                             dh.UpdateByCondition("package", "pa_printcount= nvl(pa_printcount,0)+1,pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + outboxcode.Text + "'");
@@ -386,6 +362,20 @@ namespace UAS_MES_NEW.Packing
                                     palletcode_KeyDown(sender, e);
                                     if (pa_standardqty.Text == pa_totalqty.Text)
                                     {
+                                        double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim());
+                                        if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight && ActualWeight != 0)
+                                        {
+                                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格:" + weight.Text.Trim(), outboxcode.Text, "");
+                                            LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
+                                        }
+                                        else
+                                        {
+                                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不合格:" + weight.Text.Trim(), outboxcode.Text, "");
+                                            LogicHandler.RecordProdWeight(outboxcode.Text, "CARTON", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red, outboxcode);
+                                            return;
+                                        }
                                         dh.ExecuteSql("update package set pa_status=1,PA_WEIGHT='" + weight.Text + "' where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                                         OperateResult.AppendText("栈板" + pa_outboxcode.Text + "已装满,封栈板成功\n");
                                         pa_outboxcode.Focus();