无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -16,10 +16,9 @@
import com.dsh.account.util.ResultUtil;
import com.dsh.account.util.TokenUtil;
import com.dsh.account.util.ToolUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.mappers.ModelMapper;
@@ -57,7 +56,17 @@
    @Resource
    private CoursePackageClient coursePackageClient;
    /**
     * 查询玩湃惠民卡绑定学员列表信息
     *
     * @return
     */
    @RequestMapping("/base/student/getStudentByIds/{ids}")
    public List<TStudent> getStudentByIds(@PathVariable("ids") String ids) {
        List<TStudent> list = studentService.list(new LambdaQueryWrapper<TStudent>()
                .in(TStudent::getId, Arrays.asList(ids.split(","))));
        return list;
    }
    /**
     * 添加学员
@@ -114,8 +123,8 @@
    }
    @ResponseBody
    @PostMapping("/student/queryStudentCom")
    public List<Map<String, Object>> queryStudentCom(@RequestBody Integer id) {
        List<Map<String, Object>> list = studentService.queryCom(id);
@@ -1085,14 +1094,21 @@
    @PostMapping("/student/queryUserAge1")
    public HashMap<String, Object> queryUserAge1() {
        HashMap<String, Object> map = new HashMap<>();
        List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1));
        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<>();
@@ -1100,13 +1116,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;
@@ -1159,14 +1176,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<>();
@@ -1174,7 +1199,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++;
                }
            }
@@ -1232,14 +1259,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<>();
@@ -1247,7 +1282,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++;
                }
            }
@@ -1381,7 +1418,14 @@
        map.put("boy", boy);
        map.put("girl", girl);
        return map;
    }
    @ResponseBody
    @PostMapping("/student/queryExpiredList")
    public List<TStudent> queryExpiredList(){
        List<TStudent> list = studentService.list(new QueryWrapper<TStudent>().eq("state", 1).last(" and DATE_FORMAT(now(), '%Y-%m-%d') > validity"));
        return list;
    }
}