From 695ff7ec8bd12b6cf32b77902bd5cfb44419b835 Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期五, 17 十一月 2023 09:06:57 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java | 47 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 33 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 45bcdcc..1806a5f 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 @@ -129,7 +129,6 @@ e.printStackTrace(); return ResultUtil.runErr(); } - } @ResponseBody @@ -159,9 +158,9 @@ @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 = "string"), + @ApiImplicitParam(value = "分配给课包id", name = "packetId", required = true, dataType = "Long"), }) - public ResultUtil<Integer> weeksOfAddHours(Integer packetId){ + public ResultUtil<Integer> weeksOfAddHours(Long packetId){ try { Integer appUserId = tokenUtil.getUserIdFormRedis(); if(null == appUserId){ @@ -169,10 +168,12 @@ } TAppGift one = appGiftService.getOne(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); Boolean b= false; + Integer i=0; if(one!=null && one.getNum()>0){ - b =appGiftService.weeksOfAddHours(packetId,appUserId,one.getNum()); + i=appGiftService.weeksOfAddHours(packetId,appUserId,one.getNum()); + } - if(b){ + if(i==1){ // 送完清0 one.setNum(0); appGiftService.updateById(one); @@ -246,7 +247,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(); @@ -262,6 +263,7 @@ vo.setStuWeight(sts.getWeight()); vo.setIsNot(sts.getIsDefault()); vo.setStuPhone(sts.getPhone()); + vo.setSex(sts.getSex()); stuListVos.add(vo); }); } @@ -340,13 +342,27 @@ @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"); + + 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()); + return ResultUtil.success(istuService.updateById(tStudent)); + +// return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); }catch (Exception e){ return ResultUtil.runErr(); } @@ -545,6 +561,9 @@ }) public ResultUtil<List<StuMedalVo>> queryStuMedal( Integer stuId){ try { + + + Integer appUserId = tokenUtil.getUserIdFormRedis(); if(null == appUserId){ return ResultUtil.tokenErr(); @@ -591,16 +610,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