| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(){ |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(Integer stuId){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tappuService.queryUserOfStus(userIdFormRedis)); |
| | | return ResultUtil.success(tappuService.queryUserOfStus(stuId,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | vo.setBmi(tStudent.getBmi()); |
| | | vo.setBodyStatus(BMIBodyUtil.getBodyStatus(tStudent.getBmi())); |
| | | vo.setUrl(tStudent.getLateralSurface()); |
| | | if (tStudent.getLateralSurface()!=null) { |
| | | String[] split = tStudent.getLateralSurface().split(";"); |
| | | vo.setUrls(split); |
| | | } |
| | | vo.setHeight(tStudent.getHeight()); |
| | | vo.setWeight(tStudent.getWeight()); |
| | | } |
| | |
| | | } |
| | | List<StuListVo> stuListVos = new ArrayList<>(); |
| | | List<TStudent> tStudents = istuService.list(new QueryWrapper<TStudent>() |
| | | .eq("appUserId",userIdFormRedis)); |
| | | .eq("appUserId",userIdFormRedis).eq("state",1)); |
| | | if (tStudents.size() > 0){ |
| | | tStudents.forEach(sts -> { |
| | | StuListVo vo = new StuListVo(); |
| | |
| | | vo.setStuWeight(sts.getWeight()); |
| | | vo.setIsNot(sts.getIsDefault()); |
| | | vo.setStuPhone(sts.getPhone()); |
| | | vo.setSex(sts.getSex()); |
| | | stuListVos.add(vo); |
| | | }); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil commitEditStu(StuEditInfoReq stu){ |
| | | public ResultUtil commitEditStu(StuDetailsReq stu){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | Double height = stu.getHeight(); |
| | | Double squareHeight = Math.pow(height/100, 2); |
| | | Double weight = stu.getWeight(); |
| | | |
| | | Double bim = weight/squareHeight; |
| | | |
| | | TStudent tStudent = new TStudent(); |
| | | |
| | | |
| | | |
| | | |
| | | tStudent.setId(stu.getStuId()); |
| | | tStudent.setBirthday(format.parse(stu.getBirthday())); |
| | | tStudent.setHeadImg(stu.getHeadImg()); |
| | | tStudent.setHeight(stu.getHeight()); |
| | | tStudent.setWeight(stu.getWeight()); |
| | | tStudent.setPhone(stu.getPhone()); |
| | | tStudent.setSex(stu.getSex()); |
| | | tStudent.setName(stu.getName()); |
| | | tStudent.setIdCard(stu.getIdCard()); |
| | | tStudent.setBmi(bim); |
| | | |
| | | if(ToolUtil.isNotEmpty(tStudent.getName()) && ToolUtil.isNotEmpty(tStudent.getIdCard())){ |
| | | Boolean aBoolean = JuHeUtil.idcardAuthentication(tStudent.getIdCard(), tStudent.getName()); |
| | | if(!aBoolean){ |
| | | return ResultUtil.error("身份证和姓名不匹配"); |
| | | } |
| | | } |
| | | |
| | | return ResultUtil.success(istuService.updateById(tStudent)); |
| | | |
| | | // return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | }) |
| | | public ResultUtil<List<StuMedalVo>> queryStuMedal( Integer stuId){ |
| | | try { |
| | | |
| | | |
| | | |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |