Browse Source

上料采集BUG优化

callm 11 hours ago
parent
commit
d9c03a6ec1

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

@@ -441,7 +441,7 @@ namespace UAS_MES_NEW.Make
             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("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("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,");
             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_ifforsn,max(spr_length)spr_length,max(spr_type)spr_type,replace(wm_concat(spr_prefix),',','|')spr_prefix,max(spr_regex)");

+ 1 - 1
UAS_MES_YDCY/FunctionCode/Make/Make_FeedingCollectionNEW.cs

@@ -445,7 +445,7 @@ namespace UAS_MES_NEW.Make
             sql.Append("sp_bomversion='" + ms_bomversion.Text + "' and sp_craftcode='" + ms_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
             sql.Append("And sp_mothercode ='" + ma_prodcode.Text + "' and sp_tracekind=1 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) group by sp_fsoncode,sp_id union ");
+            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,");
             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)");