Browse Source

更改栈板采集的BUG,解除时更新pa_status=0

章政 8 years ago
parent
commit
414ebdd5fb

+ 10 - 9
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -117,14 +117,20 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>箱号不能为空\n", Color.Red);
                         return;
                     }
-                    if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_outboxcode='"+outboxcode.Text+"'").ToString() != User.CurrentStepCode)
+                    if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_outboxcode='" + outboxcode.Text + "'").ToString() != User.CurrentStepCode)
                     {
                         OperateResult.AppendText(">>箱号" + outboxcode.Text + "的下一工序不是当前岗位资源对应工序\n", Color.Red, outboxcode);
                         return;
                     }
-                    if (pa_standardqty.Text == pa_currentqty.Text)
+                    string pa_status = dh.getFieldDataByCondition("package", "nvl(pa_status,0)pa_status", "pa_outboxcode='" + palletcode.Text + "'").ToString();
+                    if (pa_status == "1")
                     {
-                        Packing_Click(new object(), new EventArgs());
+                        palletcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
+                        sql.Clear();
+                        sql.Append("insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,pa_standardqty,pa_sccode,pa_currentstep)values");
+                        sql.Append("(package_seq.nextval,'" + palletcode.Text + "','" + pa_makecode.Text + "',sysdate,'0',3,'" + pa_prodcode.Text + "',0,'" + pa_standardqty.Text + "','" + User.UserSourceCode + "','" + User.CurrentStepCode + "')");
+                        dh.ExecuteSql(sql.GetString(), "insert");
+                        palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                     }
                     //如果未装满的话
                     dt = (DataTable)dh.ExecuteSql("select pa_mothercode,nvl(pa_status,0) pa_status from package where pa_outboxcode='" + outboxcode.Text + "' and pa_type=2", "select");
@@ -246,12 +252,7 @@ namespace UAS_MES.Make
             {
                 OperateResult.AppendText(">>" + palletcode.Text + "装栈板成功\n", Color.Black);
                 dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + palletcode.Text + "'", "update");
-                palletcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
-                sql.Clear();
-                sql.Append("insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_standardqty,pa_sccode,pa_currentstep)values");
-                sql.Append("(package_seq.nextval,'" + palletcode.Text + "','" + pa_makecode.Text + "',sysdate,'0',3,'" + pa_prodcode.Text + "',0,'1','" + pa_standardqty.Text + "','" + User.UserSourceCode + "','" + User.CurrentStepCode + "')");
-                dh.ExecuteSql(sql.GetString(), "insert");
-                palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
+
             }
             else OperateResult.AppendText(">>栈板号不能为空\n", Color.Red);
         }

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

@@ -635,7 +635,7 @@ namespace UAS_MES.PublicMethod
             //删除从表明细
             ExeSQL.Add("delete from packagedetail where pd_paid=(select pa_id from package where pa_outboxcode='" + iOutBoxCode + "')");
             //设置大箱或栈板的已装数量为0
-            ExeSQL.Add("update package set pa_totalqty=0,pa_currentqty=0,pa_packageqty=0 where pa_outboxcode='" + iOutBoxCode + "'");
+            ExeSQL.Add("update package set pa_totalqty=0,pa_status=0,pa_currentqty=0,pa_packageqty=0 where pa_outboxcode='" + iOutBoxCode + "'");
             dh.ExecuteSQLTran(ExeSQL.ToArray());
         }