fix(订单中心):新增订单但泪飙删除的接口逻辑
This commit is contained in:
+15
@@ -507,6 +507,21 @@ public class OrderController {
|
|||||||
return Result.failed("请重试");
|
return Result.failed("请重试");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除订单(逻辑删除)")
|
||||||
|
@DeleteMapping("/{orderNo}")
|
||||||
|
public Result<String> deleteOrder(@PathVariable("orderNo") String orderNo) {
|
||||||
|
Order order = orderService.getOrderByNumber(orderNo);
|
||||||
|
if (order == null) {
|
||||||
|
return Result.failed("订单不存在");
|
||||||
|
}
|
||||||
|
order.setIsDel(1);
|
||||||
|
boolean res = orderService.updateOrder(order);
|
||||||
|
if (res) {
|
||||||
|
return Result.succeed("删除成功");
|
||||||
|
}
|
||||||
|
return Result.failed("删除失败,请重试");
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "后台管理更新订单")
|
@Operation(summary = "后台管理更新订单")
|
||||||
@PostMapping("/update/order")
|
@PostMapping("/update/order")
|
||||||
public Result updateOrder(@RequestBody Order order) {
|
public Result updateOrder(@RequestBody Order order) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
<!-- 动态获取参数采用备参 -->
|
<!-- 动态获取参数采用备参 -->
|
||||||
<select id="findListByUser" resultType="com.central.order.model.Order">
|
<select id="findListByUser" resultType="com.central.order.model.Order">
|
||||||
select id,order_no,tourism_id,device_sn,workspace_id,code_id,user_id,order_amount,order_status,create_time,update_time from orders t WHERE t.user_id = #{param2.userId}
|
select id,order_no,tourism_id,device_sn,workspace_id,code_id,user_id,order_amount,order_status,create_time,update_time from orders t WHERE t.user_id = #{param2.userId}
|
||||||
|
and t.is_del = 0
|
||||||
<if test="param2.orderStatusList != null and param2.orderStatusList.size() > 0">
|
<if test="param2.orderStatusList != null and param2.orderStatusList.size() > 0">
|
||||||
and t.order_status in
|
and t.order_status in
|
||||||
<foreach collection="param2.orderStatusList" item="status" open="(" separator="," close=")">
|
<foreach collection="param2.orderStatusList" item="status" open="(" separator="," close=")">
|
||||||
|
|||||||
Reference in New Issue
Block a user