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

Commit 99a79919 authored by 胡佳晨's avatar 胡佳晨

order 订单回调 增加日志

parent 7f32cb4e
......@@ -727,6 +727,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
LocalDateTime now = LocalDateTime.now();
String lock = "order_lock:" + syncOrderParam.getOrderCode();
if (!redisLockUtil.tryLock(lock, 1, 5)) {
log.error("参数错误");
return "fail";//参数错误
}
......@@ -734,23 +735,27 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
KylinOrderTicketVo orderTicketData = mongoTemplate.findOne(Query.query(Criteria.where("orderCode").is(syncOrderParam.getOrderCode())), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
if (orderTicketData == null) {
redisLockUtil.unlock(lock);
log.error("订单不存在");
return "fail";//订单不存在
}
if (orderTicketData.getStatus() != KylinTableStatusConst.ORDER_STATUS0) {
if (orderTicketData.getPayCode().equals(syncOrderParam.getCode()) && orderTicketData.getStatus() == KylinTableStatusConst.ORDER_STATUS1) {
redisLockUtil.unlock(lock);
log.error("已经支付");
return "success";//已经支付
}
if (!orderTicketData.getPayCode().equals(syncOrderParam.getCode())) {
redisLockUtil.unlock(lock);
log.error("重复支付");
return "fail";//重复支付
}
}
if (orderTicketData.getPriceActual().compareTo(syncOrderParam.getPrice()) != 0) {
redisLockUtil.unlock(lock);
log.error("价格不符");
return "fail";//价格不符
}
......@@ -773,6 +778,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} else if (orderTicketData.getStatus() == 3 || orderTicketData.getStatus() == 4) {
log.error("订单号为 {} 的订单正在退款 或者已退款", syncOrderParam.getOrderCode());
} else {
log.error("订单号为 {} 的订单正常流程", syncOrderParam.getOrderCode());
orderTickets.setOrderTicketsId(orderTicketData.getOrderTicketsId());
orderTickets.setPaymentType(syncOrderParam.getPaymentType());
orderTickets.setPayCode(syncOrderParam.getCode());
......@@ -883,7 +889,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, ""));
return "success";
} catch (Exception e) {
log.error("SYNCE ORDER E = " + e.getMessage());
log.error("SYNCE ORDER E = " , e);
e.printStackTrace();
return "fail";
}
......
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