风控中台-评分历史增加tran_no字段

This commit is contained in:
zhanglei@ap-leasing.com.cn 2023-09-22 17:17:37 +08:00
parent 272a78f4c4
commit d5f1d53c84
4 changed files with 23 additions and 3 deletions

View File

@ -882,6 +882,7 @@
<attribute name="FRAUD_TAKEN_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="SCORE_RESULT_CODE" label="评分结果" type="STRING" length="50"/>
<attribute name="RESULT_TIME" label="异步结果时间" type="STRING" length="50"/> <attribute name="RESULT_TIME" label="异步结果时间" type="STRING" length="50"/>
<attribute name="TRAN_NO" label="评分流水号" type="STRING" length="50"/>
</attributes> </attributes>
<manager> <manager>
<managerProperties> <managerProperties>

View File

@ -22,9 +22,11 @@ public class AmpController {
Map<String,String> map = new HashMap<String,String>(); Map<String,String> map = new HashMap<String,String>();
map.put("flowUnid",flowUnid); map.put("flowUnid",flowUnid);
map.put("operatorId",operatorId); map.put("operatorId",operatorId);
map.put("tranNo",DateUtils.dateTimeNowAccurate());
AmpService as = new AmpServiceImpl(map); AmpService as = new AmpServiceImpl(map);
Transaction tran = as.transactionDo(); Transaction tran = as.transactionDo();
String result = resultAnalysis(tran); String result = resultAnalysis(tran);
saveScoreLog(tran,map.get("tranNo"));
as.resetFraudTakenCode(); as.resetFraudTakenCode();
return result; return result;
} }
@ -32,7 +34,7 @@ public class AmpController {
public String resultAnalysis(Transaction tran){ public String resultAnalysis(Transaction tran){
String response = ""; String response = "";
String retCode = tran.getMessageEsbHead().getRetCode(); String retCode = tran.getMessageEsbHead().getRetCode();
saveScoreLog(tran);
if("000000".equals(retCode)){ if("000000".equals(retCode)){
response = "²Ù×÷³É¹¦£¡"; response = "²Ù×÷³É¹¦£¡";
}else{ }else{
@ -40,7 +42,7 @@ public class AmpController {
} }
return response; return response;
} }
public void saveScoreLog(com.ample.esb.bean.esb.Transaction tran){ public void saveScoreLog(com.ample.esb.bean.esb.Transaction tran,String tranNo){
BizObjectManager bom = null; BizObjectManager bom = null;
try { try {
bom = JBOFactory.getBizObjectManager("jbo.oti.RC_SCORE_LOG"); bom = JBOFactory.getBizObjectManager("jbo.oti.RC_SCORE_LOG");
@ -57,6 +59,7 @@ public class AmpController {
String retCode = tran.getMessageEsbHead().getRetCode(); String retCode = tran.getMessageEsbHead().getRetCode();
bo.setAttributeValue("RET_CODE", retCode); bo.setAttributeValue("RET_CODE", retCode);
bo.setAttributeValue("PROJECT_NO", projectNo); bo.setAttributeValue("PROJECT_NO", projectNo);
bo.setAttributeValue("TRAN_NO", tranNo);
bom.saveObject(bo); bom.saveObject(bo);
} catch (JBOException e) { } catch (JBOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -33,9 +33,11 @@ import java.util.*;
public class AmpServiceImpl extends EsbCommon implements AmpService { public class AmpServiceImpl extends EsbCommon implements AmpService {
private String flowUnid; private String flowUnid;
private String operatorId; private String operatorId;
private String tranNo;
public AmpServiceImpl(Map<String,String> map){ public AmpServiceImpl(Map<String,String> map){
setFlowUnid(map.get("flowUnid")); setFlowUnid(map.get("flowUnid"));
setOperatorId(map.get("operatorId")); setOperatorId(map.get("operatorId"));
setTranNo(map.get("tranNo"));
} }
public void resetFraudTakenCode(){ public void resetFraudTakenCode(){
BizObjectManager bom = null; BizObjectManager bom = null;
@ -133,6 +135,7 @@ public class AmpServiceImpl extends EsbCommon implements AmpService {
private BizObject boCft; private BizObject boCft;
//¾­ÏúÉÌÕýʽ±í //¾­ÏúÉÌÕýʽ±í
private BizObject boDi; private BizObject boDi;
/** /**
* ÍùbeanÀïÃæÌîÖµ * ÍùbeanÀïÃæÌîÖµ
* @throws JBOException * @throws JBOException
@ -996,7 +999,7 @@ public class AmpServiceImpl extends EsbCommon implements AmpService {
app.setNumber(number); app.setNumber(number);
app.setApplicationType("APF"); app.setApplicationType("APF");
app.setOriginalSystemId("APF"); app.setOriginalSystemId("APF");
app.setTranNo(DateUtils.dateTimeNowAccurate()); app.setTranNo(tranNo);
app.setFirstProposalDate(minTime); app.setFirstProposalDate(minTime);
app.setLastProposalDate(maxTime); app.setLastProposalDate(maxTime);
app.setFaName(faName); app.setFaName(faName);
@ -1204,4 +1207,12 @@ public class AmpServiceImpl extends EsbCommon implements AmpService {
public void setOperatorId(String operatorId) { public void setOperatorId(String operatorId) {
this.operatorId = operatorId; this.operatorId = operatorId;
} }
public String getTranNo() {
return tranNo;
}
public void setTranNo(String tranNo) {
this.tranNo = tranNo;
}
} }

View File

@ -53,4 +53,9 @@ public interface RC_SCORE_LOG {
public static final String FRAUD_TAKEN_CODE = "FRAUD_TAKEN_CODE"; public static final String FRAUD_TAKEN_CODE = "FRAUD_TAKEN_CODE";
public static final String SCORE_RESULT_CODE = "SCORE_RESULT_CODE"; public static final String SCORE_RESULT_CODE = "SCORE_RESULT_CODE";
/**
* Á÷Ë®ºÅ STRING(20)<br>
*/
public static final String TRAN_NO = "TRAN_NO";
} }