|
|
@@ -67,7 +67,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
lbl = new ApplicationClass();
|
|
|
BaseUtil.WriteLbl();
|
|
|
}
|
|
|
- catch (Exception)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
|
|
|
}
|
|
|
@@ -159,10 +159,12 @@ namespace UAS_MES_NEW.Packing
|
|
|
private void LoadData()
|
|
|
{
|
|
|
//加载表单数据
|
|
|
+ string Err = "";
|
|
|
sql.Clear();
|
|
|
sql.Append("select pa_prodcode,pr_cartonmaxw,pa_salecode,pa_remark,pa_makecode,pr_cartonunit,pr_code,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
|
|
|
sql.Append("pa_status,pr_packrule,pr_detail,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_packageqty,nvl(pa_standardqty,0)pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pa_currentqty from package left join ");
|
|
|
sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ Err = "箱号";
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -260,7 +262,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
{
|
|
|
if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_prodcode,ms_craftcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
|
|
|
if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
|
|
|
{
|
|
|
if (oMsID == "" || oMsID == "null" || oMsID == "0")
|
|
|
@@ -273,7 +275,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
{
|
|
|
string prodcode = dt.Rows[0]["ms_prodcode"].ToString();
|
|
|
string craftcode = dt.Rows[0]["ms_craftcode"].ToString();
|
|
|
- string craftstepcode = dh.getFieldDataByCondition("craft left join craftdetail on cr_id =cd_crid", "(cd_stepcode)", "cr_prodcode='" + prodcode + "' and cr_code='" + craftcode + "' and cd_stepcode='" + User.CurrentStepCode + "'").ToString();
|
|
|
+ string craftstepcode = dh.getFieldDataByCondition("craft left join craftdetail on cr_id =cd_crid", "cd_stepcode", "cr_prodcode='" + prodcode + "' and cr_code='" + craftcode + "' and cd_stepcode='" + User.CurrentStepCode + "'").ToString();
|
|
|
if (craftstepcode == "")
|
|
|
{
|
|
|
OperateResult.AppendText("工序" + User.CurrentStepCode + "不在途程" + craftcode + "内,不允许采集\n", Color.Red);
|
|
|
@@ -454,6 +456,11 @@ namespace UAS_MES_NEW.Packing
|
|
|
float weigh = float.Parse(ActWeigh);
|
|
|
if (PR_CHECKCARTONW != "0")
|
|
|
{
|
|
|
+ if (MinWeight == 0 || MaxWeight == 0)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>产品" + pr_code.Text + "未维护卡通箱重量范围\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!(weigh >= MinWeight && weigh <= MaxWeight) || weigh == 0)
|
|
|
{
|
|
|
OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
|
|
|
@@ -552,11 +559,6 @@ namespace UAS_MES_NEW.Packing
|
|
|
private void Clean_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
OperateResult.Clear();
|
|
|
- for (int i = 0; i < 20; i++)
|
|
|
- {
|
|
|
- sn_code.Text = "SN30009" + i;
|
|
|
- barcode_KeyDown(sender, new KeyEventArgs(Keys.Enter));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
private void pr_code_TextChanged(object sender, EventArgs e)
|
|
|
@@ -651,7 +653,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
return;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("update oqcbatch set ob_status='UNCHECK' where ob_checkno ='" + ob_checkno.Text + "'");
|
|
|
+ sql.Append("update oqcbatch set ob_status='UNCHECK',ob_breakingdate=sysdate where ob_checkno ='" + ob_checkno.Text + "'");
|
|
|
dh.ExecuteSql(sql.GetString(), "select");
|
|
|
ob_nowcheckqty.Text = "";
|
|
|
ob_batchqty.Text = "";
|
|
|
@@ -806,7 +808,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
List<string> SQLS2 = new List<string>();
|
|
|
string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + pr_code.Text + "'").ToString();
|
|
|
//置空原箱
|
|
|
- SQLS2.Add("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY="+ standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ SQLS2.Add("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = " + standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
pa_status.Text = "0";
|
|
|
//删除箱的明细
|
|
|
SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
@@ -998,6 +1000,7 @@ namespace UAS_MES_NEW.Packing
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private bool CheckOutBoxLength(string ms_salecode_text)
|
|
|
{
|
|
|
if (AutoGenBoxCode.Checked)
|