Explorar el Código

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

Hcsy hace 8 años
padre
commit
3c3085e9ff

+ 11 - 18
UAS-MES/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -106,11 +106,9 @@ namespace UAS_MES.Make
                     //说明没有默认的模板,那就取pl_id最大的
                     listA = (DataTable)dh.ExecuteSql("select la_code,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");
                 }
-                //下载标签
-                getLabels();
                 //标签显示
                 PrintLabel.DataSource = listA;
-                PrintLabel.DisplayMember = "la_name";
+                PrintLabel.DisplayMember = "la_url";
                 PrintLabel.ValueMember = "la_id";
                 //有值,填充界面
                 BaseUtil.SetFormValue(this.Controls, dt);
@@ -147,7 +145,7 @@ namespace UAS_MES.Make
                     {
                         inputValues = new string[paramsInfo.Rows.Count];
                         sb = new StringBuilder();
-                        doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["la_name"].ToString());
+                        doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
                     }
                     //将值赋到doc对应的变量
                     for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
@@ -183,10 +181,12 @@ namespace UAS_MES.Make
                         //打印
                         LogManager.DoLog(sb.ToString());
                         //保存本次赋值进行打印
-                        doc.Save();
                         doc.Printer.SwitchTo(Printer.Text);
                         doc.PrintDocument(int.Parse(PrintNum.Text));
-                        doc.Close();
+                        for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
+                        {
+                            doc.Variables.FormVariables.Item(i + 1).Value = null;
+                        }
                         //讲文件最后写入时间改成数据库中拿到的时间
                         //记录打印日志
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "自定义标打印", "成功打印", "", "");
@@ -206,15 +206,6 @@ namespace UAS_MES.Make
             }
         }
 
-        private void getLabels()
-        {
-            //ftp = new ftpOperater();
-            for (int i = 0; i < listA.Rows.Count; i++)
-            {
-                BaseUtil.GetPrintLabel(listA.Rows[i]["la_name"].ToString(), listA.Rows[i]["la_url"].ToString());
-            }
-        }
-
         private void PrintLabel_TextChanged(object sender, EventArgs e)
         {
             if (PrintLabel.Text.StartsWith("System"))
@@ -258,7 +249,7 @@ namespace UAS_MES.Make
         {
             if (canPrint)
             {
-                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["la_name"].ToString());
+                doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
                 sb = new StringBuilder();
                 //将值赋到doc对应的变量
                 for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
@@ -276,10 +267,12 @@ namespace UAS_MES.Make
                 //打印
                 LogManager.DoLog(sb.ToString());
                 //保存本次赋值进行打印
-                doc.Save();
                 doc.Printer.SwitchTo(Printer.Text);
                 doc.PrintDocument(int.Parse(PrintNum.Text));
-                doc.Close();
+                for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
+                {
+                    doc.Variables.FormVariables.Item(i + 1).Value = null;
+                }
                 //讲文件最后写入时间改成数据库中拿到的时间
                 //记录打印日志
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "自定义标打印", "成功打印", "", "");

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

@@ -186,7 +186,7 @@ namespace UAS_MES.Make
                         string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
                         if (nextstepcode != "" && nextstepcode != User.CurrentStepCode)
                         {
-                            OperateResult.AppendText("当前序列号下一道工序" + nextstepcode, Color.Red);
+                            OperateResult.AppendText("当前序列号下一道工序" + nextstepcode+",当前资源不允许采集\n", Color.Red);
                             return;
                         }
                         PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code and cr_prodcode = ms_prodcode", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();

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

@@ -270,7 +270,7 @@ namespace UAS_MES.Make
                         string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
                         if (nextstepcode != "" && nextstepcode != User.CurrentStepCode)
                         {
-                            OperateResult.AppendText("当前序列号下一道工序为" + nextstepcode+"\n", Color.Red);
+                            OperateResult.AppendText("当前序列号下一道工序为" + nextstepcode + ",当前资源不允许采集\n", Color.Red);
                             return;
                         }
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();