| | |
| | | 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.*; |
| | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | /** |
| | | * 注销账号保留业务记录,但不计入后台累计用户、累计学员统计。 |
| | | */ |
| | | private List<Integer> getActiveUserIds(List<Integer> ids) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return Collections.singletonList(-1); |
| | | } |
| | | List<Integer> activeUserIds = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .in(TAppUser::getId, ids) |
| | | .ne(TAppUser::getState, 3)) |
| | | .stream() |
| | | .map(TAppUser::getId) |
| | | .collect(Collectors.toList()); |
| | | return activeUserIds.isEmpty() ? Collections.singletonList(-1) : activeUserIds; |
| | | } |
| | | |
| | | /** |
| | | * 查询玩湃惠民卡绑定学员列表信息 |
| | | * |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | | * 添加学员 |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | @PostMapping("/student/getStudentById") |
| | | @ResponseBody |
| | | TStudent getStudentById(Integer studentId) { |
| | | TStudent byId = studentService.getById(studentId); |
| | | return byId; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryStudentCom") |
| | | |
| | | public List<Map<String, Object>> queryStudentCom(@RequestBody Integer id) { |
| | | |
| | | List<Map<String, Object>> list = studentService.queryCom(id); |
| | |
| | | if (ids.size() == 0) { |
| | | ids.add(-1); |
| | | } |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .eq(TAppUser::getInsertType, 1) |
| | | .ne(TAppUser::getState, 3)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserYYs") |
| | | @ResponseBody |
| | | public List<Integer> getUserYYs(@RequestBody Integer id) { |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .eq(TAppUser::getInsertType, 2) |
| | | .eq(TAppUser::getAddUserId, id) |
| | | .ne(TAppUser::getState, 3)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserStore") |
| | | @ResponseBody |
| | | public List<Integer> getUserStore(@RequestBody Integer id) { |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId, id)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .eq(TAppUser::getInsertType, 3) |
| | | .eq(TAppUser::getAddUserId, id) |
| | | .ne(TAppUser::getState, 3)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserYys") |
| | | @ResponseBody |
| | | public List<Integer> getUserYys(@RequestBody Integer id) { |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId, id)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .eq(TAppUser::getInsertType, 2) |
| | | .eq(TAppUser::getAddUserId, id) |
| | | .ne(TAppUser::getState, 3)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/getUserPtVip") |
| | | public List<Integer> getUserPtVip() { |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip, 1)); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .eq(TAppUser::getInsertType, 1) |
| | | .eq(TAppUser::getIsVip, 1) |
| | | .ne(TAppUser::getState, 3)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | |
| | | public HashMap<String, Object> userAndVipPt(@RequestBody Integer type) { |
| | | 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) |
| | | .ne(TAppUser::getState, 3)); |
| | | map.put("allUser", list.size()); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip, 1)); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .eq(TAppUser::getInsertType, 1) |
| | | .eq(TAppUser::getIsVip, 1) |
| | | .ne(TAppUser::getState, 3)); |
| | | map.put("allVip", list1.size()); |
| | | |
| | | |
| | |
| | | public HashMap<String, Object> stuPt() { |
| | | 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) |
| | | .ne(TAppUser::getState, 3)); |
| | | List<Integer> collect1 = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if (collect1.size() == 0) { |
| | | collect1.add(-1); |
| | |
| | | @PostMapping("/student/stuYys") |
| | | public HashMap<String, Object> stuYys(@RequestBody List<Integer> ids) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids)); |
| | | List<Integer> activeUserIds = getActiveUserIds(ids); |
| | | List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, activeUserIds)); |
| | | map.put("allUser", students.size()); |
| | | |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | |
| | | public HashMap<String, Object> stuStores(@RequestBody List<Integer> ids) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | |
| | | List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, ids)); |
| | | List<Integer> activeUserIds = getActiveUserIds(ids); |
| | | List<TStudent> students = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, activeUserIds)); |
| | | map.put("allUser", students.size()); |
| | | |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | |
| | | 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) |
| | | .ne(TAppUser::getState, 3)); |
| | | map.put("allUser", list.size()); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1)); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .in(TAppUser::getId, ids) |
| | | .eq(TAppUser::getIsVip, 1) |
| | | .ne(TAppUser::getState, 3)); |
| | | map.put("allVip", list1.size()); |
| | | |
| | | |
| | |
| | | public HashMap<String, Object> userAndVipStore(@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) |
| | | .ne(TAppUser::getState, 3)); |
| | | map.put("allUser", list.size()); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getId, ids).eq(TAppUser::getIsVip, 1)); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>() |
| | | .in(TAppUser::getId, ids) |
| | | .eq(TAppUser::getIsVip, 1) |
| | | .ne(TAppUser::getState, 3)); |
| | | map.put("allVip", list1.size()); |
| | | |
| | | |