风控中台-增加评分历史功能

This commit is contained in:
zhanglei@ap-leasing.com.cn 2023-09-22 13:39:57 +08:00
parent 7fb9882f2d
commit 92e45e661f
5 changed files with 95 additions and 8 deletions

View File

@ -10,6 +10,8 @@
String userId= CurUser.getUserID();
String sFlowUnid = CurPage.getParameter("FlowUnid");//Á÷³Ì±àºÅ
String projectNo=CurPage.getParameter("ProjectNo");//ÏîÄ¿±àºÅ
String phaseNo=CurPage.getParameter("PhaseNo");//流程节点
String flowNo=CurPage.getParameter("FlowNo");//流程编号
String compClientID = CurPage.getParameter("CompClientID");
String detailUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/RCScoreResultDetail.jsp?CompClientID=";
String sTempletNo = "queryScoreResult";//--Ä£°åºÅ--
@ -54,7 +56,10 @@
function amp(){
var flowUnid = "<%=sFlowUnid%>";
var curUserId = "<%=userId%>";
var result = RunJavaMethodTrans("com.ample.esb.controller.AmpController","ampDo","flowUnid="+flowUnid+",operatorId="+curUserId);
var flowNo = "<%=flowNo%>";
var phaseNo = "<%=phaseNo%>";
var projectNo = "<%=projectNo%>";
var result = RunJavaMethodTrans("com.ample.esb.controller.AmpController","ampDo","flowUnid="+flowUnid+",operatorId="+curUserId+",flowNo="+flowNo+",phaseNo="+phaseNo+",projectNo="+projectNo);
alert(result);
self.location.reload();
}

View File

@ -870,11 +870,17 @@
<attributes>
<attribute name="ID" label="唯一标识" type="String" length="32" />
<attribute name="GLOBAL_SEQ_NO" label="全局唯一标识" type="STRING" length="26" />
<attribute name="INPUTUSERID" label="操作人" type="STRING" length="30"/>
<attribute name="INPUTUSERID" label="操作人ID" type="STRING" length="30"/>
<attribute name="INPUTUSERNAME" label="操作人" type="STRING" length="50"/>
<attribute name="FLOW_NODE" label="流程节点值" type="STRING" length="50"/>
<attribute name="FLOW_NODE_NAME" label="流程节点" type="STRING" length="50"/>
<attribute name="INPUTTIME" label="发起评分时间" type="STRING" length="7"/>
<attribute name="RET_CODE" label="服务返回码" type="STRING" length="50"/>
<attribute name="FLOW_UNID" label="流程id" type="STRING" length="1"/>
<attribute name="PROJECT_NO" label="项目编号" type="STRING" length="50"/>
<attribute name="FRAUD_ALERT_CODE" label="反欺诈结果" type="STRING" length="50"/>
<attribute name="FRAUD_TAKEN_CODE" label="反欺诈人工判定结果" type="STRING" length="50"/>
<attribute name="SCORE_RESULT_CODE" label="评分结果" type="STRING" length="50"/>
<attribute name="RESULT_TIME" label="异步结果时间" type="STRING" length="50"/>
</attributes>
<manager>

View File

