|
@@ -98,4 +98,26 @@ public class CustomerApiController {
|
|
|
return AjaxResult.error();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/getCustomerOverViewById")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult getCustomerOverViewById(String id) {
|
|
|
+ // 获取索引的别名,字段,创建时间http://10.32.2.231:9200/shanglifeecif.individual/default_type_/1
|
|
|
+ HttpConfig config = HttpConfig.custom().url("http://"+host+":"+port+"/shanglifeecif.individual/default_type_/"+id);
|
|
|
+ try {
|
|
|
+ Map map = new HashMap();
|
|
|
+ String result = HttpClientUtil.get(config);
|
|
|
+ JSONObject jsonObject = JSON.parseObject(result);
|
|
|
+ Map mpInfo = new HashMap();
|
|
|
+ mpInfo.put("id",jsonObject.getString("_id"));
|
|
|
+ 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")));
|
|
|
+ map.put("custInfo",mpInfo);
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ } catch (HttpProcessException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return AjaxResult.error();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|