|
|
@@ -290,31 +290,42 @@ namespace UAS_MES_NEW.Make
|
|
|
List<string> Part = new List<string>();
|
|
|
List<string> Station = new List<string>();
|
|
|
List<string> ReelNo = new List<string>();
|
|
|
+ List<string> letNo = new List<string>();
|
|
|
+
|
|
|
string Part_ = "";
|
|
|
+ int letNoNum = 0;
|
|
|
foreach (var item in xmlList)
|
|
|
{
|
|
|
MachineName.Add(item.MachineName);
|
|
|
- Part_ = item.Part;
|
|
|
+ Part_ = item.Part.Split('.')[0];
|
|
|
Station.Add(item.Station);
|
|
|
ReelNo.Add(item.ReelNo);
|
|
|
+ letNo.Add((++letNoNum).ToString());
|
|
|
}
|
|
|
string ps_id = "";
|
|
|
+
|
|
|
+ string lineId = dh.getFieldDataByCondition("smtlocationinto", "SLI_LANE", "SLI_MCNO='" + MachineName[0] + "'").ToString();
|
|
|
+
|
|
|
if (!dh.CheckExist("productsmt", "ps_prodcode='" + Part_ + "'"))
|
|
|
{
|
|
|
ps_id = dh.GetSEQ("productsmt_seq");
|
|
|
- dh.ExecuteSql("insert into productsmt(ps_id,ps_prodcode,ps_linecode,ps_status,ps_statuscode)" +
|
|
|
- "values('" + ps_id + "','" + Part_ + "','','在录入','ENTERING')", "insert");
|
|
|
+ dh.ExecuteSql("insert into productsmt(ps_id,ps_prodcode,ps_status,ps_statuscode,PS_LINECODE,PS_CODE)" +
|
|
|
+ "values('" + ps_id + "','" + Part_ + "','在录入','ENTERING','"+ lineId + "','"+ PS_CODE + "')", "insert");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
ps_id = dh.getFieldDataByCondition("productsmt", "ps_id", "ps_prodcode='"+Part_+"'").ToString();
|
|
|
}
|
|
|
+ if (dh.getRowCount("productsmtlocation", "PSL_PSID=" + ps_id) > 0)
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("delete from productsmtlocation where PSL_PSID" + ps_id, "delete");
|
|
|
+ }
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into productsmtlocation(PSL_ID, PSL_PSID, PSL_DETNO, PSL_PRODCODE, PSL_REPCODE, PSL_LOCATION, PSL_BASEQTY, PSL_TABLE)" +
|
|
|
- "select productsmtlocation_seq.nextval," + ps_id + ",rownum,:ReelNo,:ReelNo,:Station,BD_BASEQTY,'' from bom@ERP " +
|
|
|
+ "select productsmtlocation_seq.nextval," + ps_id + ",:letArr, :ReelNo,:ReelNo,:Station,BD_BASEQTY,'' from bom@ERP " +
|
|
|
"left join bomdetail@ERP on bo_id=bd_bomid where bo_mothercode='" + Part_ + "' and BD_SONCODE=:ReelNo");
|
|
|
- dh.BatchInsert(sql.GetString(), new string[] { "ReelNo", "ReelNo", "Station", "Part", "ReelNo" },
|
|
|
- ReelNo.ToArray(), ReelNo.ToArray(), Station.ToArray(), Part.ToArray(), ReelNo.ToArray());
|
|
|
+ dh.BatchInsert(sql.GetString(), new string[] {"letArr", "ReelNo", "ReelNo", "Station", "ReelNo" },
|
|
|
+ letNo.ToArray(),ReelNo.ToArray(), ReelNo.ToArray(), Station.ToArray(), ReelNo.ToArray());
|
|
|
Console.WriteLine();
|
|
|
}
|
|
|
}
|