This commit is contained in:
Cauchy
2023-10-23 17:41:38 +08:00
parent 3a59fdb860
commit 167d2de1bd
5 changed files with 85 additions and 21 deletions

View File

@@ -351,8 +351,10 @@ public class BuyOrderController {
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] orderIds) {
buyOrderService.removeByIds(Arrays.asList(orderIds));
public R delete(@RequestBody List<String> orderSnList) {
QueryWrapper<BuyOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.in("order_sn", orderSnList);
buyOrderService.remove(queryWrapper);
return R.ok();
}
@@ -389,6 +391,39 @@ public class BuyOrderController {
return R.ok();
}
/**
* app 端 取消订单
*/
// @RequestMapping("/cancelOrder")
// @Transactional
// public R appDelete(@RequestParam("orderSn") String orderSn) {
// QueryWrapper<BuyOrder> qu
//
// //1. 判断订单状态
// BuyOrder byId = buyOrderService.getById(orderId);
// if (byId != null) {
// //2. 判断当前订单是否存在优惠券 进行 回显
// Integer couponId = byId.getCouponId();
// if (couponId != null) {
//
// CouponHistoryEntity byId1 = couponHistoryService.getById(couponId);
// byId1.setUseStatus(0);
// couponHistoryService.updateById(byId1);
// }
// // 库存回滚
// List<BuyOrderDetail> buyOrderDetailEntities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetail>()
// .eq("order_id", byId.getOrderId()));
// for (BuyOrderDetail buyOrderDetailEntity : buyOrderDetailEntities) {
// Integer productId = buyOrderDetailEntity.getProductId();
// ShopProduct product = shopProductService.getById(productId);
// product.setProductStock(product.getProductStock() + buyOrderDetailEntity.getQuantity());
// shopProductService.updateById(product);
// }
// buyOrderService.removeById(orderId);
// }
// return R.ok();
// }
/**
* 充值专用订单生成接口