callm 1 жил өмнө
parent
commit
be3d84ae15

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.Designer.cs

@@ -143,7 +143,7 @@
             this.pr_code.AllPower = "ifall";
             this.pr_code.Caller = null;
             this.pr_code.Condition = null;
-            this.pr_code.DBTitle = "回流工序";
+            this.pr_code.DBTitle = "选择物料";
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.pr_code.FormName = null;
             this.pr_code.Location = new System.Drawing.Point(434, 74);

+ 5 - 3
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.cs

@@ -38,6 +38,8 @@ namespace UAS_MES_NEW.Query
             pr_code.FormName = Name;
             pr_code.DBTitle = "物料查询";
             pr_code.SetValueField = new string[] { "pr_code" };
+
+            pr_code.Text = "12112572";
         }
 
         private static string lpad(int length, string number)
@@ -195,12 +197,12 @@ namespace UAS_MES_NEW.Query
                     STF_MACHINE.Add(dt.Rows[i][1].ToString());
                 }
                 dh.ExecuteSql("delete from SMTTRACEFILE where stf_code='" + stf_code + "'", "delete");
-                dh.BatchInsert("insert into SMTTRACEFILE(STF_ID, STF_MODEL, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,STF_MACHINE, STF_CODE, STF_INDATE, STF_INMAN)" +
-                    "values(SMTTRACEFILE_SEQ.nextval,:STF_MODEL,:STF_FEEDER,:STF_FEEDERNO,:STF_LOCATION,:STF_MACHINE,'" + stf_code + "',sysdate,'" + User.UserName + "')",
+                dh.BatchInsert("insert into SMTTRACEFILE(STF_ID,stf_prodcode, STF_MODEL, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,STF_MACHINE, STF_CODE, STF_INDATE, STF_INMAN)" +
+                    "values(SMTTRACEFILE_SEQ.nextval,'"+pr_code.Text+"',:STF_MODEL,:STF_FEEDER,:STF_FEEDERNO,:STF_LOCATION,:STF_MACHINE,'" + stf_code + "',sysdate,'" + User.UserName + "')",
                     new string[] { "STF_MODEL", "STF_FEEDER", "STF_FEEDERNO", "STF_LOCATION", "STF_MACHINE" }, STF_MODEL.ToArray(), STF_FEEDER.ToArray(), STF_FEEDERNO.ToArray(), STF_LOCATION.ToArray(), STF_MACHINE.ToArray());
                 dh.ExecuteSql("delete from SMTTRACEFILE where ( STF_MODEL is null and  STF_FEEDER is null and STF_FEEDERNO is null and STF_MACHINE is null ) or stf_model in ('料槽','数量','印刷板') or STF_MACHINE in('贴片生产线:','设置:') ", "delete");
                 dataGridView1.DataSource = dt;
-                DataTable dt1 = (DataTable)dh.ExecuteSql("select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION, STF_CODE, STF_INDATE, STF_INMAN  from SMTTRACEFILE where stf_code='" + stf_code + "' order by stf_id", "select");
+                DataTable dt1 = (DataTable)dh.ExecuteSql("select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,pr_orispeccode,bo_mothercode,bd_baseqty,bd_soncode,bd_location, STF_CODE, STF_INDATE, STF_INMAN from SMTTRACEFILE left join (\r\nselect bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail \r\nLEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code left join ProdReplace on pre_bdid =bd_id where bo_mothercode='" + pr_code.Text + "' ) on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION \r\nleft join product on pr_code=STF_LOCATION where stf_prodcode='"+pr_code.Text+"' order by stf_id", "select");
                 excel.ExportExcel_LIANGAN(dt1, "C:\\Users\\callm\\Desktop\\客户资料\\"+System.DateTime.Now.ToString("yyyyMMddhhmmss")+".xls");
             }
         }