gt 3 年 前
コミット
ff679d92a2

+ 10 - 8
src/main/java/com/jd/zfjyjgfwpt/service/impl/FrontServiceImpl.java

@@ -309,14 +309,16 @@ public class FrontServiceImpl implements FrontServiceI {
         if (StrUtil.equals(obj.getString("type"), "success", true)) {
             JSONArray jsonArray = obj.getJSONObject("data").getJSONArray("data");
             Object data = null;
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JSONObject item = jsonArray.getJSONObject(i);
-                // 社会统一信用代码
-                String shtyxydm = item.getString("UNISCID");
-                String companyId = Convert.toStr(params.get("companyId"), "");
-                if (companyId.equals(shtyxydm)) {
-                    data = item;
-                    break;
+            if (Blank.isNotEmpty(jsonArray)) {
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    JSONObject item = jsonArray.getJSONObject(i);
+                    // 社会统一信用代码
+                    String shtyxydm = item.getString("UNISCID");
+                    String companyId = Convert.toStr(params.get("companyId"), "");
+                    if (companyId.equals(shtyxydm)) {
+                        data = item;
+                        break;
+                    }
                 }
             }
             return SendUtil.send(true, "", data);