瀏覽代碼

修改采集过程中修改数量影响自动打印的问题

章政 8 年之前
父節點
當前提交
e56f91b8e6

+ 13 - 6
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -78,7 +78,7 @@ namespace UAS_MES.Make
             //加载表单数据
             string Err = "";
             sql.Clear();
-            sql.Append("select pr_code,pa_outboxcode,pa_prodcode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,pa_standardqty,pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
+            sql.Append("select pr_code,pa_outboxcode,pa_prodcode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
             sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             Err = "箱号";
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -87,6 +87,10 @@ namespace UAS_MES.Make
                 //记录该数据保证在修改不被允许的前提下能偶回复之前的值
                 StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
+                if (pa_standardqty.Text != "0")
+                {
+                    pr_outboxinnerqty.Text = pa_standardqty.Text;
+                }
             }
             else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
         }
@@ -138,7 +142,7 @@ namespace UAS_MES.Make
                     {
                         //获取序列号信息
                         sql.Clear();
-                        sql.Append("select pr_code,ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,0) pa_standardqty,");
+                        sql.Append("select pr_code,ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
                         sql.Append("pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -148,9 +152,9 @@ namespace UAS_MES.Make
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
                         //保证箱内容量不会被重置
-                        if (pa_standardqty.Text != "0")
+                        if (pa_standardqty.Text != "0" && pa_standardqty.Text != "")
                         {
-                            pr_outboxinnerqty.Text = pa_standardqty.Text;
+                            pr_outboxinnerqty.Value = int.Parse(pa_standardqty.Text);
                         }
                         if (pa_outboxcode.Text == "")
                         {
@@ -246,13 +250,15 @@ namespace UAS_MES.Make
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
                                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
                                         //满箱更新状态为1
-                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == pr_outboxinnerqty.Value)
+                                        LoadData();
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == pr_outboxinnerqty.Value)
                                         {
                                             dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                            pa_status.Text = "1";
+                                            pa_standardqty.Text = "";
                                             if (AutoPrint.Checked)
                                                 Print_Click(new object(), new EventArgs());
                                         }
-                                        LoadData();
                                         LoadGridData();
                                         sn_code.Clear();
                                     }
@@ -316,6 +322,7 @@ namespace UAS_MES.Make
             {
                 dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                 pa_status.Text = "1";
+                pa_standardqty.Text = "";
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "封箱成功", pa_outboxcode.Text, "");
                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
             }

+ 12 - 6
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -145,7 +145,7 @@ namespace UAS_MES.Make
             string Err = "";
             sql.Clear();
             sql.Append("select pa_prodcode,pr_cartonmaxw,pa_makecode,pr_cartonunit,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
-            sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,pr_outboxinnerqty)pr_outboxinnerqty,pa_currentqty from package left join ");
+            sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,0)pa_standardqty,pa_currentqty from package left join ");
             sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             Err = "箱号";
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -161,6 +161,9 @@ namespace UAS_MES.Make
                 MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
                 StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
+                //保证按照箱内容量展示
+                if (pa_standardqty.Text != "0")
+                    pr_outboxinnerqty.Text = pa_standardqty.Text;
                 if (Weight - MinWeight == MaxWeight - Weight)
                     pr_cartonboxgw.Text = Weight + "±" + (MaxWeight - Weight);
                 else
@@ -214,7 +217,7 @@ namespace UAS_MES.Make
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
                         sql.Clear();
-                        sql.Append("select ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,0) pa_standardqty");
+                        sql.Append("select ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
                         sql.Append("pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -223,9 +226,9 @@ namespace UAS_MES.Make
                             StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
-                        if (pa_standardqty.Text != "0")
+                        if (pa_standardqty.Text != "0" && pa_standardqty.Text != "")
                         {
-                            pr_outboxinnerqty.Text = pa_standardqty.Text;
+                            pr_outboxinnerqty.Value = int.Parse(pa_standardqty.Text);
                         }
                         if (pa_outboxcode.Text == "")
                         {
@@ -318,18 +321,21 @@ namespace UAS_MES.Make
                                         LoadCheckQTY();
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
                                         //满箱更新状态为1
-                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
+                                        LoadData();
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                         {
                                             //检查重量合格
                                             if (float.Parse(weight.Text) > MinWeight && float.Parse(weight.Text) < MaxWeight)
                                             {
                                                 dh.UpdateByCondition("package", "pa_status=1,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                                pa_standardqty.Text = "";
+                                                pa_status.Text = "1";
                                                 if (AutoPrint.Checked)
                                                     Print_Click(new object(), new EventArgs());
                                             }
                                             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
                                         }
-                                        LoadData();
+
                                         LoadGridData();
                                         sn_code.Clear();
                                     }