Эх сурвалжийг харах

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

caosy 6 жил өмнө
parent
commit
b1532d0463

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

@@ -26,7 +26,7 @@ namespace UAS_LabelMachine.PublicMethod
             oDatecode = "";
             oLotno = "";
             string[] param = new string[] { iCustCode, iBrand, iSpec, iQty, iDateCode, iLotno, oSpec, oQty, oDatecode, oLotno };
-            dh.CallProcedure("sp_datafilter", ref param);
+            dh.CallProcedure("SP_DATAFILTER", ref param);
             oSpec = param[6];
             oQty = param[7];
             oDatecode = param[8];
@@ -79,7 +79,7 @@ namespace UAS_LabelMachine.PublicMethod
         {
             oSQL = "";
             string[] param = new string[] { iPiid, iCustCode, oSQL };
-            dh.CallProcedure("sp_GenerateBarCode", ref param);
+            dh.CallProcedure("SP_GENERATEBARCODE", ref param);
             oSQL = param[2];
         }
     }

+ 26 - 0
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs

@@ -172,6 +172,7 @@
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pr_midboxcapacity_user = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -197,6 +198,7 @@
             this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.GetMidBoxCode = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
@@ -1218,6 +1220,7 @@
             this.LabelInf.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.LabelInf.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Choose,
+            this.pr_midboxcapacity_user,
             this.pib_ifpick,
             this.pib_ifprint,
             this.pib_id1,
@@ -1357,6 +1360,7 @@
             // 
             // MidLabel
             // 
+            this.MidLabel.Controls.Add(this.GetMidBoxCode);
             this.MidLabel.Controls.Add(this.label9);
             this.MidLabel.Controls.Add(this.MidDocRefresh);
             this.MidLabel.Controls.Add(this.MidLabelNum);
@@ -1735,6 +1739,14 @@
             this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
             this.Choose.Width = 55;
             // 
+            // pr_midboxcapacity_user
+            // 
+            this.pr_midboxcapacity_user.DataPropertyName = "pr_midboxcapacity_user";
+            this.pr_midboxcapacity_user.HeaderText = "中盒容量";
+            this.pr_midboxcapacity_user.Name = "pr_midboxcapacity_user";
+            this.pr_midboxcapacity_user.Visible = false;
+            this.pr_midboxcapacity_user.Width = 78;
+            // 
             // pib_ifpick
             // 
             this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
@@ -1934,6 +1946,18 @@
             this.pib_outboxcode2.Name = "pib_outboxcode2";
             this.pib_outboxcode2.Width = 90;
             // 
+            // GetMidBoxCode
+            // 
+            this.GetMidBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.GetMidBoxCode.Location = new System.Drawing.Point(10, 201);
+            this.GetMidBoxCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.GetMidBoxCode.Name = "GetMidBoxCode";
+            this.GetMidBoxCode.Size = new System.Drawing.Size(68, 26);
+            this.GetMidBoxCode.TabIndex = 119;
+            this.GetMidBoxCode.Text = "获取盒号";
+            this.GetMidBoxCode.UseVisualStyleBackColor = true;
+            this.GetMidBoxCode.Click += new System.EventHandler(this.GetMidBoxCode_Click);
+            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2156,6 +2180,7 @@
         private System.Windows.Forms.Button CustBarCode;
         private System.Windows.Forms.ToolStripMenuItem 流水调整ToolStripMenuItem;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_midboxcapacity_user;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
@@ -2181,5 +2206,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
+        private System.Windows.Forms.Button GetMidBoxCode;
     }
 }

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

@@ -241,7 +241,6 @@ namespace UAS_LabelMachine
             MidLabelPrinter.Text = Properties.Settings.Default.MidPrinter;
             OutBoxPrinter.Text = Properties.Settings.Default.OutPrinter;
 
-
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
             string Code = dh.GetConfig("PrintMethod", "CodeOrBar").ToString();
@@ -1909,6 +1908,42 @@ namespace UAS_LabelMachine
             }
         }
 
