保存日志
This commit is contained in:
parent
943829f8d7
commit
97d5129ca5
|
@ -45,7 +45,6 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
@Override
|
@Override
|
||||||
public SysExtensionApiEntity payApply(SysExtensionApiEntity entity) {
|
public SysExtensionApiEntity payApply(SysExtensionApiEntity entity) {
|
||||||
String bodys = entity.getBodys();
|
String bodys = entity.getBodys();
|
||||||
logger.info("Cbs8ExtServiceImpl.payApply方法body参数:{}",bodys);
|
|
||||||
if (StrUtil.isNotEmpty(bodys)) {
|
if (StrUtil.isNotEmpty(bodys)) {
|
||||||
PaymentEntity paymentEntity = JSONObject.parseObject(bodys, PaymentEntity.class);
|
PaymentEntity paymentEntity = JSONObject.parseObject(bodys, PaymentEntity.class);
|
||||||
if (null != paymentEntity) {
|
if (null != paymentEntity) {
|
||||||
|
@ -73,10 +72,11 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
String requestData = JSONObject.toJSONString(list);
|
String requestData = JSONObject.toJSONString(list);
|
||||||
//加密 签名
|
//加密 签名
|
||||||
encrypAndsign(entity, requestData);
|
encrypAndsign(entity, requestData);
|
||||||
|
//重试日志id
|
||||||
|
entity.getHeaders().put("integration_task_living_details_id",paymentEntity.getTaskDetailId());
|
||||||
entity.setBodys(requestData);
|
entity.setBodys(requestData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("Cbs8ExtServiceImpl.payApply方法执行完毕:{}",JSONObject.toJSONString(entity));
|
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +96,7 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body
|
JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body
|
||||||
//自定义参数,存放的是请求报文明文
|
//自定义参数,存放的是请求报文明文
|
||||||
String hzyaExtData = targetHeaders.getString("hzyaExtData");
|
String hzyaExtData = targetHeaders.getString("hzyaExtData");
|
||||||
|
String taskDetailId = targetHeaders.getString("integration_task_living_details_id");
|
||||||
String returnDataBase64 = logEntity.getReturnData();
|
String returnDataBase64 = logEntity.getReturnData();
|
||||||
byte[] secretResByte = Base64.getDecoder().decode(returnDataBase64);
|
byte[] secretResByte = Base64.getDecoder().decode(returnDataBase64);
|
||||||
//解密报文
|
//解密报文
|
||||||
|
@ -111,11 +112,19 @@ public class Cbs8ExtServiceImpl implements ICbs8ExtService {
|
||||||
//调用接口请求参数
|
//调用接口请求参数
|
||||||
logTask.setRootAppNewData(hzyaExtData);
|
logTask.setRootAppNewData(hzyaExtData);
|
||||||
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(decryptRes);
|
PayResponseDTO payResponseDTO = PayResponseDTO.payResValueOf(decryptRes);
|
||||||
//为true是成功
|
if (StrUtil.isEmpty(taskDetailId)){
|
||||||
if (payResponseDTO.getSuccessed()) {
|
//为true是成功
|
||||||
taskLivingDetailsService.saveLogToSuccess(logTask);
|
if (payResponseDTO.getSuccessed()) {
|
||||||
|
taskLivingDetailsService.saveLogToSuccess(logTask);
|
||||||
|
}else {
|
||||||
|
taskLivingDetailsService.saveLogToFail(logTask);
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
taskLivingDetailsService.saveLogToFail(logTask);
|
if (payResponseDTO.getSuccessed()){
|
||||||
|
taskLivingDetailsService.saveLogFailToSuccess(logTask);
|
||||||
|
}else {
|
||||||
|
taskLivingDetailsService.updateLogFailToSuccess(logTask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("payApplyCallBack方法执行出错:{}",e);
|
logger.info("payApplyCallBack方法执行出错:{}",e);
|
||||||
|
|
|
@ -46,8 +46,9 @@ public class PaymentEntity extends BaseEntity {
|
||||||
private String payCompanyCode;//付款公司编码
|
private String payCompanyCode;//付款公司编码
|
||||||
|
|
||||||
//是否重试
|
//是否重试
|
||||||
private String retry_flag;
|
private String retryFlag;
|
||||||
|
//重试日志id
|
||||||
|
private String taskDetailId;
|
||||||
public String getOaId() {
|
public String getOaId() {
|
||||||
return oaId;
|
return oaId;
|
||||||
}
|
}
|
||||||
|
@ -328,11 +329,19 @@ public class PaymentEntity extends BaseEntity {
|
||||||
this.applyCode = applyCode;
|
this.applyCode = applyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRetry_flag() {
|
public String getRetryFlag() {
|
||||||
return retry_flag;
|
return retryFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRetry_flag(String retry_flag) {
|
public void setRetryFlag(String retryFlag) {
|
||||||
this.retry_flag = retry_flag;
|
this.retryFlag = retryFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskDetailId() {
|
||||||
|
return taskDetailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskDetailId(String taskDetailId) {
|
||||||
|
this.taskDetailId = taskDetailId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,7 +412,7 @@
|
||||||
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
|
<if test="payBankName != null and payBankName !='' ">and v.payBankName = #{payBankName} </if>
|
||||||
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
|
<if test="payType != null and payType !='' "> and v.payType = #{payType} </if>
|
||||||
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
|
<if test="finishedflag != null and finishedflag !='' "> and v.finishedflag = #{finishedflag} </if>
|
||||||
<if test="retry_flag == null or retry_flag == ''">
|
<if test="retryFlag == null or retryFlag == ''">
|
||||||
and v.payResult is null
|
and v.payResult is null
|
||||||
and v.amount > 0
|
and v.amount > 0
|
||||||
and v.finishedflag = 1
|
and v.finishedflag = 1
|
||||||
|
|
Loading…
Reference in New Issue