@ -1,9 +1,13 @@
package com.ample.esb.controller;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.jbo.*;
import com.amarsoft.dict.als.manage.NameManager;
import com.ample.esb.bean.esb.MessageEsbHead;
import com.ample.esb.bean.esb.Transaction;
import com.ample.esb.service.AmpService;
import com.ample.esb.service.impl.AmpServiceImpl;
import com.ample.esb.util.DateUtils;
import jbo.sys.FLOW_MODEL;
import java.util.HashMap;
import java.util.Map;
@ -11,6 +15,9 @@ import java.util.Map;
public class AmpController {
private String operatorId;
private String flowUnid;
private String flowNo;
private String phaseNo;
private String projectNo;
public String ampDo(JBOTransaction tx) throws Exception {
Map<String,String> map = new HashMap<String,String>();
map.put("flowUnid",flowUnid);
@ -25,6 +32,7 @@ public class AmpController {
public String resultAnalysis(Transaction tran){
String response = "";
String retCode = tran.getMessageEsbHead().getRetCode();
saveScoreLog(tran);
if("000000".equals(retCode)){
response = "²Ù×÷³É¹¦£¡";
}else{
@ -32,7 +40,40 @@ public class AmpController {
}
return response;
}
public void saveScoreLog(com.ample.esb.bean.esb.Transaction tran){
BizObjectManager bom = null;
try {
bom = JBOFactory.getBizObjectManager("jbo.oti.RC_SCORE_LOG");
MessageEsbHead esbHead = tran.getMessageEsbHead();
BizObject bo = bom.newObject();
bo.setAttributeValue("GLOBAL_SEQ_NO",esbHead.getGlobalSeqNo());
bo.setAttributeValue("FLOW_NODE",phaseNo);
bo.setAttributeValue("FLOW_NODE_NAME",flowNodeName(flowNo,phaseNo));
bo.setAttributeValue("INPUTUSERID",operatorId);
String userName = NameManager.getUserName(operatorId);
bo.setAttributeValue("INPUTUSERNAME",userName);
bo.setAttributeValue("FLOW_UNID",flowUnid);
bo.setAttributeValue("INPUTTIME", DateUtils.dateTimeNow());
String retCode = tran.getMessageEsbHead().getRetCode();
bo.setAttributeValue("RET_CODE", retCode);
bo.setAttributeValue("PROJECT_NO", projectNo);
bom.saveObject(bo);
} catch (JBOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
public String flowNodeName(String flowNo,String phaseNo){
String flowNodeName = "";
try {
BizObject bo = JBOFactory.createBizObjectQuery(FLOW_MODEL.CLASS_NAME,"select PHASENAME from O where flowno=:flowno and phaseno=:phaseno").setParameter("flowno",flowNo).setParameter("phaseno",phaseNo).getSingleResult(false);
flowNodeName = bo.getAttribute("PHASENAME").toString();
} catch (JBOException e) {
e.printStackTrace();
}
return flowNodeName;
}
public String getOperatorId() {
return operatorId;
@ -50,6 +91,27 @@ public class AmpController {
this.flowUnid = flowUnid;
}
public String getFlowNo() {
return flowNo;
}
public void setFlowNo(String flowNo) {
this.flowNo = flowNo;
}
public String getPhaseNo() {
return phaseNo;
}
public void setPhaseNo(String phaseNo) {
this.phaseNo = phaseNo;
}
public String getProjectNo() {
return projectNo;
}
public void setProjectNo(String projectNo) {
this.projectNo = projectNo;
}
}

View File

@ -114,6 +114,8 @@ public class AmpServiceImpl extends EsbCommon implements AmpService {
}
return app;
}
//公共参数
//订单临时表
private BizObject boLpit;

View File

@ -20,15 +20,19 @@ public interface RC_SCORE_LOG {
*/
public static final String GLOBAL_SEQ_NO = "GLOBAL_SEQ_NO";
/**
* 全局唯一标识 LONG(64)<br>
* 节点名称 LONG(64)<br>
*/
public static final String FLOW_NODE = "FLOW_NODE";
/**
* 节点名称 LONG(64)<br>
*/
public static final String FLOW_NODE_NAME = "FLOW_NODE_NAME";
/**
* 交易码(15)<br>
* 流程id(15)<br>
*/
public static final String FLOW_UNID = "FLOW_UNID";
/**
* 服务id STRING(990)<br>
* 返回结果时间 STRING(990)<br>
*/
public static final String RESULT_TIME = "RESULT_TIME";
/**
@ -36,9 +40,17 @@ public interface RC_SCORE_LOG {
*/
public static final String RET_CODE = "RET_CODE";
public static final String PROJECT_NO = "PROJECT_NO";
public static final String INPUTUSERID = "INPUTUSERID";
public static final String INPUTUSERNAME = "INPUTUSERNAME";
public static final String INPUTTIME = "INPUTTIME";
public static final String FRAUD_ALERT_CODE = "FRAUD_ALERT_CODE";
public static final String FRAUD_TAKEN_CODE = "FRAUD_TAKEN_CODE";
public static final String SCORE_RESULT_CODE = "SCORE_RESULT_CODE";
}