| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | studentVo.setAge(Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(tStudent.getBirthday()))); |
| | | listVo.add(studentVo); |
| | | studentVo.setName(tStudent.getName()); |
| | | } |
| | | return ResultUtil.success(listVo); |
| | | }catch (Exception e){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据电话号码学员信息 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/student/queryStudentByPhone") |
| | | public TStudent queryStudentByPhone(@RequestBody String phone){ |
| | | try { |
| | | TStudent one = studentService.getOne(new QueryWrapper<TStudent>().eq("phone", phone).eq("state", 1)); |
| | | return one; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/student/queryStudentById") |
| | | public TStudent queryStudentById(@RequestBody Integer id){ |
| | | TStudent student = studentService.getById(id); |
| | | return student; |
| | | } |
| | | } |