风控中台对接-评分回调接口修改

This commit is contained in:
zhanglei 2023-09-01 18:29:00 +08:00
parent b889eb8296
commit 868045f50b

View File

@ -32,7 +32,7 @@ public class ScoreResultServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public void doPost(HttpServletRequest request, HttpServletResponse response) {
System.out.println("评分结果推送接收接口请求回调开始!");
response.setContentType("application/x-www-form-urlencoded;charset:utf-8");
response.setContentType("application/xml;charset:utf-8");
response.setHeader("Cache-Control", "no-store");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0L);
@ -49,9 +49,14 @@ public class ScoreResultServlet extends HttpServlet {
}
resultXml = sb.toString();
ARE.getLog().info("接收到Rpt记录" + resultXml);
out.print(updateResult(resultXml));
System.out.println("评分结果推送接收接口请求回调结束!");
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
private void savePushLog(String xmlRes) throws Exception{
@ -62,7 +67,11 @@ public class ScoreResultServlet extends HttpServlet {
}
tx = JBOFactory.createJBOTransaction();
JSONObject resStrJson = PbocXmlUtils.toJson(xmlRes);
JSONObject resJson = resStrJson.getJSONObject("APPLICATION");//ÉêÇëºÅ
JSONObject resJsonTransaction = resStrJson.getJSONObject("TRANSACTION");//申请号
JSONObject resJsonMessageBody = resJsonTransaction.getJSONObject("MESSAGE_BODY");//申请号
JSONObject resJsonRequest = resJsonMessageBody.getJSONObject("REQUEST");//申请号
JSONObject resJson = resJsonRequest.getJSONObject("APPLICATION");//申请号
// JSONObject resJson = resStrJson.getJSONObject("APPLICATION");//申请号
JSONObject baseInfoJson = resJson.getJSONObject("BASE_INFO");//申请号
String projectNo = baseInfoJson.getString("APPLICATION_NUMBER");//申请号
BizObjectManager rcCallbackLog = JBOFactory.getBizObjectManager(RC_CALLBACK_LOG.CLASS_NAME, tx);