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

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

微信回调 提交

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