lisy
2023-07-14 7865a1010be2f95faab151d99ecdb095f44c2a08
cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
@@ -4,9 +4,11 @@
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.AppointmentRecordVo;
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.exploreDetail.LonLatRequest;
import com.dsh.account.model.vo.medalDetail.GongVo;
import com.dsh.account.model.vo.medalDetail.StuMedalVo;
import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo;
@@ -64,17 +66,15 @@
    @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){
    public ResultUtil<ClassInfoVo> queryCouponRecord(LonLatRequest lonLatRequest){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
                return ResultUtil.tokenErr();
            }
            return ResultUtil.success(tappuService.queryUserOfStus(userIdFormRedis,longitude,latitude));
            return ResultUtil.success(tappuService.queryUserOfStus(userIdFormRedis,lonLatRequest.getLongitude(),lonLatRequest.getLatitude()));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -86,10 +86,10 @@
    @PostMapping("/api/startCource/queryPhysical")
    @ApiOperation(value = "获取学员测试报告", tags = {"APP-开始上课"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "学员id", name = "id", required = true, dataType = "int"),
            @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(@RequestBody Integer stuID){
    public ResultUtil<StuPhysicalVo> getStuPhysicalInfo(Integer stuID){
        StuPhysicalVo vo = new StuPhysicalVo();
        TStudent tStudent = istuService.getById(stuID);
        if (ToolUtil.isNotEmpty(tStudent)){
@@ -108,18 +108,16 @@
    @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){
    public ResultUtil addStu(StuDetailsReq stu){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
                return ResultUtil.tokenErr();
            }
            istuService.addStuOfAppUser(stu,userIdFormRedis);
            return ResultUtil.success();
            return istuService.addStuOfAppUser(stu,userIdFormRedis);
        }catch (Exception e){
            return ResultUtil.runErr(ResultUtil.ERROR);
        }
@@ -174,7 +172,7 @@
            @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){
    public ResultUtil<List<StuListVo>> dealSwitchStudents(Integer stuId){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
@@ -200,7 +198,7 @@
            @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){
    public ResultUtil<ClassDetailsInsVo> coursePackageDetails(Integer lessonId, Integer stuId){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
@@ -225,7 +223,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
    })
    public ResultUtil<List<PurchaseRecordVo>> recordList(@RequestBody RecordTimeRequest timeRequest){
    public ResultUtil<List<PurchaseRecordVo>> recordList(RecordTimeRequest timeRequest){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
@@ -245,9 +243,11 @@
    @PostMapping("/api/startCource/renewal")
    @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 = "lessonId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"),
    })
    public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId){
    public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(Integer lessonId, Integer stuId){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
@@ -294,7 +294,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
    })
    public ResultUtil continuationOperation(@RequestBody ClasspaymentRequest request){
    public ResultUtil continuationOperation(ClasspaymentRequest request){
        try {
            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
            if(null == userIdFormRedis){
@@ -318,7 +318,7 @@
            @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(@RequestParam("stuId") Integer stuId){
    public ResultUtil<List<StuCommentsVo>> queryStuComment( Integer stuId){
        try {
            return ResultUtil.success(evalstuService.queryStuCommentsList(stuId));
        }catch (Exception e){
@@ -337,7 +337,7 @@
            @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){
    public ResultUtil<List<StuMedalVo>> queryStuMedal( Integer stuId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
@@ -360,7 +360,7 @@
            @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){
    public ResultUtil<List<GongVo>> queryStuGoog(Integer stuId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
@@ -373,56 +373,49 @@
    }
    /**
     * 课后视频课表
     * 上课预约记录
     */
    @ResponseBody
    @PostMapping("/api/startCource/afterSourceDetails")
    @ApiOperation(value = "课后视频课表", tags = {"APP-开始上课"})
    @PostMapping("/api/startCource/stuAppointList")
    @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 queryAfterSourceDetails(@RequestParam("stuId") Integer stuId){
    public ResultUtil<AppointmentRecordVo> cgeClassAppointmentRecordList(Integer stuId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
                return ResultUtil.tokenErr();
            }
            // TODO: 2023/7/4
            return ResultUtil.success();
            return ResultUtil.success(istuService.getAppointmentRecords(stuId,appUserId));
        }catch (Exception e){
            return ResultUtil.runErr();
        }
    }
    /**
     * 已报名课程列表
     * 取消预约
     */
    @ResponseBody
    @PostMapping("/api/startCource/registeredCourses")
    @ApiOperation(value = "已报名课程列表", tags = {"APP-开始上课"})
    @PostMapping("/api/startCource/cancelCourse")
    @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"),
            @ApiImplicitParam(value = "上课记录id", name = "courseStuRecordId", required = true, dataType = "int"),
    })
    public ResultUtil<List<RegisterCourseVo>> queryRegisteredCoursesDetails(@RequestParam("stuId") Integer stuId){
    public ResultUtil cancelReservation(Integer courseStuRecordId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
                return ResultUtil.tokenErr();
            }
            return ResultUtil.success();
            return istuService.cancelReservationOfCourse(courseStuRecordId);
        }catch (Exception e){
            return ResultUtil.runErr();
        }
    }
}