|
|
@@ -39,13 +39,13 @@ namespace UAS_MES.Make
|
|
|
|
|
|
DataTable mapB;
|
|
|
|
|
|
- String TSN="";//记录第一次输入的SN
|
|
|
+ String TSN = "";//记录第一次输入的SN
|
|
|
|
|
|
DataTable infoc;
|
|
|
|
|
|
string re_ms_id = "";
|
|
|
|
|
|
- string ms_id="";
|
|
|
+ string ms_id = "";
|
|
|
|
|
|
DataTable formValue;//界面赋值
|
|
|
|
|
|
@@ -66,6 +66,7 @@ namespace UAS_MES.Make
|
|
|
BaseUtil.SetFormCenter(stw);
|
|
|
stw.ShowDialog();
|
|
|
}
|
|
|
+
|
|
|
private void InPrint()
|
|
|
{
|
|
|
try
|
|
|
@@ -89,6 +90,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
//窗口关闭的时候
|
|
|
}
|
|
|
+
|
|
|
private void radioButton_CheckedChange(object sender, EventArgs e)
|
|
|
{
|
|
|
RadioButton btn = sender as RadioButton;
|
|
|
@@ -97,18 +99,21 @@ namespace UAS_MES.Make
|
|
|
//如果是切换成彩盒或者机身标提示用户 输入SN
|
|
|
OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
clearAll();
|
|
|
- } else if (btn.Name == "CartonBox" || btn.Checked)
|
|
|
+ }
|
|
|
+ else if (btn.Name == "CartonBox" || btn.Checked)
|
|
|
{
|
|
|
OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
|
|
|
clearAll();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private void inputText_KeyDown(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
//按下enter键
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
{
|
|
|
- if (inputText.Text == "") {
|
|
|
+ if (inputText.Text == "")
|
|
|
+ {
|
|
|
OperateResult.AppendText("<<输入不能为空\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
@@ -118,35 +123,38 @@ namespace UAS_MES.Make
|
|
|
//select max(ms_id)ms_id from makeserial where ms_sncode=?
|
|
|
ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
|
|
|
//如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
|
|
|
- if (ms_id == "") {
|
|
|
+ if (ms_id == "")
|
|
|
+ {
|
|
|
OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
|
|
|
OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
return;
|
|
|
}
|
|
|
//判断是否装箱通过
|
|
|
- if (checkPacked()) {
|
|
|
+ if (checkPacked())
|
|
|
+ {
|
|
|
return;
|
|
|
}
|
|
|
//界面赋值
|
|
|
- formValue = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='"+ms_id+"'", "select");
|
|
|
- BaseUtil.SetFormValue(this.Controls,formValue);
|
|
|
+ formValue = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='" + ms_id + "'", "select");
|
|
|
+ BaseUtil.SetFormValue(this.Controls, formValue);
|
|
|
//无值,可补打
|
|
|
inputValue.Text = inputText.Text;
|
|
|
inputText.Text = "";
|
|
|
}
|
|
|
//打印类型为卡通箱
|
|
|
- else if(CartonBox.Checked)
|
|
|
+ else if (CartonBox.Checked)
|
|
|
{
|
|
|
//查询箱号是否存在
|
|
|
dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=1", "select");
|
|
|
- if (dt.Rows.Count==0) {
|
|
|
+ if (dt.Rows.Count == 0)
|
|
|
+ {
|
|
|
//无值,返回提示用户“箱号不存在”, “>>请输入卡通箱号”
|
|
|
OperateResult.AppendText("<<箱号:" + inputText.Text + "不存在\n", Color.Red, inputText);
|
|
|
OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
|
|
|
return;
|
|
|
}
|
|
|
//界面赋值
|
|
|
- BaseUtil.SetFormValue(this.Controls,dt);
|
|
|
+ BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
//有值,可以打
|
|
|
//展示产品编号和标签模板到界面
|
|
|
inputValue.Text = inputText.Text;
|
|
|
@@ -157,28 +165,23 @@ namespace UAS_MES.Make
|
|
|
|
|
|
private void PrintLabel_TextChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
- if (pr_code.Text=="") {
|
|
|
+ if (pr_code.Text == "")
|
|
|
+ {
|
|
|
return;
|
|
|
}
|
|
|
if (fuselagel.Checked)
|
|
|
- {
|
|
|
type = "机身标";
|
|
|
- getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc";
|
|
|
- }
|
|
|
else if (giftBox.Checked)
|
|
|
- {
|
|
|
type = "彩盒标";
|
|
|
- getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='彩盒标' order by pl_isdefault desc";
|
|
|
- }
|
|
|
else
|
|
|
- {
|
|
|
type = "卡通箱标";
|
|
|
- getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='卡通箱标' order by pl_isdefault desc";
|
|
|
- }
|
|
|
+
|
|
|
+ getlabel = "select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "'and PL_LABELTYPE='" + type + "' order by pl_isdefault desc";
|
|
|
+
|
|
|
listA = (DataTable)dh.ExecuteSql(getlabel, "select");
|
|
|
if (listA.Rows.Count == 0)
|
|
|
{
|
|
|
- OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护"+type+"模板\n", Color.Red);
|
|
|
+ OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护" + type + "模板\n", Color.Red);
|
|
|
}
|
|
|
PrintLabel.DataSource = listA;
|
|
|
PrintLabel.DisplayMember = "pl_name";
|
|
|
@@ -264,11 +267,13 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 判断彩盒和机身标序列是否已经装箱
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- private bool checkPacked() {
|
|
|
+ private bool checkPacked()
|
|
|
+ {
|
|
|
//如果存在,则判断是否装箱
|
|
|
dt = (DataTable)dh.ExecuteSql("select ms_id,ms_prodcode,ms_makecode,pr_detail, ms_outboxcode from makeserial left join product on pr_code=ms_prodcode where ms_id='" + ms_id + "'", "select");
|
|
|
//判断ms_outboxcode 是否为空,如果有值,则返回提示用户“已经装箱
|
|
|
@@ -292,22 +297,20 @@ namespace UAS_MES.Make
|
|
|
//插入数据至表MAKEDOWN
|
|
|
string md_code = "";
|
|
|
LogicHandler.GetSerialNumByCaller("MakeDown", out md_code);
|
|
|
- //拼接sql插入语句
|
|
|
sql.Clear();
|
|
|
sql.Append("INSERT INTO MAKEDOWN (MD_ID,MD_LINECODE,MD_SCCODE,MD_STEPCODE,");
|
|
|
- sql.Append(CartonBox.Checked?"MD_OUTBOXCODE":"MD_SNCODE"+",MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
|
|
|
+ sql.Append(CartonBox.Checked ? "MD_OUTBOXCODE" : "MD_SNCODE" + ",MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
|
|
|
sql.Append("MD_DOWNDATE,MD_DOWNMAN,MD_STATUS) values (MAKEDOWN_seq.nextval,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
|
|
|
sql.Append("'" + User.CurrentStepCode + "','" + inputValue.Text + "','" + pr_code.Text + "','" + ms_makecode.Text + "','补打标签','" + md_code + "',sysdate,'" + User.UserCode + "','-1')");
|
|
|
- //执行
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
}
|
|
|
|
|
|
private void rePrintCheck_KeyDown(object sender, KeyEventArgs e)
|
|
|
{
|
|
|
//输入ENTER
|
|
|
- if (e.KeyCode==Keys.Enter)
|
|
|
+ if (e.KeyCode == Keys.Enter)
|
|
|
{
|
|
|
- if (rePrintCheck.Text=="")
|
|
|
+ if (rePrintCheck.Text == "")
|
|
|
{
|
|
|
OperateResult.AppendText("<<输入不能为空\n", Color.Red);
|
|
|
return;
|
|
|
@@ -360,14 +363,14 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
}
|
|
|
//勾选的是卡通箱
|
|
|
- else if(CartonBox.Checked)
|
|
|
+ else if (CartonBox.Checked)
|
|
|
{
|
|
|
//第一次输入
|
|
|
if (TSN == "")
|
|
|
{
|
|
|
- infoc = (DataTable)dh.ExecuteSql("select pa_prodcode,pa_makecode,pa_downstatus from package where pa_outboxcode='"+rePrintCheck.Text+"' and pa_type=1", "select");
|
|
|
+ infoc = (DataTable)dh.ExecuteSql("select pa_prodcode,pa_makecode,pa_downstatus from package where pa_outboxcode='" + rePrintCheck.Text + "' and pa_type=1", "select");
|
|
|
//如果查询无值,提示用户卡通箱号不存在,请输入卡通箱号
|
|
|
- if (infoc.Rows.Count==0)
|
|
|
+ if (infoc.Rows.Count == 0)
|
|
|
{
|
|
|
OperateResult.AppendText("<<卡通箱号:" + rePrintCheck.Text + "不存在\n", Color.Red, rePrintCheck);
|
|
|
OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
|
|
|
@@ -376,7 +379,7 @@ namespace UAS_MES.Make
|
|
|
//存在则保存,用于和第二次的比对
|
|
|
TSN = rePrintCheck.Text;
|
|
|
//提示用户输入卡通箱号
|
|
|
- OperateResult.AppendText(">>请输入核对卡通箱号\n", Color.Green,rePrintCheck);
|
|
|
+ OperateResult.AppendText(">>请输入核对卡通箱号\n", Color.Green, rePrintCheck);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -397,7 +400,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
|
|
|
sql.Append("cl_result,cl_sncode,cl_code) values (commandlog_seq.nextval,:inman,sysdate,:linecode,:sourcecode,:makecode,");
|
|
|
sql.Append(":operate,:result,'','')");
|
|
|
- dh.ExecuteSql(sql.GetString(), "insert", User.UserCode, User.UserLineCode, User.UserSourceCode,infoc.Rows[0]["pa_makecode"].ToString(), "标签补打核对,卡通箱号:" + TSN, "核对成功");
|
|
|
+ dh.ExecuteSql(sql.GetString(), "insert", User.UserCode, User.UserLineCode, User.UserSourceCode, infoc.Rows[0]["pa_makecode"].ToString(), "标签补打核对,卡通箱号:" + TSN, "核对成功");
|
|
|
}
|
|
|
else
|
|
|
{
|