Parcourir la source

长图文管理

eganwu il y a 2 ans
Parent
commit
2ed8d05065

+ 15 - 3
src/custom/restcontroller/webmanage/saletool/sharematerial/LongPicText.java

@@ -208,7 +208,11 @@ public class LongPicText extends Controller {
         JSONArray jsonArray = new JSONArray();
         JSONArray jsonArray = new JSONArray();
         if (rows.isNotEmpty()) {
         if (rows.isNotEmpty()) {
             jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
             jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
-            jsonArray = jsonObject.getJSONArray("pics");
+            if (jsonObject.containsKey("pics")) {
+                jsonArray = jsonObject.getJSONArray("pics");
+            } else {
+                jsonArray = new JSONArray();
+            }
         }
         }
 
 
         ArrayList<Long> ids = new ArrayList<>();
         ArrayList<Long> ids = new ArrayList<>();
@@ -239,7 +243,11 @@ public class LongPicText extends Controller {
         JSONArray jsonArray = new JSONArray();
         JSONArray jsonArray = new JSONArray();
         if (rows.isNotEmpty()) {
         if (rows.isNotEmpty()) {
             jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
             jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
-            jsonArray = jsonObject.getJSONArray("pics");
+            if (jsonObject.containsKey("pics")) {
+                jsonArray = jsonObject.getJSONArray("pics");
+            } else {
+                jsonArray = new JSONArray();
+            }
         }
         }
         JSONArray newjsonArray = getTempJSONArray(jsonArray, String.valueOf(attachmentid));
         JSONArray newjsonArray = getTempJSONArray(jsonArray, String.valueOf(attachmentid));
 
 
@@ -276,7 +284,11 @@ public class LongPicText extends Controller {
         JSONArray jsonArray = new JSONArray();
         JSONArray jsonArray = new JSONArray();
         if (rows.isNotEmpty()) {
         if (rows.isNotEmpty()) {
             jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
             jsonObject = rows.get(0).getJSONObject("sharepagecontrol");
-            jsonArray = jsonObject.getJSONArray("pics");
+            if (jsonObject.containsKey("pics")) {
+                jsonArray = jsonObject.getJSONArray("pics");
+            } else {
+                jsonArray = new JSONArray();
+            }
         }
         }
         jsonObject.put("pics", getTempJSONArray(jsonArray, String.valueOf(attachmentid)));
         jsonObject.put("pics", getTempJSONArray(jsonArray, String.valueOf(attachmentid)));