Authored by LUOXC

fixbug

... ... @@ -3,6 +3,7 @@ package com.yohoufo.order.service.handler.transfer;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.config.ConfigReader;
import com.yohoufo.dal.order.model.OrdersPayTransfer;
import com.yohoufo.order.service.transfer.TransferResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -35,7 +36,16 @@ public class AlipayTransferChancelSelector {
if (StringUtils.equals("40004", jsonObject.getString("code"))
&& StringUtils.equals("EXCEED_LIMIT_DM_MAX_AMOUNT", jsonObject.getString("sub_code"))) {
lastTransferDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
log.info("transferWhenExceedMillion 转账阿里接口返回 {},进入商家转账模式 lastTransferDate={}", jsonObject, lastTransferDate);
log.info("transferWhenExceedMillion lastTransferDate={}", lastTransferDate);
return true;
}
return false;
}
public boolean isExceedMillion(TransferResult transferResult) {
if (transferResult.getCode() == 505) {
lastTransferDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
log.info("transferWhenExceedMillion lastTransferDate={}", lastTransferDate);
return true;
}
return false;
... ...
... ... @@ -1150,6 +1150,7 @@ public class PaymentServiceImpl implements IPaymentService {
transferSuccess.setUpdateTime(DateUtil.getCurrentTimeSecond());
ordersPayTransferMapper.updateByPrimaryKeySelective(transferSuccess);
} else {
alipayTransferChancelSelector.isExceedMillion(transferResult);
logger.warn("{}, transfer fail {}", logTag, transferResult);
throwServiceException(transferResult.getCode(), transferResult.getMsg());
}
... ...