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

Commit 4d89c74a authored by 胡佳晨's avatar 胡佳晨

微信回调 提交

parent 82bf9d4f
...@@ -67,7 +67,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -67,7 +67,7 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
); );
redisUtil.set(DragonConstant.REFUND_REDIS_KET + orderRefundCode, notifyUrl); redisUtil.set(DragonConstant.REFUND_REDIS_KET + orderRefundCode, notifyUrl);
DragonRefundChannelDto dto = null; DragonRefundChannelDto dto = null;
String localWePayCallBackUrl = url+"/refund/callBack/wepay"; String localWePayCallBackUrl = url + "/refund/callBack/wepay";
if (insertResult) { if (insertResult) {
switch (paymentType) { switch (paymentType) {
case DragonConstant.REFUND_TYPE_APP_ALIPAY: case DragonConstant.REFUND_TYPE_APP_ALIPAY:
...@@ -150,8 +150,9 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -150,8 +150,9 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
entity.getContent(); entity.getContent();
String jsonStr = EntityUtils.toString(entity, "UTF-8"); String jsonStr = EntityUtils.toString(entity, "UTF-8");
log.debug("JSONSTR = " + jsonStr);
WePayRefundReturnDto wePayRefundReturnDto = XmlUtil.toBean(jsonStr, WePayRefundReturnDto.class); WePayRefundReturnDto wePayRefundReturnDto = XmlUtil.toBean(jsonStr, WePayRefundReturnDto.class);
log.debug("BEAN = " + wePayRefundReturnDto);
if (!wePayRefundReturnDto.getResultCode().equalsIgnoreCase("SUCCESS") || wePayRefundReturnDto.getResultCode() == null) { if (!wePayRefundReturnDto.getResultCode().equalsIgnoreCase("SUCCESS") || wePayRefundReturnDto.getResultCode() == null) {
try { try {
String refundError = ""; String refundError = "";
...@@ -333,11 +334,12 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -333,11 +334,12 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
String jsonStr = new String(outSteam.toByteArray(), "utf-8"); String jsonStr = new String(outSteam.toByteArray(), "utf-8");
outSteam.close(); outSteam.close();
inStream.close(); inStream.close();
log.info("JSON = " + jsonStr); log.debug("JSON = " + jsonStr);
WePayRefundReturnCallBackDto callBackDto = XmlUtil.toBean(jsonStr, WePayRefundReturnCallBackDto.class); WePayRefundReturnCallBackDto callBackDto = XmlUtil.toBean(jsonStr, WePayRefundReturnCallBackDto.class);
log.info("DATA = " + callBackDto); log.debug("DATA = " + callBackDto);
if (callBackDto.getReturnCode().equalsIgnoreCase("SUCCESS")) { if (callBackDto.getReturnCode().equalsIgnoreCase("SUCCESS")) {
String reqInfo = PayWepayUtils.getInstance().unCodeReqInfo(callBackDto.getReqInfo()); String reqInfo = PayWepayUtils.getInstance().unCodeReqInfo(callBackDto.getReqInfo());
log.debug("REQINFO = " + reqInfo);
WePayRefundReturnCallBackInfoDto info = XmlUtil.toBean(reqInfo, WePayRefundReturnCallBackInfoDto.class); WePayRefundReturnCallBackInfoDto info = XmlUtil.toBean(reqInfo, WePayRefundReturnCallBackInfoDto.class);
String outRefundNo = info.getOutRefundNo(); String outRefundNo = info.getOutRefundNo();
String refundAt = info.getSuccessTime(); String refundAt = info.getSuccessTime();
...@@ -352,9 +354,9 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -352,9 +354,9 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
); );
NotifyUrlDto dto = new NotifyUrlDto(); NotifyUrlDto dto = new NotifyUrlDto();
if(info.getRefundStatus().equalsIgnoreCase("SUCCESS")){ if (info.getRefundStatus().equalsIgnoreCase("SUCCESS")) {
dto.setStatus(1); dto.setStatus(1);
}else{ } else {
dto.setStatus(0); dto.setStatus(0);
} }
// dto.setOrderCode(); // dto.setOrderCode();
...@@ -417,23 +419,23 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -417,23 +419,23 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
} }
private void sendNotifyUrl(NotifyUrlDto notifyUrlDto){ private void sendNotifyUrl(NotifyUrlDto notifyUrlDto) {
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
MultiValueMap<String, String> params = new LinkedMultiValueMap(); MultiValueMap<String, String> params = new LinkedMultiValueMap();
params.add("orderRefundCode",notifyUrlDto.getOrderRefundCode()); params.add("orderRefundCode", notifyUrlDto.getOrderRefundCode());
params.add("refundAt",notifyUrlDto.getRefundAt()); params.add("refundAt", notifyUrlDto.getRefundAt());
params.add("refundCode",notifyUrlDto.getRefundCode()); params.add("refundCode", notifyUrlDto.getRefundCode());
params.add("refundError",notifyUrlDto.getRefundError()); params.add("refundError", notifyUrlDto.getRefundError());
params.add("refundId",notifyUrlDto.getRefundId()); params.add("refundId", notifyUrlDto.getRefundId());
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((String) redisUtil.get(DragonConstant.REFUND_REDIS_KET+notifyUrlDto.getOrderRefundCode()), params); String response = HttpUtil.post((String) redisUtil.get(DragonConstant.REFUND_REDIS_KET + notifyUrlDto.getOrderRefundCode()), params);
if(response.equals("success")){ if (response.equals("success")) {
sendMySqlRedis( sendMySqlRedis(
SqlMapping.get("dragon_order_refund_call_back.update"), SqlMapping.get("dragon_order_refund_call_back.update"),
new Object[]{nowTime, DateUtil.Formatter.yyyyMMddHHmmss.format(nowTime), DragonConstant.RefundStatusEnum.STATUS_SUCCESS.getCode(), notifyUrlDto.getRefundCode()} new Object[]{nowTime, DateUtil.Formatter.yyyyMMddHHmmss.format(nowTime), DragonConstant.RefundStatusEnum.STATUS_SUCCESS.getCode(), notifyUrlDto.getRefundCode()}
); );
}else{ } else {
sendMySqlRedis( sendMySqlRedis(
SqlMapping.get("dragon_order_refund_call_back.update"), SqlMapping.get("dragon_order_refund_call_back.update"),
new Object[]{nowTime, DateUtil.Formatter.yyyyMMddHHmmss.format(nowTime), DragonConstant.RefundStatusEnum.STATUS_FAIL.getCode(), notifyUrlDto.getRefundCode()} new Object[]{nowTime, DateUtil.Formatter.yyyyMMddHHmmss.format(nowTime), DragonConstant.RefundStatusEnum.STATUS_FAIL.getCode(), notifyUrlDto.getRefundCode()}
......
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