Browse Source

代码精简

callm 6 years ago
parent
commit
c7f84b5075

+ 4 - 4
UAS-出货标签管理(标签复核)/PublicMethod/DataHelper.cs

@@ -12,16 +12,16 @@ 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=jinhaode.f3322.org/orcl;User ID=HD;PassWord=select!#%*(";
+        private readonly string InnerConnectionStrings = "Data Source=jinhaode.f3322.org/orcl;User ID=HD;PassWord=select!#%*(";
         //富为ERP地址
-        public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
+        public static readonly string ERPAddesss = "http://jinhaode.f3322.org:8099/ERP/";
         //富为FTP
         public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
-        public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
+        public static readonly string Masters = "HD,HD_TEST";
 
         ////高登地址
         //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)));";

File diff suppressed because it is too large
+ 226 - 278
UAS-出货标签管理(标签复核)/UAS_出货标签管理.Designer.cs


+ 2 - 131
UAS-出货标签管理(标签复核)/UAS_出货标签管理.cs

@@ -54,7 +54,6 @@ namespace UAS_LabelMachine
         object[] ItemData;
 
         Dictionary<string, string> CollectData;
-        Dictionary<string, string> MidIDAndOutboxcode = new Dictionary<string, string>();
         /// <summary>
         /// 全部采集
         /// </summary>
@@ -70,14 +69,6 @@ namespace UAS_LabelMachine
         ArrayList<ArrayList<string>> ScanData;
         ArrayList<string> GetData;
 
-        List<string> SingleParam = new List<string>();
-
-        List<string> MidParam = new List<string>();
-
-        List<string> OutParam = new List<string>();
-
-        DataTable Attach;
-
         public UAS_出货标签打印(string Master)
         {
             this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
@@ -178,6 +169,7 @@ namespace UAS_LabelMachine
         private void CollectionSetting_Click(object sender, EventArgs e)
         {
             采集策略 form = new 采集策略(sg_code.Text);
+            form.WindowState = FormWindowState.Maximized;
             form.FormClosed += sg_code_UserControlTextChanged;
             BaseUtil.SetFormCenter(form);
             form.ShowDialog();
@@ -465,7 +457,6 @@ namespace UAS_LabelMachine
             }
             //提醒用户需要采集的数据
             RemindUser();
-            RefreshProcessData();
             MessageLog.AppendText(">>扫描到数据" + Input.Text + "\n", Color.Blue);
             //如果所采集的行的物料不一样的话,重新计算箱内容量
             if (CurrentRowIndex - 1 > 0)
@@ -787,10 +778,6 @@ namespace UAS_LabelMachine
                         dh.CallProcedure("GetCustBarcode", param);
                     }
                     LoadGridData(sender, e);
-                    //重新输入单号后清除缓存
-                    MidIDAndOutboxcode.Clear();
-                    //刷新采集进度
-                    RefreshProcessData();
                     //设置当前的最大箱号
                     CurrentItemIndex = 0;
                     LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
@@ -817,48 +804,12 @@ namespace UAS_LabelMachine
                     dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
                     MessageBox.Show("删除成功");
                     LoadGridData(sender, e);
-                    RefreshProcessData();
                 }
             }
             else
                 MessageBox.Show("尚未勾选需要删除的明细");
         }
 
