From acad524bfb7f376c09ff8e6600fab207780156e1 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期四, 23 十一月 2023 18:46:05 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java | 66 ++++++++++++++++++++++++++------- 1 files changed, 52 insertions(+), 14 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 f1a160f..9ef0f9b 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 @@ -7,7 +7,6 @@ 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.DetailsListVo; import com.dsh.account.model.vo.classDetails.*; import com.dsh.account.model.vo.classDetails.classInsVo.*; import com.dsh.account.model.vo.commentDetail.StuCommentsVo; @@ -24,7 +23,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -72,13 +70,13 @@ @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) - public ResultUtil<ClassInfoVo> queryCouponRecord(){ + public ResultUtil<ClassInfoVo> queryCouponRecord(Integer stuId){ try { Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); if(null == userIdFormRedis){ return ResultUtil.tokenErr(); } - return ResultUtil.success(tappuService.queryUserOfStus(userIdFormRedis)); + return ResultUtil.success(tappuService.queryUserOfStus(stuId,userIdFormRedis)); }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); @@ -203,7 +201,10 @@ if (ToolUtil.isNotEmpty(tStudent)){ vo.setBmi(tStudent.getBmi()); vo.setBodyStatus(BMIBodyUtil.getBodyStatus(tStudent.getBmi())); - vo.setUrl(tStudent.getLateralSurface()); + if (tStudent.getLateralSurface()!=null) { + String[] split = tStudent.getLateralSurface().split(";"); + vo.setUrls(split); + } vo.setHeight(tStudent.getHeight()); vo.setWeight(tStudent.getWeight()); } @@ -249,7 +250,7 @@ } List<StuListVo> stuListVos = new ArrayList<>(); List<TStudent> tStudents = istuService.list(new QueryWrapper<TStudent>() - .eq("appUserId",userIdFormRedis)); + .eq("appUserId",userIdFormRedis).eq("state",1)); if (tStudents.size() > 0){ tStudents.forEach(sts -> { StuListVo vo = new StuListVo(); @@ -265,6 +266,7 @@ vo.setStuWeight(sts.getWeight()); vo.setIsNot(sts.getIsDefault()); vo.setStuPhone(sts.getPhone()); + vo.setSex(sts.getSex()); stuListVos.add(vo); }); } @@ -343,13 +345,46 @@ @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){ + public ResultUtil commitEditStu(StuDetailsReq stu){ try { Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); if(null == userIdFormRedis){ return ResultUtil.tokenErr(); } - return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + + Double height = stu.getHeight(); + Double squareHeight = Math.pow(height/100, 2); + Double weight = stu.getWeight(); + + Double bim = weight/squareHeight; + + TStudent tStudent = new TStudent(); + + + + + tStudent.setId(stu.getStuId()); + tStudent.setBirthday(format.parse(stu.getBirthday())); + tStudent.setHeadImg(stu.getHeadImg()); + tStudent.setHeight(stu.getHeight()); + tStudent.setWeight(stu.getWeight()); + tStudent.setPhone(stu.getPhone()); + tStudent.setSex(stu.getSex()); + tStudent.setName(stu.getName()); + tStudent.setIdCard(stu.getIdCard()); + tStudent.setBmi(bim); + + if(ToolUtil.isNotEmpty(tStudent.getName()) && ToolUtil.isNotEmpty(tStudent.getIdCard())){ + Boolean aBoolean = JuHeUtil.idcardAuthentication(tStudent.getIdCard(), tStudent.getName()); + if(!aBoolean){ + return ResultUtil.error("身份证和姓名不匹配"); + } + } + + return ResultUtil.success(istuService.updateById(tStudent)); + +// return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); }catch (Exception e){ return ResultUtil.runErr(); } @@ -548,6 +583,9 @@ }) public ResultUtil<List<StuMedalVo>> queryStuMedal( Integer stuId){ try { + + + Integer appUserId = tokenUtil.getUserIdFormRedis(); if(null == appUserId){ return ResultUtil.tokenErr(); @@ -594,16 +632,16 @@ @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 { + public ResultUtil<List<RecordAppoint>> cgeClassAppointmentRecordList(Integer stuId, Integer appointStatus, Integer timeType, String search,Integer pageNum){ +// 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(); - } + return ResultUtil.success(istuService.getAppointmentRecords(stuId,appUserId,appointStatus,timeType,search,pageNum)); +// }catch (Exception e){ +// return ResultUtil.runErr(); +// } } -- Gitblit v1.7.1