Browse Source

1、床垫清单新增包装类自动识别多物料加序号

MY 2 ngày trước cách đây
mục cha
commit
ce4abead54
1 tập tin đã thay đổi với 9 bổ sung4 xóa
  1. 9 4
      JLHHJSvr/Helper/InterfaceHelper.cs

+ 9 - 4
JLHHJSvr/Helper/InterfaceHelper.cs

@@ -1058,10 +1058,15 @@ namespace JLHHJSvr.Helper
                 {201, "无纺布护角"}
             };
 
-            var countDict = new Dictionary<int, int>
+            // 判断是否多物料
+            var formulaList = new List<u_mattress_formula>();
+            DbSqlHelper.Select(cmd, "u_mattress_formula", "formulatype = 3 AND if_mtrl = 2",null, "formulakind", 0,0, formulaList, null, "formulakind");
+
+            var countDict = new Dictionary<int, int>();
+            foreach (var formula in formulaList)
             {
-                {16, 1}
-            };
+                if (!countDict.ContainsKey(formula.formulakind.Value)) countDict.Add(formula.formulakind.Value, 1);
+            }
 
             // 外观
             interfaceList.Add(InserMattressInterfacePz("床垫", "包装方式", 1, new string[] { Enum.GetName(typeof(PackType), mattress.packtype) }));
@@ -1082,7 +1087,7 @@ namespace JLHHJSvr.Helper
 
                     if (countDict.ContainsKey(mx.formulakind.Value))
                     {
-                        chastr += countDict[mx.formulakind.Value];
+                        chastr += countDict[mx.formulakind.Value]++;
                     }
 
                     // 添加包装信息