鹏远个人信息报告

This commit is contained in:
luojian 2019-06-11 11:05:40 +08:00
parent 3c74d9e0da
commit f52fe891d0

View File

@ -0,0 +1,133 @@
<%@page import="com.itextpdf.text.log.SysoCounter"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="com.alibaba.fastjson.JSONArray"%>
<%@page import="com.alibaba.fastjson.JSON"%>
<%@page import="com.alibaba.fastjson.JSONObject"%>
<%@page import="com.tenwa.httpclient.controller.BigDataController"%>
<%@page import="java.util.Date"%>
<%@page import="com.tenwa.util.SerialNumberUtil"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@include file="/IncludeBegin.jsp"%><%
String flowunid = CurPage.getParameter("ObjectNo");
String projectNo = CurPage.getParameter("ProjectNo");
String ReadyApprove = CurPage.getParameter("ReadyApprove");
String applyId = "";
String getType = CurPage.getParameter("GetType");
String type = "";
String count = "";
String reasonDesc = "";
BigDataController bdc = new BigDataController();
boolean flag = true;
if("GET".equals(getType)) {
JBOTransaction tx = JBOFactory.createJBOTransaction();
applyId = SerialNumberUtil.getPengyuanNumber(tx);
tx.commit();
type = "SAVE";
} else {
String result = bdc.getDataApplyId(CurPage, "ebank_af", Sqlca);
if("false".equals(result)) {
JBOTransaction tx = JBOFactory.createJBOTransaction();
applyId = SerialNumberUtil.getPengyuanNumber(tx);
tx.commit();
type = "SAVE";
} else {
String[] res = result.split("@");
applyId = res[1];
count = res[2];
type = "GET";
}
}
Map<String,String> params = new HashMap<String,String>(); //初始化参数
String resultals =bdc.getCustomerInfoPerson(flowunid, Sqlca);
if(!"false".equals(resultals)){
String[] sReturn = resultals.split("@");
params.put("queryType","25136");
params.put("name",sReturn[1]);//被查询人姓名
params.put("documentNo",sReturn[2]);//被查询人证件号码
params.put("cardNos",sReturn[4]);//银行卡号
params.put("queryReasonID","101");
params.put("subreportIDs","14501,14518");
params.put("refID","");
}
FileInputStream fr = null;
BufferedReader br = null;
try {
String htmlURL = bdc.getAndSavePengyuanData(params, "ebank_af", Sqlca, type, applyId, CurPage);
File file = new File(htmlURL);
fr = new FileInputStream(file);
br = new BufferedReader(new InputStreamReader(fr, "UTF-8"));
String str;
while((str = br.readLine()) != null) {
String html = str;
if(html.indexOf(".png") != -1 || html.indexOf(".jpg") != -1) {
html = html.replaceAll("image/image_\\d+[.]", "Tenwa/Lease/Flow/Comm/BigdataPengyuan/query_report/image/image.");
}
if(html.indexOf("width=\"95%\"") != -1) {
html = html.replaceAll("width=\"95%\"", "");
}
if(html.indexOf("height=\"70\"") != -1) {
html = html.replaceAll("height=\"70\"", "");
}
if(html.indexOf("width=\"103\"") != -1) {
html = html.replaceAll("width=\"103\"", "");
}
if(html.indexOf("<td>个人信息报告</td>") != -1) {
html = html.replaceAll("<td>个人信息报告</td>", "<td><a style=\"position:absolute;left:0;top:8%\" title=\"拉取鹏元数据\" onclick=\"AsButton.run(this, function(){getData();}, event);return false;\" class=\"inline_button \" hidefocus=\"\" href=\"javascript:void(0);\"><span style=\"display:none;\"></span><span class=\"left\">&nbsp;</span><span class=\"center\"><span class=\"btn_icon btn_icon_edit\">&nbsp;</span><span class=\"btn_text\">拉取鹏元数据</span></span><span class=\"right\">&nbsp;</span></a>个人信用报告</td>");
}
if(html.indexOf("<body>") != -1) {
html = html.replaceAll("<body>", "<body style=\"overflow:scroll;height:95%\">");
}
if(html.indexOf("<table class=\"report\" align=\"center\">") != -1) {
html = html.replaceAll("<table class=\"report\" align=\"center\">", "<table class=\"report\" align=\"center\" style=\"width:99%\">");
}
%>
<%=html%>
<%}
System.out.println("------------------鹏元-个人反欺诈解析结束时间----------------------");
System.out.println("");
System.out.println("");
System.out.println("------------------"+StringFunction.getTodayNow()+"----------------------");
System.out.println("");
System.out.println("");
System.out.println("------------------鹏元-个人反欺诈解析结束时间----------------------");
//查询获取数据次数
if("SAVE".equals(type)) {
String result = bdc.getDataApplyId(CurPage, "pengyuan_af", Sqlca);
if("false".equals(result)) {
count = "0";
} else {
count = result.split("@")[2];
}
}
} catch(Exception e) {
e.printStackTrace();
flag = false;
reasonDesc = e.getMessage();
Sqlca.rollback();
%>
<script type="text/javascript" src="<%=sWebRootPath %>/Frame/page/js/as_debug_message.js"></script>
<script type="text/javascript">
AsDebug.alert("提示","获取数据失败");
</script>
<%
} finally {
if(br != null) br.close();
if(fr != null) fr.close();
}
%>
<script type="text/javascript">
function getData() {
if('<%=ReadyApprove%>'=='ReadOnly'){
AsDebug.alert("提示", "查询页面不允许获取大数据");
return;
}
if("<%=count%>" == "done") {
AsDebug.alert("提示", "已达到获取数据次数上限");
} else {
location.href = location.href.indexOf("&GetType=GET") == -1 ? location.href + "&GetType=GET&Count=<%=count%>" : location.href.substring(0, location.href.indexOf("&GetType=GET")) + "&GetType=GET&Count=<%=count%>";
}
}
</script>
<%@include file="/IncludeEnd.jsp"%>