+        private void GetMidBoxCode_Click(object sender, EventArgs e)
+        {
+            int BoxCode = 1;
+            int innerboxcount = 1;
+            for (int i = 0; i < LabelInf.Rows.Count; i++)
+            {
+                string midcapa = LabelInf.Rows[i].Cells["pr_midboxcapacity_user"].Value.ToString();
+                //如果出现值为空或者0默认界面上填写的值
+                MidBoxCapacity.Value = decimal.Parse((midcapa == "" || midcapa == "0") ? MidBoxCapacity.Value.ToString() : midcapa);
+                LabelInf.Rows[i].Cells["pib_outboxcode1"].Value = BoxCode;
+                if (i + 1 < LabelInf.Rows.Count)
+                {
+                    if (innerboxcount == MidBoxCapacity.Value)
+                    {
+                        BoxCode = BoxCode + 1;
+                        innerboxcount = 1;
+                    }
+                    else if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_prodcode"].Value.ToString())
+                    {
+                        BoxCode = BoxCode + 1;
+                        innerboxcount = 1;
+                    }
+                    else
+                    {
+                        innerboxcount = innerboxcount + 1;
+                    }
+                }
+            }
+            sdh.BatchInsert("prodiobarcode", LabelInf.DataSource as DataTable);
+            DataTable dt1 = (DataTable)sdh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifupload,pib_ifpick,pib_ifprint from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' ", "select");
+            if (dt1.Rows.Count > 0)
+            {
+                dh.CallProcedure("sp_uploadbarcode", dt1);
+            }
+        }
+
         private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
         {
             string close = MessageBox.Show(this.ParentForm, "是否注销", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
@@ -2515,6 +2550,8 @@ namespace UAS_LabelMachine
                 ArrayList<string> pib_custoutboxcode = new ArrayList<string>();
                 ArrayList<string> brand = new ArrayList<string>();
                 ArrayList<string> madein = new ArrayList<string>();
+                ArrayList<string> size = new ArrayList<string>();
+                ArrayList<string> weight = new ArrayList<string>();
                 //用于数量的校验
                 Dictionary<string, decimal> sumqty = new Dictionary<string, decimal>();
                 Dictionary<string, Dictionary<string, decimal>> outsumqty = new Dictionary<string, Dictionary<string, decimal>>();
@@ -2557,6 +2594,8 @@ namespace UAS_LabelMachine
                     string pr_spec = dt.Rows[i]["规格型号"].ToString().Trim();
                     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;
@@ -2648,6 +2687,8 @@ namespace UAS_LabelMachine
                                 pdid.Add(pd_id);
                                 prbrand.Add(品牌 == "" ? pr_brand : 品牌);
                                 madein.Add(产地 == "" ? pr_madein : 产地);
+                                size.Add(尺寸);
+                                weight.Add(重量);
                                 pdprodcode.Add(pd_prodcode);
                             }
                             custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
@@ -2663,6 +2704,8 @@ namespace UAS_LabelMachine
                             pdid.Add(pd_id);
                             prbrand.Add(品牌 == "" ? pr_brand : 品牌);
                             madein.Add(产地 == "" ? pr_madein : 产地);
+                            size.Add(尺寸);
+                            weight.Add(重量);
                             pdprodcode.Add(pd_prodcode);
                         }
                         else
@@ -2683,6 +2726,8 @@ namespace UAS_LabelMachine
                                 pdid.Add(pd_id);
                                 prbrand.Add(品牌 == "" ? pr_brand : 品牌);
                                 madein.Add(产地 == "" ? pr_madein : 产地);
+                                size.Add(尺寸);
+                                weight.Add(重量);
                                 pdprodcode.Add(pd_prodcode);
                             }
                         }
@@ -2738,10 +2783,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)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
+                        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("'" + 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)");
-                        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" }, 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());
+                        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());
                         //更新流水
                         dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
                         LoadGridData();
@@ -2870,5 +2915,7 @@ namespace UAS_LabelMachine
             sdh.ExecuteSql(SQL, "update");
             LoadGridData();
         }
+
+
     }
 }

+ 3 - 0
UAS-出货标签管理(贸易版)/UAS_出货标签管理.resx

@@ -153,6 +153,9 @@
   <metadata name="ImportExcel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>528, 17</value>
   </metadata>
+  <metadata name="pr_midboxcapacity_user.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>