| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.model.vo.classDetails.ClasspaymentRequest; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.*; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | | import com.dsh.account.model.vo.medalDetail.GongVo; |
| | | import com.dsh.account.model.vo.medalDetail.StuMedalVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.service.EvaluateStudentService; |
| | | import com.dsh.account.service.StudentHonorService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.DateUtil; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | private TAppUserService tappuService; |
| | | |
| | | @Autowired |
| | | private EvaluateStudentService evalstuService; |
| | | |
| | | @Autowired |
| | | private StudentHonorService honorService; |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/queryStudentData") |
| | | @PostMapping("/api/startCource/queryStudentData") |
| | | @ApiOperation(value = "上课首页", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "经度值", name = "longitude", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "纬度值", name = "latitude", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(@RequestBody String longitude, @RequestBody String latitude, HttpServletRequest request){ |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(@RequestBody String longitude, @RequestBody String latitude){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/queryPhysical") |
| | | @PostMapping("/api/startCource/queryPhysical") |
| | | @ApiOperation(value = "获取学员测试报告", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "学员id", name = "id", required = true, dataType = "int"), |
| | |
| | | * 添加学员信息 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/addData") |
| | | @PostMapping("/api/startCource/addData") |
| | | @ApiOperation(value = "添加学员信息", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "学员信息", name = "stu", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | @Transactional |
| | | public ResultUtil addStu(@RequestBody StuDetailsReq stu,HttpServletRequest request){ |
| | | public ResultUtil addStu(@RequestBody StuDetailsReq stu){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | * 该APP用户下的学员列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/listOfStu") |
| | | @PostMapping("/api/startCource/listOfStu") |
| | | @ApiOperation(value = "学员列表", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<StuListVo>> queryStuList(HttpServletRequest request){ |
| | | public ResultUtil<List<StuListVo>> queryStuList(){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | vo.setStuHeight(sts.getHeight()); |
| | | vo.setStuWeight(sts.getWeight()); |
| | | vo.setIsNot(sts.getIsDefault()); |
| | | stuListVos.add(vo); |
| | | }); |
| | | } |
| | | return ResultUtil.success(stuListVos); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 切换学员 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/switchStu") |
| | | @ApiOperation(value = "切换学员", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @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(@RequestBody Integer stuId){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.switchStudentActions(userIdFormRedis,stuId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 课时详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/lessonDetails") |
| | | @PostMapping("/api/startCource/lessonDetails") |
| | | @ApiOperation(value = "课时详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "课包id", name = "lessonId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<ClassDetailsInsVo> coursePackageDetails(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | public ResultUtil<ClassDetailsInsVo> coursePackageDetails(@RequestBody Integer lessonId, @RequestBody Integer stuId){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | * 课时详情-记录列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/recordDetails") |
| | | @PostMapping("/api/startCource/recordDetails") |
| | | @ApiOperation(value = "课时详情-记录列表", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<PurchaseRecordVo>> recordList(@RequestBody RecordTimeRequest timeRequest, HttpServletRequest request){ |
| | | public ResultUtil<List<PurchaseRecordVo>> recordList(@RequestBody RecordTimeRequest timeRequest){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-续课 |
| | | * 课时详情-续课课包详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/renewal") |
| | | @PostMapping("/api/startCource/renewal") |
| | | @ApiOperation(value = "课时详情-续课课包详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-续课 |
| | | * 课时详情-选择优惠券 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/conponList") |
| | | @PostMapping("/api/startCource/conponList") |
| | | @ApiOperation(value = "课时详情-选择优惠券", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<CouponStuAvailableVo>> queryCouponList(HttpServletRequest request){ |
| | | public ResultUtil<List<CouponStuAvailableVo>> queryCouponList(){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-续课 |
| | | * 课时详情-支付 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/payment") |
| | | @PostMapping("/api/startCource/payment") |
| | | @ApiOperation(value = "课时详情-支付", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<?> continuationOperation(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | public ResultUtil continuationOperation(@RequestBody ClasspaymentRequest request){ |
| | | try { |
| | | |
| | | return ResultUtil.success(); |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return istuService.renewClassPayment(userIdFormRedis,request); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | * 学员评语 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/stuComment") |
| | | @PostMapping("/api/startCource/stuComment") |
| | | @ApiOperation(value = "学员评语", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | @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<?> queryStuComment(@RequestParam("stuId") Integer stuId, HttpServletRequest request){ |
| | | public ResultUtil<List<StuCommentsVo>> queryStuComment(@RequestParam("stuId") Integer stuId){ |
| | | try { |
| | | return ResultUtil.success(evalstuService.queryStuCommentsList(stuId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | /** |
| | | * 学员勋章详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/stuMedal") |
| | | @ApiOperation(value = "学员勋章详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @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(@RequestParam("stuId") Integer stuId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(honorService.queryHonorDetails(stuId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 学员勋章 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/stuGoog") |
| | | @ApiOperation(value = "学员勋章", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @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(@RequestParam("stuId") Integer stuId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(honorService.queryStuOfMedalData(stuId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |