Administrator
2025-03-05 af0be3243ab0d75e38ae8213de461c4a584652f7
src/main/java/com/taoke/autopay/controller/admin/AdminWxUserController.java
@@ -61,19 +61,41 @@
    private WxUserSettingService wxUserSettingService;
    /**
     * @param key
     * @param keyType 1-用户ID/昵称   2-地域
     * @param page
     * @param limit
     * @return
     */
    @ResponseBody
    @RequestMapping("list")
    public String listWxUser(String uid, int page, int limit) {
    public String listWxUser(String key, Integer keyType, int page, int limit) {
        //先查询所有的数据
        WxUserInfoMapper.DaoQuery query = new WxUserInfoMapper.DaoQuery();
        query.sortList=Arrays.asList(new String[]{"login_time desc"});
        if (!StringUtil.isNullOrEmpty(uid)) {
            if(NumberUtil.isNumeric(uid)) {
                query.id = Long.parseLong(uid);
        if (keyType == null) {
            keyType = 1;
        }
        switch (keyType) {
            case 1:
                if (!StringUtil.isNullOrEmpty(key)) {
                    if (NumberUtil.isNumeric(key)) {
                        query.id = Long.parseLong(key);
            }else{
                query.searchKey = uid;
                        query.searchKey = key;
            }
        }
                break;
            case 2:
                if (!StringUtil.isNullOrEmpty(key)) {
                    query.searchArea = key;
                }
                break;
        }
        List<WxUserInfo> userList = wxUserService.list(query, page, limit);
        long count = wxUserService.count(query);
        Map<Long, WxUserSettings> settingsMap = new HashMap<>();
@@ -118,5 +140,19 @@
        return JsonUtil.loadTrueResult("");
    }
    @ResponseBody
    @RequestMapping("getUser")
    public String getUser(Long id) {
        WxUserInfo user = wxUserService.selectById(id);
        return JsonUtil.loadTrueResult(user);
    }
    @ResponseBody
    @RequestMapping("updateUser")
    public String updateUser(WxUserInfo user) {
        wxUserService.update(user);
        return JsonUtil.loadTrueResult("");
    }
}