Authored by chenchao

format error desc

@@ -402,10 +402,11 @@ public abstract class AbstractAlipayService extends AbstractPayService { @@ -402,10 +402,11 @@ public abstract class AbstractAlipayService extends AbstractPayService {
402 //收集来的错误码 402 //收集来的错误码
403 //TODO 错误码需要不断完善 403 //TODO 错误码需要不断完善
404 if (Objects.nonNull(abtee =AlipayBatchTransferErrorEnum.getByCode(errorCode))) { 404 if (Objects.nonNull(abtee =AlipayBatchTransferErrorEnum.getByCode(errorCode))) {
  405 + String desc = formatErrorDesc(abtee, transferOrderCode);
405 return TransferResult.builder() 406 return TransferResult.builder()
406 .code(501) 407 .code(501)
407 .payErrorCode(errorCode) 408 .payErrorCode(errorCode)
408 - .msg(abtee.getDesc()) 409 + .msg(desc)
409 .build(); 410 .build();
410 411
411 } else { 412 } else {
@@ -428,6 +429,14 @@ public abstract class AbstractAlipayService extends AbstractPayService { @@ -428,6 +429,14 @@ public abstract class AbstractAlipayService extends AbstractPayService {
428 429
429 } 430 }
430 431
  432 + private static String formatErrorDesc(AlipayBatchTransferErrorEnum abtee, String transferOrderCode){
  433 + String desc = abtee.getDesc();
  434 + if (abtee.equals(AlipayBatchTransferErrorEnum.TRANS_NO_NOT_UNIQUE)){
  435 + desc = String.format(desc, transferOrderCode);
  436 + }
  437 + return desc;
  438 + }
  439 +
431 public PayQueryBo transferQuery(String buyerOrderCode) { 440 public PayQueryBo transferQuery(String buyerOrderCode) {
432 JSONObject result = transferQueryAsOriginalResult(buyerOrderCode); 441 JSONObject result = transferQueryAsOriginalResult(buyerOrderCode);
433 // 查询结果转换成 共通的对象 442 // 查询结果转换成 共通的对象