Browse Source

工单上下线按照工序

callm 3 weeks ago
parent
commit
36d66d69d7
1 changed files with 7 additions and 10 deletions
  1. 7 10
      UAS_MES_JWS/FunctionCode/Query/Query_LoadMake.cs

+ 7 - 10
UAS_MES_JWS/FunctionCode/Query/Query_LoadMake.cs

@@ -1,13 +1,10 @@
-using DevExpress.XtraMap.Native;
-using LabelManager2;
+using LabelManager2;
 using System;
 using System.Data;
-using System.Linq;
 using System.Threading;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
-using UAS_MES_NEW.PublicForm;
 using UAS_MES_NEW.PublicMethod;
 
 namespace UAS_MES_NEW.Query
@@ -67,13 +64,13 @@ namespace UAS_MES_NEW.Query
                 MessageBox.Show("人数必须大于0");
                 return;
             }
-            if (dh.CheckExist("loadmake", "lm_linecode='" + li_code.Text + "' and lm_downtime is null"))
+            if (dh.CheckExist("loadmake", "lm_linecode='" + li_code.Text + "' and lm_stepcode='" + User.CurrentStepCode + "' and lm_downtime is null"))
             {
                 MessageBox.Show("线别" + li_code.Text + "存在在线工单,不允许上线");
                 return;
             }
-            dh.ExecuteSql("insert into loadmake(lm_id,lm_makecode,lm_linecode,lm_uptime,lm_inman,lm_mannum)" +
-                "values(loadmake_seq.nextval,'" + ma_code.Text + "','" + li_code.Text + "',sysdate,'" + User.UserName + "','" + mancount.Value + "')", "insert");
+            dh.ExecuteSql("insert into loadmake(lm_id,lm_makecode,lm_linecode,lm_uptime,lm_inman,lm_mannum,lm_stepcode)" +
+                "values(loadmake_seq.nextval,'" + ma_code.Text + "','" + li_code.Text + "',sysdate,'" + User.UserName + "','" + mancount.Value + "','" + User.CurrentStepCode + "')", "insert");
             LoadGridData();
         }
 
@@ -97,7 +94,7 @@ namespace UAS_MES_NEW.Query
 
         private void LoadGridData()
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select * from loadmake where lm_downtime is  null", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select * from loadmake where lm_downtime is  null and lm_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.FillDgvWithDataTable(DGV, dt);
         }
 
@@ -116,8 +113,8 @@ namespace UAS_MES_NEW.Query
                     string makecode = DGV.Rows[i].Cells["lm_makecode"].Value.ToString();
                     string licode = DGV.Rows[i].Cells["lm_linecode"].Value.ToString();
                     string mannum = DGV.Rows[i].Cells["LM_MANNUM"].Value.ToString();
-                    dh.ExecuteSql("insert into loadmake(lm_id,lm_makecode,lm_linecode,lm_uptime,lm_inman,lm_mannum)" +
-                    "values(loadmake_seq.nextval,'" + makecode + "','" + licode + "',sysdate,'" + User.UserName + "','" + mannum + "')", "insert");
+                    dh.ExecuteSql("insert into loadmake(lm_id,lm_makecode,lm_linecode,lm_uptime,lm_inman,lm_mannum,lm_stepcode)" +
+                    "values(loadmake_seq.nextval,'" + makecode + "','" + licode + "',sysdate,'" + User.UserName + "','" + mannum + "','" + User.CurrentStepCode + "')", "insert");
                 }
             }
             LoadGridData();