From 61ec7e4aa5b2343e77fc3e1e0bbc769e2a7a1a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A3=8A?= <寮犵@LAPTOP-O3DO03BA> Date: Mon, 25 Jun 2018 15:07:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B7=E5=89=8D=E5=BE=81=E4=BF=A1=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=B0=8FBug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LBCarCreditTempList.jsp | 2 +- .../comm/credit/CreditBodyGuardAction.java | 482 +++++++++--------- 2 files changed, 243 insertions(+), 241 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBPreLoanAntiFraud/LBCarCreditTempList.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBPreLoanAntiFraud/LBCarCreditTempList.jsp index ee40876a4..a52098084 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBPreLoanAntiFraud/LBCarCreditTempList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBPreLoanAntiFraud/LBCarCreditTempList.jsp @@ -16,7 +16,7 @@ //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 String sButtons[][] = { - {"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, + {"true","","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, {"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, {"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""}, {"true","","Button","信贷校验","信贷校验","creditVerification()","","","","btn_icon_detail",""} diff --git a/src_core/com/tenwa/comm/credit/CreditBodyGuardAction.java b/src_core/com/tenwa/comm/credit/CreditBodyGuardAction.java index 14208364d..55ad3798f 100644 --- a/src_core/com/tenwa/comm/credit/CreditBodyGuardAction.java +++ b/src_core/com/tenwa/comm/credit/CreditBodyGuardAction.java @@ -36,268 +36,270 @@ public class CreditBodyGuardAction { BizObjectManager bom2 = JBOFactory.getBizObjectManager(LB_CAR_CREDIT_CALLRESULT.CLASS_NAME, tx); BizObjectManager bom3 = JBOFactory.getBizObjectManager(LB_CAR_CREDIT_RISKITEM.CLASS_NAME, tx); BizObject biz1 = bom1.createQuery("ID=:id").setParameter("id", id).getSingleResult(true); - String entryid = biz1.getAttribute("entryid").getString(); - BizObject entryObject = bom2.createQuery("select final_decision from O where entryid=:ENTRYID").setParameter("ENTRYID",entryid).getSingleResult(false); - if(entryObject == null){ - BizObject resultObject = bom2.newObject(); - BodyGuardApiInvoker bodyGuardApiInvoker = new BodyGuardApiInvoker(); - Map params = new HashMap<>(); - //工作流编号 - params.put("biz_code", "AntiFraud"); - //借款人姓名 - params.put("account_name", biz1.getAttribute("account_name").toString()); - //借款人身份证 - params.put("id_number", biz1.getAttribute("id_number").toString()); - //借款人手机号 - params.put("account_mobile", biz1.getAttribute("account_mobile").toString()); - //借款人银行卡号 - params.put("card_number", biz1.getAttribute("card_number")); - //借款人QQ - params.put("qq_number", biz1.getAttribute("qq_number").toString()); - //借款人邮箱 - params.put("account_email", biz1.getAttribute("account_email").toString()); - //借款公司名称 - params.put("lend_company", biz1.getAttribute("lend_company").toString()); - //借款人单位地址 - params.put("account_address_work", biz1.getAttribute("account_address_work").toString()); - //借款用途 - params.put("loan_purpose", biz1.getAttribute("loan_purpose").toString()); - //共同借款人姓名 - params.put("coborrower_name", biz1.getAttribute("coborrower_name").toString()); - //共同借款人身份证 - params.put("coborrower_id_number", biz1.getAttribute("coborrower_id_number").toString()); - //共同借款人手机 - params.put("coborrower_mobile", biz1.getAttribute("coborrower_mobile").toString()); - //共同借款人社会关系 - params.put("coborrower_relation", biz1.getAttribute("coborrower_relation").toString()); - //第三联系人姓名 - params.put("contact3_name", biz1.getAttribute("contact3_name").toString()); - //第三联系人手机号 - params.put("contact3_mobile", biz1.getAttribute("contact3_mobile").toString()); - //第三联系人身份证 - params.put("contact3_id_number", biz1.getAttribute("contact3_id_number").toString()); - //第三联系人社会关系 - params.put("contact3_relation", biz1.getAttribute("contact3_relation").toString()); - //第二联系人姓名 - params.put("contact2_name", biz1.getAttribute("contact2_name").toString()); - //第二联系人手机号 - params.put("contact2_mobile", biz1.getAttribute("contact2_mobile").toString()); - //第二联系人身份证 - params.put("contact2_id_number", biz1.getAttribute("contact2_id_number").toString()); - //第二联系人社会关系 - params.put("contact2_relation", biz1.getAttribute("contact2_relation").toString()); - //第一联系人姓名 - params.put("contact1_name", biz1.getAttribute("contact1_name").toString()); - //第一联系人手机号 - params.put("contact1_mobile", biz1.getAttribute("contact1_mobile").toString()); - //第一联系人身份证 - params.put("contact1_id_number", biz1.getAttribute("contact1_id_number").toString()); - //第一联系人社会关系 - params.put("contact1_relation", biz1.getAttribute("contact1_relation").toString()); - //调用接口方法 - BodyGuardApiResponse ResponseResult = bodyGuardApiInvoker.invoke(params); - if(!ResponseResult.getSuccess()){ - return ResponseResult.getReason_desc().toString(); - } - //解析返回成功的JSON数据 - JSONObject object = JSONObject.parseObject(ResponseResult.getResult_desc()); - //JSON结果对象 - JSONObject resultobject = (JSONObject) object.get("ANTIFRAUD"); - resultObject.setAttributeValue("entryid",ResponseResult.getId()); - resultObject.setAttributeValue("final_score", resultobject.get("final_score")); - resultObject.setAttributeValue("final_decision", resultobject.get("final_decision")); - bom2.saveObject(resultObject); - //保存风险详情到风险项目表 - @SuppressWarnings("rawtypes") - List riskItemList = JSON.parseArray(JSON.toJSONString(resultobject.get("risk_items")),HashMap.class); - if(!riskItemList.isEmpty()){ - for(int i=0;i detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = "高风险较为集中地区:"+detailList.get(0).get("high_risk_areas").toString().replace("[", "").replace("]",""); - }else if("身份证命中法院失信名单".equals(riskItemList.get(i).get("risk_name"))){ + if(biz1 != null){ + String entryid = biz1.getAttribute("entryid").getString(); + BizObject entryObject = bom2.createQuery("select final_decision from O where entryid=:ENTRYID").setParameter("ENTRYID",entryid).getSingleResult(false); + if(entryObject == null){ + BizObject resultObject = bom2.newObject(); + BodyGuardApiInvoker bodyGuardApiInvoker = new BodyGuardApiInvoker(); + Map params = new HashMap<>(); + //工作流编号 + params.put("biz_code", "AntiFraud"); + //借款人姓名 + params.put("account_name", biz1.getAttribute("account_name").toString()); + //借款人身份证 + params.put("id_number", biz1.getAttribute("id_number").toString()); + //借款人手机号 + params.put("account_mobile", biz1.getAttribute("account_mobile").toString()); + //借款人银行卡号 + params.put("card_number", biz1.getAttribute("card_number")); + //借款人QQ + params.put("qq_number", biz1.getAttribute("qq_number").toString()); + //借款人邮箱 + params.put("account_email", biz1.getAttribute("account_email").toString()); + //借款公司名称 + params.put("lend_company", biz1.getAttribute("lend_company").toString()); + //借款人单位地址 + params.put("account_address_work", biz1.getAttribute("account_address_work").toString()); + //借款用途 + params.put("loan_purpose", biz1.getAttribute("loan_purpose").toString()); + //共同借款人姓名 + params.put("coborrower_name", biz1.getAttribute("coborrower_name").toString()); + //共同借款人身份证 + params.put("coborrower_id_number", biz1.getAttribute("coborrower_id_number").toString()); + //共同借款人手机 + params.put("coborrower_mobile", biz1.getAttribute("coborrower_mobile").toString()); + //共同借款人社会关系 + params.put("coborrower_relation", biz1.getAttribute("coborrower_relation").toString()); + //第三联系人姓名 + params.put("contact3_name", biz1.getAttribute("contact3_name").toString()); + //第三联系人手机号 + params.put("contact3_mobile", biz1.getAttribute("contact3_mobile").toString()); + //第三联系人身份证 + params.put("contact3_id_number", biz1.getAttribute("contact3_id_number").toString()); + //第三联系人社会关系 + params.put("contact3_relation", biz1.getAttribute("contact3_relation").toString()); + //第二联系人姓名 + params.put("contact2_name", biz1.getAttribute("contact2_name").toString()); + //第二联系人手机号 + params.put("contact2_mobile", biz1.getAttribute("contact2_mobile").toString()); + //第二联系人身份证 + params.put("contact2_id_number", biz1.getAttribute("contact2_id_number").toString()); + //第二联系人社会关系 + params.put("contact2_relation", biz1.getAttribute("contact2_relation").toString()); + //第一联系人姓名 + params.put("contact1_name", biz1.getAttribute("contact1_name").toString()); + //第一联系人手机号 + params.put("contact1_mobile", biz1.getAttribute("contact1_mobile").toString()); + //第一联系人身份证 + params.put("contact1_id_number", biz1.getAttribute("contact1_id_number").toString()); + //第一联系人社会关系 + params.put("contact1_relation", biz1.getAttribute("contact1_relation").toString()); + //调用接口方法 + BodyGuardApiResponse ResponseResult = bodyGuardApiInvoker.invoke(params); + if(!ResponseResult.getSuccess()){ + return ResponseResult.getReason_desc().toString(); + } + //解析返回成功的JSON数据 + JSONObject object = JSONObject.parseObject(ResponseResult.getResult_desc()); + //JSON结果对象 + JSONObject resultobject = (JSONObject) object.get("ANTIFRAUD"); + resultObject.setAttributeValue("entryid",ResponseResult.getId()); + resultObject.setAttributeValue("final_score", resultobject.get("final_score")); + resultObject.setAttributeValue("final_decision", resultobject.get("final_decision")); + bom2.saveObject(resultObject); + //保存风险详情到风险项目表 + @SuppressWarnings("rawtypes") + List riskItemList = JSON.parseArray(JSON.toJSONString(resultobject.get("risk_items")),HashMap.class); + if(!riskItemList.isEmpty()){ + for(int i=0;i detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = "高风险较为集中地区:"+detailList.get(0).get("high_risk_areas").toString().replace("[", "").replace("]",""); + }else if("身份证命中法院失信名单".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + @SuppressWarnings("rawtypes") + List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3) + +",犯罪类型为:"+detailList.get(0).get("fraud_type_display_name").toString().split("、")[0]; + }else if("身份证命中法院执行名单".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + @SuppressWarnings("rawtypes") + List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3); + }else if("身份证命中高风险关注名单".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = detailList.get(0).get("hit_type_display_name").toString()+"命中"+detailList.get(0).get("fraud_type_display_name").toString() + +"等高风险行为名单"; + }else if("身份证命中车辆租赁违约名单".equals(riskItemList.get(i).get("risk_name"))){ @SuppressWarnings("rawtypes") List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3) + + ",违约类型:"+detailList.get(0).get("fraud_type_display_name").toString().split("、")[0]; + }else if("身份证命中欠款公司法人代表名单".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3) + + ",身份证本人为:"+detailList.get(0).get("fraud_type_display_name").toString().split("、")[0]; + }else if("手机号命中诈骗骚扰库".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(2) + + ",违规类型:"+detailList.get(0).get("fraud_type_display_name").toString(); + }else if("第一联系人身份证命中法院执行名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + detailList.get(0).get("hit_type_display_name"); + detailList.get(0).get("fraud_type_display_name"); + detailList.get(0).get("description"); @SuppressWarnings("rawtypes") List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3) - +",犯罪类型为:"+detailList.get(0).get("fraud_type_display_name").toString().split("、")[0]; - }else if("身份证命中法院执行名单".equals(riskItemList.get(i).get("risk_name"))){ + }else if("第一联系人身份证命中法院结案名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ @SuppressWarnings("rawtypes") List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + detailList.get(0).get("hit_type_display_name"); + detailList.get(0).get("fraud_type_display_name"); + detailList.get(0).get("description"); @SuppressWarnings("rawtypes") - List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + msg = "违规类型:"+detailList.get(0).get("description").toString(); + }else if("第二联系人身份证命中法院失信名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ + @SuppressWarnings("rawtypes") + List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + detailList.get(0).get("hit_type_display_name"); + detailList.get(0).get("fraud_type_display_name"); + detailList.get(0).get("description"); + @SuppressWarnings("rawtypes") + List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + detailList.get(0).get("hit_type_display_name"); + detailList.get(0).get("fraud_type_display_name"); + detailList.get(0).get("description"); + @SuppressWarnings("rawtypes") + List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + StringBuffer sb = new StringBuffer(); for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3); - }else if("身份证命中高风险关注名单".equals(riskItemList.get(i).get("risk_name"))){ + msg = "违规类型:"+detailList.get(0).get("description").toString()+"犯罪类型:"+detailList.get(0).get("fraud_type_display_name").toString(); + }else if("第三联系人身份证命中法院执行名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ @SuppressWarnings("rawtypes") List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = detailList.get(0).get("hit_type_display_name").toString()+"命中"+detailList.get(0).get("fraud_type_display_name").toString() - +"等高风险行为名单"; - }else if("身份证命中车辆租赁违约名单".equals(riskItemList.get(i).get("risk_name"))){ - @SuppressWarnings("rawtypes") - List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3) - + ",违约类型:"+detailList.get(0).get("fraud_type_display_name").toString().split("、")[0]; - }else if("身份证命中欠款公司法人代表名单".equals(riskItemList.get(i).get("risk_name"))){ - @SuppressWarnings("rawtypes") - List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(3) - + ",身份证本人为:"+detailList.get(0).get("fraud_type_display_name").toString().split("、")[0]; - }else if("手机号命中诈骗骚扰库".equals(riskItemList.get(i).get("risk_name"))){ - @SuppressWarnings("rawtypes") - List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = detailList.get(0).get("hit_type_display_name").toString()+detailList.get(0).get("description").toString().substring(2) - + ",违规类型:"+detailList.get(0).get("fraud_type_display_name").toString(); - }else if("第一联系人身份证命中法院执行名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ - @SuppressWarnings("rawtypes") - List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - detailList.get(0).get("hit_type_display_name"); - detailList.get(0).get("fraud_type_display_name"); - detailList.get(0).get("description"); - @SuppressWarnings("rawtypes") - List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); - for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - detailList.get(0).get("hit_type_display_name"); - detailList.get(0).get("fraud_type_display_name"); - detailList.get(0).get("description"); - @SuppressWarnings("rawtypes") - List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); - for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = "违规类型:"+detailList.get(0).get("description").toString(); - }else if("第二联系人身份证命中法院失信名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ - @SuppressWarnings("rawtypes") - List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - detailList.get(0).get("hit_type_display_name"); - detailList.get(0).get("fraud_type_display_name"); - detailList.get(0).get("description"); - @SuppressWarnings("rawtypes") - List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); - for(int j=0;j courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); + for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); + detailList.get(0).get("hit_type_display_name"); + detailList.get(0).get("fraud_type_display_name"); + detailList.get(0).get("description"); + @SuppressWarnings("rawtypes") + List greylistdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("grey_list_details")),HashMap.class); + for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - detailList.get(0).get("hit_type_display_name"); - detailList.get(0).get("fraud_type_display_name"); - detailList.get(0).get("description"); - @SuppressWarnings("rawtypes") - List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); - StringBuffer sb = new StringBuffer(); - for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - msg = "违规类型:"+detailList.get(0).get("description").toString()+"犯罪类型:"+detailList.get(0).get("fraud_type_display_name").toString(); - }else if("第三联系人身份证命中法院执行名单_一般联系人".equals(riskItemList.get(i).get("risk_name"))){ - @SuppressWarnings("rawtypes") - List detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - detailList.get(0).get("hit_type_display_name"); - detailList.get(0).get("fraud_type_display_name"); - detailList.get(0).get("description"); - @SuppressWarnings("rawtypes") - List courtdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("court_details")),HashMap.class); - for(int j=0;j detailList = JSON.parseArray(JSON.toJSONString(riskItemList.get(i).get("risk_detail")),HashMap.class); - detailList.get(0).get("hit_type_display_name"); - detailList.get(0).get("fraud_type_display_name"); - detailList.get(0).get("description"); - @SuppressWarnings("rawtypes") - List greylistdetailList = JSON.parseArray(JSON.toJSONString(detailList.get(0).get("grey_list_details")),HashMap.class); - for(int j=0;j