callm 2 недель назад
Родитель
Сommit
7f2b21ed02
1 измененных файлов с 10 добавлено и 9 удалено
  1. 10 9
      UAS-出货标签管理(贸易版-正常)/UAS_出货标签管理.cs

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

@@ -2549,14 +2549,14 @@ namespace UAS_LabelMachine
             };
             if (prcode != "")
             {
-                // 按ID列表查
-                var ids = new List<long>();
+                // prcode 为料号(编码)列表, 格式 'code1','code2',... 去引号后按 number 查
+                var numbers = new List<string>();
                 foreach (var s in prcode.Split(','))
                 {
-                    long n;
-                    if (long.TryParse(s.Trim(), out n)) ids.Add(n);
+                    string n = s.Trim().Trim('\'', '"');
+                    if (!string.IsNullOrEmpty(n)) numbers.Add(n);
                 }
-                if (ids.Count > 0) queryBody["id"] = ids;
+                if (numbers.Count > 0) queryBody["number"] = numbers;
             }
             // prcode=="" 时查全部已审核物料, 后面在C#里增量过滤
 
@@ -2879,6 +2879,7 @@ namespace UAS_LabelMachine
                     if (!string.IsNullOrEmpty(oid)) FOWNERID = oid;
 
                     pd_outqty.Add(GetJsonVal(entry, "qty"));
+                    // pd_prodcode 存物料内码ID(非料号): 后续 SQL 用 where pr_id=:pd_prodcode 关联 temp_product.pr_id(存内码)
                     pd_prodcode.Add(GetJsonVal(entry, "material_number"));
                     pi_cardcode.Add(customerId);
                     pd_ordercode.Add(GetJsonVal(entry, "mainbillnumber"));              // 发货通知单无订单号字段mainbillnumber
@@ -2891,7 +2892,7 @@ namespace UAS_LabelMachine
                     pd_custprodcode.Add(GetJsonVal(entry, "cusmaterialid_cusmat"));            // 暂无客户物料映射查询接口
                     pi_departmentcode.Add(deptCode);
                     pi_date.Add(bizdate);
-                    prcode += "'" + GetJsonVal(entry, "material_id") + "',";
+                    prcode += "'" + GetJsonVal(entry, "material_number") + "',";
                 }
             }
 
@@ -2913,9 +2914,9 @@ namespace UAS_LabelMachine
                     dh.ExecuteSql("delete from prodiodetail where pd_inoutno='" + pi_inoutno.Text + "'", "insert");
                 }
 
-                //dh.BatchInsert("delete from product where pr_code in  (select pr_code from temp_product where pr_id=:pr_code)", new string[] { "pd_prodcode" }, pd_prodcode.ToArray());
-                //dh.BatchInsert("delete from temp_product where pr_code in (select pr_code from temp_product where pr_id=:pr_code)", new string[] { "pd_prodcode" }, pd_prodcode.ToArray());
-                //SysProduct(prcode.Substring(0, prcode.Length-1));
+                dh.BatchInsert("delete from product where pr_code in  (select pr_code from temp_product where pr_code=:pr_code)", new string[] { "pd_prodcode" }, pd_prodcode.ToArray());
+                dh.BatchInsert("delete from temp_product where pr_code in (select pr_code from temp_product where pr_code=:pr_code)", new string[] { "pd_prodcode" }, pd_prodcode.ToArray());
+                SysProduct(prcode.Substring(0, prcode.Length - 1));
 
                 sql.Clear();
                 sql.Append("insert into prodiodetail(pd_id,pd_inoutno,pd_pdno,pd_piid,pd_piclass,pd_prodcode,pd_outqty,pd_brand,pd_custprodspec,pd_custproddetail,pd_usi,pd_gsd,pd_tsmt,pd_custprodcode,pd_ordercode,pd_prodid)");