瀏覽代碼

添加品牌产地字段维护

章政 6 年之前
父節點
當前提交
3c8a44613e

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

@@ -17,9 +17,12 @@ namespace UAS_LabelMachine
 
         string custcode;
 
-        public ReSetMaxNum(string iCustCode)
+        string inoutno;
+
+        public ReSetMaxNum(string iCustCode,string iInoutno)
         {
             custcode = iCustCode;
+            inoutno = iInoutno;
             InitializeComponent();
         }
         //前缀
@@ -78,7 +81,7 @@ namespace UAS_LabelMachine
                             //替换参数后重新执行SQL
                             foreach (Match mch in match.Matches(SQL))
                             {
-                                SQL = SQL.Replace(mch.Value.Trim(), "'" + this.Number.Text + "'");
+                                SQL = SQL.Replace(mch.Value.Trim(), "'"+ inoutno + "'");
                             }
                             Temp = (DataTable)dh.ExecuteSql(SQL, "select");
                         }

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

@@ -178,7 +178,7 @@
             this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -1224,7 +1224,7 @@
             this.pib_pdno,
             this.pib_prodcode,
             this.pr_orispeccode,
-            this.pr_brand,
+            this.pib_brand,
             this.pib_madein,
             this.pr_zxbzs,
             this.pr_unit,
@@ -1784,13 +1784,13 @@
             this.pr_orispeccode.ReadOnly = true;
             this.pr_orispeccode.Width = 48;
             // 
-            // pr_brand
+            // pib_brand
             // 
-            this.pr_brand.DataPropertyName = "pr_brand";
-            this.pr_brand.HeaderText = "品牌";
-            this.pr_brand.Name = "pr_brand";
-            this.pr_brand.ReadOnly = true;
-            this.pr_brand.Width = 54;
+            this.pib_brand.DataPropertyName = "pib_brand";
+            this.pib_brand.HeaderText = "品牌";
+            this.pib_brand.Name = "pib_brand";
+            this.pib_brand.ReadOnly = true;
+            this.pib_brand.Width = 54;
             // 
             // pib_madein
             // 
@@ -2162,7 +2162,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_pdno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_prodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_brand;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_madein;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;

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

@@ -516,7 +516,7 @@ namespace UAS_LabelMachine
                     string date = "";
                     string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
                     string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
