Commit 37cd71e3 by 周晓航

提取公共代码,暂无需求开发

parent 1225ea66
......@@ -30,17 +30,24 @@ public enum PayRefundStatus {
this.desc = desc;
}
public static PayRefundStatus getByCode(Integer code) {
public static PayRefundStatus getByPayResultCode(Integer code) {
if (code == null) {
return null;
return PayRefundStatus.FAIL;
}
for (PayRefundStatus payStatus : values()) {
if (payStatus.getCode().equals(code)) {
return payStatus;
switch (code) {
// 退款中状态码需要单独处理
case 8200305:
return PayRefundStatus.RUNNING;
// 重复请求,按照退款中处理
case 82004005:
return PayRefundStatus.RUNNING;
// 退款成功
case 100:
return PayRefundStatus.SUCCESS;
default:
return PayRefundStatus.FAIL;
}
}
return null;
}
public Integer getCode() {
return code;
......
......@@ -19,8 +19,6 @@ import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIapp
import com.freemud.application.sdk.api.base.BaseResponse;
import com.freemud.application.sdk.api.log.ErrorLog;
import com.freemud.application.sdk.api.ordercenter.entities.v1.OrderBeanV1;
import com.freemud.application.sdk.api.ordercenter.enums.PayChannelType;
import com.freemud.application.sdk.api.ordercenter.enums.orderv1.OrderTypeV1;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtendedReq;
import com.freemud.application.sdk.api.ordercenter.response.OrderBaseResp;
......@@ -35,11 +33,11 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
......@@ -226,19 +224,7 @@ public class PaymentHandle {
private PayRefundStatus getFinalRefundStatus(Integer resultCode) {
switch (resultCode) {
// 退款中状态码需要单独处理
case 8200305:
return PayRefundStatus.RUNNING;
// 重复请求,按照退款中处理
case 82004005:
return PayRefundStatus.RUNNING;
// 退款成功
case 100:
return PayRefundStatus.SUCCESS;
default:
return PayRefundStatus.FAIL;
}
return PayRefundStatus.getByPayResultCode(resultCode);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment