删除订单

This commit is contained in:
2024-09-02 15:51:24 +08:00
parent b3850469ec
commit ce8dc138f9
4 changed files with 32 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.util.ObjectUtil;
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
import com.chaozhanggui.system.cashierservice.entity.dto.OrderDto;
import com.chaozhanggui.system.cashierservice.service.OrderService;
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;
@CrossOrigin(origins = "*")
@RestController
@@ -51,6 +53,14 @@ public class OrderController {
return orderService.orderList(userId,page,size,status);
}
@PostMapping("/rmOrder")
private Result rmOrder(@RequestBody Map<String, Object> map){
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
return Result.fail("订单号不允许为空");
}
return orderService.rmOrder(Integer.valueOf(map.get("orderId").toString()));
}
@GetMapping("/tradeIntegral")
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException, ParseException {
return orderService.tradeIntegral(userId,id);