|
@@ -180,33 +180,33 @@ public class OrderExpirationServiceImpl implements OrderExpirationService, Comma
|
|
|
log.info("檢測到有訂單需要退款,訂單no: {}", orderNo);
|
|
log.info("檢測到有訂單需要退款,訂單no: {}", orderNo);
|
|
|
|
|
|
|
|
// 處理訂單退款
|
|
// 處理訂單退款
|
|
|
- aliController.processRefund(order.getAlipayNo(), new BigDecimal(order.getOrderAmount()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).toString(), refundReason,"");
|
|
|
|
|
-
|
|
|
|
|
- log.info("訂單退款成功,訂單no: {}", orderNo);
|
|
|
|
|
|
|
+ String refundResult = aliController.processRefund(order.getAlipayNo(), new BigDecimal(order.getOrderAmount()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).toString(), refundReason, "");
|
|
|
|
|
+ if ("调用成功".equals(refundResult)) {
|
|
|
|
|
+ log.info("訂單退款成功,訂單no: {}", orderNo);
|
|
|
|
|
|
|
|
- //同意退款通知
|
|
|
|
|
- LifeNotice lifeNotice = buildUserLifeNotice(order, "同意退款通知", "您的编号为" + orderNo + "的订单,律师已同意您的退款申请,订单金额将在1-3个工作日原路返还,请注意查收。");
|
|
|
|
|
- WebSocketVo webSocketVo = buildWebSocketVo(lifeNotice);
|
|
|
|
|
-
|
|
|
|
|
- lifeNoticeMapper.insert(lifeNotice);
|
|
|
|
|
- webSocketProcess.sendMessage(lifeNotice.getReceiverId(), JSONObject.from(webSocketVo).toJSONString());
|
|
|
|
|
|
|
+ //同意退款通知
|
|
|
|
|
+ LifeNotice lifeNotice = buildUserLifeNotice(order, "同意退款通知", "您的编号为" + orderNo + "的订单,律师已同意您的退款申请,订单金额将在1-3个工作日原路返还,请注意查收。");
|
|
|
|
|
+ WebSocketVo webSocketVo = buildWebSocketVo(lifeNotice);
|
|
|
|
|
|
|
|
- //退款到账通知
|
|
|
|
|
- LifeNotice lifeNotice2 = buildUserLifeNotice(order, "退款到账通知", "您的编号为" + orderNo + "的订单,订单金额已原路返还至您的支付渠道,请查收。");
|
|
|
|
|
- WebSocketVo webSocketVo2 = buildWebSocketVo(lifeNotice);
|
|
|
|
|
- lifeNotice2.setCreatedTime(DateUtils.calcMinute(lifeNotice.getCreatedTime(), 2));
|
|
|
|
|
|
|
+ lifeNoticeMapper.insert(lifeNotice);
|
|
|
|
|
+ webSocketProcess.sendMessage(lifeNotice.getReceiverId(), JSONObject.from(webSocketVo).toJSONString());
|
|
|
|
|
|
|
|
- lifeNoticeMapper.insert(lifeNotice2);
|
|
|
|
|
- webSocketProcess.sendMessage(lifeNotice2.getReceiverId(), JSONObject.from(webSocketVo2).toJSONString());
|
|
|
|
|
|
|
+ //退款到账通知
|
|
|
|
|
+ LifeNotice lifeNotice2 = buildUserLifeNotice(order, "退款到账通知", "您的编号为" + orderNo + "的订单,订单金额已原路返还至您的支付渠道,请查收。");
|
|
|
|
|
+ WebSocketVo webSocketVo2 = buildWebSocketVo(lifeNotice);
|
|
|
|
|
+ lifeNotice2.setCreatedTime(DateUtils.calcMinute(lifeNotice.getCreatedTime(), 2));
|
|
|
|
|
|
|
|
- log.info("系统通知发送成功,訂單no: {}", orderNo);
|
|
|
|
|
|
|
+ lifeNoticeMapper.insert(lifeNotice2);
|
|
|
|
|
+ webSocketProcess.sendMessage(lifeNotice2.getReceiverId(), JSONObject.from(webSocketVo2).toJSONString());
|
|
|
|
|
|
|
|
- LawyerConsultationOrder update = new LawyerConsultationOrder();
|
|
|
|
|
- update.setId(order.getId());
|
|
|
|
|
- update.setOrderStatus(5);
|
|
|
|
|
- update.setApplyRefundStatus("4");
|
|
|
|
|
- orderMapper.updateById(update);
|
|
|
|
|
|
|
+ log.info("系统通知发送成功,訂單no: {}", orderNo);
|
|
|
|
|
|
|
|
|
|
+ LawyerConsultationOrder update = new LawyerConsultationOrder();
|
|
|
|
|
+ update.setId(order.getId());
|
|
|
|
|
+ update.setOrderStatus(5);
|
|
|
|
|
+ update.setApplyRefundStatus("4");
|
|
|
|
|
+ orderMapper.updateById(update);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("處理有訂單需要退款key失敗,key: {}", expiredKey, e);
|
|
log.error("處理有訂單需要退款key失敗,key: {}", expiredKey, e);
|