| | |
| | | |
| | | 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.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.StudentHonorService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.service.*; |
| | | import com.dsh.account.util.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | @Autowired |
| | | private TAppGiftService appGiftService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @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 = "string"), |
| | | }) |
| | | public ResultUtil<Integer> weeksOfAddHours(Integer 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; |
| | | if(one!=null && one.getNum()>0){ |
| | | b =appGiftService.weeksOfAddHours(packetId,appUserId,one.getNum()); |
| | | } |
| | | if(b){ |
| | | // 送完清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") |