From 73372f312e8b8bae98623006640b016f9a433988 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期一, 16 十月 2023 15:12:49 +0800
Subject: [PATCH] 10.16
---
cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java | 402 +++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 358 insertions(+), 44 deletions(-)
diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
index 2f7c1ea..3ba94f2 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
@@ -1,22 +1,22 @@
package com.dsh.account.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.dsh.account.entity.TAppGift;
import com.dsh.account.entity.TStudent;
import com.dsh.account.feignclient.competition.model.PurchaseRecordVo;
+import com.dsh.account.feignclient.course.model.RecordAppoint;
+import com.dsh.account.model.vo.classDetails.*;
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.service.EvaluateStudentService;
-import com.dsh.account.service.TAppUserService;
-import com.dsh.account.service.TStudentService;
-import com.dsh.account.util.DateUtil;
-import com.dsh.account.util.ResultUtil;
-import com.dsh.account.util.TokenUtil;
-import com.dsh.account.util.ToolUtil;
+import com.dsh.account.service.*;
+import com.dsh.account.util.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@@ -24,12 +24,15 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
-import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
/**
@@ -51,25 +54,29 @@
private EvaluateStudentService evalstuService;
@Autowired
+ private StudentHonorService honorService;
+
+ @Autowired
private TokenUtil tokenUtil;
+
+ @Autowired
+ private TAppGiftService appGiftService;
@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){
+ public ResultUtil<ClassInfoVo> queryCouponRecord(){
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));
}catch (Exception e){
e.printStackTrace();
return ResultUtil.runErr();
@@ -78,17 +85,122 @@
@ResponseBody
- @PostMapping("/base/startCource/queryPhysical")
+ @PostMapping("/api/startCource/weeksOfCourseDetails")
+ @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 = "学员id", name = "stuId", required = true, dataType = "int"),
+ @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){
+ try {
+ Integer appUserId = tokenUtil.getUserIdFormRedis();
+ if(null == appUserId){
+ return ResultUtil.tokenErr();
+ }
+ 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-开始上课"})
+ @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 = "学员id", name = "stuId", required = true, dataType = "int"),
+ @ApiImplicitParam(value = "门店id", name = "storeId", required = true, dataType = "int"),
+ @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){
+ try {
+ Integer appUserId = tokenUtil.getUserIdFormRedis();
+ if(null == appUserId){
+ return ResultUtil.tokenErr();
+ }
+ return ResultUtil.success(tappuService.weeksOfCourseDetailsList(appUserId,stuId,time,storeId,longitude,latitude));
+ }catch (Exception e){
+ e.printStackTrace();
+ return ResultUtil.runErr();
+ }
+ }
+
+ @ResponseBody
+ @PostMapping("/api/startCource/weeksOfGetHours")
+ @ApiOperation(value = "上课首页获取未分配课时-课程列表", tags = {"APP-开始上课"})
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+ })
+ public ResultUtil<Integer> weeksOfGetHours(){
+ try {
+ Integer appUserId = tokenUtil.getUserIdFormRedis();
+ 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){
+ e.printStackTrace();
+ return ResultUtil.runErr();
+ }
+ }
+
+
+ @ResponseBody
+ @PostMapping("/api/startCource/weeksOfAddHours")
+ @ApiOperation(value = "上课首页分配课时-课程列表", tags = {"APP-开始上课"})
+ @ApiImplicitParams({
+ @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){
+ try {
+ Integer appUserId = tokenUtil.getUserIdFormRedis();
+ 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());
+
+ }
+ if(i==1){
+ // 送完清0
+ one.setNum(0);
+ appGiftService.updateById(one);
+ return ResultUtil.success();
+ }else {
+ return ResultUtil.runErr();
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ return ResultUtil.runErr();
+ }
+ }
+
+
+ @ResponseBody
+ @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)){
vo.setBmi(tStudent.getBmi());
+ vo.setBodyStatus(BMIBodyUtil.getBodyStatus(tStudent.getBmi()));
vo.setUrl(tStudent.getLateralSurface());
vo.setHeight(tStudent.getHeight());
vo.setWeight(tStudent.getWeight());
@@ -100,21 +212,19 @@
* 添加学员信息
*/
@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){
+ 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);
}
@@ -124,7 +234,7 @@
* 该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.....")
@@ -142,6 +252,9 @@
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());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
vo.setBirthday(simpleDateFormat.format(sts.getBirthday()));
vo.setStuName(sts.getName());
@@ -149,6 +262,8 @@
vo.setStuHeight(sts.getHeight());
vo.setStuWeight(sts.getWeight());
vo.setIsNot(sts.getIsDefault());
+ vo.setStuPhone(sts.getPhone());
+ stuListVos.add(vo);
});
}
return ResultUtil.success(stuListVos);
@@ -157,18 +272,139 @@
}
}
+
+ /**
+ * 切换学员
+ */
+ @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(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("/api/startCource/editStu")
+ @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<StuDetailsVo> editStudentInfo(Integer stuId){
+ try {
+ TStudent byId = istuService.getById(stuId);
+ if (ToolUtil.isEmpty(byId)){
+ ResultUtil.error("未查询到该学员!");
+ }
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ StuDetailsVo detailsVo = new StuDetailsVo();
+ detailsVo.setStuId(byId.getId());
+ detailsVo.setStuHeadImg(byId.getHeadImg());
+ detailsVo.setStuName(byId.getName());
+ 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());
+ return ResultUtil.success(detailsVo);
+ }catch (Exception e){
+ return ResultUtil.runErr();
+ }
+ }
+
+
+
+ /**
+ * 提交编辑学员
+ */
+ @ResponseBody
+ @PostMapping("/api/startCource/commitEditStu")
+ @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 commitEditStu(StuEditInfoReq stu){
+ try {
+ Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+ if(null == userIdFormRedis){
+ return ResultUtil.tokenErr();
+ }
+ return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis));
+ }catch (Exception e){
+ return ResultUtil.runErr();
+ }
+ }
+
+
+
+ /**
+ * 学员设为默认
+ */
+ @ResponseBody
+ @PostMapping("/api/startCource/editDefault")
+ @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 editDefault(Integer stuId){
+ try {
+ Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+ if(null == userIdFormRedis){
+ return ResultUtil.tokenErr();
+ }
+ TStudent byId = istuService.getById(stuId);
+ 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()));
+ for (TStudent tStudent : list) {
+ tStudent.setIsDefault(2);
+ istuService.updateById(tStudent);
+ }
+ return ResultUtil.success();
+ }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){
+ public ResultUtil<ClassDetailsInsVo> coursePackageDetails(Integer lessonId, Integer stuId){
try {
Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
if(null == userIdFormRedis){
@@ -188,12 +424,12 @@
* 课时详情-记录列表
*/
@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){
+ public ResultUtil<List<PurchaseRecordVo>> recordList(RecordTimeRequest timeRequest){
try {
Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
if(null == userIdFormRedis){
@@ -210,12 +446,14 @@
* 课时详情-续课课包详情
*/
@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.....")
+ @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){
@@ -233,7 +471,7 @@
* 课时详情-选择优惠券
*/
@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.....")
@@ -257,16 +495,20 @@
* 课时详情-支付
*/
@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(ClasspaymentRequest request){
try {
-
- return ResultUtil.success();
+ Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+ if(null == userIdFormRedis){
+ return ResultUtil.tokenErr();
+ }
+ return istuService.renewClassPayment(userIdFormRedis,request);
}catch (Exception e){
+ e.printStackTrace();
return ResultUtil.runErr();
}
@@ -277,14 +519,38 @@
* 学员评语
*/
@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<List<StuCommentsVo>> queryStuComment(@RequestParam("stuId") Integer stuId){
+ public ResultUtil<List<StuCommentsVo>> queryStuComment( Integer stuId){
try {
return ResultUtil.success(evalstuService.queryStuCommentsList(stuId));
+ }catch (Exception e){
+ return ResultUtil.runErr();
+ }
+ }
+
+
+ /**
+ * 学员勋章详情
+ */
+ @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( 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();
}
@@ -295,23 +561,71 @@
* 学员勋章
*/
@ResponseBody
- @PostMapping("/base/startCource/stuMedal")
+ @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(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<StuMedalVo> queryStuMedal(@RequestParam("stuId") Integer stuId){
+ public ResultUtil<List<GongVo>> queryStuGoog(Integer stuId){
try {
Integer appUserId = tokenUtil.getUserIdFormRedis();
if(null == appUserId){
return ResultUtil.tokenErr();
}
-
- return ResultUtil.success();
+ return ResultUtil.success(honorService.queryStuOfMedalData(stuId));
}catch (Exception e){
return ResultUtil.runErr();
}
}
+ /**
+ * 上课预约记录
+ */
+ @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"),
+ @ApiImplicitParam(value = "预约状态 0=全部 1=待上课 2=已完成 3=已取消", name = "appointStatus", required = false, dataType = "int"),
+ @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){
+ try {
+ Integer appUserId = tokenUtil.getUserIdFormRedis();
+ if(null == appUserId){
+ return ResultUtil.tokenErr();
+ }
+ return ResultUtil.success(istuService.getAppointmentRecords(stuId,appUserId,appointStatus,timeType,search));
+ }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();
+ }
+ }
}
--
Gitblit v1.7.1