| | |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.TCoursePackagePayment; |
| | | import com.dsh.account.model.QueryDataFee; |
| | | import com.dsh.account.model.Student; |
| | | import com.dsh.account.model.StudentVo; |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.service.*; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | |
| | | return studentService.save(student); |
| | | } |
| | | /** |
| | | * 获取有学员的用户ids |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/student/getHasStudentUser") |
| | | public List<Integer> getHasStudentUser(){ |
| | | return studentService.list(new QueryWrapper<TStudent>()).stream().map(TStudent::getAppUserId).distinct().collect(Collectors.toList()); |
| | | } |
| | | /** |
| | | * 获取用户学员列表 |
| | | * @param appUserId |
| | | * @return |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryListByIds") |
| | | public List<TStudent> queryListByIds(@RequestBody List<Integer> collect){ |
| | | try { |
| | | List<TStudent> list = studentService.list(new QueryWrapper<TStudent>().in("id",collect).eq("state", 1)); |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryStudentCom") |
| | | public List<Map<String, Object>> queryStudentCom(@RequestBody Integer id){ |
| | | |
| | | List<Map<String, Object>> list = studentService.queryCom(id); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/frozen") |
| | | public void frozen(@RequestBody TStudent student){ |
| | | studentService.updateById(student); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryById") |
| | | public TStudent queryById(@RequestBody Integer id) { |
| | | return studentService.getById(id); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/updateTStudent") |
| | | public void updateTStudent(@RequestBody TStudent student){ |
| | | try { |
| | | studentService.updateById(student); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | |
| | | @PostMapping("/student/giftSelect") |
| | | public List<SelectDto> giftSelect(@RequestBody GiftSearchDto giftSearchDto){ |
| | | System.out.println("======giftSelect=========giftSearchDto===="+giftSearchDto); |
| | | |
| | | TAppUser one = appUserService.getOne(new QueryWrapper<TAppUser>().eq("name", giftSearchDto.getName()) |
| | | .eq("phone", giftSearchDto.getPhone())); |
| | | // Integer appId = studentService.getGiftSelect(giftSearchDto); |
| | | TCoursePackagePayment1 coursePackagePaymentById = paymentClient.getCoursePackagePaymentById1(giftSearchDto.getId()); |
| | | // System.out.println("=======giftSelect======appId====>"+appId); |
| | | List<TStudent> selectDtos = studentService.list(new QueryWrapper<TStudent>() |
| | | .select("name, id") |
| | | .eq("state", 1) |
| | | .eq("name", giftSearchDto.getName()).eq("phone",giftSearchDto.getPhone()).ne("appUserId",coursePackagePaymentById.getAppUserId())); |
| | | |
| | | |
| | | .eq("appUserId",one.getId())); |
| | | List<SelectDto> list = new ArrayList<>(); |
| | | for (TStudent student : selectDtos) { |
| | | SelectDto selectDto = new SelectDto(); |
| | |
| | | selectDto.setId(student.getId()); |
| | | list.add(selectDto); |
| | | } |
| | | // 只筛选当前用户已经购买了这个课程的学员 |
| | | |
| | | System.out.println("=======giftSelect======selectDtos====>"+list); |
| | | return list; |
| | | } |
| | |
| | | @ResponseBody |
| | | public List<Integer> getUserStore(@RequestBody Integer id){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id)); |
| | | 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)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | @ResponseBody |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/comdel") |
| | | public void comdel(@RequestBody Integer id) { |
| | | evaluateStudentService.removeById(id); |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/stuStores") |
| | | public HashMap<String, Object> stuStores(@RequestBody Integer id){ |
| | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private EvaluateStudentService evaluateStudentService; |
| | | @ResponseBody |
| | | @PostMapping("/student/save") |
| | | public void save(@RequestBody EvaluateStudent evaluateStudent) { |
| | | evaluateStudent.setInsertTime(new Date()); |
| | | evaluateStudentService.saveOrUpdate(evaluateStudent); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |