打印日志
This commit is contained in:
parent
68083196ee
commit
9425dcd48a
|
@ -28,6 +28,12 @@ public interface ICbs8ExtService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity);
|
SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity);
|
||||||
|
/**
|
||||||
|
* 代发代扣 支付申请 回调方法
|
||||||
|
* @param logEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void agentPayApplyCallBack(SysMessageManageLogEntity logEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 交易结果查询
|
* 交易结果查询
|
||||||
|
|
|
@ -136,6 +136,49 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代发代扣 支付申请 回调方法
|
||||||
|
*
|
||||||
|
* @param logEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void agentPayApplyCallBack(SysMessageManageLogEntity logEntity) {
|
||||||
|
try {
|
||||||
|
logger.info("回调方法里的参数:{}", JSONObject.toJSONString(logEntity));
|
||||||
|
JSONObject targetData = JSONObject.parseObject(logEntity.getTargetData());//目标数据
|
||||||
|
JSONObject sourceData = JSONObject.parseObject(logEntity.getSourceData());//源数据
|
||||||
|
JSONObject sourceHeaders = sourceData.getJSONObject("header");//源header
|
||||||
|
JSONObject targetHeaders = targetData.getJSONObject("header");//目标header
|
||||||
|
JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body
|
||||||
|
//自定义参数,存放的是请求报文明文
|
||||||
|
String hzyaExtData = targetHeaders.getString("hzyaExtData");
|
||||||
|
String returnDataBase64 = logEntity.getReturnData();
|
||||||
|
byte[] secretResByte = Base64.getDecoder().decode(returnDataBase64);
|
||||||
|
//解密报文
|
||||||
|
String decryptRes = CBSUtil.decrypt(secretResByte);
|
||||||
|
//6、记录系统日志
|
||||||
|
IntegrationTaskLivingDetailsEntity logTask = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
logTask.setRootAppPk(sourceBody.getString("formsonId"));
|
||||||
|
logTask.setRootAppBill(sourceBody.getString("referenceNum"));
|
||||||
|
logTask.setPluginId("CBS8PayApplyAgentPlugin");
|
||||||
|
//对方接口返回信息
|
||||||
|
logTask.setNewTransmitInfo(decryptRes);
|
||||||
|
logTask.setNewPushDate(new Date());
|
||||||
|
//调用接口请求参数
|
||||||
|
logTask.setRootAppNewData(hzyaExtData);
|
||||||
|
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(decryptRes);
|
||||||
|
//为true是成功
|
||||||
|
if (payResponseDTO.getSuccessed()) {
|
||||||
|
taskLivingDetailsService.saveLogToSuccess(logTask);
|
||||||
|
}else {
|
||||||
|
taskLivingDetailsService.saveLogToFail(logTask);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info("agentPayApplyCallBack方法执行出错:{}",e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 交易结果查询
|
* 交易结果查询
|
||||||
*
|
*
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class Cbs8ServiceImpl implements ICbs8Service {
|
||||||
.put("appId","800026")
|
.put("appId","800026")
|
||||||
.build();
|
.build();
|
||||||
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body();
|
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body();
|
||||||
|
logger.info("payApply方法调用externalCallInterfaceToESB返回信息:{}",body);
|
||||||
//解密响应报文
|
//解密响应报文
|
||||||
String result = decryptResBody(body);
|
String result = decryptResBody(body);
|
||||||
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(result);
|
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(result);
|
||||||
|
|
Loading…
Reference in New Issue