Browse Source

泽天条码重置修改

callm 5 years ago
parent
commit
f9e843c468

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

@@ -405,7 +405,14 @@ namespace UAS_LabelMachine
             }
             catch (Exception)
             {
-                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
+                if (ReSetType != " ")
+                {
+                    dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
+                }
+                else
+                {
+                    dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
+                }
                 CollectInputData();
                 return;
             }
@@ -1400,9 +1407,9 @@ namespace UAS_LabelMachine
                 sql.Clear();
                 sql.Append("select " + Fileds.Substring(0, Fileds.Length - 1) + " from ExportView where pib_inoutno='" + pi_inoutno.Text + "'");
                 string finnalSQL = "";
-                LogicHandler.GetExportDataSQL(pi_inoutno.Text,pi_cardcode.Text, type, sql.ToString(), out finnalSQL);
+                LogicHandler.GetExportDataSQL(pi_inoutno.Text, pi_cardcode.Text, type, sql.ToString(), out finnalSQL);
                 dt = (DataTable)dh.ExecuteSql(finnalSQL, "select");
-                eh.ExportExcel(dt, Field, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text+ type);
+                eh.ExportExcel(dt, Field, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text + type);
                 string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (close.ToString() == "Yes")
                     Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + type + ".xls");
@@ -1688,26 +1695,45 @@ namespace UAS_LabelMachine
                         break;
                     //流水需要通过MaxNumber去取
                     case "流水":
-                        string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
+                        string maxnum = "";
+                        if (ReSetType != " ")
+                        {
+                            maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
+                        }
+                        else
+                        {
+                            maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' ").ToString();
+                        }
                         //设置当前流水
                         if (maxnum == "")
                         {
-                            maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
-                            if (maxnum != "")
+                            if (ReSetType != " ")
                             {
-                                Count = int.Parse(maxnum) + Count;
+                                maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
                             }
                             else
+                            {
+                                maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' ").ToString();
+                            }
+                            if (maxnum == "")
                             {
                                 maxnum = "1";
                             }
+                            Count = int.Parse(maxnum) + Count;
                             dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber,rmn_type) values(RuleMaxNum_seq.nextval,'" + (NrCode == "" ? "Default" : NrCode) + "','" + Prefix + "','" + Count + "','" + ReSetType + "')", "insert");
                             MaxNum = int.Parse(maxnum);
                         }
                         else
                         {
                             MaxNum = int.Parse(maxnum);
-                            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + Count) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
+                            if (ReSetType != " ")
+                            {
+                                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + Count) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
+                            }
+                            else
+                            {
+                                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + Count) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
+                            }
                         }
                         SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
                         Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
@@ -1949,7 +1975,14 @@ namespace UAS_LabelMachine
                     }
                     else
                     {
-                        dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
+                        if (ReSetType != " ")
+                        {
+                            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
+                        }
+                        else
+                        {
+                            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
+                        }
                         Pack_Click(sender, e);
                         return;
                     }

+ 4 - 3
UAS-出货标签管理/PublicMethod/DataHelper.cs

@@ -12,12 +12,12 @@ namespace UAS_LabelMachine
     {
 
         ////富为外网地址
-        //private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
-        //private readonly string InnerConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
+        //private readonly string ConnectionStrings = "Data Source=richwell.3322.org/orcl;User ID=DATACENTER;PassWord=select!#%*(";
+        //private readonly string InnerConnectionStrings = "Data Source=richwell.3322.org/orcl;User ID=DATACENTER;PassWord=select!#%*(";
         ////富为ERP地址
         //public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
         ////富为FTP
-        //public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
+        //public static readonly string FTPAdress = "ftp://richwell.3322.org|printuser|printuser";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套
@@ -277,6 +277,7 @@ namespace UAS_LabelMachine
         /// </summary>
         public DataTable getFieldsDatasByCondition(string sql)
         {
+            Console.WriteLine(sql);
             DataTable dt = new DataTable();
             command = new OracleCommand(sql, connection);
             OracleDataAdapter ad = new OracleDataAdapter(command);

File diff suppressed because it is too large
+ 205 - 375
UAS-出货标签管理/UAS_出货标签管理.Designer.cs


+ 11 - 2
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -704,6 +704,10 @@ namespace UAS_LabelMachine
                             if (LabelInf.Rows[CurrentRowIndex].Cells["pib_cusbarcode"].Value != null)
                                 SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_cusbarcode"].Value.ToString();
                         }
+                        else if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("流水"))
+                        {
+                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BaseUtil.lpad(5, (CurrentRowIndex + 1).ToString());
+                        }
                         if (SingleDoc.Variables.FreeVariables.Item(j + 1).Value == "")
                         {
                             DataRow[] dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
@@ -1285,6 +1289,7 @@ namespace UAS_LabelMachine
                         {
                             string pib_id = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
                             DataRow[] dr = SingleBoxCacheData.Select("pib_id=" + pib_id);
+
                             StringBuilder ParamLog = new StringBuilder();
                             for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
                             {
@@ -1315,6 +1320,10 @@ namespace UAS_LabelMachine
                                     if (LabelInf.Rows[i].Cells["pib_cusbarcode"].Value != null)
                                         SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["pib_cusbarcode"].Value.ToString();
                                 }
+                                else if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower().Contains("流水"))
+                                {
+                                    SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BaseUtil.lpad(5, (CurrentRowIndex + 1).ToString());
+                                }
                                 if (SingleDoc.Variables.FreeVariables.Item(j + 1).Value == "")
                                 {
                                     DataRow[] dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
@@ -2342,7 +2351,7 @@ namespace UAS_LabelMachine
                     }
                 }
             }
-            SaveGrid_Click(sender, e); 
+            SaveGrid_Click(sender, e);
         }
 
         private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -2494,7 +2503,7 @@ namespace UAS_LabelMachine
                             string custbarcode = LabelInf.Rows[i].Cells["pib_cusbarcode"].Value.ToString();
                             //通过接口维护料盘和外箱关系,需要根据箱内容量计算
                             //判断下一行箱号不一样重新取一个客户外箱号
-                            if (i +1 < LabelInf.Rows.Count)
+                            if (i + 1 < LabelInf.Rows.Count)
                             {
                                 string CurrentOutBoxCode = LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString();
                                 string NextOutBoxCode = LabelInf.Rows[i + 1].Cells["pib_outboxcode2"].Value.ToString();

+ 5 - 2
UAS-出货标签管理/UAS_出货标签管理.resx

@@ -150,10 +150,10 @@
   <metadata name="ExportFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>294, 17</value>
   </metadata>
-  <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="rownum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="pr_unit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -168,6 +168,9 @@
   <metadata name="pib_cusoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pib_custbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

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