Commit dda748e1 by wuwenlong

cancel pay dev;

parent 1961e75a
......@@ -116,6 +116,15 @@ public class SOrderController extends BaseController
return R.ok(sOrderService.cancel(orderNo));
}
/**
* 取消支付
*/
@ApiOperation(value = "取消支付")
@RequestMapping(value = "/cancelPay", method = RequestMethod.POST)
public R<Boolean> cancelPay(@RequestBody @Validated @NotBlank(message = "订单编号不能为空") String orderNo) {
return R.ok(sOrderService.cancelPay(orderNo));
}
/**
* 根据参数计算订单价格
......
......@@ -102,7 +102,8 @@ public class OrderTask {
SOrder sOrder = orderService.getByOrderNo(String.valueOf(data));
if (ObjectUtil.isNull(sOrder)) {
logger.error("orderTask.autoCancel | 订单不存在,orderNo: " + data);
throw new BaseException("订单不存在,orderNo: " + data);
continue;
// throw new BaseException("订单不存在,orderNo: " + data);
}
boolean result = autoCancel(sOrder);
if (!result) {
......
......@@ -142,6 +142,13 @@ public interface ISOrderService extends IService<SOrder>
*/
boolean cancel(String orderNo);
/**
* 取消支付
* @param orderNo
* @return
*/
boolean cancelPay(String orderNo);
SOrder selectSOrderByOrderNo(String orderNo);
SOrderVo queryOrderInfoByNo(String orderNo);
......
......@@ -701,6 +701,16 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
@Override
public boolean cancelPay(String orderNo) {
SOrder order = getByOrderNo(orderNo);
if (Objects.isNull(order)) {
throw new BaseException("订单不存在!");
}
removeById(order.getId());
return true;
}
@Override
public SOrder selectSOrderByOrderNo(String orderNo) {
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SOrder::getOrderNo, orderNo);
......
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