فهرست منبع

维修BUG修改

callm 3 هفته پیش
والد
کامیت
809058aeb9

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

@@ -435,7 +435,7 @@ namespace UAS_MES_NEW.Make
             sql.Clear();
             sql.Append("select max(sptype)sptype,case when spr_isreplace=-1 then to_char(spr_isreplace) else sp_fsoncode end A,SP_ID, max(sp_rate)sp_rate,replace(wm_concat(sp_fsoncode),',','?')sp_fsoncode,replace(wm_concat(sp_prefix),',','?')sp_prefix,max(pr_lightbox)pr_lightbox,replace(wm_concat(nvl(sp_subnum,0)),',','?')sp_subnum,replace(wm_concat(nvl(sp_subnumlength,0)),',','?')sp_subnumlength,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,max(sp_barcoderule)sp_barcoderule,replace(wm_concat(sp_sntype),',','?')sp_sntype,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)sp_ifforsn,replace(wm_concat(sp_length),',','?')sp_length,max(sp_type)sp_type,max(sp_regex)sp_regex,max(pr_detail)pr_detail,max(substr(pr_spec,0,20))pr_spec from(");
             sql.Append("select '主料' sptype,0 spr_id,-1 spr_isreplace,max(sp_rate)sp_rate,max(pr_lightbox)pr_lightbox,sp_id,max(nvl(sp_subnum,0))sp_subnum,max(nvl(sp_subnumlength,0))sp_subnumlength,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
-            sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,max(sp_sntype)sp_sntype,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
+            sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,max(nvl(sp_sntype,'原厂'))sp_sntype,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
             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_detail,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 ");
@@ -443,7 +443,7 @@ namespace UAS_MES_NEW.Make
             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 ) 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,");
-            sql.Append("spr_fsoncode,max(spr_barcoderule)spr_barcoderule,max(spr_sntype)spr_sntype,wm_concat(spr_soncode) spr_soncode,max(spr_ifuseregex)spr_ifuseregex,max(spr_ifforsn)");
+            sql.Append("spr_fsoncode,max(spr_barcoderule)spr_barcoderule,max(nvl(spr_sntype,'原厂'))spr_sntype,wm_concat(spr_soncode) spr_soncode,max(spr_ifuseregex)spr_ifuseregex,max(spr_ifforsn)");
             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_detail,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 ");

+ 13 - 15
UAS_MES_YDCY/FunctionCode/Make/Make_Repair67F.cs

@@ -574,24 +574,22 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
             }
-
-
             sql.Clear();
-            sql.Append("select max(pr_lightbox)pr_lightbox,sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
-            sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
+            sql.Append("select * from (select max(sp_stepcode)sp_stepcode,max(sptype)sptype,case when spr_isreplace=-1 then to_char(spr_isreplace) else sp_fsoncode end A,SP_ID, max(sp_rate)sp_rate,replace(wm_concat(sp_fsoncode),',','?')sp_fsoncode,replace(wm_concat(sp_prefix),',','?')sp_prefix,max(pr_lightbox)pr_lightbox,replace(wm_concat(nvl(sp_subnum,0)),',','?')sp_subnum,replace(wm_concat(nvl(sp_subnumlength,0)),',','?')sp_subnumlength,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,max(sp_barcoderule)sp_barcoderule,replace(wm_concat(sp_sntype),',','?')sp_sntype,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)sp_ifforsn,replace(wm_concat(sp_length),',','?')sp_length,max(sp_type)sp_type,max(sp_regex)sp_regex,max(pr_detail)pr_detail,max(substr(pr_spec,0,20))pr_spec from(");
+            sql.Append("select '主料' sptype,max(sp_stepcode)sp_stepcode,0 spr_id,-1 spr_isreplace,max(sp_rate)sp_rate,max(pr_lightbox)pr_lightbox,sp_id,max(nvl(sp_subnum,0))sp_subnum,max(nvl(sp_subnumlength,0))sp_subnumlength,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
+            sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,max(nvl(sp_sntype,'原厂'))sp_sntype,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
             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='" + ma_bomversion + "' and sp_craftcode='" + cr_code.Text + "' and instr('" + ms_paststep + "',sp_stepcode)>0 ");
-            sql.Append("And sp_mothercode ='" + ms_prodcode.Text + "' and sp_tracekind=1  and  nvl(pr_prodtype,' ')<>'包装物料' and not exists(select 1 from craftmaterial left join makematerial on cm_makecode=mm_code and (cm_fsoncode=mm_prodcode or instr(mm_repprodcode,cm_fsoncode)>0) where ");
-            sql.Append("cm_sncode in (select '" + firstsn + "' from dual union select sn from makesnrelation where firstsn='" + firstsn + "') and cm_makecode='" + ms_makecode.Text + "' and ");
-            sql.Append("(sp_fsoncode=mm_prodcode or sp_fsoncode=mm_repprodcode or cm_fsoncode=sp_fsoncode)  and cm_status=0 and cm_stepcode=sp_stepcode) group by sp_fsoncode,sp_id order by SP_DETNO asc");
+            sql.Append("sp_regex,max(pr_detail)pr_detail,max(substr(pr_detail,0,20))pr_spec from stepproduct left join product on pr_code=sp_fsoncode where ");
+            sql.Append("sp_bomversion='" + ma_bomversion + "' and sp_craftcode='" + cr_code.Text + "' and  instr('" + ms_paststep + "',sp_stepcode)>0 ");
+            sql.Append("And sp_mothercode ='" + ms_prodcode.Text + "' and sp_tracekind=1  and  nvl(pr_prodtype,' ')<>'包装物料'  group by sp_fsoncode,sp_id union ");
+            sql.Append("select '替代' sptype,max(spr_stepcode)spr_stepcode,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,");
+            sql.Append("spr_fsoncode,max(spr_barcoderule)spr_barcoderule,max(nvl(spr_sntype,'原厂'))spr_sntype,wm_concat(spr_soncode) spr_soncode,max(spr_ifuseregex)spr_ifuseregex,max(spr_ifforsn)");
+            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_detail,0,20))pr_spec from stepproductrep left join product on pr_code=spr_fsoncode where ");
+            sql.Append("spr_bomversion='" + ma_bomversion + "' and spr_craftcode='" + cr_code.Text + "' and instr('" + ms_paststep + "',spr_stepcode)>0 ");
+            sql.Append("And spr_mothercode ='" + ms_prodcode.Text + "' and spr_tracekind=1  and  nvl(pr_prodtype,' ')<>'包装物料' 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) where  not exists(select 1 from craftmaterial where cm_sncode in (select '"+firstsn+"' from dual union select sn from makesnrelation where firstsn='"+ firstsn + "') and cm_makecode='"+ms_makecode.Text+ "'and instr(sp_fsoncode,cm_fsoncode)>0 and cm_status=0)");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-
-            //查询拆解的物料
-            //sql.Clear();
-            //sql.Append("select distinct cm_soncode,pr_detail from craftmaterial left join product on pr_code=cm_fsoncode where cm_sncode in (select '" + firstsn + "' from dual union ");
-            //sql.Append("select sn from makesnrelation where firstsn='" + firstsn + "') and nvl(pr_prodtype,' ')<>'包装物料' and cm_craftcode='" + cr_code.Text + "' and cm_makecode='" + ms_makecode.Text + "' and cm_status=-1 ");
-            //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             ////如果含有序列号物料有被拆解过
             if (dt.Rows.Count > 0)
             {