Bläddra i källkod

上海人寿首页保单件数接口提交

kouchengxing 4 år sedan
förälder
incheckning
1abb9f9904

+ 26 - 5
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/api/IndexApiController.java

@@ -192,19 +192,40 @@ public class IndexApiController extends BaseController {
                 if(jsonObject!=null){
                 if(jsonObject!=null){
                     JSONArray hits = jsonObject.getJSONArray("hits");
                     JSONArray hits = jsonObject.getJSONArray("hits");
                     if(hits!=null && hits.size()>0){
                     if(hits!=null && hits.size()>0){
-                        List manNum = new ArrayList();
-                        List womanNum = new ArrayList();
+                        String[] manNum = new String[5];
+                        String[] womanNum = new String[5];
                         for (Object o:hits) {
                         for (Object o:hits) {
                             JSONObject object = JSONUtil.parseObj(o);
                             JSONObject object = JSONUtil.parseObj(o);
                             if(object!=null){
                             if(object!=null){
                                 JSONObject source = object.getJSONObject("_source");
                                 JSONObject source = object.getJSONObject("_source");
                                 String gender = source.getStr("gender");
                                 String gender = source.getStr("gender");
-                                String labelname = source.getStr("labelname");
+                                String labelname = source.getStr("labelname").trim();
                                 String cusnum = source.getStr("cusnum");
                                 String cusnum = source.getStr("cusnum");
                                 if("0".equals(gender)){
                                 if("0".equals(gender)){
-                                        manNum.add(cusnum);
+                                    if("儿童".equals(labelname)){
+                                        manNum[0] = cusnum;
+                                    }else if("少年".equals(labelname)){
+                                        manNum[1] = cusnum;
+                                    }else if("青年".equals(labelname)){
+                                        manNum[2] = cusnum;
+                                    }else if("中年".equals(labelname)){
+                                        manNum[3] = cusnum;
+                                    }else {
+                                        manNum[4] = cusnum;
+                                    }
+
                                 }else {
                                 }else {
-                                    womanNum.add(cusnum);
+                                    if("儿童".equals(labelname)){
+                                        womanNum[0] = cusnum;
+                                    }else if("少年".equals(labelname)){
+                                        womanNum[1] = cusnum;
+                                    }else if("青年".equals(labelname)){
+                                        womanNum[2] = cusnum;
+                                    }else if("中年".equals(labelname)){
+                                        womanNum[3] = cusnum;
+                                    }else {
+                                        womanNum[4] = cusnum;
+                                    }
                                 }
                                 }
                             }
                             }