Browse Source

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

caosy 6 years ago
parent
commit
ad28e85ead

+ 2 - 1
UAS-出货标签管理(吉利通)/CustomControl/BlurSearch.cs

@@ -2,12 +2,13 @@
 using System.Data;
 using System.Data;
 using System.Windows.Forms;
 using System.Windows.Forms;
 using UAS_LabelMachine;
 using UAS_LabelMachine;
+using UAS_LabelMachine.Entity;
 
 
 namespace UAS_LabelMachine.CustomControl
 namespace UAS_LabelMachine.CustomControl
 {
 {
     public partial class BlurSearch : UserControl
     public partial class BlurSearch : UserControl
     {
     {
-        DataHelper dh = new DataHelper();
+        DataHelper dh = SystemInf.dh;
 
 
         public delegate void OnTextChange(object sender, EventArgs e);
         public delegate void OnTextChange(object sender, EventArgs e);
 
 

+ 5 - 4
UAS-出货标签管理(吉利通)/CustomControl/Pagination.cs

@@ -2,6 +2,7 @@
 using System.Data;
 using System.Data;
 using System.IO;
 using System.IO;
 using System.Windows.Forms;
 using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
 
 
 namespace UAS_LabelMachine.CustomControl
 namespace UAS_LabelMachine.CustomControl
 {
 {
@@ -26,7 +27,7 @@ namespace UAS_LabelMachine.CustomControl
         {
         {
             InitializeComponent();
             InitializeComponent();
             //鼠标经过控件的时候显示文字
             //鼠标经过控件的时候显示文字
-            dh = new DataHelper();
+            dh = SystemInf.dh;
             toolTip1.SetToolTip(DownLoadTemplet, "下载模板");
             toolTip1.SetToolTip(DownLoadTemplet, "下载模板");
             toolTip1.SetToolTip(UpLoadData, "上传数据");
             toolTip1.SetToolTip(UpLoadData, "上传数据");
             toolTip1.SetToolTip(ExportExcel, "导出数据");
             toolTip1.SetToolTip(ExportExcel, "导出数据");
@@ -170,7 +171,7 @@ namespace UAS_LabelMachine.CustomControl
         //刷新总页数
         //刷新总页数
         private void RefreshTotalCount()
         private void RefreshTotalCount()
         {
         {
-            DataHelper dh = new DataHelper();
+            DataHelper dh = SystemInf.dh;
             //获取记录的总行数
             //获取记录的总行数
             if (Condition.Trim() != "")
             if (Condition.Trim() != "")
             {
             {
@@ -216,7 +217,7 @@ namespace UAS_LabelMachine.CustomControl
             {
             {
                 DeleteID[i] = Dgv.SelectedRows[i].Cells[Table_ID].Value.ToString();
                 DeleteID[i] = Dgv.SelectedRows[i].Cells[Table_ID].Value.ToString();
             }
             }
-            DataHelper dh = new DataHelper();
+            DataHelper dh = SystemInf.dh;
             //取的配置的数据是从DataTable里面判断的,取的是固定字段的Dgv用第二种
             //取的配置的数据是从DataTable里面判断的,取的是固定字段的Dgv用第二种
             string tablename = TableName;
             string tablename = TableName;
             if (TableName.Contains("join"))
             if (TableName.Contains("join"))
@@ -245,7 +246,7 @@ namespace UAS_LabelMachine.CustomControl
         {
         {
             //Data表示导出数据
             //Data表示导出数据
             //Templet表示导出模板
             //Templet表示导出模板
-            DataHelper dh = new DataHelper();
+            DataHelper dh = SystemInf.dh;
             folderBrowserDialog1.Description = "选择导出的路径";
             folderBrowserDialog1.Description = "选择导出的路径";
             DialogResult result = folderBrowserDialog1.ShowDialog();
             DialogResult result = folderBrowserDialog1.ShowDialog();
             if (result == DialogResult.OK)
             if (result == DialogResult.OK)

+ 2 - 1
UAS-出货标签管理(吉利通)/CustomControl/SearchTextBox.cs

@@ -1,6 +1,7 @@
 using System;
 using System;
 using System.Data;
 using System.Data;
 using System.Windows.Forms;
 using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
 using UAS_LabelMachine.PublicMethod;
 using UAS_LabelMachine.PublicMethod;
 
 
 namespace UAS_LabelMachine.CustomControl
 namespace UAS_LabelMachine.CustomControl
@@ -8,7 +9,7 @@ namespace UAS_LabelMachine.CustomControl
     public partial class SearchTextBox : UserControl
     public partial class SearchTextBox : UserControl
     {
     {
 
 
-        DataHelper dh = new DataHelper();
+        DataHelper dh = SystemInf.dh;
 
 
         #region 构造函数
         #region 构造函数
         public SearchTextBox()
         public SearchTextBox()

+ 5 - 1
UAS-出货标签管理(吉利通)/Entity/SystemInf.cs

@@ -1,4 +1,6 @@
-namespace UAS_LabelMachine.Entity
+using LabelManager2;
+
+namespace UAS_LabelMachine.Entity
 {
 {
     class SystemInf
     class SystemInf
     {
     {
@@ -9,5 +11,7 @@
         public static SqliteDBHelper adh;
         public static SqliteDBHelper adh;
 
 
         public static SqliteDBHelper back_adh;
         public static SqliteDBHelper back_adh;
+
+        public static ApplicationClass lbl;
     }
     }
 }
 }

+ 2 - 1
UAS-出货标签管理(吉利通)/PublicMethod/ExcelHandler.cs

@@ -4,12 +4,13 @@ using System;
 using NPOI.HSSF.UserModel;
 using NPOI.HSSF.UserModel;
 using NPOI.SS.UserModel;
 using NPOI.SS.UserModel;
 using NPOI.HSSF.Util;
 using NPOI.HSSF.Util;
+using UAS_LabelMachine.Entity;
 
 
 namespace UAS_LabelMachine
 namespace UAS_LabelMachine
 {
 {
     class ExcelHandler
     class ExcelHandler
     {
     {
-        DataHelper dh = new DataHelper();
+        DataHelper dh = SystemInf.dh;
 
 
         /// <summary>
         /// <summary>
         /// 导出Excel,返回文件在客户端的路径
         /// 导出Excel,返回文件在客户端的路径

+ 1 - 1
UAS-出货标签管理(吉利通)/PublicMethod/GlobalEventsHandler.cs

@@ -41,7 +41,7 @@ namespace UAS_Labeling.PublicMethod
         /// <returns></returns>
         /// <returns></returns>
         private bool CheckPower(Control c)
         private bool CheckPower(Control c)
         {
         {
-            dh = new DataHelper();
+            dh = SystemInf.dh;
             if (User.UserAccountType != "admin")
             if (User.UserAccountType != "admin")
             {
             {
                 {
                 {

+ 9 - 0
UAS-出货标签管理(吉利通)/PublicMethod/LogicHandler.cs

@@ -134,6 +134,15 @@ namespace UAS_LabelMachine.PublicMethod
                         if (dt.Rows.Count > 0)
                         if (dt.Rows.Count > 0)
                         {
                         {
                             dh.CallProcedure("sp_uploadbarcode", dt, out pibid);
                             dh.CallProcedure("sp_uploadbarcode", dt, out pibid);
+                            dt = (DataTable)dh.ExecuteSql("select count(1) from prodiobarcode where pib_inoutno='" + iInoutno + "' and pib_ifupload=0", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                //全部数据上传之后更新单据状态
+                                if (int.Parse(dt.Rows[0][0].ToString()) == 0)
+                                {
+                                    dh.ExecuteSql("update prodinout set pi_pdastatus='已复核' where pi_inoutno='" + iInoutno + "'", "update");
+                                }
+                            }
                             //更新本地数据为已上传
                             //更新本地数据为已上传
                             if (adh.UpdateByCondition("prodiobarcode", "pib_ifupload=-1", "pib_id in (" + pibid + ")") > 0)
                             if (adh.UpdateByCondition("prodiobarcode", "pib_ifupload=-1", "pib_id in (" + pibid + ")") > 0)
                             {
                             {

+ 13 - 13
UAS-出货标签管理(吉利通)/PublicMethod/ftpOperater.cs

@@ -27,19 +27,19 @@ namespace UAS_LabelMachine
         public void UpLoadFile(string filepath, string filename)
         public void UpLoadFile(string filepath, string filename)
         {
         {
             //上传之前判断文件是否存在
             //上传之前判断文件是否存在
-            string[] filelist = GetFileList();
-            if (filelist != null)
-                for (int i = 0; i < filelist.Length; i++)
-                {
-                    if (filelist[i] == filename)
-                    {
-                        string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                        if (upload.ToString() != "Yes")
-                        {
-                            return;
-                        }
-                    }
-                }
+            //string[] filelist = GetFileList();
+            //if (filelist != null)
+            //    for (int i = 0; i < filelist.Length; i++)
+            //    {
+            //        if (filelist[i] == filename)
+            //        {
+            //            string upload = MessageBox.Show("已存在同名文件,是否覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            //            if (upload.ToString() != "Yes")
+            //            {
+            //                return;
+            //            }
+            //        }
+            //    }
             FtpWebRequest reqFTP;
             FtpWebRequest reqFTP;
             reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + filename));
             reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + filename));
             reqFTP.UseBinary = true;
             reqFTP.UseBinary = true;

+ 1 - 14
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -178,6 +178,7 @@ namespace UAS_LabelMachine
             try
             try
             {
             {
                 lbl = new ApplicationClass();
                 lbl = new ApplicationClass();
+                SystemInf.lbl = lbl;
             }
             }
             catch (Exception)
             catch (Exception)
             {
             {
@@ -826,20 +827,6 @@ namespace UAS_LabelMachine
             }
             }
         }
         }
 
 
-        private void LabelMaintain_Click(object sender, EventArgs e)
-        {
-            客户标签维护 form = new 客户标签维护();
-            BaseUtil.SetFormCenter(form);
-            if (SingleDoc != null)
-                SingleDoc.Close();
-            if (MidDoc != null)
-                MidDoc.Close();
-            if (OutBoxDoc != null)
-                OutBoxDoc.Close();
-            form.FormClosed += LabelFormClose;
-            form.ShowDialog();
-        }
-
         private void LabelFormClose(object sender, EventArgs e)
         private void LabelFormClose(object sender, EventArgs e)
         {
         {
             if (GetGridOnly.Checked)
             if (GetGridOnly.Checked)

+ 1 - 2
UAS-出货标签管理(吉利通)/客户标签维护.cs

@@ -97,7 +97,7 @@ namespace UAS_LabelMachine
             LoadData();
             LoadData();
             Width = Width + 1;
             Width = Width + 1;
             asc.controllInitializeSize(this);
             asc.controllInitializeSize(this);
-            lbl = new ApplicationClass();
+            lbl = SystemInf.lbl;
             Width = Width + 1;
             Width = Width + 1;
         }
         }
 
 
@@ -306,7 +306,6 @@ namespace UAS_LabelMachine
             try
             try
             {
             {
                 lbl.Documents.CloseAll();
                 lbl.Documents.CloseAll();
-                lbl.Application.Quit();
             }
             }
             catch (Exception)
             catch (Exception)
             {
             {

+ 2 - 2
UAS-出货标签管理(贸易版)/PublicMethod/BaseUtil.cs

@@ -28,8 +28,8 @@ namespace UAS_LabelMachine
                 SysDisc = value;
                 SysDisc = value;
             }
             }
         }
         }
-       static int serialnum = 0;
-     static   bool FirstCode = false;
+        static int serialnum = 0;
+        static bool FirstCode = false;
         //生成唯一条码
         //生成唯一条码
         public static string BarcodeMethod1(string pd_id, string pr_id, string pib_barcode)
         public static string BarcodeMethod1(string pd_id, string pr_id, string pib_barcode)
         {
         {

+ 1 - 1
UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs

@@ -1100,7 +1100,7 @@ namespace UAS_LabelMachine
         /// </summary>
         /// </summary>
         /// <param name="ProcedureName"></param>
         /// <param name="ProcedureName"></param>
         /// <param name="param"></param>
         /// <param name="param"></param>
-        public void CallProcedure(string ProcedureName, params string[] param)
+        public void CallProcedure(string ProcedureName, ref string[] param)
         {
         {
             command = new OracleCommand(ProcedureName);
             command = new OracleCommand(ProcedureName);
             command.Connection = connection;
             command.Connection = connection;

+ 23 - 0
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -0,0 +1,23 @@
+using UAS_LabelMachine.Entity;
+
+namespace UAS_LabelMachine.PublicMethod
+{
+    class LogicHandler
+    {
+        public static DataHelper dh = SystemInf.dh;
+
+        public static void FilterData(string iCustCode, string iBrand, string iSpec, string iQty, string iDateCode, string iLotno, out string oSpec, out string oQty, out string oDatecode, out string oLotno)
+        {
+            oSpec = "";
+            oQty = "";
+            oDatecode = "";
+            oLotno = "";
+            string[] param = new string[] { iCustCode, iBrand, iSpec, iQty, iDateCode, iLotno, oSpec, oQty, oDatecode, oLotno };
+            dh.CallProcedure("sp_datafilter", ref param);
+            oSpec = param[6];
+            oQty = param[7];
+            oDatecode = param[8];
+            oLotno = param[9];
+        }
+    }
+}

+ 4 - 0
UAS-出货标签管理(贸易版)/UAS-出货标签管理(贸易版).csproj

@@ -254,6 +254,7 @@
     <Compile Include="PublicMethod\ftpOperater.cs" />
     <Compile Include="PublicMethod\ftpOperater.cs" />
     <Compile Include="PublicMethod\GlobalEventsHandler.cs" />
     <Compile Include="PublicMethod\GlobalEventsHandler.cs" />
     <Compile Include="PublicMethod\HttpHandler.cs" />
     <Compile Include="PublicMethod\HttpHandler.cs" />
+    <Compile Include="PublicMethod\LogicHandler.cs" />
     <Compile Include="PublicMethod\LogManager.cs" />
     <Compile Include="PublicMethod\LogManager.cs" />
     <Compile Include="PublicMethod\Print.cs" />
     <Compile Include="PublicMethod\Print.cs" />
     <Compile Include="PublicMethod\SqliteDBHelper.cs" />
     <Compile Include="PublicMethod\SqliteDBHelper.cs" />
@@ -774,6 +775,9 @@
     <Content Include="tool\Analysis.dll" />
     <Content Include="tool\Analysis.dll" />
     <Content Include="tool\DataHelper.dll" />
     <Content Include="tool\DataHelper.dll" />
     <Content Include="tool\NPOI.dll" />
     <Content Include="tool\NPOI.dll" />
+    <Content Include="tool\NPOI.OOXML.dll" />
+    <Content Include="tool\NPOI.OpenXml4Net.dll" />
+    <Content Include="tool\NPOI.OpenXmlFormats.dll" />
     <Content Include="tool\Oracle.ManagedDataAccess.dll" />
     <Content Include="tool\Oracle.ManagedDataAccess.dll" />
     <Content Include="tool\Seagull.BarTender.Print.dll" />
     <Content Include="tool\Seagull.BarTender.Print.dll" />
     <None Include="Resources\matte_white_square_icon_business_tool_hammer_96px_571061_easyicon.net.ico" />
     <None Include="Resources\matte_white_square_icon_business_tool_hammer_96px_571061_easyicon.net.ico" />

File diff suppressed because it is too large
+ 386 - 173
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs


+ 11 - 2
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -1096,7 +1096,7 @@ namespace UAS_LabelMachine
                     if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "")
                     if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "")
                     {
                     {
                         string[] param = new string[] { PI_ID, "" };
                         string[] param = new string[] { PI_ID, "" };
-                        dh.CallProcedure("GetCustBarcode", param);
+                        dh.CallProcedure("GetCustBarcode", ref param);
                     }
                     }
                     LoadGridData(sender, e);
                     LoadGridData(sender, e);
                     //重新输入单号后清除缓存
                     //重新输入单号后清除缓存
@@ -2232,6 +2232,15 @@ namespace UAS_LabelMachine
                             }
                             }
                             string pib_outboxcode2 = dt.Rows[i]["箱号"].ToString();
                             string pib_outboxcode2 = dt.Rows[i]["箱号"].ToString();
                             DataRow[] dr = dt1.Select("pr_orispeccode='" + pr_orispeccode + "'");
                             DataRow[] dr = dt1.Select("pr_orispeccode='" + pr_orispeccode + "'");
+                            if (dr.Length == 0)
+                            {
+                                LogicHandler.FilterData(cu_code.Text, "FUDAN", pr_orispeccode, qty, DateCode, LotNo, out pr_orispeccode, out qty, out DateCode, out LotNo);
+                                dr = dt1.Select("pr_orispeccode='" + pr_orispeccode + "'");
+                            }
+                            else
+                            {
+                                LogicHandler.FilterData(cu_code.Text, dr[0]["pr_brand"].ToString(), pr_orispeccode, qty, DateCode, LotNo, out pr_orispeccode, out qty, out DateCode, out LotNo);
+                            }
                             if (dr.Length > 0)
                             if (dr.Length > 0)
                             {
                             {
                                 string pd_orderdetno = dr[0]["pd_orderdetno"].ToString();
                                 string pd_orderdetno = dr[0]["pd_orderdetno"].ToString();
@@ -2249,7 +2258,7 @@ namespace UAS_LabelMachine
                                 string pib_barcode = dh.getFieldDataByCondition("prodiobarcode", "max(pib_barcode)", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
                                 string pib_barcode = dh.getFieldDataByCondition("prodiobarcode", "max(pib_barcode)", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
                                 if (outqty % zxbzs != 0)
                                 if (outqty % zxbzs != 0)
                                 {
                                 {
-                                    barcodenum = outqty / zxbzs + 1;
+                                    barcodenum = Math.Floor(outqty / zxbzs) + 1;
                                     //如果有余数先加上所有最小包最后加尾数
                                     //如果有余数先加上所有最小包最后加尾数
                                     for (int j = 0; j < barcodenum - 1; j++)
                                     for (int j = 0; j < barcodenum - 1; j++)
                                     {
                                     {

Some files were not shown because too many files changed in this diff