shim 8 жил өмнө
parent
commit
7fdd596c7e

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

@@ -26,8 +26,6 @@ namespace UAS_MES.Make
         // DataTable ListB;
         DataTable mapB;
 
-        System.DateTime[] indate;
-
         string ma_unlimitin = "";
 
         ApplicationClass lbl;
@@ -148,8 +146,8 @@ namespace UAS_MES.Make
                                 return;
                             }
                             //按照打印张数打印
-                            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.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, sncode.Text, int.Parse(PrintNum.Text));
                             //提示用户打印成功
                             OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
                             //记录日志
@@ -193,20 +191,18 @@ namespace UAS_MES.Make
         }
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + ma_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='" + ma_prodcode.Text + "' and la_templatetype='机身标' and la_statuscode='AUDITED' order by la_isdefault", "select");
             if (dt.Rows.Count == 0)
             {
                 return;
             }
             PrintLabel.DataSource = dt;
-            PrintLabel.DisplayMember = "pl_name";
-            PrintLabel.ValueMember = "pl_labelcode";
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             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());
             }
             pr_change = true;
         }

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

@@ -40,8 +40,6 @@ namespace UAS_MES.Make
 
         DataTable info;
 
-        System.DateTime[] indate;
-
         //创建串口实例
         SerialPort serialPort1 = new SerialPort();
         //true的时候表示从串口读取数据
@@ -162,8 +160,8 @@ namespace UAS_MES.Make
                                     OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护栈板标签模板\n", Color.Red, palletcode);
                                     return;
                                 }
-                                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, palletcode.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, palletcode.Text, int.Parse(printNum.Text));
                             }
                             catch (Exception ex)
                             {
@@ -192,20 +190,18 @@ namespace UAS_MES.Make
 
         private void pa_prodcode_TextChanged(object sender, EventArgs e)
         {
-            listc = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pa_prodcode.Text + "'and PL_LABELTYPE='栈板标' order by pl_isdefault desc", "select");
+            listc = (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");
             if (listc.Rows.Count == 0)
             {
                 OperateResult.AppendText(">>产品:" + pa_prodcode.Text + "未维护栈板标签模板\n", Color.Red);
             }
             PrintLabel.DataSource = listc;
-            PrintLabel.DisplayMember = "pl_name";
-            PrintLabel.ValueMember = "pl_labelcode";
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[listc.Rows.Count];
             for (int i = 0; i < listc.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(listc.Rows[i]["pl_labelname"].ToString(), listc.Rows[i]["pl_labelurl"].ToString(), listc.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(listc.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(listc.Rows[i]["la_name"].ToString(), listc.Rows[i]["la_url"].ToString());
             }
         }
 

+ 8 - 12
UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs

@@ -31,8 +31,6 @@ namespace UAS_MES.Make
 
         DataTable dt;
 
-        System.DateTime[] indate;
-
         ftpOperater ftp;
 
         DataTable listA;
@@ -179,7 +177,7 @@ namespace UAS_MES.Make
             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='" + type + "' order by pl_isdefault desc";
+            getlabel = "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='"+type+"' and la_statuscode='AUDITED' order by la_isdefault";
 
             listA = (DataTable)dh.ExecuteSql(getlabel, "select");
             if (listA.Rows.Count == 0)
@@ -187,14 +185,12 @@ namespace UAS_MES.Make
                 OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护" + type + "模板\n", Color.Red);
             }
             PrintLabel.DataSource = listA;
-            PrintLabel.DisplayMember = "pl_name";
-            PrintLabel.ValueMember = "pl_labelcode";
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftp = new ftpOperater();
-            indate = new System.DateTime[listA.Rows.Count];
             for (int i = 0; i < listA.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(listA.Rows[i]["pl_labelname"].ToString(), listA.Rows[i]["pl_labelurl"].ToString(), listA.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(listA.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(listA.Rows[i]["la_name"].ToString(), listA.Rows[i]["la_url"].ToString());
             }
         }
         private void print_Click(object sender, EventArgs e)
@@ -229,8 +225,8 @@ namespace UAS_MES.Make
                 //判定通过进行打印
                 //按照打印张数打印
                 OperateResult.AppendText("<<打印成功\n", Color.Green);
-                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.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, inputValue.Text, int.Parse(printNum.Text));
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
                 //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
@@ -254,8 +250,8 @@ namespace UAS_MES.Make
                 }
                 //判断通过,打印
                 OperateResult.AppendText("<<打印成功\n", Color.Green);
-                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.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, inputValue.Text, int.Parse(printNum.Text));
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
                 //如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN

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

@@ -45,8 +45,6 @@ namespace UAS_MES.Make
         //true的时候表示从串口读取数据
         bool GetData = true;
 
-        System.DateTime[] indate;
-
         public Make_SpecialCartonPack()
         {
             InitializeComponent();
@@ -196,8 +194,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);
             }
@@ -494,16 +492,14 @@ namespace UAS_MES.Make
             {
                 LoadCheckQTY();
                 pr_code.Text = dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_sncode='" + PackageDetail.Rows[0].Cells["pd_barcode"].Value.ToString() + "' order by ms_id desc").ToString();
-                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 + "' 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());
                 }
             }
         }