From 2fa3110b84b42061be3c58fc206582c0f24de6a9 Mon Sep 17 00:00:00 2001 From: zyx <1029606625@qq.com> Date: Mon, 19 Jun 2023 16:32:12 +0800 Subject: [PATCH] =?UTF-8?q?6/19=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8E=E6=9C=AA=E5=88=A0=E9=99=A4=E5=85=B6?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/takeout/controller/UserController.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java index 4e6257d..9726c7b 100644 --- a/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java @@ -1,5 +1,6 @@ package io.renren.modules.takeout.controller; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import io.renren.common.annotation.LogOperation; import io.renren.common.constant.Constant; import io.renren.common.page.PageData; @@ -10,8 +11,10 @@ import io.renren.common.validator.ValidatorUtils; import io.renren.common.validator.group.AddGroup; import io.renren.common.validator.group.DefaultGroup; import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.front.bean.AddressBook; import io.renren.modules.takeout.dto.UserDTO; import io.renren.modules.takeout.excel.UserExcel; +import io.renren.modules.front.service.AddressBookService; import io.renren.modules.takeout.service.UserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -39,6 +42,8 @@ import java.util.Map; public class UserController { @Autowired private UserService userService; + @Autowired + private AddressBookService addressBookService; @GetMapping("page") @ApiOperation("分页") @@ -100,6 +105,13 @@ public class UserController { userService.delete(ids); + //删除每个用户的所有地址 + for (Long id : ids) { + LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>(); + luw.eq(AddressBook::getUserId, id); + addressBookService.remove(luw); + } + return new Result(); }