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

Commit 5c7b9ce5 authored by anjiabin's avatar anjiabin

sync 增加日志

parent fc780867
...@@ -126,20 +126,6 @@ public class KylinOrderTicketsController { ...@@ -126,20 +126,6 @@ public class KylinOrderTicketsController {
} }
@GetMapping("checkPayment")
@ApiOperation("订单状态")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap> checkOrderResult(@RequestParam("orderId") @NotNull(message = "订单id不能为空") String orderId) {
Integer status = orderTicketsService.checkOrderResult(orderId).getData();
if (null == status) {
return ResponseDto.failure(ErrorMapping.get("20003"));
} else {
HashMap<String, Integer> map = new HashMap<>();
map.put("status", status);
return ResponseDto.success(map);
}
}
@GetMapping("orderUnPayCount") @GetMapping("orderUnPayCount")
@ApiOperation("待支付演出订单数量") @ApiOperation("待支付演出订单数量")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
......
...@@ -700,6 +700,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -700,6 +700,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
@Override @Override
public String syncOrder(SyncOrderParam syncOrderParam) { public String syncOrder(SyncOrderParam syncOrderParam) {
try {
//支付时间 //支付时间
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String lock = "order_lock:" + syncOrderParam.getOrder_code(); String lock = "order_lock:" + syncOrderParam.getOrder_code();
...@@ -847,6 +848,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -847,6 +848,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
redisLockUtil.unlock(lock); redisLockUtil.unlock(lock);
log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, "")); log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, ""));
return "success"; return "success";
} catch (Exception e) {
log.error("SYNCE ORDER E = "+e.getMessage());
e.printStackTrace();
return "fail";
}
} }
@Override @Override
......
...@@ -63,4 +63,18 @@ public class KylinOrderTicketsController { ...@@ -63,4 +63,18 @@ public class KylinOrderTicketsController {
public String syncOrder(@ModelAttribute @Valid SyncOrderParam syncOrderParam) { public String syncOrder(@ModelAttribute @Valid SyncOrderParam syncOrderParam) {
return orderTicketsService.syncOrder(syncOrderParam); return orderTicketsService.syncOrder(syncOrderParam);
} }
@GetMapping("checkPayment")
@ApiOperation("订单状态")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap> checkOrderResult(@RequestParam("orderId") @NotNull(message = "订单id不能为空") String orderId) {
Integer status = orderTicketsService.checkOrderResult(orderId).getData();
if (null == status) {
return ResponseDto.failure(ErrorMapping.get("20003"));
} else {
HashMap<String, Integer> map = new HashMap<>();
map.put("status", status);
return ResponseDto.success(map);
}
}
} }
...@@ -708,6 +708,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -708,6 +708,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
@Override @Override
public String syncOrder(SyncOrderParam syncOrderParam) { public String syncOrder(SyncOrderParam syncOrderParam) {
try {
//支付时间 //支付时间
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String lock = "order_lock:" + syncOrderParam.getOrder_code(); String lock = "order_lock:" + syncOrderParam.getOrder_code();
...@@ -754,7 +755,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -754,7 +755,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (orderTicketData.getStatus() == 2) { if (orderTicketData.getStatus() == 2) {
mongoVoUtils.resetOrderListVo(orderTicketData.getUserId(), 2, orderTicketData.getOrderTicketsId(), null); mongoVoUtils.resetOrderListVo(orderTicketData.getUserId(), 2, orderTicketData.getOrderTicketsId(), null);
log.error("订单号位 {} 的订单超时支付", syncOrderParam.getOrder_code()); log.error("订单号位 {} 的订单超时支付", syncOrderParam.getOrder_code());
// orderRefundsCallbackService.refundApply(orderTicketData.getOrderTicketsId()); orderRefundsCallbackService.refundApply(orderTicketData.getOrderTicketsId());
} else if (orderTicketData.getStatus() == 3 || orderTicketData.getStatus() == 4) { } else if (orderTicketData.getStatus() == 3 || orderTicketData.getStatus() == 4) {
log.error("订单号位 {} 的订单正在退款 或者已退款", syncOrderParam.getOrder_code()); log.error("订单号位 {} 的订单正在退款 或者已退款", syncOrderParam.getOrder_code());
} else { } else {
...@@ -855,6 +856,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -855,6 +856,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
redisLockUtil.unlock(lock); redisLockUtil.unlock(lock);
log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, "")); log.info(UserPathDto.setData("订单支付成功回调", syncOrderParam, ""));
return "success"; return "success";
} catch (Exception e) {
log.error("SYNCE ORDER E = "+e.getMessage());
e.printStackTrace();
return "fail";
}
} }
@Override @Override
......
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