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