| | |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | @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){ |
| | |
| | | } |
| | | 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); |