Browse Source

代码调整

callm 6 years ago
parent
commit
90327395f7

+ 4 - 2
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -1261,7 +1261,7 @@ namespace UAS_LabelMachine
             }
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            BoxCount.Text = LabelInfDataTable.Compute("sum(pib_qty)", "1=1").ToString()+"KPCS";
+            BoxCount.Text = LabelInfDataTable.Compute("sum(pib_qty)", "1=1").ToString() + "KPCS";
             bindingsource(LabelInf, LabelInfDataTable);
             if (LabelInf.Rows.Count > 0)
             {
@@ -1838,12 +1838,14 @@ namespace UAS_LabelMachine
                             string FWhcode = LabelInf.Rows[i].Cells["pib_brand"].Value.ToString();
                             string FDC = LabelInf.Rows[i].Cells["pib_datecode"].Value.ToString();
                             string FLOTNO = LabelInf.Rows[i].Cells["pib_lotno"].Value.ToString();
+                            string FPDCustProdCode = LabelInf.Rows[i].Cells["pd_custprodcode"].Value.ToString();
                             string BPrcode = LabelInf.Rows[i + 1].Cells["pib_prodcode"].Value.ToString();
                             string BPocode = LabelInf.Rows[i + 1].Cells["pd_pocode"].Value.ToString();
                             string BWhcode = LabelInf.Rows[i + 1].Cells["pib_brand"].Value.ToString();
                             string BDC = LabelInf.Rows[i + 1].Cells["pib_datecode"].Value.ToString();
                             string BLOTNO = LabelInf.Rows[i + 1].Cells["pib_lotno"].Value.ToString();
-                            if (FPrcode != BPrcode || FPocode != BPocode || FWhcode != BWhcode || (DiffDC.Checked && FDC != BDC) || (DiffLotNo.Checked && FLOTNO != BLOTNO))
+                            string BPDCustProdCode = LabelInf.Rows[i + 1].Cells["pd_custprodcode"].Value.ToString();
+                            if (FPDCustProdCode != BPDCustProdCode || FPrcode != BPrcode || FPocode != BPocode || FWhcode != BWhcode || (DiffDC.Checked && FDC != BDC) || (DiffLotNo.Checked && FLOTNO != BLOTNO))
                             {
                                 GetNumCount = GetNumCount + 1;
                             }

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

@@ -11,30 +11,30 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        ////海创外网地址
-        //private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
-        ////海创ERP地址
-        //public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
-        ////海创FTP
-        //public static readonly string FTPAddress = "ftp://cmityj.gicp.net|HCFTP|Admin1@#";
+        //海创外网地址
+        private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
+        //海创ERP地址
+        public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
+        //海创FTP
+        public static readonly string FTPAddress = "ftp://cmityj.gicp.net:21|HCFTP|Admin1@#";
 
-        //public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "HC_TEST";
-
-        //凯而高地址
-        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //凯而高ERP地址
-        public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
-        //凯而高FTP
-        public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
-        public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|HCFTP|Admin1@#";
+        public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
-        public static readonly string Masters = "GOLDEN";
+        public static readonly string Masters = "HC_TEST";
+
+        ////凯而高地址
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////凯而高ERP地址
+        //public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
+        ////凯而高FTP
+        //public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+        //public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "GOLDEN";
 
         ////凯而高
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.12)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -49,11 +49,23 @@ namespace UAS_LabelMachine
         //public static readonly string Masters = "GOLDEN";
 
         ////高登地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.238.39.179)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.158)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         ////高登ERP地址
         //public static readonly string ERPAddesss = "http://183.238.39.179:8099/ERP/";
-        ////高登TP
+        ////高登FTP
         //public static readonly string InnerFTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
+        //public static readonly string FTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "GOLDEN";
+
+        ////高登地址
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.238.39.179)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////高登ERP地址
+        //public static readonly string ERPAddesss = "http://183.238.39.179:8099/ERP/";
+        ////高登FTP
+        //public static readonly string InnerFTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
         //public static readonly string FTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
@@ -71,27 +83,6 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER";
 
