callm 19 jam lalu
induk
melakukan
1868ae5c00

+ 1 - 2
UAS_MES_YD/DataOperate/ExcelHandler.cs

@@ -20,11 +20,10 @@ namespace UAS_MES_NEW.DataOperate
         /// </summary>
         public string ExportExcel(DataTable dt, string FolderPath)
         {
-            //创建一个内存流,用来接收转换成Excel的内容
             MemoryStream ms;
             ms = DataTableToExcel(dt);
             //以系统当前时间命名文件,FileMode.Create表示创建文件,FileAccess.Write表示拥有写的权限
-            string filePath = @FolderPath + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
+            string filePath = @FolderPath;
             FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
             byte[] data = ms.ToArray();
             fs.Write(data, 0, data.Length);

+ 2 - 2
UAS_MES_YDCY/FunctionCode/Make/Make_FeedingCollectionBadOnlyNEW.cs

@@ -439,7 +439,7 @@ namespace UAS_MES_NEW.Make
             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
             sql.Append("sp_regex,max(pr_detail)pr_detail,max(substr(pr_spec,0,20))pr_spec from stepproduct left join product on pr_code=sp_fsoncode where ");
             sql.Append("sp_bomversion='" + ms_bomversion.Text + "' and sp_craftcode='" + ms_craftcode.Text + "' and  instr('" + ms_paststep + "',sp_stepcode)>0 ");
-            sql.Append("And sp_mothercode ='" + ma_prodcode.Text + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where ");
+            sql.Append("And sp_mothercode ='" + ma_prodcode.Text + "' and sp_tracekind=1  and  nvl(pr_prodtype,' ')<>'包装物料' and not exists(select 1 from craftmaterial where ");
             sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_makecode='" + ma_code.Text + "' and cm_fsoncode=");
             sql.Append("sp_fsoncode and cm_status=0 and cm_stepcode=sp_stepcode and cm_spid=sp_id) group by sp_fsoncode,sp_id union ");
             sql.Append("select '替代' sptype,spr_id,max(spr_isreplace),max(spr_rate)spr_rate,max(pr_lightbox)pr_lightbox,spr_spid,max(nvl(spr_subnum,0))spr_subnum,max(nvl(spr_subnumlength,0))spr_subnumlength,max(spr_detno)spr_detno,min(spr_ifrepeat)spr_ifrepeat,max(spr_checkbarcode)spr_checkbarcode,min(spr_checksalecode)spr_checksalecode,");
@@ -447,7 +447,7 @@ namespace UAS_MES_NEW.Make
             sql.Append("spr_ifforsn,max(spr_length)spr_length,max(spr_type)spr_type,replace(wm_concat(spr_prefix),',','|')spr_prefix,max(spr_regex)");
             sql.Append("spr_regex,max(pr_detail)pr_detail,max(substr(pr_spec,0,20))pr_spec from stepproductrep left join product on pr_code=spr_fsoncode where ");
             sql.Append("spr_bomversion='" + ms_bomversion.Text + "' and spr_craftcode='" + ms_craftcode.Text + "' and instr('" + ms_paststep + "',spr_stepcode)>0 ");
-            sql.Append("And spr_mothercode ='" + ma_prodcode.Text + "' and spr_tracekind=1 and not exists(select 1 from craftmaterial where ");
+            sql.Append("And spr_mothercode ='" + ma_prodcode.Text + "' and spr_tracekind=1  and  nvl(pr_prodtype,' ')<>'包装物料' and not exists(select 1 from craftmaterial where ");
             sql.Append("cm_sncode in (select '" + ms_firstsn + "' from dual union select sn from makesnrelation where firstsn='" + ms_firstsn + "') and cm_makecode='" + ma_code.Text + "' and cm_fsoncode=");
             sql.Append("spr_fsoncode and cm_status=0 and cm_stepcode=spr_stepcode) group by spr_fsoncode,spr_id,spr_spid ");
             sql.Append(") group by case when spr_isreplace=-1 then to_char(spr_isreplace) else sp_fsoncode end,sp_id order by sp_id");