章政 8 years ago
parent
commit
deaa6304d7

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

@@ -16,6 +16,7 @@ namespace UAS_MES.Make
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
+        System.DateTime[] indate;
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
         //保存make left join makecraftdetail left join product的数据
@@ -100,7 +101,7 @@ namespace UAS_MES.Make
                         {
                             if (PrintLabel.SelectedValue != null && PrintNum.Text.Trim() != "")
                             {
-                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text));
+                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                                 if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "彩盒打印", User.UserSourceCode, User.UserCode, "彩盒打印成功", out ErrorMessage))
                                 {
                                     ErrorMessage = "打印完成,执行更新";
@@ -148,9 +149,11 @@ namespace UAS_MES.Make
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";
             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());
             }
         }
 

+ 1 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -234,7 +234,7 @@ namespace UAS_MES.PublicMethod
             if (URL.Contains("ftp:"))
             {
                 ftpOperater ftp = new ftpOperater();
-                return ftp.Download(LabelName, time);
+                return ftp.Download(LabelName);
             }
             else
             {

+ 7 - 1
UAS-MES/PublicMethod/Print.cs

@@ -2,6 +2,7 @@
 using LabelManager2;
 using System.Data;
 using System.Text;
+using System.IO;
 
 namespace UAS_MES.PublicMethod
 {
@@ -12,6 +13,7 @@ namespace UAS_MES.PublicMethod
         static Document doc;
         ////CodeSoft的打印机
         //string CodeSpft_Printer;
+        static FileInfo info;
 
         public Print() { }
 
@@ -20,7 +22,7 @@ namespace UAS_MES.PublicMethod
         /// </summary>
         /// <param name="Url"></param>
         /// <param name="LabelCode"></param>
-        public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode,int PrintNum)
+        public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode,int PrintNum,System.DateTime intime)
         {
             //打开模板路径
             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + LabelName);
@@ -47,6 +49,10 @@ namespace UAS_MES.PublicMethod
             doc.Printer.SwitchTo(PrinterName);
             doc.PrintDocument(PrintNum);
             doc.Close();
+            //讲文件最后写入时间改成数据库中拿到的时间
+            info = new FileInfo(ftpOperater.DownLoadTo + LabelName);
+            info.LastWriteTime = intime;
+            
         }
 
         public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode)

+ 2 - 42
UAS-MES/PublicMethod/ftpOperater.cs

@@ -181,7 +181,7 @@ namespace UAS_MES.PublicMethod
         /// 实现ftp下载操作
         /// </summary>
         /// <param name="fileName">远程文件名</param>
-        public string Download(string fileName,DateTime time)
+        public string Download(string fileName)
         {
             FtpWebRequest reqFTP;
             try
@@ -208,9 +208,6 @@ namespace UAS_MES.PublicMethod
                 ftpStream.Close();
                 outputStream.Close();
                 response.Close();
-                //设置最后修改文件时间为服务器时间
-                FileInfo f = new FileInfo(DownLoadTo + @"\" + fileName);
-                f.LastWriteTime = time;
                 return DownLoadTo + @"\" + fileName;
             }
             catch (Exception ex)
@@ -220,43 +217,6 @@ namespace UAS_MES.PublicMethod
             }
         }
 
-        /// <summary>
-        /// 实现ftp下载操作
-        /// </summary>
-        /// <param name="fileName">远程文件名</param>
-        public string Download(string fileName)
-        {
-            FtpWebRequest reqFTP;
-            try
-            {
-                FileStream outputStream = new FileStream(DownLoadTo + @"\" + fileName, FileMode.Create);
-                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + fileName));
-                reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
-                reqFTP.UseBinary = true;
-                reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
-                FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
-                Stream ftpStream = response.GetResponseStream();
-                long cl = response.ContentLength;
-                int bufferSize = 2048;
-                int readCount;
-                byte[] buffer = new byte[bufferSize];
-
-                readCount = ftpStream.Read(buffer, 0, bufferSize);
-                while (readCount > 0)
-                {
-                    outputStream.Write(buffer, 0, readCount);
-                    readCount = ftpStream.Read(buffer, 0, bufferSize);
-                }
-                ftpStream.Close();
-                outputStream.Close();
-                response.Close();
-                return DownLoadTo + @"\" + fileName;
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.Message);
-                return "";
-            }
-        }
+       
     }
 }

+ 123 - 0
UAS_KanBan/Process.resx

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="Refresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

BIN
UAS_KanBan/tool/CSkin.dll


BIN
UAS_KanBan/tool/Oracle.ManagedDataAccess.dll


+ 13 - 1
UAS_WinForm.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES接口", "MES接口\UAS-MES接口.csproj", "{A52EFE9C-838E-4E8C-BAAA-B1C226E57A81}"
 EndProject
@@ -13,6 +13,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-特殊解析规则", "UAS-特殊解析规则\UAS-特殊解析规则.csproj", "{7D199649-095F-4280-BD82-9481BCAB85B4}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_XmlAnalysor", "UAS_XmlAnalysor\UAS_XmlAnalysor.csproj", "{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_KanBan", "UAS_KanBan\UAS_KanBan.csproj", "{13FB3DAF-E684-4B04-9F35-710F925A64C3}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -39,6 +43,14 @@ Global
 		{7D199649-095F-4280-BD82-9481BCAB85B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{7D199649-095F-4280-BD82-9481BCAB85B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7D199649-095F-4280-BD82-9481BCAB85B4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Release|Any CPU.Build.0 = Release|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

BIN
UAS_XmlAnalysor/tool/Oracle.ManagedDataAccess.dll