-        ////华商龙外网地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YITOA_DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.18.115.198)(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////华商龙ERP地址
-        //public static readonly string ERPAddesss = "http://218.18.115.198:8888/ERP/";
-        ////华商龙FTP
-        //public static readonly string FTPAddress = "ftp://218.18.115.198:21|Print|Administrator1@#";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1523";
-        ////需要显示的账套
-        //public static readonly string Masters = "XSQ,N_YITOA_YWC,ZXN,N_YITOA_LHCT,N_YITOA_CT,N_CHL,N_YITOA_HK,N_HUASL_SHTL,N_WILICHK,N_WILIC,N_E_SHINE_SH,N_SHBJ,N_BJKG,N_HUASL,N_HUASL_QD,N_HUASL_XM,N_HUASL_SZ";
-
-        ////UAS测试地址
-        //private readonly string ConnectionStrings = "Data Source=192.168.253.6/orcl;User ID=UAS_TEST;PassWord=select!#%*(";
-        ////UAS测试地址
-        //public static readonly string ERPAddesss = "http://192.168.253.6/uas_test/";
-        ////UAS测试FTP
-        //public static readonly string FTPAddress = "ftp://192.168.253.9/PrintFile|mesconfig|Administrator1@#";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "UAS_TEST";
         public static string DBConnectionString;
         static OracleConnection connection = null;
         static OracleCommand command = null;
@@ -839,7 +830,6 @@ namespace UAS_LabelMachine
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
-            Console.WriteLine(SQL);
             //用来拼接参数的
             if (names.Length > 0)
             {
@@ -1134,7 +1124,7 @@ namespace UAS_LabelMachine
             command.CommandText = ProcedureName;
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
-                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 1000, param[i], ParameterDirection.InputOutput));
+                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 2000, param[i], ParameterDirection.InputOutput));
             try
             {
                 command.ExecuteNonQuery();

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

@@ -109,7 +109,7 @@ namespace UAS_LabelMachine.PublicMethod
                 MidDoc.PrintDocument();
             }
 
-            public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iDC, bool iLotNo)
+            public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iOrderCode, bool iDC, bool iLotNo)
             {
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
@@ -139,6 +139,10 @@ namespace UAS_LabelMachine.PublicMethod
                 {
                     GroupByCondition += "pib_lotno,";
                 }
+                if (iOrderCode)
+                {
+                    GroupByCondition += "pd_ordercode,";
+                }
                 if (iCustProdCode || iCustPo || iDC || iLotNo)
                 {
                     GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
@@ -322,7 +326,7 @@ namespace UAS_LabelMachine.PublicMethod
                 MidFormat.Print();
             }
 
-            public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iDC, bool iLotNo)
+            public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iOrderCode, bool iDC, bool iLotNo)
             {
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
@@ -352,6 +356,10 @@ namespace UAS_LabelMachine.PublicMethod
                 {
                     GroupByCondition += "pib_lotno,";
                 }
+                if (iOrderCode)
+                {
+                    GroupByCondition += "pd_ordercode,";
+                }
                 if (iCustProdCode || iCustPo || iDC || iLotNo)
                 {
                     GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));

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


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

@@ -1492,9 +1492,9 @@ namespace UAS_LabelMachine
             string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
             string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
             if (PrintMethod == "CodeSoft")
-                Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
+                Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_ordercode.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
             else
-                Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
+                Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_ordercode.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
         }
 
         private void CleanDetail_Click(object sender, EventArgs e)
@@ -1898,6 +1898,13 @@ namespace UAS_LabelMachine
                                 BoxCode = BoxCode + 1;
                             }
                         }
+                        else if (cu_print_ordercode.Checked)
+                        {
+                            if (LabelInf.Rows[i].Cells["pd_ordercode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pd_ordercode"].Value.ToString())
+                            {
+                                BoxCode = BoxCode + 1;
+                            }
+                        }
                     }
                 }
                 sdh.BatchInsert("prodiobarcode", LabelInf.DataSource as DataTable);
@@ -2553,6 +2560,7 @@ namespace UAS_LabelMachine
                 ArrayList<string> madein = new ArrayList<string>();
                 ArrayList<string> size = new ArrayList<string>();
                 ArrayList<string> weight = new ArrayList<string>();
+                ArrayList<string> prdetail = new ArrayList<string>();
                 //用于数量的校验
                 Dictionary<string, decimal> sumqty = new Dictionary<string, decimal>();
                 Dictionary<string, Dictionary<string, decimal>> outsumqty = new Dictionary<string, Dictionary<string, decimal>>();
@@ -2597,6 +2605,7 @@ namespace UAS_LabelMachine
                     string 产地 = dt.Rows[i]["产地"].ToString().Trim();
                     string 尺寸 = dt.Rows[i]["尺寸"].ToString().Trim();
                     string 重量 = dt.Rows[i]["重量"].ToString().Trim();
