浏览代码

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 年之前
父节点
当前提交
8b82a9264d

+ 1 - 4
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -42,8 +42,6 @@ namespace UAS_MES.Make
 
         Thread thread;
 
-        private System.DateTime[] indate;
-
         string ErrorMessage = "";
 
         public Make_BigBoxCollection()
@@ -205,12 +203,11 @@ namespace UAS_MES.Make
 
         private void FillPrintLabel()
         {
-            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='大箱标' and la_status='AUDITED' order by la_isdefault", "select");
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='大箱标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = _dt;
             PrintLabel.DisplayMember = "la_name";
             PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[_dt.Rows.Count];
             for (int i = 0; i < _dt.Rows.Count; i++)
             {
                 BaseUtil.GetPrintLabel(_dt.Rows[i]["la_name"].ToString(), _dt.Rows[i]["la_url"].ToString());

+ 6 - 9
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs

@@ -21,7 +21,6 @@ namespace UAS_MES.Make
     public partial class Make_BigBoxWeight : Form
     {
         AutoSizeFormClass asc = new AutoSizeFormClass();
-        System.DateTime[] indate;
         DataHelper dh;
         Document doc;
         //true的时候表示从串口读取数据
@@ -138,8 +137,8 @@ namespace UAS_MES.Make
                     {
                         try
                         {
-                            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
+                            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text));
                             dh.ExecuteSql("update package set pa_printcount= pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                             printcount++;
                             weightsum.Text = printcount + "";
@@ -179,16 +178,14 @@ namespace UAS_MES.Make
 
         private void pa_prodcode_TextChanged(object sender, EventArgs e)
         {
-            DataTable _dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pa_prodcode.Text + "' and PL_LABELTYPE='大箱标' order by PL_ISDEFAULT DESC", "select");
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='大箱标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = _dt;
-            PrintLabel.DisplayMember = "pl_name";
-            PrintLabel.ValueMember = "pl_labelcode";
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[_dt.Rows.Count];
             for (int i = 0; i < _dt.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(_dt.Rows[i]["pl_labelname"].ToString(), _dt.Rows[i]["pl_labelurl"].ToString(), _dt.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(_dt.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(_dt.Rows[i]["la_name"].ToString(), _dt.Rows[i]["la_url"].ToString());
             }
         }
 

+ 6 - 9
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -28,7 +28,6 @@ namespace UAS_MES.Make
         decimal StandardQTY = 0;
         string LastSncode;
         Document doc;
-        System.DateTime[] indate;
 
         public Make_PackageCollection()
         {
@@ -113,8 +112,8 @@ namespace UAS_MES.Make
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
-                    doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                    Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                    doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
+                    Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text));
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
@@ -299,16 +298,14 @@ namespace UAS_MES.Make
             pa_outboxcode.MakeCode = pa_makecode.Text;
             pa_outboxcode.ProdCode = pr_code.Text;
             pa_outboxcode.Caller = "PACKAGE";
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='卡通箱标' order by pl_isdefault desc ", "select");
+            dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = dt;
-            PrintLabel.DisplayMember = "pl_laname";
-            PrintLabel.ValueMember = "pl_labelcode";
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(dt.Rows[i]["pl_labelname"].ToString(), dt.Rows[i]["pl_labelurl"].ToString(), dt.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(dt.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(dt.Rows[i]["la_name"].ToString(), dt.Rows[i]["la_id"].ToString());
             }
         }
 

+ 6 - 10
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -46,8 +46,6 @@ namespace UAS_MES.Make
         //true的时候表示从串口读取数据
         bool GetData = true;
 
-        System.DateTime[] indate;
-
         public Make_PackageCollectionWeigh()
         {
 
@@ -191,8 +189,8 @@ namespace UAS_MES.Make
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
-                    doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                    Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                    doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
+                    Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text));
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
@@ -377,16 +375,14 @@ namespace UAS_MES.Make
             pa_outboxcode.MakeCode = pa_makecode.Text;
             pa_outboxcode.ProdCode = pr_code.Text;
             pa_outboxcode.Caller = "PACKAGE";
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='卡通箱标' order by pl_isdefault desc ", "select");
+            dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='卡通箱标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = dt;
-            PrintLabel.DisplayMember = "pl_laname";
-            PrintLabel.ValueMember = "pl_labelcode";
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(dt.Rows[i]["pl_labelname"].ToString(), dt.Rows[i]["pl_labelurl"].ToString(), dt.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(dt.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(dt.Rows[i]["la_name"].ToString(), dt.Rows[i]["la_url"].ToString(), dt.Rows[i]["pl_indate"].ToString());
             }
         }
 

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -173,7 +173,7 @@ namespace UAS_MES.Make
 
         private void FillPrintLabel()
         {
-            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='栈板标' order by la_isdefault", "select");
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pa_prodcode.Text + "' and la_templatetype='栈板标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = _dt;
             PrintLabel.DisplayMember = "la_name";
             PrintLabel.ValueMember = "la_id";