记得上下班打卡 | git大法好,push需谨慎

Commit c4d4f989 authored by 胡佳晨's avatar 胡佳晨

dragon - 退款返回错误内容

parent 1711f9b8
......@@ -99,9 +99,11 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
break;
}
log.info("dto = "+ JSON.toJSONString(dto));
log.info("dto = " + JSON.toJSONString(dto));
if (dto.getResult().equalsIgnoreCase("refunding")) {
if (dto == null) {
return ResponseDto.failure("退款失败:参数异常");
} else if (dto.getResult().equalsIgnoreCase("refunding")) {
} else if (dto.getResult().equalsIgnoreCase("refunded")) {
//调用回调
} else if (dto.getResult().equalsIgnoreCase("error")) {
......@@ -115,14 +117,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
refundAppDto.setOrderRefundCode(orderRefundCode);
refundAppDto.setRefundCode(refundCode);
log.info("refundAppDto = "+ JSON.toJSONString(refundAppDto));
log.info("refundAppDto = " + JSON.toJSONString(refundAppDto));
return ResponseDto.success(refundAppDto);
} else {
return ResponseDto.failure("退款失败");
}
} catch (Exception e) {
e.printStackTrace();
log.info("orderCode = "+ orderCode+"",e);
log.info("orderCode = " + orderCode + "", e);
return ResponseDto.failure("退款失败:" + e.getMessage());
}
}
......@@ -171,7 +173,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
WePayRefundReturnDto wePayRefundReturnDto = XmlUtil.toBean(jsonStr, WePayRefundReturnDto.class);
if (wePayRefundReturnDto.getErrCodeDes() != null) {
channelDto.setResult("error");
channelDto.setMessage( wePayRefundReturnDto.getErrCodeDes());
channelDto.setMessage(wePayRefundReturnDto.getErrCodeDes());
contentDto.setRequest(data);
contentDto.setResponse(jsonStr);
channelDto.setContent(contentDto);
......@@ -381,7 +383,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundAt(refundAt);
dto.setRefundError(callBackDto.getReturnMsg());
log.info("SEND WEPAY NOTIFTURL = " + JSON.toJSONString(dto));
sendNotifyUrl(dto,null);
sendNotifyUrl(dto, null);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
......@@ -410,7 +412,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
@Override
public String aliPayRefundCodeStatus(String outTradeNo, String tradeNo, String outBizNo,String callBackUrl) {
public String aliPayRefundCodeStatus(String outTradeNo, String tradeNo, String outBizNo, String callBackUrl) {
try {
LocalDateTime nowTime = LocalDateTime.now();
AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();//创建API对应的request类
......@@ -435,7 +437,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundAt(DateUtil.Formatter.yyyyMMddHHmmss.format(LocalDateTime.now()));
dto.setRefundPrice(response.getRefundAmount());
dto.setRefundError("");
sendNotifyUrl(dto,callBackUrl);
sendNotifyUrl(dto, callBackUrl);
log.debug("SEND ALIPAY NOTIFTURL2 = " + JSON.toJSONString(dto));
......@@ -462,7 +464,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
return "fail";
}
}catch (Exception e){
} catch (Exception e) {
}
return null;
......@@ -494,7 +496,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundAt(callBackDto.getGmtRefund());
dto.setRefundPrice(response.getRefundAmount());
dto.setRefundError("");
sendNotifyUrl(dto,null);
sendNotifyUrl(dto, null);
mqHandleUtil.sendMySqlRedis(
SqlMapping.get("dragon_order_refund_log.insert"),
......@@ -525,7 +527,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
}
}
private void sendNotifyUrl(NotifyUrlDto notifyUrlDto,String url) {
private void sendNotifyUrl(NotifyUrlDto notifyUrlDto, String url) {
LocalDateTime nowTime = LocalDateTime.now();
MultiValueMap<String, String> params = new LinkedMultiValueMap();
params.add("orderRefundCode", notifyUrlDto.getOrderRefundCode());
......@@ -534,7 +536,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
params.add("refundError", notifyUrlDto.getRefundError());
params.add("refundPrice", notifyUrlDto.getRefundPrice());
params.add("status", notifyUrlDto.getStatus().toString());
String response = HttpUtil.post(url==null?dataUtils.getRefundNotifyUrl(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()):url, params);
String response = HttpUtil.post(url == null ? dataUtils.getRefundNotifyUrl(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()) : url, params);
log.info("RETURN RESPONSE=" + response);
if (response.equals("success")) {
mqHandleUtil.sendMySqlRedis(
......
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