新增菜单复制函数menuServiceImpl.install()

This commit is contained in:
2024-11-22 19:32:39 +08:00
parent 4ac03ac65d
commit ae5890ce11

View File

@@ -10,8 +10,10 @@ import com.gxwebsoft.common.system.entity.Order;
import com.gxwebsoft.common.system.entity.OrderGoods;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.param.OrderGoodsParam;
import com.gxwebsoft.common.system.service.MenuService;
import com.gxwebsoft.common.system.service.OrderGoodsService;
import com.gxwebsoft.common.system.service.OrderService;
import com.gxwebsoft.common.system.service.impl.MenuServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -34,6 +36,10 @@ public class OrderGoodsController extends BaseController {
private OrderGoodsService orderGoodsService;
@Resource
private OrderService orderService;
@Resource
private MenuService menuService;
@Resource
private MenuServiceImpl menuServiceImpl;
@ApiOperation("分页查询订单商品")
@GetMapping("/page")
@@ -98,6 +104,8 @@ public class OrderGoodsController extends BaseController {
if (loginUser == null) {
return fail("请先登录");
}
// 复制菜单
menuServiceImpl.install(orderGoods.getMenuId());
if (orderGoodsService.updateById(orderGoods)) {
if (orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderStatus,0).eq(OrderGoods::getOrderId,orderGoods.getOrderId())) == 0) {
orderService.update(new LambdaUpdateWrapper<Order>().eq(Order::getOrderId,orderGoods.getOrderId()).set(Order::getOrderStatus,1));