|
|
@@ -141,16 +141,42 @@ namespace UAS_MES_NEW.Special
|
|
|
OperateResult.AppendText(">>不允许自己转自己\n", Color.Red, sncode);
|
|
|
return;
|
|
|
}
|
|
|
- if (!sncode.Text.Contains(ma_code.Text.Replace("-1", "")))
|
|
|
+ Boolean CheckPass = false;
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql(" select max(psr_prefix)psr_prefix,max(PSR_LENGTH)PSR_LENGTH from productsnrule where psr_prodcode=v_maprodcode and psr_type='after'", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>未包含工单号\n", Color.Red, sncode);
|
|
|
- return;
|
|
|
+ string psr_prefix = dt.Rows[0]["psr_prefix"].ToString();
|
|
|
+ string PSR_LENGTH = dt.Rows[0]["PSR_LENGTH"].ToString();
|
|
|
+
|
|
|
+ if (!sncode.Text.StartsWith(psr_prefix))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号:" + sncode.Text + " 前缀错误,不满足产品防呆规则\n", Color.Red, sncode);
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (sncode.Text.Length != int.Parse(PSR_LENGTH))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号:" + sncode.Text + " 长度错误,不满足产品防呆规则\n", Color.Red, sncode);
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+ CheckPass = true;
|
|
|
}
|
|
|
- if (sncode.Text.Substring(-1) != "Z" && sncode.Text.Substring(-1) != "W")
|
|
|
+ if (!CheckPass)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>结尾非Z和W,不允许采集!\n", Color.Red, sncode);
|
|
|
- return;
|
|
|
+ if (!sncode.Text.Contains(ma_code.Text.Replace("-1", "")))
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>未包含工单号\n", Color.Red, sncode);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (sncode.Text.Substring(-1) != "Z" && sncode.Text.Substring(-1) != "W")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>结尾非Z和W,不允许采集!\n", Color.Red, sncode);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
if (!ChangeResult.Checked)
|
|
|
{
|
|
|
if (dh.CheckExist("returnsnbd", "rsb_newsn = '" + sncode.Text + "'"))
|