update 未分账支付单分到默认账户

This commit is contained in:
2023-10-16 10:18:06 +08:00
parent 45da1f1ed1
commit c2af8aca41
16 changed files with 148 additions and 109 deletions

View File

@@ -833,6 +833,9 @@ public class AdapayService {
}
String jsonString = JSON.toJSONString(paymentConfirm);
log.info("调分账接口param:{}, result:{}", JSON.toJSONString(confirmParams), jsonString);
// 删除支付确认信息缓存
redisCache.deleteObject(CacheConstants.PAYMENT_CONFIRM_LIST + paymentId);
return JSONObject.parseObject(jsonString, PaymentConfirmResponse.class);
}
@@ -1000,6 +1003,15 @@ public class AdapayService {
* 查询支付确认对象列表
*/
public QueryPaymentConfirmDetailResponse queryPaymentConfirmList(QueryPaymentConfirmDTO dto) {
QueryPaymentConfirmDetailResponse response = null;
// 查缓存
String redisKey = CacheConstants.PAYMENT_CONFIRM_LIST + dto.getPaymentId();
String redisResult = redisCache.getCacheObject(redisKey);
if (StringUtils.isNotBlank(redisResult)) {
response = JSONObject.parseObject(redisResult, QueryPaymentConfirmDetailResponse.class);
return response;
}
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
if (config == null) {
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
@@ -1008,15 +1020,15 @@ public class AdapayService {
param.put("payment_id", dto.getPaymentId());
param.put("app_id", config.getAdapayAppId());
QueryPaymentConfirmDetailResponse queryPaymentConfirmDetailResponse = null;
try {
Map<String, Object> map = PaymentConfirm.queryList(param, config.getWechatAppId());
queryPaymentConfirmDetailResponse = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class);
response = JSON.parseObject(JSON.toJSONString(map), QueryPaymentConfirmDetailResponse.class);
// log.info("queryPaymentConfirmDetailResponse:{}", JSON.toJSONString(queryPaymentConfirmDetailResponse));
redisCache.setCacheObject(redisKey, JSON.toJSONString(response), CacheConstants.cache_expire_time_10d);
} catch (BaseAdaPayException e) {
log.error("查询支付确认对象列表error", e);
}
return queryPaymentConfirmDetailResponse;
return response;
}
/**