Browse Source

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

Hcsy 8 years ago
parent
commit
a961abdfe3

+ 3 - 0
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -25,6 +25,8 @@ namespace UAS_MES.Make
 
         LogStringBuilder sql = new LogStringBuilder();
 
+        Document doc;
+
         Make_NewBigBox NewBigBox;
 
         //箱类型
@@ -242,6 +244,7 @@ namespace UAS_MES.Make
             if (PrintLabel.Items.Count != 0)
             {
                 OperateResult.AppendText(">>打印箱号" + bigoutboxcode.Text + "\n", Color.Black);
+                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
                 Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
             }
             else

+ 6 - 2
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -28,6 +28,8 @@ namespace UAS_MES.Make
 
         ApplicationClass lbl;
 
+        Document doc;
+
         Thread thread;
         //创建串口实例
         SerialPort serialPort1 = new SerialPort();
@@ -130,7 +132,8 @@ namespace UAS_MES.Make
                     {
                         if (AutoPrint.Checked)
                         {
-                            Print.CodeSoft(Tag.ToString(),lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
+                            Print.CodeSoft(Tag.ToString(),doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                         }
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格", outboxcode.Text, "");
                         OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
@@ -185,7 +188,8 @@ namespace UAS_MES.Make
         //确认打印
         private void Confirm_Click(object sender, EventArgs e)
         {
-            Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
+            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
         }
 
         //停止进程,关闭串口

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

@@ -34,6 +34,8 @@ namespace UAS_MES.Make
 
         ApplicationClass lbl;
 
+        Document doc;
+
         Thread InitPrint;
 
         List<string> CollectData = new List<string>();
@@ -219,7 +221,8 @@ namespace UAS_MES.Make
                             sql.Append("where ma_code='" + macode + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
-                            Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_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, ms_sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                             RemainIndex = 0;
                             CollectData.Clear();
                             CollectDataSonCode.Clear();

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -27,6 +27,7 @@ namespace UAS_MES.Make
         string oOutBoxCode = "";
         decimal StandardQTY = 0;
         string LastSncode;
+        Document doc;
         System.DateTime[] indate;
 
         public Make_PackageCollection()
@@ -104,7 +105,6 @@ namespace UAS_MES.Make
             pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
         }
 
-
         private void Print_Click(object sender, EventArgs e)
         {
             if (PrintLabel.Items.Count != 0)
@@ -113,7 +113,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);
-                    Print.CodeSoft(Tag.ToString(), lbl, 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.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]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }

+ 3 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -21,6 +21,7 @@ namespace UAS_MES.Make
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
+        Document doc;
         ApplicationClass lbl;
         Thread thread;
         DataTable Dbfind;
@@ -190,7 +191,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);
-                    Print.CodeSoft(Tag.ToString(), lbl, 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.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]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }

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

@@ -38,6 +38,8 @@ namespace UAS_MES.Make
 
         ApplicationClass lbl;
 
+        Document doc;
+
         Thread thread;
 
         private System.DateTime[] indate;
@@ -213,7 +215,8 @@ namespace UAS_MES.Make
             if (PrintLabel.Items.Count != 0)
             {
                 OperateResult.AppendText(">>打印箱号" + palletcode.Text + "\n", Color.Black);
-                Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                doc = lbl.Documents.Open(ftpOperater.DownLoadTo+ PrintLabel.Text.Split(':')[1]);
+                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
             }
             else
                 OperateResult.AppendText(">>产品" + pa_prodcode.Text + "未维护打印标签\n", Color.Red);

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

@@ -91,7 +91,7 @@ namespace UAS_MES.Make
                             if (GetMakeInfo(code.Text, out makecode, out errorMessage))
                             {
                                 //核对工序
-                                if (LogicHandler.CheckStepSNAndMacode(makecode == ms_macode.Text ? makecode : "", User.UserSourceCode, code.Text, User.UserCode, out oMakecode, out oMsid, out errorMessage))
+                                if (LogicHandler.CheckStepSNAndMacode(makecode, User.UserSourceCode, code.Text, User.UserCode, out oMakecode, out oMsid, out errorMessage))
                                 {
                                     //按照out出的工单号查出工单相关信息,并赋值到相关控件
                                     sql.Clear();

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

@@ -90,7 +90,7 @@ namespace UAS_MES.Make
                                 return;
                             }
                             //用户填写了工单号,那么序列号必须要是该工单的,否则提示错误
-                            if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == oMakeCode ? oMakeCode : "", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out errorMessage))
+                            if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out errorMessage))
                             {
                                 //如果用户没有选择工单号
                                 if (ma_code.Text == "" || ma_code.Text != oMakeCode)

+ 4 - 2
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -22,6 +22,7 @@ namespace UAS_MES.Make
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
         ApplicationClass lbl;
+        Document doc;
         Thread thread;
         DataTable Dbfind;
         string ErrorMessage = "";
@@ -195,7 +196,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);
-                    Print.CodeSoft(Tag.ToString(), lbl, 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.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]);
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
@@ -485,7 +487,7 @@ namespace UAS_MES.Make
         private void PackageDetail_DataSourceChanged(object sender, EventArgs e)
         {
             if (PackageDetail.RowCount == 1)
-            { 
+            {
                 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");