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

Commit 072b2288 authored by 胡佳晨's avatar 胡佳晨

修改 退款 错误 日志提示

parent 5c335e88
...@@ -43,4 +43,8 @@ public class WePayRefundReturnDto { ...@@ -43,4 +43,8 @@ public class WePayRefundReturnDto {
private String couponRefundCount; private String couponRefundCount;
@XStreamAlias("cash_refund_fee") @XStreamAlias("cash_refund_fee")
private String cashRefundFee; private String cashRefundFee;
@XStreamAlias("err_code")
private String errCode;
@XStreamAlias("err_code_des")
private String errCodeDes;
} }
...@@ -104,11 +104,10 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -104,11 +104,10 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
} else if (dto.getResult().equalsIgnoreCase("error")) { } else if (dto.getResult().equalsIgnoreCase("error")) {
//调用回调 //调用回调
log.error(""); log.error("");
return ResponseDto.failure("退款失败:" + dto.getMessage());
} else if (dto.getResult().equalsIgnoreCase("exception")) { } else if (dto.getResult().equalsIgnoreCase("exception")) {
log.error(""); log.error("");
} }
DragonRefundAppDto refundAppDto = new DragonRefundAppDto(); DragonRefundAppDto refundAppDto = new DragonRefundAppDto();
refundAppDto.setOrderCode(orderCode); refundAppDto.setOrderCode(orderCode);
refundAppDto.setCode(code); refundAppDto.setCode(code);
...@@ -167,6 +166,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -167,6 +166,14 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String jsonStr = EntityUtils.toString(entity, "UTF-8"); String jsonStr = EntityUtils.toString(entity, "UTF-8");
log.debug("JSONSTR = " + jsonStr); log.debug("JSONSTR = " + jsonStr);
WePayRefundReturnDto wePayRefundReturnDto = XmlUtil.toBean(jsonStr, WePayRefundReturnDto.class); WePayRefundReturnDto wePayRefundReturnDto = XmlUtil.toBean(jsonStr, WePayRefundReturnDto.class);
if (wePayRefundReturnDto.getErrCodeDes() != null) {
channelDto.setResult("error");
channelDto.setMessage(paymentType + " refund error: " + wePayRefundReturnDto.getErrCodeDes());
contentDto.setRequest(data);
contentDto.setResponse(jsonStr);
channelDto.setContent(contentDto);
return channelDto;
}
log.debug("BEAN = " + wePayRefundReturnDto); log.debug("BEAN = " + wePayRefundReturnDto);
if (!wePayRefundReturnDto.getReturnCode().equalsIgnoreCase("SUCCESS") || wePayRefundReturnDto.getReturnCode() == null) { if (!wePayRefundReturnDto.getReturnCode().equalsIgnoreCase("SUCCESS") || wePayRefundReturnDto.getReturnCode() == null) {
try { try {
...@@ -376,7 +383,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -376,7 +383,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundPrice(info.getRefundFee()); dto.setRefundPrice(info.getRefundFee());
dto.setRefundAt(refundAt); dto.setRefundAt(refundAt);
dto.setRefundError(callBackDto.getReturnMsg()); dto.setRefundError(callBackDto.getReturnMsg());
log.debug("SEND WEPAY NOTIFTURL = "+ JSON.toJSONString(dto)); log.debug("SEND WEPAY NOTIFTURL = " + JSON.toJSONString(dto));
sendNotifyUrl(dto); sendNotifyUrl(dto);
mqHandleUtil.sendMySqlRedis( mqHandleUtil.sendMySqlRedis(
...@@ -432,7 +439,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -432,7 +439,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
dto.setRefundAt(callBackDto.getGmtRefund()); dto.setRefundAt(callBackDto.getGmtRefund());
dto.setRefundPrice(response.getRefundAmount()); dto.setRefundPrice(response.getRefundAmount());
dto.setRefundError(""); dto.setRefundError("");
log.debug("SEND ALIPAY NOTIFTURL = "+ JSON.toJSONString(dto)); log.debug("SEND ALIPAY NOTIFTURL = " + JSON.toJSONString(dto));
sendNotifyUrl(dto); sendNotifyUrl(dto);
mqHandleUtil.sendMySqlRedis( mqHandleUtil.sendMySqlRedis(
...@@ -473,7 +480,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -473,7 +480,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
params.add("refundError", notifyUrlDto.getRefundError()); params.add("refundError", notifyUrlDto.getRefundError());
params.add("refundPrice", notifyUrlDto.getRefundPrice()); params.add("refundPrice", notifyUrlDto.getRefundPrice());
params.add("status", notifyUrlDto.getStatus().toString()); params.add("status", notifyUrlDto.getStatus().toString());
String response = HttpUtil.post( dataUtils.getRefundNotifyUrl(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()), params); String response = HttpUtil.post(dataUtils.getRefundNotifyUrl(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()), params);
log.debug("RETURN RESPONSE=" + response); log.debug("RETURN RESPONSE=" + response);
if (response.equals("success")) { if (response.equals("success")) {
mqHandleUtil.sendMySqlRedis( 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