|
|
@@ -6,6 +6,8 @@ using System.IO;
|
|
|
using UAS_MES_NEW.Entity;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Windows.Forms;
|
|
|
+using static System.Runtime.CompilerServices.RuntimeHelpers;
|
|
|
+using System.Drawing;
|
|
|
|
|
|
namespace UAS_MES_NEW.PublicMethod
|
|
|
{
|
|
|
@@ -101,7 +103,7 @@ namespace UAS_MES_NEW.PublicMethod
|
|
|
{
|
|
|
doc.Variables.FormVariables.Item(k + 1).Value = null;
|
|
|
}
|
|
|
- LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
|
|
|
+ LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode, LabelName);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -110,15 +112,15 @@ namespace UAS_MES_NEW.PublicMethod
|
|
|
{
|
|
|
ErrorMessage = "";
|
|
|
DataTable dt = new DataTable();
|
|
|
- if (IfRePrint != "-1"&&LabelType!="栈板标")
|
|
|
+ if (IfRePrint != "-1" && LabelType != "栈板标")
|
|
|
{
|
|
|
- if (LabelType == "卡通箱标" || LabelType == "大箱标" )
|
|
|
+ if (LabelType == "卡通箱标" || LabelType == "大箱标")
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + LabelName + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "' and lpl_file='"+LabelName+"'", "select");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + LabelName + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "' and lpl_file='"+LabelName+"'", "select");
|
|
|
}
|
|
|
////如果已经打印过了,则不允许再打印
|
|
|
if (dt.Rows.Count > 0)
|
|
|
@@ -127,6 +129,25 @@ namespace UAS_MES_NEW.PublicMethod
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (LabelType == "卡通箱标" || LabelType == "机身标" || LabelType == "彩盒标")
|
|
|
+ {
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "'", "select");
|
|
|
+ if (dt.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ ErrorMessage = SnCode + LabelType + "未打印,不允许补打";
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ string getlabel = @"select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + ProdCode + "' and la_templatetype='" + LabelType + "' and la_statuscode='AUDITED' order by la_isdefault";
|
|
|
+ DataTable listA = (DataTable)dh.ExecuteSql(getlabel, "select");
|
|
|
+ if (listA.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ MessageBox.Show("产品:" + ProdCode + "未维护" + LabelType + "模板");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
|
|
|
FileInfo PrintFile = new FileInfo(LabelName);
|
|
|
//打开模板路径
|
|
|
@@ -204,7 +225,7 @@ namespace UAS_MES_NEW.PublicMethod
|
|
|
{
|
|
|
doc.Variables.FormVariables.Item(k + 1).Value = null;
|
|
|
}
|
|
|
- LogicHandler.doLabelPrintLog(SnCode, LabelType + LabelName, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
|
|
|
+ LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode, LabelName);
|
|
|
return true;
|
|
|
}
|
|
|
}
|