|
|
@@ -28,6 +28,8 @@ namespace UAS_MES.Make
|
|
|
//当前提示的索引
|
|
|
int RemainIndex = 0;
|
|
|
|
|
|
+ List<string> RemindItem = new List<string>();
|
|
|
+
|
|
|
string ErrorMessage = "";
|
|
|
|
|
|
System.DateTime[] indate;
|
|
|
@@ -130,20 +132,25 @@ namespace UAS_MES.Make
|
|
|
code.Text = "";
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,sp_fsoncode,max(sp_barcoderule)");
|
|
|
- sql.Append("sp_barcoderule,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,max(sp_prefix)sp_prefix,max(sp_regex)");
|
|
|
- sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
|
|
|
- sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
|
|
|
- sql.Append("And sp_mothercode ='" + pr_code.Text + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where (cm_sncode='" + ms_firstsn + "' or ");
|
|
|
- sql.Append("cm_sncode in (select sn from makesnrelation where firstsn='" + ms_firstsn + "')) and cm_makecode='" + ma_code.Text + "' and cm_soncode=");
|
|
|
- sql.Append("sp_soncode and cm_status=0) group by sp_fsoncode order by SP_DETNO asc");
|
|
|
+ sql.Append("select sp_id,sp_barcoderule,sp_ifuseregex,sp_ifforsn,sp_length,sp_soncode");
|
|
|
+ sql.Append(",pr_detail,sp_type,sp_prefix,sp_regex,sp_fsoncode from stepproduct left join product on pr_code=sp_soncode where ");
|
|
|
+ sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "'");
|
|
|
+ sql.Append("And sp_mothercode ='" + pr_code.Text + "' and sp_tracekind =1 and not exists (select 1 from ");
|
|
|
+ sql.Append("craftmaterial where (cm_sncode='" + ms_firstsn + "' or cm_sncode in (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) order by SP_DETNO asc");
|
|
|
ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
//获取对应 产品的机身标的打印模板
|
|
|
if (ListA.Rows.Count > 0)
|
|
|
{
|
|
|
- string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
|
|
|
+ string fsoncode= ListA.Rows[RemainIndex]["sp_fsoncode"].ToString();
|
|
|
string prdetail = ListA.Rows[RemainIndex]["pr_detail"].ToString();
|
|
|
+ string soncode = "";
|
|
|
+ RemindItem.Add(fsoncode);
|
|
|
+ for (int i = 0; i < ListA.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ if (fsoncode == ListA.Rows[i]["sp_fsoncode"].ToString())
|
|
|
+ soncode += ListA.Rows[i]["sp_soncode"].ToString() + ",";
|
|
|
+ }
|
|
|
OperateResult.AppendText("<<请采集" + soncode + "(" + prdetail + ")的物料数据\n", Color.Black);
|
|
|
code.Clear();
|
|
|
}
|
|
|
@@ -223,9 +230,23 @@ namespace UAS_MES.Make
|
|
|
code.Clear();
|
|
|
if (RemainIndex <= ListA.Rows.Count - 1)
|
|
|
{
|
|
|
- string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
|
|
|
- string prdetail = ListA.Rows[RemainIndex]["pr_detail"].ToString();
|
|
|
- OperateResult.AppendText("<<请采集" + soncode + "(" + prdetail + ")的物料数据\n", Color.Black);
|
|
|
+ string fsoncode = ListA.Rows[RemainIndex]["sp_fsoncode"].ToString();
|
|
|
+ if (RemindItem.Contains(fsoncode))
|
|
|
+ {
|
|
|
+ RemainIndex = RemainIndex + 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RemindItem.Add(fsoncode);
|
|
|
+ string soncode = "";
|
|
|
+ for (int i = 0; i < ListA.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ if (fsoncode == ListA.Rows[i]["sp_fsoncode"].ToString())
|
|
|
+ soncode += ListA.Rows[i]["sp_soncode"].ToString() + ",";
|
|
|
+ }
|
|
|
+ string prdetail = ListA.Rows[RemainIndex]["pr_detail"].ToString();
|
|
|
+ OperateResult.AppendText("<<请采集" + soncode + "(" + prdetail + ")的物料数据\n", Color.Black);
|
|
|
+ }
|
|
|
}
|
|
|
if (RemainIndex == ListA.Rows.Count)
|
|
|
{
|
|
|
@@ -241,12 +262,11 @@ namespace UAS_MES.Make
|
|
|
//更新半成品SN已被工单使用
|
|
|
dh.ExecuteSql("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + ms_sncode.Text + "' and ms_makecode<>'" + ma_code.Text + "')", "update");
|
|
|
OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
|
|
|
- doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
|
|
|
- Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text));
|
|
|
RemainIndex = 0;
|
|
|
+ RemindItem.Clear();
|
|
|
CollectData.Clear();
|
|
|
CollectDataSonCode.Clear();
|
|
|
- BaseUtil.CleanDataTable(ListA);
|
|
|
+ BaseUtil.CleanDataTableData(ListA);
|
|
|
if (LogicHandler.SetTestResult(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "彩盒上料打印", "彩盒上料成功", User.UserCode, out ErrorMessage))
|
|
|
{
|
|
|
//提示正确返回时传递的信息
|
|
|
@@ -255,9 +275,10 @@ namespace UAS_MES.Make
|
|
|
mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
|
|
|
code.Clear();
|
|
|
LoadCollectNum();
|
|
|
- BaseUtil.CleanDataTableData(ListA);
|
|
|
}
|
|
|
else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
|
|
|
+ doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
|
|
|
+ Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text));
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -300,6 +321,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
BaseUtil.CleanDataTableData(ListA);
|
|
|
RemainIndex = 0;
|
|
|
+ RemindItem.Clear();
|
|
|
code.Clear();
|
|
|
OperateResult.AppendText(">>请重新采集序列号\n");
|
|
|
}
|