Browse Source

Merge branch 'develop' into develop2

hu 9 months ago
parent
commit
a1f7f4b930
1 changed files with 45 additions and 17 deletions
  1. 45 17
      src/custom/restcontroller/sale/itemgroup/itemgroup.java

+ 45 - 17
src/custom/restcontroller/sale/itemgroup/itemgroup.java

@@ -809,7 +809,7 @@ public class itemgroup extends Controller {
 
 
             }
             }
 
 
-
+            List<String> list = new ArrayList<>(listParmNotBlank);
             for (String firstcolor : firstcolorList) {
             for (String firstcolor : firstcolorList) {
                 boolean isexistParm = false;
                 boolean isexistParm = false;
                 for (Object object : colormap) {
                 for (Object object : colormap) {
@@ -820,10 +820,17 @@ public class itemgroup extends Controller {
                     }
                     }
                 }
                 }
                 if (!isexistParm) {
                 if (!isexistParm) {
-                    JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("parm", firstcolor);
-                    jsonObject.put("flag", true);
-                    colormap.add(jsonObject);
+                    if(list.get(0).equals("color")){
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstcolor);
+                        jsonObject.put("flag", true);
+                        colormap.add(jsonObject);
+                    }else{
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstcolor);
+                        jsonObject.put("flag", false);
+                        colormap.add(jsonObject);
+                    }
                 }
                 }
             }
             }
             for (String firstspec : firstspecList) {
             for (String firstspec : firstspecList) {
@@ -836,10 +843,17 @@ public class itemgroup extends Controller {
                     }
                     }
                 }
                 }
                 if (!isexistParm) {
                 if (!isexistParm) {
-                    JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("parm", firstspec);
-                    jsonObject.put("flag", true);
-                    specmap.add(jsonObject);
+                    if(list.get(0).equals("color")){
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstspec);
+                        jsonObject.put("flag", true);
+                        colormap.add(jsonObject);
+                    }else{
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstspec);
+                        jsonObject.put("flag", false);
+                        colormap.add(jsonObject);
+                    }
                 }
                 }
             }
             }
             for (String firstmaterial : firstmaterialList) {
             for (String firstmaterial : firstmaterialList) {
@@ -852,10 +866,17 @@ public class itemgroup extends Controller {
                     }
                     }
                 }
                 }
                 if (!isexistParm) {
                 if (!isexistParm) {
-                    JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("parm", firstmaterial);
-                    jsonObject.put("flag", true);
-                    materialmap.add(jsonObject);
+                    if(list.get(0).equals("color")){
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstmaterial);
+                        jsonObject.put("flag", true);
+                        colormap.add(jsonObject);
+                    }else{
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstmaterial);
+                        jsonObject.put("flag", false);
+                        colormap.add(jsonObject);
+                    }
                 }
                 }
             }
             }
             for (String firstcheek : firstcheekList) {
             for (String firstcheek : firstcheekList) {
@@ -868,10 +889,17 @@ public class itemgroup extends Controller {
                     }
                     }
                 }
                 }
                 if (!isexistParm) {
                 if (!isexistParm) {
-                    JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("parm", firstcheek);
-                    jsonObject.put("flag", true);
-                    cheekmap.add(jsonObject);
+                    if(list.get(0).equals("color")){
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstcheek);
+                        jsonObject.put("flag", true);
+                        colormap.add(jsonObject);
+                    }else{
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("parm", firstcheek);
+                        jsonObject.put("flag", false);
+                        colormap.add(jsonObject);
+                    }
                 }
                 }
             }
             }
         }else {
         }else {