瀏覽代碼

拆解更换批管控物料逻辑调整

Hcsy 8 年之前
父節點
當前提交
680fa95f96
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      UAS-MES/FunctionCode/Make/Make_Decompose.cs

+ 3 - 3
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -243,7 +243,7 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    if (!dh.CheckExist("makesourcestock", "mss_makecode = '" + ms_makecode.Text + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'"))
+                                    if (!dh.CheckExist("makesourcestock"," (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'"))
                                     {
                                         OperateResult.AppendText(">>物料" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "岗位备料无条码" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "\n", Color.Red);
                                         continue;
@@ -251,7 +251,7 @@ namespace UAS_MES.Make
                                     else
                                     {
                                         sql.Clear();
-                                        sql.Append("select MSS_REMAIN,MSS_BASEQTY from makesourcestock where mss_makecode = '" + ms_makecode.Text + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
+                                        sql.Append("select mss_id,MSS_REMAIN,MSS_BASEQTY from makesourcestock where  (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
                                         dtst = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                         int MSS_REMAIN = int.Parse(dtst.Rows[0]["MSS_REMAIN"].ToString());
                                         int MSS_BASEQTY = int.Parse(dtst.Rows[0]["MSS_BASEQTY"].ToString());
@@ -262,7 +262,7 @@ namespace UAS_MES.Make
                                         }
                                         else
                                         {
-                                            dh.UpdateByCondition("makesourcestock", "MSS_REMAIN = NVL(MSS_REMAIN, 0) - MSS_BASEQTY,MSS_USEQTY = NVL(MSS_USEQTY, 0) + MSS_BASEQTY,mss_madeqty=NVL(mss_madeqty,0)+ceil(MSS_USEQTY/MSS_BASEQTY)", " mss_makecode = '" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
+                                            dh.UpdateByCondition("makesourcestock", "MSS_REMAIN = NVL(MSS_REMAIN, 0) - MSS_BASEQTY,MSS_USEQTY = NVL(MSS_USEQTY, 0) + MSS_BASEQTY,mss_madeqty=NVL(mss_madeqty,0)+ceil(MSS_USEQTY/MSS_BASEQTY)", " mss_id = '" + dtst.Rows[0]["mss_id"].ToString() + "' and (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'");
                                         }
                                     }
                                 }