Bläddra i källkod

1、床垫清单,修复获取主规格配置报错问题

iggy 3 veckor sedan
förälder
incheckning
50b434416d
1 ändrade filer med 13 tillägg och 11 borttagningar
  1. 13 11
      JLHHJSvr/Excutor/RefreshMattressInterfaceExcutor.cs

+ 13 - 11
JLHHJSvr/Excutor/RefreshMattressInterfaceExcutor.cs

@@ -61,21 +61,23 @@ namespace JLHHJSvr.Excutor
                     var mxlist = mattressHelper.GetMattressMxMtrl(request.mattressid_fu.Value, new List<string>() { "u_mattress_formula.formulatype IN (1)" });
                     var cwInterfaceList = new List<u_mattress_interface>();
                     interfaceHelper.AutoSetFormulaTypeOnePz(mxlist, cwInterfaceList);
-                    interfaceHelper.MattressInterfaceFindERPPz(request.mattressid_fu.Value, cwInterfaceList);
-                    // 
-                    var cwDict = new Dictionary<int, u_mattress_interface>();
-                    foreach(var cw in cwInterfaceList)
+                    if(cwInterfaceList.Count > 0)
                     {
-                        if (cw.erp_pzid > 0 && !cwDict.ContainsKey(cw.erp_pzid.Value)) cwDict.Add(cw.erp_pzid.Value, cw);
-                    }
-                    foreach (var copy in copy_list)
-                    {
-                        if(cwDict.TryGetValue(copy.erp_pzid.Value,out var mx) && copy.bj_pzname.Contains("床网"))
+                        interfaceHelper.MattressInterfaceFindERPPz(request.mattressid_fu.Value, cwInterfaceList);
+                        // 
+                        var cwDict = new Dictionary<int, u_mattress_interface>();
+                        foreach (var cw in cwInterfaceList)
                         {
-                            copy.bj_namemx = mx.bj_namemx;
+                            if (cw.erp_pzid > 0 && !cwDict.ContainsKey(cw.erp_pzid.Value)) cwDict.Add(cw.erp_pzid.Value, cw);
+                        }
+                        foreach (var copy in copy_list)
+                        {
+                            if (cwDict.TryGetValue(copy.erp_pzid.Value, out var mx) && copy.bj_pzname.Contains("床网"))
+                            {
+                                copy.bj_namemx = mx.bj_namemx;
+                            }
                         }
                     }
-
                 } else
                 {
                     interfaceHelper.ImportMattressInterfaceList(request.mattressid.Value, copy_list);