lisy
2023-06-14 19d7560cd5b1f6498e9889d7f0e8a8e18ba4197f
cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
@@ -1,7 +1,7 @@
package com.dsh.account.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq;
import com.dsh.account.util.DateUtil;
import com.dsh.account.entity.TStudent;
@@ -10,6 +10,7 @@
import com.dsh.account.model.vo.classDetails.classInsVo.StuPhysicalVo;
import com.dsh.account.service.TAppUserService;
import com.dsh.account.service.TStudentService;
import com.dsh.account.util.ToolUtil;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,7 +45,7 @@
    @ResponseBody
    @PostMapping("/stu/queryStudentData")
    @ApiOperation(value = "根据登录用户ID查询学员信息", tags = {"用户——学员信息"}, notes = "")
    @ApiOperation(value = "根据登录用户ID查询学员信息", tags = {"APP-用户学员信息"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "用户id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -59,17 +60,22 @@
    }
    /**
     * 获取学员测试报告
     */
    @ResponseBody
    @PostMapping("/stu/queryPhysical")
    @ApiOperation(value = "获取学员测试报告", tags = {"APP-获取学员测试报告"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "学员id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public StuPhysicalVo getStuPhysicalInfo(@RequestBody Integer stuID){
        StuPhysicalVo vo = new StuPhysicalVo();
        TStudent tStudent = istuService.selectById(stuID);
        vo.setBmi(tStudent.getBmi());
        vo.setUrl(tStudent.getLateralSurface());
        vo.setHeight(tStudent.getHeight());
        vo.setWeight(tStudent.getWeight());
        TStudent tStudent = istuService.getById(stuID);
        if (ToolUtil.isNotEmpty(tStudent)){
            vo.setBmi(tStudent.getBmi());
            vo.setUrl(tStudent.getLateralSurface());
            vo.setHeight(tStudent.getHeight());
            vo.setWeight(tStudent.getWeight());
        }
        return vo;
    }
@@ -94,7 +100,7 @@
        student.setBmi(multiply.doubleValue());
        student.setInsertTime(new Date());
        student.setState(1);
        istuService.insert(student);
        istuService.save(student);
    }
    /**
@@ -103,7 +109,7 @@
    @PostMapping("/stu/listOfStu")
    public List<StuListVo> queryStuList(@RequestBody Integer appUserID){
        List<StuListVo> stuListVos = new ArrayList<>();
        List<TStudent> tStudents = istuService.selectList(new EntityWrapper<TStudent>()
        List<TStudent> tStudents = istuService.list(new QueryWrapper<TStudent>()
                .eq("appUserId",appUserID));
        if (tStudents.size() > 0){
            tStudents.forEach(sts -> {