فهرست منبع

大箱尾数箱不校验重量

callm 1 روز پیش
والد
کامیت
8269218f18
1فایلهای تغییر یافته به همراه14 افزوده شده و 8 حذف شده
  1. 14 8
      UAS_MES_YD/FunctionCode/Packing/Packing_BigBoxWeight.cs

+ 14 - 8
UAS_MES_YD/FunctionCode/Packing/Packing_BigBoxWeight.cs

@@ -109,7 +109,7 @@ namespace UAS_MES_NEW.Packing
             if (e.KeyCode == Keys.Enter)
             {
                 sql.Clear();
-                sql.Append("select pa_weight,pr_bigboxmaxw,pr_bigboxminw,pr_colorboxgw,pa_id,pa_prodcode,pr_spec,pr_detail,pa_makecode,pa_salecode,pa_totalqty,");
+                sql.Append("select pa_weight,pr_bigboxmaxw,pr_bigboxminw,PA_STANDARDQTY,PA_CURRENTQTY,pr_colorboxgw,pa_id,pa_prodcode,pr_spec,pr_detail,pa_makecode,pa_salecode,pa_totalqty,");
                 sql.Append("pa_packageqty from package left join product on pr_code=pa_prodcode where ");
                 sql.Append("pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type=2");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -132,6 +132,8 @@ namespace UAS_MES_NEW.Packing
                     string _maxweight = dt.Rows[0]["pr_bigboxmaxw"].ToString();
                     string _minweight = dt.Rows[0]["pr_bigboxminw"].ToString();
                     string pa_weight = dt.Rows[0]["pa_weight"].ToString();
+                    string PA_STANDARDQTY = dt.Rows[0]["PA_STANDARDQTY"].ToString();
+                    string PA_CURRENTQTY = dt.Rows[0]["PA_CURRENTQTY"].ToString();
                     if (pa_weight != "")
                     {
                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经称重\n", Color.Red);
@@ -147,15 +149,19 @@ namespace UAS_MES_NEW.Packing
                     else
                         pr_colorboxgw.Text = MinWeight + "-" + MaxWeight;
 
-                    if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
+                    if (PA_STANDARDQTY == PA_CURRENTQTY)
                     {
-                        OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "重量检测检测合格\n", Color.Green);
-                    }
-                    else
-                    {
-                        OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "重量检测未通过\n", Color.Red);
-                        return;
+                        if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
+                        {
+                            OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "重量检测检测合格\n", Color.Green);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "重量检测未通过\n", Color.Red);
+                            return;
+                        }
                     }
+
                     //更新大箱重量
                     sql.Clear();
                     sql.Append("update package set pa_weight='" + ActualWeight + "' where pa_outboxcode= '" + pa_outboxcode.Text + "'");