|
@@ -168,7 +168,7 @@ namespace UAS_LabelMachine
|
|
|
Width = ScreenArea.Width;
|
|
Width = ScreenArea.Width;
|
|
|
Height = ScreenArea.Height;
|
|
Height = ScreenArea.Height;
|
|
|
MidBoxCapacity.Value = Properties.Settings.Default.MidBoxCapacity;
|
|
MidBoxCapacity.Value = Properties.Settings.Default.MidBoxCapacity;
|
|
|
- OutboxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
|
|
|
|
|
|
|
+ OutBoxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
|
|
|
asc.controllInitializeSize(this);
|
|
asc.controllInitializeSize(this);
|
|
|
asc.controlAutoSize(this);
|
|
asc.controlAutoSize(this);
|
|
|
//实例化打印进程
|
|
//实例化打印进程
|
|
@@ -204,6 +204,12 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ string LotNo = "";
|
|
|
|
|
+ string DateCode = "";
|
|
|
|
|
+ string Order = "";
|
|
|
|
|
+ string QTY = "";
|
|
|
|
|
+ string PN = "";
|
|
|
|
|
+ string OutBox = "";
|
|
|
//获取串口数据
|
|
//获取串口数据
|
|
|
private void Serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
|
|
private void Serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
|
|
|
{
|
|
{
|
|
@@ -214,12 +220,6 @@ namespace UAS_LabelMachine
|
|
|
byte[] readBuffer = new byte[len];
|
|
byte[] readBuffer = new byte[len];
|
|
|
port.Read(readBuffer, 0, len); //将数据读入缓存
|
|
port.Read(readBuffer, 0, len); //将数据读入缓存
|
|
|
string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
|
|
string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
|
|
|
- string LotNo = "";
|
|
|
|
|
- string DateCode = "";
|
|
|
|
|
- string Order = "";
|
|
|
|
|
- string QTY = "";
|
|
|
|
|
- string PN = "";
|
|
|
|
|
- string OutBox = "";
|
|
|
|
|
string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
switch (port.Tag)
|
|
switch (port.Tag)
|
|
|
{
|
|
{
|
|
@@ -336,10 +336,16 @@ namespace UAS_LabelMachine
|
|
|
//获取当前最大的箱号
|
|
//获取当前最大的箱号
|
|
|
string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
|
|
|
+ boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
|
|
+ int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
|
if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
{
|
|
{
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
|
|
|
|
|
+ {
|
|
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
|
|
+ }
|
|
|
else if (CurrentRowIndex - 1 >= 0)
|
|
else if (CurrentRowIndex - 1 >= 0)
|
|
|
{
|
|
{
|
|
|
if (cu_print_midlotno.Checked)
|
|
if (cu_print_midlotno.Checked)
|
|
@@ -364,19 +370,21 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
|
|
|
- adh.ExecuteSql("update prodiobarcode set pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
|
|
|
|
|
+ adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
LabelInf.Refresh();
|
|
LabelInf.Refresh();
|
|
|
if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
|
CurrentRowIndex = CurrentRowIndex + 1;
|
|
CurrentRowIndex = CurrentRowIndex + 1;
|
|
|
RefreshProcessData();
|
|
RefreshProcessData();
|
|
|
|
|
+ LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
|
|
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
|
|
+ LogManager.DoLog(ex.StackTrace);
|
|
|
MessageBox.Show("接收返回消息异常!具体原因:" + ex.Message, "提示信息");
|
|
MessageBox.Show("接收返回消息异常!具体原因:" + ex.Message, "提示信息");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1148,7 +1156,9 @@ namespace UAS_LabelMachine
|
|
|
Count++;
|
|
Count++;
|
|
|
}
|
|
}
|
|
|
int midboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (midboxcode == "" ? "0" : midboxcode));
|
|
int midboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (midboxcode == "" ? "0" : midboxcode));
|
|
|
|
|
+ int outboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + (outboxcode == "" ? "0" : outboxcode));
|
|
|
midboxProcess.Text = midboxcount + "/" + MidBoxCapacity.Value;
|
|
midboxProcess.Text = midboxcount + "/" + MidBoxCapacity.Value;
|
|
|
|
|
+ outboxProcess.Text = outboxcount + "/" + OutBoxCapacity.Value;
|
|
|
//设置当前的箱号和盒号
|
|
//设置当前的箱号和盒号
|
|
|
Process_midboxcode.Text = midboxcode;
|
|
Process_midboxcode.Text = midboxcode;
|
|
|
Process_outboxcode.Text = outboxcode;
|
|
Process_outboxcode.Text = outboxcode;
|