|
|
@@ -46,6 +46,8 @@ namespace UAS_MES.Make
|
|
|
|
|
|
List<string> CollectData = new List<string>();
|
|
|
|
|
|
+ List<string> CollectDataSonCode = new List<string>();
|
|
|
+
|
|
|
public Make_FeedingCollection()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
@@ -397,7 +399,10 @@ namespace UAS_MES.Make
|
|
|
RemainList[i] = dt1.Rows[i]["sp_soncode"].ToString();
|
|
|
//A序列不存在需要提醒的内容则直接判断B的
|
|
|
if (dt1.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ CollectDataSonCode.Add(dt1.Rows[0]["sp_soncode"].ToString());
|
|
|
OperateResult.AppendText("<<请采集" + dt1.Rows[0]["sp_soncode"].ToString() + "的" + dt1.Rows[0]["sp_type"].ToString() + "数据\n", Color.Black);
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
OperateResult.AppendText(">>当前序列号没有需要采集的内容,请采集其他序列号\n", Color.Red);
|
|
|
@@ -423,18 +428,21 @@ namespace UAS_MES.Make
|
|
|
code.Clear();
|
|
|
//如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了
|
|
|
if (RemainIndex < RemainList.Length)
|
|
|
+ {
|
|
|
+ CollectDataSonCode.Add(dt1.Rows[RemainIndex]["sp_soncode"].ToString());
|
|
|
OperateResult.AppendText("<<请采集" + RemainList[RemainIndex] + "的" + dt1.Rows[RemainIndex]["sp_type"].ToString() + "数据\n", Color.Black);
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,");
|
|
|
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)");
|
|
|
- sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,ms_code,ms_sncode,mcd_stepcode,");
|
|
|
+ sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,mcd_stepcode,");
|
|
|
sql.Append("mcd_stepname,ma_craftcode,ma_craftname,:barcode,1,sysdate,'" + User.UserCode + "',ma_linecode,ma_wccode,");
|
|
|
sql.Append("'" + User.UserSourceCode + "','" + sp_id + "',0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code left join stepproduct on sp_stepcode=mcd_stepcode ");
|
|
|
sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
|
|
|
sql.Append("where ma_code='" + make_code + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
|
|
|
- dh.BatchInsert(sql.GetString(), new string[] { "barcode" }, CollectData.ToArray());
|
|
|
+ dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
|
|
|
//采集成功,设置序列号栏目为空
|
|
|
RemainIndex = 0;
|
|
|
OperateResult.AppendText(">>上料采集完成!\n", Color.Green);
|