puzhibing
2023-07-14 c81d766cd91be3b3a24c8db94dcd93c071a66c62
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(String longitude, 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,7 +86,7 @@
    @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(Integer stuID){
@@ -117,8 +117,7 @@
            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);
        }
@@ -244,7 +243,9 @@
    @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(Integer lessonId, Integer stuId){
        try {
@@ -317,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){
@@ -336,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){
@@ -359,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){
@@ -371,6 +372,50 @@
        }
    }
    /**
     * 上课预约记录
     */
    @ResponseBody
    @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<AppointmentRecordVo> cgeClassAppointmentRecordList(Integer stuId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
                return ResultUtil.tokenErr();
            }
            return ResultUtil.success(istuService.getAppointmentRecords(stuId,appUserId));
        }catch (Exception e){
            return ResultUtil.runErr();
        }
    }
    /**
     * 取消预约
     */
    @ResponseBody
    @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 = "courseStuRecordId", required = true, dataType = "int"),
    })
    public ResultUtil cancelReservation(Integer courseStuRecordId){
        try {
            Integer appUserId = tokenUtil.getUserIdFormRedis();
            if(null == appUserId){
                return ResultUtil.tokenErr();
            }
            return istuService.cancelReservationOfCourse(courseStuRecordId);
        }catch (Exception e){
            return ResultUtil.runErr();
        }
    }
}