-                    string pr_brand = LabelInf.Rows[CurrentRowIndex].Cells["pr_brand"].Value.ToString();
+                    string pr_brand = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString();
                     LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
                     if (CollectionUnit.Text == "盒")
                     {
@@ -754,7 +754,7 @@ namespace UAS_LabelMachine
                         length--;
                         break;
                     case "品牌":
-                        cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_brand"];
+                        cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"];
                         Matchstr = MatchStr(item.Value, "品牌");
                         //如果采集的数量不相等的话
                         if (cell.Value.ToString() != Matchstr)
@@ -819,7 +819,7 @@ namespace UAS_LabelMachine
                 string month = "";
                 string day = "";
                 string date = "";
-                string pr_brand = LabelInf.Rows[CurrentRowIndex].Cells["pr_brand"].Value.ToString();
+                string pr_brand = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString();
                 LogicHandler.GetTimeFromDatecode(DateCode, pr_brand, out year, out month, out day, out date);
                 sql.Append(",pib_datecode='" + DateCode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' ");
             }
@@ -1614,7 +1614,7 @@ namespace UAS_LabelMachine
             TotalCount.Text = LabelInf.RowCount.ToString();
             if (LabelInf.RowCount > 0)
             {
-                Brand = LabelInf.Rows[0].Cells["pr_brand"].FormattedValue.ToString();
+                Brand = LabelInf.Rows[0].Cells["pib_brand"].FormattedValue.ToString();
                 if (Brand != "")
                     sg_code.Text = dh.getFieldDataByCondition("scangroup", "sg_code", "sg_brand='" + Brand + "'").ToString();
                 SetOutBoxCapacity(LabelInf.Rows[0].Cells["pib_prodcode"].Value.ToString());
@@ -2308,7 +2308,7 @@ namespace UAS_LabelMachine
                 case "流水调整":
                     if (cu_code.Text != "")
                     {
-                        ReSetMaxNum reset = new ReSetMaxNum(cu_code.Text);
+                        ReSetMaxNum reset = new ReSetMaxNum(cu_code.Text, pi_inoutno.Text);
                         BaseUtil.SetFormCenter(reset);
                         reset.ShowDialog();
                     }
@@ -2463,18 +2463,16 @@ namespace UAS_LabelMachine
             {
                 GetCustRule();
                 //获取最大的流水号
-
                 DataTable dt = ExcelHandler.ExcelToDataTable(ImportExcel.FileName, true);
                 if (dt == null)
                 {
                     MessageBox.Show("文件" + ImportExcel.FileName + "被占用或者格式不正确");
                     return;
                 }
+                string outsql = "";
+                LogicHandler.GenerateBarCode(PI_ID, cu_code.Text, out outsql);
                 sql.Clear();
-                sql.Append("select pr_spec,pd_outqty-nvl(sum(pib_qty),0) pd_outqty,pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,");
-                sql.Append("pd_prodcode,pd_ordercode,pd_orderdetno from prodiodetail left join product on pd_prodcode=pr_code left join prodiobarcode  ");
-                sql.Append("on pd_id=pib_pdid  where pd_inoutno='" + pi_inoutno.Text + "' group by pr_spec,pd_outqty,");
-                sql.Append("pr_id,pd_piclass,pd_piid,pd_id,pr_zxbzs,pr_brand,pd_pdno,pd_id,pd_prodcode,pd_ordercode,pd_orderdetno order by pd_pdno");
+                sql.Append(outsql);
                 DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 //需要插入的参数
                 ArrayList<string> barcode = new ArrayList<string>();
@@ -2490,6 +2488,8 @@ namespace UAS_LabelMachine
                 ArrayList<string> prbrand = new ArrayList<string>();
                 ArrayList<string> pdprodcode = new ArrayList<string>();
                 ArrayList<string> pib_custoutboxcode = new ArrayList<string>();
+                ArrayList<string> brand = new ArrayList<string>();
+                ArrayList<string> madein = new ArrayList<string>();
                 //用于数量的校验
                 Dictionary<string, decimal> sumqty = new Dictionary<string, decimal>();
                 Dictionary<string, Dictionary<string, decimal>> outsumqty = new Dictionary<string, Dictionary<string, decimal>>();
@@ -2530,6 +2530,8 @@ namespace UAS_LabelMachine
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     string pr_spec = dt.Rows[i]["规格型号"].ToString().Trim();
+                    string 品牌 = dt.Rows[i]["品牌"].ToString().Trim();
+                    string 产地 = dt.Rows[i]["产地"].ToString().Trim();
                     if (pr_spec.Trim() == "")
                     {
                         break;
@@ -2581,6 +2583,7 @@ namespace UAS_LabelMachine
                         string pd_id = dr[k]["pd_id"].ToString();
                         string pd_piclass = dr[k]["pd_piclass"].ToString();
                         string pr_id = dr[k]["pr_id"].ToString();
+                        string pr_madein = dr[k]["pr_madein"].ToString();
                         //已导入数量
                         decimal zxbzs = decimal.Parse(dr[k]["pr_zxbzs"].ToString());
                         decimal pd_outqty = 0;
@@ -2590,7 +2593,7 @@ namespace UAS_LabelMachine
                             continue;
                         }
                         //如果导入行的数量小于改明细的出货数量
-                        if (outsumqty[pr_spec][pd_pdno] >= outqty)
+                        if (outsumqty[pr_spec][pd_pdno] >= outqty && outqty > 0)
                         {
                             //使用导入明细行数量
                             pd_outqty = outqty;
@@ -2618,7 +2621,8 @@ namespace UAS_LabelMachine
                                 pdorderdetno.Add(pd_orderdetno);
                                 pdpdno.Add(pd_pdno);
                                 pdid.Add(pd_id);
-                                prbrand.Add(pr_brand);
+                                prbrand.Add(品牌 == "" ? pr_brand : 品牌);
+                                madein.Add(产地 == "" ? pr_madein : 产地);
                                 pdprodcode.Add(pd_prodcode);
                             }
                             custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
@@ -2632,7 +2636,8 @@ namespace UAS_LabelMachine
                             pdorderdetno.Add(pd_orderdetno);
                             pdpdno.Add(pd_pdno);
                             pdid.Add(pd_id);
-                            prbrand.Add(pr_brand);
+                            prbrand.Add(品牌 == "" ? pr_brand : 品牌);
+                            madein.Add(产地 == "" ? pr_madein : 产地);
                             pdprodcode.Add(pd_prodcode);
                         }
                         else
@@ -2651,7 +2656,8 @@ namespace UAS_LabelMachine
                                 pdorderdetno.Add(pd_orderdetno);
                                 pdpdno.Add(pd_pdno);
                                 pdid.Add(pd_id);
-                                prbrand.Add(pr_brand);
+                                prbrand.Add(品牌 == "" ? pr_brand : 品牌);
+                                madein.Add(产地 == "" ? pr_madein : 产地);
                                 pdprodcode.Add(pd_prodcode);
                             }
                         }
@@ -2707,10 +2713,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)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
+                        sql.Append("pib_outboxcode2,pib_custbarcode,pib_custoutboxcode,pib_madein)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)");
-                        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" }, 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());
+                        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());
                         //更新流水
                         dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
                         LoadGridData();
@@ -2750,7 +2756,7 @@ namespace UAS_LabelMachine
         {
             Button setvalue = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
-            string pr_brand = LabelInf.Rows[rowindex].Cells["pr_brand"].Value.ToString();
+            string pr_brand = LabelInf.Rows[rowindex].Cells["pib_brand"].Value.ToString();
             string datecode = setvalue.FindForm().Controls["datecode"].Text;
             string lotno = setvalue.FindForm().Controls["lotno"].Text;
             string nums = setvalue.FindForm().Controls["Nums"].Text;
@@ -2785,7 +2791,7 @@ namespace UAS_LabelMachine
         {
             Button setvalueandprint = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
-            string pr_brand = LabelInf.Rows[rowindex].Cells["pr_brand"].Value.ToString();
+            string pr_brand = LabelInf.Rows[rowindex].Cells["pib_brand"].Value.ToString();
             string datecode = setvalueandprint.FindForm().Controls["datecode"].Text;
             string lotno = setvalueandprint.FindForm().Controls["lotno"].Text;
             string nums = setvalueandprint.FindForm().Controls["Nums"].Text;