Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
傅伟强-富德
/
test
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 50bc276c
authored
Mar 01, 2019
by
傅伟强-富德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test.txt
1 parent
8ed81495
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
test.txt
test.txt
View file @
50bc276
...
...
@@ -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);
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment