|
@@ -62,8 +62,8 @@ public class CustomerApiController {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
try {
|
|
|
+ logger.info("进客户列表时间:"+DateUtils.getTime());
|
|
|
|
|
|
//1.如果存在保单信息的查询条件,需要先查询保单信息然后通过保单关联出客户信息
|
|
|
//处理保单查询条件
|
|
@@ -227,9 +227,10 @@ public class CustomerApiController {
|
|
|
|
|
|
map.put("list",listMap);
|
|
|
map.put("total",total);
|
|
|
-
|
|
|
+ logger.info("出客户列表时间:"+DateUtils.getTime());
|
|
|
return AjaxResult.success(map);
|
|
|
} catch (Exception e) {
|
|
|
+ logger.info("列表报错时间:"+DateUtils.getTime());
|
|
|
e.printStackTrace();
|
|
|
return AjaxResult.error();
|
|
|
}
|
|
@@ -308,6 +309,7 @@ public class CustomerApiController {
|
|
|
|
|
|
Request scriptRequest = new Request("GET", "/shanglifeecif.insurancearrangement/_search?scroll=1m");
|
|
|
scriptRequest.setEntity(entity);
|
|
|
+
|
|
|
Response response = restClient.performRequest(scriptRequest);
|
|
|
// Response response= restClient.performRequest("GET", "/shanglifeecif.insurancearrangement/_search?scroll=1m",Collections.<String, String>emptyMap(),entity);
|
|
|
|
|
@@ -350,7 +352,7 @@ public class CustomerApiController {
|
|
|
public AjaxResult getCustomerById(String id) {
|
|
|
// 获取索引的别名,字段,创建时间http://10.32.2.231:9200/shanglifeecif.individual/default_type_/1
|
|
|
try {
|
|
|
-
|
|
|
+ logger.info("进客户详情时间:"+DateUtils.getTime());
|
|
|
Map<String, String> paramMap = new HashMap<String, String>();
|
|
|
paramMap.put("pretty", "true");
|
|
|
Request scriptRequest = new Request("GET", "/shanglifeecif.individual/default_type_/"+id+"?pretty=true");
|
|
@@ -451,9 +453,10 @@ public class CustomerApiController {
|
|
|
partytimeline.add(mp);
|
|
|
}
|
|
|
map.put("partytimeline",partytimeline);
|
|
|
-
|
|
|
+ logger.info("出客户详情时间:"+DateUtils.getTime());
|
|
|
return AjaxResult.success(map);
|
|
|
} catch (Exception e) {
|
|
|
+ logger.info("客户详情报错时间:"+DateUtils.getTime());
|
|
|
e.printStackTrace();
|
|
|
return AjaxResult.error();
|
|
|
}
|
|
@@ -464,10 +467,12 @@ public class CustomerApiController {
|
|
|
public AjaxResult getCustomerOverViewById(String id) {
|
|
|
// 获取索引的别名,字段,创建时间http://10.32.2.231:9200/shanglifeecif.individual/default_type_/1
|
|
|
try {
|
|
|
+ logger.info("进客户概览时间:"+DateUtils.getTime());
|
|
|
Map<String, String> paramMap = new HashMap<String, String>();
|
|
|
paramMap.put("pretty", "true");
|
|
|
Request scriptRequest = new Request("GET", "shanglifeecif.individual/default_type_/"+id+"?pretty=true");
|
|
|
Response response = restClient.performRequest(scriptRequest);
|
|
|
+
|
|
|
String result = EntityUtils.toString(response.getEntity());
|
|
|
Map map = new HashMap();
|
|
|
JSONObject jsonObject = JSON.parseObject(result);
|
|
@@ -494,40 +499,68 @@ public class CustomerApiController {
|
|
|
|
|
|
//概览投保时间和保费折线图
|
|
|
Map expectedData = new HashMap();
|
|
|
- List edata = new ArrayList();
|
|
|
+ Double[] edata = new Double[12];
|
|
|
expectedData.put("name","");
|
|
|
|
|
|
Map actaulData = new HashMap();
|
|
|
- List adata = new ArrayList();
|
|
|
+ Double[] adata = new Double[12];
|
|
|
actaulData.put("name","");
|
|
|
List xaxisData = new ArrayList();
|
|
|
+ xaxisData.add("1");
|
|
|
+ xaxisData.add("2");
|
|
|
+ xaxisData.add("3");
|
|
|
+ xaxisData.add("4");
|
|
|
+ xaxisData.add("5");
|
|
|
+ xaxisData.add("6");
|
|
|
+ xaxisData.add("7");
|
|
|
+ xaxisData.add("8");
|
|
|
+ xaxisData.add("9");
|
|
|
+ xaxisData.add("10");
|
|
|
+ xaxisData.add("11");
|
|
|
+ xaxisData.add("12");
|
|
|
long insureDay = 0;//投保时长
|
|
|
int guaranteeDay = 0;//享受保障天数
|
|
|
|
|
|
- List majorCategories = new ArrayList();
|
|
|
- Map a = new HashMap();//意外伤害险
|
|
|
- Map u = new HashMap();//万能保险
|
|
|
- Map r = new HashMap();//年金保险
|
|
|
- Map s = new HashMap();//重疾保险
|
|
|
- Map l = new HashMap();//人寿保险
|
|
|
- Map h = new HashMap();//健康险
|
|
|
+
|
|
|
Map majorCategorie = new HashMap();
|
|
|
+
|
|
|
+ Map mpremMap = new HashMap();
|
|
|
for (int i = 0; i <array.size() ; i++) {
|
|
|
JSONObject json = (JSONObject)array.get(i);
|
|
|
JSONObject _source = (JSONObject) json.get("_source");
|
|
|
+ Date padate = _source.getDate("padate");
|
|
|
+
|
|
|
+ //xaxisData.add(DateUtils.parseDateToStr("MM",padate));
|
|
|
+
|
|
|
if(_source.containsKey("prem")){
|
|
|
prem+=_source.getDouble("prem");
|
|
|
- edata.add(_source.getDouble("prem"));
|
|
|
- adata.add(_source.getDouble("prem"));
|
|
|
+ String m = DateUtils.parseDateToStr("M", padate);
|
|
|
+
|
|
|
+
|
|
|
+ if(mpremMap.containsKey(m)){
|
|
|
+ double tprem = Double.parseDouble(mpremMap.get(m).toString());
|
|
|
+ tprem+=_source.getDouble("prem");
|
|
|
+ //mpremMap.put(m,mprem);
|
|
|
+ edata[Integer.parseInt(m)-1] = tprem;
|
|
|
+ adata[Integer.parseInt(m)-1] = tprem;
|
|
|
+ }else{
|
|
|
+ mpremMap.put(m,_source.getDouble("prem"));
|
|
|
+ edata[Integer.parseInt(m)-1] = _source.getDouble("prem");
|
|
|
+ adata[Integer.parseInt(m)-1] = _source.getDouble("prem");
|
|
|
+ }
|
|
|
+
|
|
|
+ //edata.add(_source.getDouble("prem"));
|
|
|
+ //adata.add(_source.getDouble("prem"));
|
|
|
}
|
|
|
- Date padate = _source.getDate("padate");
|
|
|
+
|
|
|
+
|
|
|
if(i==0){
|
|
|
insureDay = DateUtils.getDateDifDay(new Date(),padate);
|
|
|
}
|
|
|
if("有效".equals(_source.getString("policystate"))){
|
|
|
guaranteeDay+=_source.getInteger("agrmntage");
|
|
|
}
|
|
|
- xaxisData.add(DateUtils.parseDateToStr("MM",padate));
|
|
|
+
|
|
|
//String risk_categories = _source.getString("risk_categories");
|
|
|
String risk_categories_name = _source.getString("risk_categories_name");
|
|
|
|
|
@@ -537,11 +570,12 @@ public class CustomerApiController {
|
|
|
risk += _source.getDouble("risk");
|
|
|
}
|
|
|
majorCategorie.put(risk_categories_name,risk);
|
|
|
+ }else{
|
|
|
+ if(_source.containsKey("risk")){
|
|
|
+ majorCategorie.put(risk_categories_name,_source.getDouble("risk"));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if(_source.containsKey("risk")){
|
|
|
- majorCategorie.put(risk_categories_name,_source.getDouble("risk"));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
expectedData.put("data",edata);
|
|
@@ -582,8 +616,10 @@ public class CustomerApiController {
|
|
|
mpInfo.put("guaranteeDay",guaranteeDay);
|
|
|
map.put("custInfo",mpInfo);
|
|
|
map.put("majorCategorie",majorCategorie);
|
|
|
+ logger.info("出客户概览时间:"+DateUtils.getTime());
|
|
|
return AjaxResult.success(map);
|
|
|
} catch (Exception e) {
|
|
|
+ logger.info("客户概览报错时间:"+DateUtils.getTime());
|
|
|
e.printStackTrace();
|
|
|
return AjaxResult.error();
|
|
|
}
|