Commit 50bc276c by 傅伟强-富德

Update test.txt

1 parent 8ed81495
Showing with 43 additions and 0 deletions
......@@ -236,7 +236,50 @@
T1.UPDATED_USER
)
</insert>
public void updateAssignPolicyInfo(List<JSONObject> jsonObject)
{
List<JSONObject> resultList=new ArrayList<JSONObject>();
for (int i = 0; i < jsonObject.size(); i++)
{
Map pilicyInfo=new HashMap();
pilicyInfo=jsonObject.get(i);
String policyNos = (String) pilicyInfo.get("policyNo");
SearchSourceBuilder searchSourceBuilder=new SearchSourceBuilder();
BoolQueryBuilder boolQuery=new BoolQueryBuilder();
boolQuery.filter(QueryBuilders.termsQuery("po_policy_no",policyNos));
SumAggregationBuilder pp_modal_total_prem = AggregationBuilders.sum("pp_modal_total_prem").field("pp_modal_total_prem");
searchSourceBuilder.query(boolQuery).aggregation(pp_modal_total_prem);
try{
Search search=new Search.Builder(searchSourceBuilder.toString())
.addIndex("policyproinfo").addType(MyConstant.ES_TYPE)
.setParameter(Parameters.SIZE,8000).setParameter(Parameters.SCROLL,"5m")
.build();
//执行查询
logUtils.info("统计数据查询语句:"+searchSourceBuilder.toString());
JestResult result = client.execute(search);
// handleResult(resultList, result);
List<JSONObject> selectList = result.getSourceAsObjectList(JSONObject.class);
System.out.println("查询结果"+selectList+"数量"+selectList.size());
//第一次查询的结果要先处理
for (JSONObject object : selectList) {
object.put("service_emp_no", (String) pilicyInfo.get("servicerNo"));
object.put("rnpsi_assign_mode", (String) pilicyInfo.get("assignRule"));
object.put("rnpsi_last_assign_user", (String) pilicyInfo.get("lastAssignUser"));
//object.put("rnpsi_last_assign_date", DateUtil.getDateTimeFormat(jsonObject2.getString("lastAssignDate")));
//object.put("rnpsi_last_assign_date", bir);
object.put("rnpsi_orphan_mark", "0");
resultList.add(object);
}
System.out.println("resultList info:"+resultList);
}catch (Exception e){
logUtils.error(e);
e.printStackTrace();
}
}
insertPolicyInfo(resultList);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!