-        /// <summary>
-        /// 刷新采集进度
-        /// </summary>
-        private void RefreshProcessData()
-        {
-            if (LabelInf.Rows.Count > 0)
-            {
-                //设置初始化的采集进度
-                int Count = 0;
-                int CurrentMidBoxCollectedCount = 0;
-                //当前盒号的总盘数
-                int CurrentMidBoxTotalCount = 0;
-                //未超出当前范围的时候
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
-                        Count++;
-                    //和当前编辑箱号相等行
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True" && LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
-                        CurrentMidBoxCollectedCount++;
-                    //当前盒号一共有几盘
-                    if (LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
-                        CurrentMidBoxTotalCount++;
-                }
-                Capacity.Text = "可装" + CurrentMidBoxTotalCount + "盘";
-                Installed.Text = "已装" + CurrentMidBoxCollectedCount + "盘";
-                //设置当前的箱号和盒号
-                Process_outboxcode.Text = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value.ToString();
-                Process_midboxcode.Text = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString();
-                //设置当前总数和已采集数量
-                TotalCount.Text = LabelInf.RowCount.ToString();
-                CollectedCount.Text = Count.ToString();
-            }
-        }
-
         private void LoadGridData()
         {
             LoadGridData(new object(), new EventArgs());
@@ -877,7 +828,7 @@ namespace UAS_LabelMachine
             sql.Append("pib_lotno,pib_datecode,pib_qty,pr_spec,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint");
             sql.Append(" from prodiobarcode left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
             sql.Append(" pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode ");
-            sql.Append("where pib_piid='" + PI_ID + "' order by to_number(pib_outboxcode1),pib_id,pd_prodcode");
+            sql.Append("where pib_piid='" + PI_ID + "' order by pd_detno");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             MidSource.DataSource = dt;
             BaseUtil.FillDgvWithDataTable(LabelInf, (DataTable)MidSource.DataSource);
@@ -997,36 +948,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        /// <summary>
-        /// 勾选的时候自动打印
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void LabelInf_CellValueChanged(object sender, DataGridViewCellEventArgs e)
-        {
-            if (e.RowIndex >= 0)
-            {
-                if (!(DataHelper.DBConnectionString.Contains("richwell") || DataHelper.DBConnectionString.Contains("192.168.0.88")))
-                {
-                    if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
-                    {
-                        string datecode = LabelInf.Rows[e.RowIndex].Cells["pib_datecode"].Value.ToString();
-                        try
-                        {
-                            System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", CultureInfo.CurrentCulture);
-                            GregorianCalendar gc = new GregorianCalendar();
-                            int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
-                            if (weekOfYear < 10)
-                                LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
-                            else
-                                LabelInf.Rows[e.RowIndex].Cells["pib_datecode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
-                        }
-                        catch (Exception) { }
-                    }
-                }
-            }
-        }
-
         private void AllCollected_Click(object sender, EventArgs e)
         {
             if (AllCollect == false)
@@ -1076,28 +997,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void LabelInf_CellEndEdit(object sender, DataGridViewCellEventArgs e)
-        {
-            if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "盒")
-            {
-                string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
-                string midbox = LabelInf.Rows[e.RowIndex].Cells["pib_outboxcode1"].Value.ToString();
-                for (int i = 0; i < LabelInf.Rows.Count; i++)
-                {
-                    if (midbox == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
-                        LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
-                }
-            }
-            if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" && CollectionUnit.Text == "全部")
-            {
-                string madein = LabelInf.Rows[e.RowIndex].Cells["pib_madein"].Value.ToString();
-                for (int i = 0; i < LabelInf.Rows.Count; i++)
-                {
-                    LabelInf.Rows[i].Cells["pib_madein"].Value = madein;
-                }
-            }
-        }
-
         private void ExportData_Click(object sender, EventArgs e)
         {
             ExportFileDialog.Description = "选择导出的路径";
@@ -1144,34 +1043,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void AttachInfo_Click(object sender, EventArgs e)
-        {
-            if (cu_code.Text != "")
-            {
-                附件内容打印 att = new 附件内容打印(cu_code.Text);
-                att.ShowDialog();
-            }
-            else MessageBox.Show("请先获取出库单信息");
-        }
-
-        private void MidBoxCapacity_Leave(object sender, EventArgs e)
-        {
-            NumericUpDown nup = (NumericUpDown)sender;
-            switch (nup.Name)
-            {
-                case "MidBoxCapacity":
-                    Properties.Settings.Default.MidBoxCapacity = nup.Value;
-                    Properties.Settings.Default.Save();
-                    break;
-                case "OutboxCapacity":
-                    Properties.Settings.Default.OutboxCapacity = nup.Value;
-                    Properties.Settings.Default.Save();
-                    break;
-                default:
-                    break;
-            }
-        }
-
         private void RefreshDBConnect_Tick(object sender, EventArgs e)
         {
             dh.ExecuteSql("select sysdate from dual", "select");

+ 6 - 18
UAS-出货标签管理(标签复核)/UAS_出货标签管理.resx

@@ -150,34 +150,22 @@
   <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">
-    <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="pr_unit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_datecode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_cusbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pd_custprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pib_cusoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pd_custprodspec.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">
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pd_custprodcode.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="pd_custprodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_unit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

File diff suppressed because it is too large
+ 331 - 154
UAS-出货标签管理(标签复核)/采集策略.Designer.cs


+ 2 - 14
UAS-出货标签管理(标签复核)/采集策略.cs

@@ -18,7 +18,7 @@ namespace UAS_LabelMachine
 
         DataTable dt;
 
-        int ItemNum = 8;
+        int ItemNum = 5;
 
         public 采集策略()
         {
@@ -28,8 +28,6 @@ namespace UAS_LabelMachine
             si_type4.CheckedChanged += CheckChanged;
             si_type2.CheckedChanged += CheckChanged;
             si_type5.CheckedChanged += CheckChanged;
-            si_type6.CheckedChanged += CheckChanged;
-            si_type7.CheckedChanged += CheckChanged;
         }
 
         public 采集策略(string SG_CODE)
@@ -41,8 +39,6 @@ namespace UAS_LabelMachine
             si_type4.CheckedChanged += CheckChanged;
             si_type2.CheckedChanged += CheckChanged;
             si_type5.CheckedChanged += CheckChanged;
-            si_type6.CheckedChanged += CheckChanged;
-            si_type7.CheckedChanged += CheckChanged;
         }
 
         private void 采集策略_Load(object sender, EventArgs e)
@@ -58,8 +54,6 @@ namespace UAS_LabelMachine
             si_kind3.Text = "全部";
             si_kind4.Text = "全部";
             si_kind5.Text = "全部";
-            si_kind6.Text = "全部";
-            si_kind7.Text = "全部";
             if (sg_code.Text != "")
             {
                 KeyEventArgs e2 = new KeyEventArgs(Keys.Enter);
@@ -178,15 +172,9 @@ namespace UAS_LabelMachine
                 case "MPN":
                     i = 4;
                     break;
-                case "品牌":
+                case "客户料号":
                     i = 5;
                     break;
-                case "UPN":
-                    i = 6;
-                    break;
-                case "REEL ID":
-                    i = 7;
-                    break;
                 default:
                     break;
             }

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