+                    string 名称 = dt.Rows[i]["产品名称"].ToString().Trim();
                     if (pr_spec.Trim() == "")
                     {
                         break;
@@ -2649,6 +2658,7 @@ namespace UAS_LabelMachine
                         string pd_piclass = dr[k]["pd_piclass"].ToString();
                         string pr_id = dr[k]["pr_id"].ToString();
                         string pr_madein = dr[k]["pr_madein"].ToString();
+                        string pr_detail = dr[k]["pr_detail"].ToString();
                         //已导入数量
                         decimal zxbzs = decimal.Parse(dr[k]["pr_zxbzs"].ToString());
                         decimal pd_outqty = 0;
@@ -2691,6 +2701,7 @@ namespace UAS_LabelMachine
                                 size.Add(尺寸);
                                 weight.Add(重量);
                                 pdprodcode.Add(pd_prodcode);
+                                prdetail.Add(名称 == "" ? pr_detail : 名称);
                             }
                             custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
                             pib_custoutboxcode.Add(pib_outboxcode2);
@@ -2708,6 +2719,7 @@ namespace UAS_LabelMachine
                             size.Add(尺寸);
                             weight.Add(重量);
                             pdprodcode.Add(pd_prodcode);
+                            prdetail.Add(名称 == "" ? pr_detail : 名称);
                         }
                         else
                         {
@@ -2730,9 +2742,14 @@ namespace UAS_LabelMachine
                                 size.Add(尺寸);
                                 weight.Add(重量);
                                 pdprodcode.Add(pd_prodcode);
+                                prdetail.Add(名称 == "" ? pr_detail : 名称);
                             }
                         }
                         outqty -= outsumqty[pr_spec][pd_pdno];
+                        if (outqty <= 0)
+                        {
+                            outqty = 0;
+                        }
                         outsumqty[pr_spec][pd_pdno] -= pd_outqty;
                     }
                 }
@@ -2784,10 +2801,10 @@ namespace UAS_LabelMachine
                         sql.Clear();
                         sql.Append("insert into prodiobarcode (PIB_ID,PIB_PRODCODE,pib_inman,PIB_INDATE,PIB_INOUTNO,PIB_PIID,pib_brand,PIB_BARCODE,PIB_PDNO,");
                         sql.Append("PIB_PDID,PIB_PICLASS,PIB_QTY,pib_datecode,pib_lotno,PIB_IFPRINT,PIB_IFPICK,PIB_ORDERCODE,pib_orderdetno,");
-                        sql.Append("pib_outboxcode2,pib_custbarcode,pib_custoutboxcode,pib_madein,pib_size,pib_weight)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
+                        sql.Append("pib_outboxcode2,pib_custbarcode,pib_custoutboxcode,pib_madein,pib_size,pib_weight,pib_prdetail)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
                         sql.Append("'" + pi_inoutno.Text + "'," + PI_ID + ",:pr_brand,:barcode,:pd_pdno,:pd_id,'" + pi_class.Text + "',:pib_inqty,");
-                        sql.Append(":pib_datecode,:pib_lotno,0,-1,:pd_ordercode,:pd_orderdetno,:outboxcode,:custbarcode,:pib_custoutboxcode,:pib_madein,:pib_size,:pib_weight)");
-                        dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode", "pib_custoutboxcode", "pib_madein" , "pib_size", "pib_weight" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray(), custoutboxcode.ToArray(), madein.ToArray(),size.ToArray(),weight.ToArray());
+                        sql.Append(":pib_datecode,:pib_lotno,0,-1,:pd_ordercode,:pd_orderdetno,:outboxcode,:custbarcode,:pib_custoutboxcode,:pib_madein,:pib_size,:pib_weight,:pib_prdetail)");
+                        dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode", "pib_custoutboxcode", "pib_madein", "pib_size", "pib_weight", "pib_prdetail" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray(), custoutboxcode.ToArray(), madein.ToArray(), size.ToArray(), weight.ToArray(), prdetail.ToArray());
                         //更新流水
                         dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
                         LoadGridData();
@@ -2916,7 +2933,5 @@ namespace UAS_LabelMachine
             sdh.ExecuteSql(SQL, "update");
             LoadGridData();
         }
-
-
     }
 }

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