luodangjia
2025-02-07 8ffeb751b3a694e8d1cb6a21bec855f6c49b31b6
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -37,6 +37,7 @@
import com.ruoyi.system.api.feignClient.SysUserClient;
import com.ruoyi.system.api.model.LoginUser;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -64,6 +65,7 @@
@Api(tags = {"登录注册-小程序"})
@RestController
@RequestMapping("/app-user")
@Slf4j
public class AppUserController extends BaseController {
    
    @Resource
@@ -528,6 +530,16 @@
                .like(AppUser::getName, name));
        return R.ok(list);
    }
    /**
     * 根据用户名称模糊搜索用户列表,不过滤状态
     */
    @GetMapping("/getAppUserByNameNoFilter")
    public R<List<AppUser>> getAppUserByNameNoFilter(@RequestParam("name") String name) {
        List<AppUser> list = appUserService.list(new LambdaQueryWrapper<AppUser>()
                .like(AppUser::getName, name));
        return R.ok(list);
    }
    /**
     * 根据用户电话模糊搜索用户列表
@@ -539,6 +551,15 @@
    public R<List<AppUser>> getAppUserByPhone(@RequestParam("phone") String phone) {
        List<AppUser> list = appUserService.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getDelFlag, 0).eq(AppUser::getStatus, 1)
                .like(AppUser::getPhone, phone));
        return R.ok(list);
    }
    /**
     * 更具用户电话模糊查询用户列表,不过滤状态
     */
    @GetMapping("/getAppUserByPhoneNoFilter")
    public R<List<AppUser>> getAppUserByPhoneNoFilter(@RequestParam("phone") String phone) {
        List<AppUser> list = appUserService.getAppUserByPhoneNoFilter(phone);
        return R.ok(list);
    }
@@ -675,7 +696,9 @@
        AppUser byId = appUserService.getById(id);
        byId.setStatus(status);
        appUserService.updateById(byId);
        if (status == 2){
        loginout(id);
        }
        return R.ok();
    }
@@ -684,6 +707,9 @@
        if (!CollectionUtils.isEmpty(keys)) {
            for (String key : keys) {
                LoginUser user = redisService.getCacheObject(key);
                if (user == null || user.getUserid() == null) {
                    continue;
                }
                if (user.getUserid().equals(userId)) {
                    redisService.deleteObject(key);
                    break;
@@ -836,7 +862,11 @@
    @ApiOperation(value = "用户列表-绑定下级列表", tags = {"管理后台"})
    public R<Page<AppUser>> bottom(Long id, Integer pageNum, Integer pageSize) {
        //绑定下级
        Page<AppUser> page = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).page(Page.of(pageNum, pageSize));
        Page<AppUser> page = appUserService.lambdaQuery()
                .eq(AppUser::getInviteUserId, id)
                .eq(AppUser::getDelFlag, 0)
                .eq(AppUser::getStatus, 1)
                .page(Page.of(pageNum, pageSize));
        return R.ok(page);
    }