|
|
@@ -68,6 +68,8 @@ namespace UAS_MES_NEW.Make
|
|
|
|
|
|
List<string> SpType = new List<string>();
|
|
|
|
|
|
+ List<string> SpSNType = new List<string>();
|
|
|
+
|
|
|
List<string> ReturnUseRate = new List<string>();
|
|
|
|
|
|
List<string> ReturnSubFix = new List<string>();
|
|
|
@@ -176,6 +178,7 @@ namespace UAS_MES_NEW.Make
|
|
|
string sp_subnumlength = dt1.Rows[RemainIndex]["sp_subnumlength"].ToString();
|
|
|
string sp_rate = dt1.Rows[RemainIndex]["sp_rate"].ToString();
|
|
|
string sptype = dt1.Rows[RemainIndex]["sptype"].ToString();
|
|
|
+ string sp_sntype = dt1.Rows[RemainIndex]["sp_sntype"].ToString();
|
|
|
string resultstr = "";
|
|
|
string subfix = "";
|
|
|
string userate = "0";
|
|
|
@@ -210,7 +213,7 @@ namespace UAS_MES_NEW.Make
|
|
|
sp_soncode = ErrorMessage;
|
|
|
}
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上物料", sn_code.Text + "上物料" + code.Text + "料号" + sp_fsoncode, sn_code.Text, "");
|
|
|
- Save_OtherCode(soncode, sp_soncode, make_code, sn_code.Text, sp_id, resultstr, userate, subfix, sptype);
|
|
|
+ Save_OtherCode(soncode, sp_soncode, make_code, sn_code.Text, sp_id, resultstr, userate, subfix, sptype, sp_sntype);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -420,9 +423,9 @@ namespace UAS_MES_NEW.Make
|
|
|
//单独用一个DataTable存储一个
|
|
|
dt1 = new DataTable();
|
|
|
sql.Clear();
|
|
|
- sql.Append("select 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,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 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,max(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,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
|
|
|
+ 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_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 sp_stepcode='" + User.CurrentStepCode + "' ");
|
|
|
@@ -430,14 +433,14 @@ 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,wm_concat(spr_soncode) spr_soncode,max(spr_ifuseregex)spr_ifuseregex,max(spr_ifforsn)");
|
|
|
+ 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)");
|
|
|
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 spr_stepcode='" + User.CurrentStepCode + "' ");
|
|
|
sql.Append("And spr_mothercode ='" + ma_prodcode.Text + "' and spr_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("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,sptype,sp_id order by sp_id");
|
|
|
+ sql.Append(") group by case when spr_isreplace=-1 then to_char(spr_isreplace) else sp_fsoncode end,sp_id order by sp_id");
|
|
|
dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
code.Clear();
|
|
|
//用于记录提醒的数据长度
|
|
|
@@ -550,13 +553,14 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
|
|
|
|
//此类中通用的保存逻辑
|
|
|
- private void Save_OtherCode(string sp_fsoncode, string sp_soncode, string ma_code, string ms_sncode, string sp_id, string resultstr, string userate, string subfix,string sptype)
|
|
|
+ private void Save_OtherCode(string sp_fsoncode, string sp_soncode, string ma_code, string ms_sncode, string sp_id, string resultstr, string userate, string subfix, string sptype, string sp_sntype)
|
|
|
{
|
|
|
LogicHandler.CheckBarcode(ma_code, ms_sncode, code.Text, resultstr, Tag.ToString());
|
|
|
CollectDataSonCode.Add(sp_fsoncode);
|
|
|
ReturnUseRate.Add(userate);
|
|
|
ReturnSubFix.Add(subfix);
|
|
|
SpType.Add(sptype);
|
|
|
+ SpSNType.Add(sp_sntype);
|
|
|
//采集成功提示
|
|
|
ResultStr.Add(resultstr);
|
|
|
CollectData.Add(code.Text);
|
|
|
@@ -580,13 +584,13 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into Craftmaterial (cm_id ,cm_prodtype,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
|
|
|
- sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn,cm_substr,cm_subfix,cm_rate,cm_type)");
|
|
|
+ sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn,cm_substr,cm_subfix,cm_rate,cm_type,cm_sntype)");
|
|
|
sql.Append("select Craftmaterial_seq.nextval,sp_prodtype, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,mcd_stepcode,");
|
|
|
sql.Append("mcd_stepname,sp_fsoncode,ms_craftcode,ms_craftname,:barcode,1,sysdate,'" + User.UserCode + "','" + User.UserLineCode + "',ma_wccode,");
|
|
|
- sql.Append("'" + User.UserSourceCode + "',:sp_id,0,1,ms_firstsn,:substr,:subfix,:rate,:sptype from make left join makecraftdetail on mcd_maid=ma_id left join stepproduct on sp_stepcode=mcd_stepcode ");
|
|
|
+ sql.Append("'" + User.UserSourceCode + "',:sp_id,0,1,ms_firstsn,:substr,:subfix,:rate,:sptype,:spsntype from make left join makecraftdetail on mcd_maid=ma_id left join stepproduct on sp_stepcode=mcd_stepcode ");
|
|
|
sql.Append(" and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code and sp_craftcode=ms_craftcode ");
|
|
|
sql.Append("where ma_code='" + make_code + "'and sp_id=:sp_id1 and ms_sncode='" + ms_sncode + "'");
|
|
|
- dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "substr", "subfix", "rate", "sptype", "sp_id1", }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), ResultStr.ToArray(), ReturnSubFix.ToArray(), ReturnUseRate.ToArray() ,SpType.ToArray(), SPID.ToArray());
|
|
|
+ dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "substr", "subfix", "rate", "sptype", "spsntype", "sp_id1", }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), ResultStr.ToArray(), ReturnSubFix.ToArray(), ReturnUseRate.ToArray(), SpType.ToArray(), SpSNType.ToArray(), SPID.ToArray());
|
|
|
try
|
|
|
{
|
|
|
string Log = "";
|
|
|
@@ -621,6 +625,7 @@ namespace UAS_MES_NEW.Make
|
|
|
ReturnUseRate.Clear();
|
|
|
ReturnSubFix.Clear();
|
|
|
SpType.Clear();
|
|
|
+ SpSNType.Clear();
|
|
|
ResultStr.Clear();
|
|
|
CheckBarcode.Clear();
|
|
|
CollectDataSonCode.Clear();
|
|
|
@@ -640,6 +645,7 @@ namespace UAS_MES_NEW.Make
|
|
|
ReturnUseRate.Clear();
|
|
|
ReturnSubFix.Clear();
|
|
|
SpType.Clear();
|
|
|
+ SpSNType.Clear();
|
|
|
ResultStr.Clear();
|
|
|
CollectData.Clear();
|
|
|
CollectDataSonCode.Clear();
|