Pu Zhibing
2025-01-24 4b1453e19306592f703aa794e238bd028f67d320
cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -20,6 +20,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.mappers.ModelMapper;
@@ -1086,14 +1087,20 @@
    public HashMap<String, Object> queryUserAge1() {
        HashMap<String, Object> map = new HashMap<>();
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)
                        .isNotNull(TAppUser::getPhone)
                .ne(TAppUser::getState,3)
                .isNotNull(TAppUser::getCity));
        Set<String> strings2 = new HashSet<>(list.stream().filter(e -> e.getCity().equals("[]")).collect(Collectors.groupingBy(TAppUser::getProvince)).keySet());
        List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList());
        if (collect.size() == 0) {
            collect.add(-1);
        }
        Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet();
        Set<String> strings = new HashSet<>(list.stream()
                .filter(e -> !e.getCity().equals("[]") && StringUtils.hasLength(e.getCity()))
                .collect(Collectors.groupingBy(TAppUser::getCity))
                .keySet());
        strings.addAll(strings2);
        ArrayList<String> strings1 = new ArrayList<>();
        ArrayList<Integer> integers = new ArrayList<>();
@@ -1101,13 +1108,14 @@
            int a = 0;
            strings1.add(string);
            for (TAppUser tAppUser : list) {
                if (tAppUser.getCity().equals(string)) {
                if (tAppUser.getCity()!=null&&tAppUser.getCity().equals(string)) {
                    a++;
                }else if (tAppUser.getProvince()!=null&&tAppUser.getProvince().equals(string)){
                    a++;
                }
            }
            integers.add(a);
        }
        map.put("cityData", strings1);
        map.put("cityNum", integers);
        int age1 = 0;
@@ -1160,14 +1168,22 @@
    @PostMapping("/student/queryUserAgeYys")
    public HashMap<String, Object> queryUserAgeYys(@RequestBody List<Integer> ids) {
        HashMap<String, Object> map = new HashMap<>();
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids));
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids)
                .isNotNull(TAppUser::getPhone)
                .ne(TAppUser::getState,3)
                .isNotNull(TAppUser::getCity));
        Set<String> strings2 = new HashSet<>(list.stream().filter(e -> e.getCity().equals("[]")).collect(Collectors.groupingBy(TAppUser::getProvince)).keySet());
        List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList());
        if (collect.size() == 0) {
            collect.add(-1);
        }
        Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet();
        Set<String> strings = new HashSet<>(list.stream()
                .filter(e -> !e.getCity().equals("[]") && StringUtils.hasLength(e.getCity()))
                .collect(Collectors.groupingBy(TAppUser::getCity))
                .keySet());
        strings.addAll(strings2);
        ArrayList<String> strings1 = new ArrayList<>();
        ArrayList<Integer> integers = new ArrayList<>();
@@ -1175,7 +1191,9 @@
            int a = 0;
            strings1.add(string);
            for (TAppUser tAppUser : list) {
                if (tAppUser.getCity().equals(string)) {
                if (tAppUser.getCity()!=null&&tAppUser.getCity().equals(string)) {
                    a++;
                }else if (tAppUser.getProvince()!=null&&tAppUser.getProvince().equals(string)){
                    a++;
                }
            }
@@ -1233,14 +1251,22 @@
    @PostMapping("/student/queryUserAgeStore")
    public HashMap<String, Object> queryUserAgeStore(@RequestBody List<Integer> ids) {
        HashMap<String, Object> map = new HashMap<>();
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids));
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids)
                .isNotNull(TAppUser::getPhone)
                .ne(TAppUser::getState,3)
                .isNotNull(TAppUser::getCity));
        List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList());
        if (collect.size() == 0) {
            collect.add(-1);
        }
        Set<String> strings2 = new HashSet<>(list.stream().filter(e -> e.getCity().equals("[]")).collect(Collectors.groupingBy(TAppUser::getProvince)).keySet());
        Set<String> strings = list.stream().collect(Collectors.groupingBy(TAppUser::getCity)).keySet();
        Set<String> strings = new HashSet<>(list.stream()
                .filter(e -> !e.getCity().equals("[]") && StringUtils.hasLength(e.getCity()))
                .collect(Collectors.groupingBy(TAppUser::getCity))
                .keySet());
        strings.addAll(strings2);
        ArrayList<String> strings1 = new ArrayList<>();
        ArrayList<Integer> integers = new ArrayList<>();
@@ -1248,7 +1274,9 @@
            int a = 0;
            strings1.add(string);
            for (TAppUser tAppUser : list) {
                if (tAppUser.getCity().equals(string)) {
                if (tAppUser.getCity()!=null&&tAppUser.getCity().equals(string)) {
                    a++;
                }else if (tAppUser.getProvince()!=null&&tAppUser.getProvince().equals(string)){
                    a++;
                }
            }