瀏覽代碼

出货单采集更新语句优化

Hcsy 8 年之前
父節點
當前提交
d9603d11d6
共有 1 個文件被更改,包括 14 次插入9 次删除
  1. 14 9
      UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

+ 14 - 9
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -164,10 +164,13 @@ namespace UAS_MES.Warehouse
                         OperateResult.AppendText("出货单" + pi_inoutno.Text + "未完成备货,无法确认出货\n", Color.Red);
                         return;
                     }
-                    else {
-                        dh.ExecuteSql("update package set pa_status=2 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'", "update");
-                        dh.ExecuteSql("update prodinout set pi_pdastatus='已出库' where pi_inoutno='" + pi_inoutno.Text + "'", "update");
-                        dh.ExecuteSql("insert into messagelog(ml_id,ml_date,ml_man,ml_content,ml_result,ml_search)values(messagelog_seq.nextval,sysdate,'" + User.UserName + "','确认出货','确认出货成功','ProdInOut!Sale|pi_id=" + pi_id.Text + "')", "insert");
+                    else
+                    {
+                        List<String> ExeSQL = new List<string>();
+                        ExeSQL.Add("update package set pa_status=2 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
+                        ExeSQL.Add("update prodinout set pi_pdastatus='已出库' where pi_inoutno='" + pi_inoutno.Text + "'");
+                        ExeSQL.Add("insert into messagelog(ml_id,ml_date,ml_man,ml_content,ml_result,ml_search)values(messagelog_seq.nextval,sysdate,'" + User.UserName + "','确认出货','确认出货成功','ProdInOut!Sale|pi_id=" + pi_id.Text + "')");
+                        dh.ExecuteSQLTran(ExeSQL.ToArray());   
                         OperateResult.AppendText("出货单" + pi_inoutno.Text + "出库成功\n", Color.Black,pi_inoutno);
                         BaseUtil.CleanDataGridView(InOutDetailDGV);
                     }
@@ -527,11 +530,13 @@ namespace UAS_MES.Warehouse
                     OperateResult.AppendText("出货单" + pi_inoutno.Text + "尚未备货,无法取消明细\n", Color.Red);
                     return;
                 }
-                dh.ExecuteSql("update makeserial set ms_iostatus=1 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + " ' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode and nvl(pim_outboxcode,' ')=' ') and ms_status=2", "update");
-                dh.ExecuteSql("update package set pa_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'", "update");
-                dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "'", "delete");
-                dh.ExecuteSql("update prodinout set pi_pdastatus='未备货' where pi_inoutno='" + pi_inoutno.Text + "'", "update");
-                dh.ExecuteSql("insert into messagelog(ml_id,ml_date,ml_man,ml_content,ml_result,ml_search)values(messagelog_seq.nextval,sysdate,'" + User.UserName+ "','清除全部备货明细','清除备货明细成功','ProdInOut!Sale|pi_id=" + pi_id.Text+"')", "insert");
+                List<String> ExeSQL = new List<string>();
+                ExeSQL.Add("update makeserial set ms_iostatus=1 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + " ' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode and nvl(pim_outboxcode,' ')=' ') and ms_status=2");
+                ExeSQL.Add("update package set pa_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
+                ExeSQL.Add("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "'");
+                ExeSQL.Add("update prodinout set pi_pdastatus='未备货' where pi_inoutno='" + pi_inoutno.Text + "'");
+                ExeSQL.Add("insert into messagelog(ml_id,ml_date,ml_man,ml_content,ml_result,ml_search)values(messagelog_seq.nextval,sysdate,'" + User.UserName + "','清除全部备货明细','清除备货明细成功','ProdInOut!Sale|pi_id=" + pi_id.Text + "')");
+                dh.ExecuteSQLTran(ExeSQL.ToArray());
                 OperateResult.AppendText("出货单" + pi_inoutno.Text + "取消明细成功\n", Color.Black,input);
             }
             else {