Browse Source

出货单模块字段获取BUG修改

Hcsy 8 năm trước cách đây
mục cha
commit
86bee3b284

+ 12 - 6
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -240,13 +240,15 @@ namespace UAS_MES.Warehouse
                     {
                         if (palletBtn.Checked)
                         {
+                            string pa_makecode = "";
                             sql.Clear();
-                            sql.Append("select pa_outboxcode,pa_status,pa_iostatus,pa_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
+                            sql.Append("select pa_outboxcode,pa_status,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
                                 if (!checkinput(dt, "栈板号"))
                                     return;
+                                pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
                             }
                             else
                             {
@@ -257,20 +259,22 @@ namespace UAS_MES.Warehouse
                                 return;
                             //更新箱号对应的出货单号
                             dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "出货备货", "栈板" + input.Text + "出货备货成功", "", input.Text);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "出货备货", "栈板" + input.Text + "出货备货成功", "", input.Text);
                         }
                         else if (bigboxBtn.Checked)
                         {
                             string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_sncode = '" + input.Text + "'").ToString();
+                            string pa_makecode = "";
                             if (outboxcode != "")
                             {
                                 input.Text = outboxcode;
                             }
                             sql.Clear();
-                            sql.Append("select pa_outboxcode,pa_makecode,pa_status,nvl(pa_downstatus,0)pa_downstatus,pa_outno, pa_mothercode from package where pa_outboxcode='" + input.Text + "' and pa_type in(1,2)");
+                            sql.Append("select pa_outboxcode,pa_makecode,pa_status,nvl(pa_iostatus,0) pa_iostatus,nvl(pa_downstatus,0)pa_downstatus,pa_outno, pa_mothercode from package where pa_outboxcode='" + input.Text + "' and pa_type in(1,2)");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
+                                pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
                                 if (dt.Rows[0]["pa_mothercode"].ToString() != "")
                                 {
                                     OperateResult.AppendText("箱号" + input.Text + "已经装大箱或者栈板" + dt.Rows[0]["pa_mothercode"].ToString() + ",不允许单独出货\n", Color.Red, input);
@@ -288,7 +292,7 @@ namespace UAS_MES.Warehouse
                                 return;
                             //更新箱号对应的出货单号
                             dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "出货备货", "箱号" + input.Text + "出货备货成功", "", input.Text);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "出货备货", "箱号" + input.Text + "出货备货成功", "", input.Text);
                         }
                         else if (serBtn.Checked)
                         {
@@ -424,6 +428,7 @@ namespace UAS_MES.Warehouse
                             {
                                 string pa_iostatus = dt.Rows[0]["pa_iostatus"].ToString();
                                 string pa_outno = dt.Rows[0]["pa_outno"].ToString();
+                                string pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
                                 if (pa_iostatus != "0" && pa_iostatus != "1")
                                 {
                                     OperateResult.AppendText("栈板号" + input.Text + "不是备货状态,无法取消备货\n", Color.Red, input);
@@ -442,7 +447,7 @@ namespace UAS_MES.Warehouse
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
                                 OperateResult.AppendText("栈板号" + input.Text + "取消备货成功\n", Color.Black, input);
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "取消出货备货", "栈板" + input.Text + "取消出货备货成功", "", input.Text);
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "取消出货备货", "栈板" + input.Text + "取消出货备货成功", "", input.Text);
                             }
                             else
                             {
@@ -467,6 +472,7 @@ namespace UAS_MES.Warehouse
                                 string pa_iostatus = dt.Rows[0]["pa_iostatus"].ToString();
                                 string pa_outno = dt.Rows[0]["pa_outno"].ToString();
                                 string pa_mothercode = dt.Rows[0]["pa_mothercode"].ToString();
+                                string pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
                                 if (pa_iostatus != "0" && pa_iostatus != "1")
                                 {
                                     OperateResult.AppendText("箱号" + input.Text + "不是备货状态,无法取消备货\n", Color.Red, input);
@@ -490,7 +496,7 @@ namespace UAS_MES.Warehouse
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
                                 OperateResult.AppendText("箱号" + input.Text + "取消备货成功\n", Color.Black, input);
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", "", input.Text);
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", "", input.Text);
                             }
                             else
                             {