|
|
@@ -7,6 +7,7 @@ import com.arronlong.httpclientutil.HttpClientUtil;
|
|
|
import com.arronlong.httpclientutil.common.HttpConfig;
|
|
|
import com.arronlong.httpclientutil.exception.HttpProcessException;
|
|
|
import com.dgtis.common.core.utils.DateUtils;
|
|
|
+import com.dgtis.common.core.utils.StringUtils;
|
|
|
import com.dgtis.common.core.utils.sql.EsJsonUtil;
|
|
|
import com.dgtis.common.core.web.domain.AjaxResult;
|
|
|
import org.apache.http.HttpEntity;
|
|
|
@@ -60,8 +61,20 @@ public class CustomerApiController {
|
|
|
mp.put("id",json.getString("_id"));
|
|
|
JSONObject jsonOb = JSON.parseObject(json.getString("_source"));
|
|
|
mp.putAll(JSON.parseObject(json.getString("_source"),Map.class));
|
|
|
- mp.put("birthday", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", jsonOb.getDate("birthday")));
|
|
|
- mp.put("age",DateUtils.getAge(jsonOb.getDate("birthday")));
|
|
|
+
|
|
|
+ if(mp.containsKey("birthday")){
|
|
|
+ Date date = jsonOb.getDate("birthday");
|
|
|
+ if(date!=null){
|
|
|
+ mp.put("birthday", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", date));
|
|
|
+ mp.put("age",DateUtils.getAge(date));
|
|
|
+ }else{
|
|
|
+ mp.put("birthday", "");
|
|
|
+ mp.put("age","");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ mp.put("birthday", "");
|
|
|
+ mp.put("age","");
|
|
|
+ }
|
|
|
listMap.add(mp);
|
|
|
}
|
|
|
long total = hitsobject.getLong("total");
|
|
|
@@ -91,8 +104,19 @@ public class CustomerApiController {
|
|
|
Map mpInfo = new HashMap();
|
|
|
String indid = jsonObject.getString("_id");
|
|
|
mpInfo.put("id",indid);
|
|
|
- mpInfo.putAll(JSON.parseObject(jsonObject.getString("_source"),Map.class));
|
|
|
- mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",JSON.parseObject(jsonObject.getString("_source")).getDate("birthday")));
|
|
|
+ JSONObject source = JSON.parseObject(jsonObject.getString("_source"));
|
|
|
+ mpInfo.putAll(JSON.parseObject(jsonObject.getString("_source"),Map.class));
|
|
|
+ //mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",JSON.parseObject(jsonObject.getString("_source")).getDate("birthday")));
|
|
|
+ if(mpInfo.containsKey("birthday")){
|
|
|
+ Date date = source.getDate("birthday");
|
|
|
+ if(date!=null){
|
|
|
+ mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",date));
|
|
|
+ mpInfo.put("age",DateUtils.getAge(date));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ mpInfo.put("birthday","");
|
|
|
+ mpInfo.put("age","");
|
|
|
+ }
|
|
|
map.put("custInfo",mpInfo);
|
|
|
|
|
|
|
|
|
@@ -113,7 +137,23 @@ public class CustomerApiController {
|
|
|
relationship.add(mp);
|
|
|
}
|
|
|
map.put("relationship",relationship);
|
|
|
- map.put("custInfo2",null);
|
|
|
+ query =new HashMap();
|
|
|
+ query.put("applicantid",indid);
|
|
|
+ entity = new NStringEntity(EsJsonUtil.QuerygetMust(query), ContentType.APPLICATION_JSON);
|
|
|
+ response= restClient.performRequest("GET", "/shanglifeecif.insuranceclaimthread/_search",Collections.<String, String>emptyMap(),entity);
|
|
|
+ result = EntityUtils.toString(response.getEntity());
|
|
|
+ jsonObject = JSON.parseObject(result);
|
|
|
+ hitsobject = (JSONObject) jsonObject.get("hits");
|
|
|
+ array = JSON.parseArray(hitsobject.get("hits").toString());
|
|
|
+ List insuranceclaimthread = new ArrayList<>();
|
|
|
+ for (int i = 0; i <array.size() ; i++) {
|
|
|
+ JSONObject json = (JSONObject)array.get(i);
|
|
|
+ Map mp = new HashMap();
|
|
|
+ mp.put("id",json.getString("_id"));
|
|
|
+ mp.putAll(JSON.parseObject(json.getString("_source"),Map.class));
|
|
|
+ insuranceclaimthread.add(mp);
|
|
|
+ }
|
|
|
+ map.put("insuranceclaimthread",insuranceclaimthread);
|
|
|
map.put("custInfo3",null);
|
|
|
map.put("custInfo4",null);
|
|
|
map.put("custInfo5",null);
|
|
|
@@ -139,9 +179,21 @@ public class CustomerApiController {
|
|
|
Map map = new HashMap();
|
|
|
JSONObject jsonObject = JSON.parseObject(result);
|
|
|
Map mpInfo = new HashMap();
|
|
|
- mpInfo.put("id",jsonObject.getString("_id"));
|
|
|
+ String indid = jsonObject.getString("_id");
|
|
|
+ mpInfo.put("id",indid);
|
|
|
+ JSONObject source = JSON.parseObject(jsonObject.getString("_source"));
|
|
|
mpInfo.putAll(JSON.parseObject(jsonObject.getString("_source"),Map.class));
|
|
|
- mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",JSON.parseObject(jsonObject.getString("_source")).getDate("birthday")));
|
|
|
+ //mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",JSON.parseObject(jsonObject.getString("_source")).getDate("birthday")));
|
|
|
+ if(mpInfo.containsKey("birthday")){
|
|
|
+ Date date = source.getDate("birthday");
|
|
|
+ if(date!=null){
|
|
|
+ mpInfo.put("birthday",DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",date));
|
|
|
+ mpInfo.put("age",DateUtils.getAge(date));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ mpInfo.put("birthday","");
|
|
|
+ mpInfo.put("age","");
|
|
|
+ }
|
|
|
map.put("custInfo",mpInfo);
|
|
|
return AjaxResult.success(map);
|
|
|
} catch (Exception e) {
|