|  |  |  | 
|---|
|  |  |  | private TAppGiftService appGiftService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | @PostMapping("/api/startCource/queryStudentData") | 
|---|
|  |  |  | @ApiOperation(value = "上课首页", tags = {"APP-开始上课"}) | 
|---|
|  |  |  | @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){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(tappuService.queryUserOfStus(userIdFormRedis)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(tappuService.queryUserOfStus(stuId, userIdFormRedis)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(value = "用户经度", name = "longitude", required = false, dataType = "string"), | 
|---|
|  |  |  | @ApiImplicitParam(value = "用户纬度", name = "latitude", required = false, dataType = "string"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<List<CourseVenue>> queryWeeksOfClassInfo(String time,Integer stuId, String longitude, String latitude){ | 
|---|
|  |  |  | public ResultUtil<List<CourseVenue>> queryWeeksOfClassInfo(String time, Integer stuId, String longitude, String latitude) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(tappuService.queryWeekOfCourseDetails(appUserId,stuId,time,longitude,latitude)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(tappuService.queryWeekOfCourseDetails(appUserId, stuId, time, longitude, latitude)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | @PostMapping("/api/startCource/weeksOfCourseDetailsList") | 
|---|
|  |  |  | @ApiOperation(value = "上课首页-课程列表2.0", tags = {"APP-开始上课"}) | 
|---|
|  |  |  | @ApiOperation(value = "上课首页-课程列表", tags = {"APP-开始上课"}) | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), | 
|---|
|  |  |  | @ApiImplicitParam(value = "查询时间yyyy-MM-dd", name = "time", required = true, dataType = "string"), | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(value = "用户经度", name = "longitude", required = false, dataType = "string"), | 
|---|
|  |  |  | @ApiImplicitParam(value = "用户纬度", name = "latitude", required = false, dataType = "string"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<Map<String,Object>> weeksOfCourseDetailsList(String time, Integer stuId, Integer storeId, String longitude, String latitude){ | 
|---|
|  |  |  | public ResultUtil<Map<String, Object>> weeksOfCourseDetailsList(String time, Integer stuId, Integer storeId, String longitude, String latitude) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(tappuService.weeksOfCourseDetailsList(appUserId,stuId,time,storeId,longitude,latitude)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(tappuService.weeksOfCourseDetailsList(appUserId, stuId, time, storeId, longitude, latitude)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<Integer> weeksOfGetHours(){ | 
|---|
|  |  |  | public ResultUtil<Integer> weeksOfGetHours() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | TAppGift one = appGiftService.getOne(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ResultUtil.success(one==null?0:one.getNum()); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | Integer num = 0; | 
|---|
|  |  |  | List<TAppGift> list = appGiftService.list(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); | 
|---|
|  |  |  | for (TAppGift tAppGift : list) { | 
|---|
|  |  |  | num += tAppGift.getNum(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(num); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), | 
|---|
|  |  |  | @ApiImplicitParam(value = "分配给课包id", name = "packetId", required = true, dataType = "Long"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<Integer> weeksOfAddHours(Long packetId){ | 
|---|
|  |  |  | public ResultUtil<Integer> weeksOfAddHours(Long packetId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | TAppGift one = appGiftService.getOne(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); | 
|---|
|  |  |  | Boolean b= false; | 
|---|
|  |  |  | Integer i=0; | 
|---|
|  |  |  | if(one!=null && one.getNum()>0){ | 
|---|
|  |  |  | i=appGiftService.weeksOfAddHours(packetId,appUserId,one.getNum()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer i = 0; | 
|---|
|  |  |  | if (one != null && one.getNum() > 0) { | 
|---|
|  |  |  | i = appGiftService.weeksOfAddHours(packetId, appUserId, one.getNum()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(i==1){ | 
|---|
|  |  |  | if (i == 1) { | 
|---|
|  |  |  | // 送完清0 | 
|---|
|  |  |  | one.setNum(0); | 
|---|
|  |  |  | appGiftService.updateById(one); | 
|---|
|  |  |  | return ResultUtil.success(); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(value = "学员id", name = "stuID", required = true, dataType = "int"), | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<StuPhysicalVo> getStuPhysicalInfo(Integer stuID){ | 
|---|
|  |  |  | public ResultUtil<StuPhysicalVo> getStuPhysicalInfo(Integer stuID) { | 
|---|
|  |  |  | StuPhysicalVo vo = new StuPhysicalVo(); | 
|---|
|  |  |  | TStudent tStudent = istuService.getById(stuID); | 
|---|
|  |  |  | if (ToolUtil.isNotEmpty(tStudent)){ | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public ResultUtil addStu(StuDetailsReq stu){ | 
|---|
|  |  |  | public ResultUtil addStu(StuDetailsReq stu) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return istuService.addStuOfAppUser(stu,userIdFormRedis); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return istuService.addStuOfAppUser(stu, userIdFormRedis); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(ResultUtil.ERROR); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<List<StuListVo>> queryStuList(){ | 
|---|
|  |  |  | public ResultUtil<List<StuListVo>> queryStuList() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<StuListVo> stuListVos = new ArrayList<>(); | 
|---|
|  |  |  | List<TStudent> tStudents = istuService.list(new QueryWrapper<TStudent>() | 
|---|
|  |  |  | .eq("appUserId",userIdFormRedis).eq("state",1)); | 
|---|
|  |  |  | if (tStudents.size() > 0){ | 
|---|
|  |  |  | .eq("appUserId", userIdFormRedis).eq("state", 1)); | 
|---|
|  |  |  | if (tStudents.size() > 0) { | 
|---|
|  |  |  | tStudents.forEach(sts -> { | 
|---|
|  |  |  | StuListVo vo = new StuListVo(); | 
|---|
|  |  |  | vo.setStuId(sts.getId()); | 
|---|
|  |  |  | vo.setStuHeadImg(sts.getHeadImg()); | 
|---|
|  |  |  | vo.setStuPhone(ToolUtil.isEmpty(sts.getPhone()) ? "" : sts.getPhone()); | 
|---|
|  |  |  | vo.setIdCard(ToolUtil.isEmpty(sts.getIdCard()) ? "":sts.getIdCard()); | 
|---|
|  |  |  | vo.setIdCard(ToolUtil.isEmpty(sts.getIdCard()) ? "" : sts.getIdCard()); | 
|---|
|  |  |  | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | 
|---|
|  |  |  | vo.setBirthday(simpleDateFormat.format(sts.getBirthday())); | 
|---|
|  |  |  | vo.setStuName(sts.getName()); | 
|---|
|  |  |  | 
|---|
|  |  |  | vo.setStuWeight(sts.getWeight()); | 
|---|
|  |  |  | vo.setIsNot(sts.getIsDefault()); | 
|---|
|  |  |  | vo.setStuPhone(sts.getPhone()); | 
|---|
|  |  |  | vo.setSex(sts.getSex()); | 
|---|
|  |  |  | stuListVos.add(vo); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(stuListVos); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @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<List<StuListVo>> dealSwitchStudents(Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<List<StuListVo>> dealSwitchStudents(Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.switchStudentActions(userIdFormRedis,stuId)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(istuService.switchStudentActions(userIdFormRedis, stuId)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @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<StuDetailsVo> editStudentInfo(Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<StuDetailsVo> editStudentInfo(Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | TStudent byId = istuService.getById(stuId); | 
|---|
|  |  |  | if (ToolUtil.isEmpty(byId)){ | 
|---|
|  |  |  | if (ToolUtil.isEmpty(byId)) { | 
|---|
|  |  |  | ResultUtil.error("未查询到该学员!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | 
|---|
|  |  |  | 
|---|
|  |  |  | detailsVo.setBirthday(simpleDateFormat.format(byId.getBirthday())); | 
|---|
|  |  |  | detailsVo.setStuHeight(byId.getHeight()); | 
|---|
|  |  |  | detailsVo.setStuWeight(byId.getWeight()); | 
|---|
|  |  |  | detailsVo.setIdCard(ToolUtil.isEmpty(byId.getIdCard()) ? "": byId.getIdCard()); | 
|---|
|  |  |  | detailsVo.setStuPhone(ToolUtil.isEmpty(byId.getPhone()) ?  "" : byId.getPhone()); | 
|---|
|  |  |  | detailsVo.setIdCard(ToolUtil.isEmpty(byId.getIdCard()) ? "" : byId.getIdCard()); | 
|---|
|  |  |  | detailsVo.setStuPhone(ToolUtil.isEmpty(byId.getPhone()) ? "" : byId.getPhone()); | 
|---|
|  |  |  | return ResultUtil.success(detailsVo); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @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){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | 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)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @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 editDefault(Integer stuId){ | 
|---|
|  |  |  | public ResultUtil editDefault(Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | TStudent byId = istuService.getById(stuId); | 
|---|
|  |  |  | if (ToolUtil.isEmpty(byId)){ | 
|---|
|  |  |  | if (ToolUtil.isEmpty(byId)) { | 
|---|
|  |  |  | ResultUtil.error("未查询到该学员!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | byId.setIsDefault(1); | 
|---|
|  |  |  | istuService.updateById(byId); | 
|---|
|  |  |  | List<TStudent> list = istuService.list(new LambdaQueryWrapper<TStudent>() | 
|---|
|  |  |  | .eq(TStudent::getAppUserId,userIdFormRedis) | 
|---|
|  |  |  | .ne(TStudent::getId,byId.getId())); | 
|---|
|  |  |  | .eq(TStudent::getAppUserId, userIdFormRedis) | 
|---|
|  |  |  | .ne(TStudent::getId, byId.getId())); | 
|---|
|  |  |  | for (TStudent tStudent : list) { | 
|---|
|  |  |  | tStudent.setIsDefault(2); | 
|---|
|  |  |  | istuService.updateById(tStudent); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(value = "课包id", name = "lessonId", required = true, dataType = "int"), | 
|---|
|  |  |  | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<ClassDetailsInsVo> coursePackageDetails(Integer lessonId, Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<ClassDetailsInsVo> coursePackageDetails(Integer lessonId, Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ResultUtil.success(istuService.querySessionDetailsDt(userIdFormRedis,lessonId,stuId)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(istuService.querySessionDetailsDt(userIdFormRedis, lessonId, stuId)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<List<PurchaseRecordVo>> recordList(RecordTimeRequest timeRequest){ | 
|---|
|  |  |  | public ResultUtil<List<PurchaseRecordVo>> recordList(RecordTimeRequest timeRequest) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.queryDeduRecordDetails(timeRequest,userIdFormRedis)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(istuService.queryDeduRecordDetails(timeRequest, userIdFormRedis)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(value = "课包id", name = "lessonId", required = true, dataType = "int"), | 
|---|
|  |  |  | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(Integer lessonId, Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(Integer lessonId, Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.queryStuOfCourseDetails(lessonId,stuId,userIdFormRedis)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(istuService.queryStuOfCourseDetails(lessonId, stuId, userIdFormRedis)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<List<CouponStuAvailableVo>> queryCouponList(){ | 
|---|
|  |  |  | public ResultUtil<List<CouponStuAvailableVo>> queryCouponList() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.queryStuOfConponDetails(userIdFormRedis)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil continuationOperation(ClasspaymentRequest request){ | 
|---|
|  |  |  | public ResultUtil continuationOperation(ClasspaymentRequest request) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == userIdFormRedis){ | 
|---|
|  |  |  | if (null == userIdFormRedis) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return istuService.renewClassPayment(userIdFormRedis,request); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return istuService.renewClassPayment(userIdFormRedis, request); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @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<List<StuCommentsVo>> queryStuComment( Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<List<StuCommentsVo>> queryStuComment(Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | return ResultUtil.success(evalstuService.queryStuCommentsList(stuId)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @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<List<StuMedalVo>> queryStuMedal( Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<List<StuMedalVo>> queryStuMedal(Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(honorService.queryHonorDetails(stuId)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return ResultUtil.success(honorService.queryHonorDetails(appUserId)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @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<List<GongVo>> queryStuGoog(Integer stuId){ | 
|---|
|  |  |  | public ResultUtil<List<GongVo>> queryStuGoog(Integer stuId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(honorService.queryStuOfMedalData(stuId)); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(value = "时间类型 0=全部 1=近一周 2=近一个月 3=近一年", name = "timeType", required = false, dataType = "int"), | 
|---|
|  |  |  | @ApiImplicitParam(value = "课程名称", name = "appointStatus", required = false, dataType = "string"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil<List<RecordAppoint>> cgeClassAppointmentRecordList(Integer stuId, Integer appointStatus, Integer timeType, String search,Integer pageNum){ | 
|---|
|  |  |  | //        try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.getAppointmentRecords(stuId,appUserId,appointStatus,timeType,search,pageNum)); | 
|---|
|  |  |  | //        }catch (Exception e){ | 
|---|
|  |  |  | //            return ResultUtil.runErr(); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | public ResultUtil<List<RecordAppoint>> cgeClassAppointmentRecordList(Integer stuId, Integer appointStatus, Integer timeType, String search, Integer pageNum) { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultUtil.success(istuService.getAppointmentRecords(stuId, appUserId, appointStatus, timeType, search, pageNum)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), | 
|---|
|  |  |  | @ApiImplicitParam(value = "上课记录id", name = "courseStuRecordId", required = true, dataType = "int"), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultUtil cancelReservation(Integer courseStuRecordId){ | 
|---|
|  |  |  | public ResultUtil cancelReservation(Integer courseStuRecordId) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer appUserId = tokenUtil.getUserIdFormRedis(); | 
|---|
|  |  |  | if(null == appUserId){ | 
|---|
|  |  |  | if (null == appUserId) { | 
|---|
|  |  |  | return ResultUtil.tokenErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return istuService.cancelReservationOfCourse(courseStuRecordId); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | return ResultUtil.runErr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|