Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -171,6 +171,13 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
|||||||
log.error("未找到该剧集 用户id:{} 剧集:{}", userId, courseId);
|
log.error("未找到该剧集 用户id:{} 剧集:{}", userId, courseId);
|
||||||
return Result.error("未找到该剧集");
|
return Result.error("未找到该剧集");
|
||||||
}
|
}
|
||||||
|
boolean isVip;
|
||||||
|
UserEntity userEntity = userService.selectUserById(userId);
|
||||||
|
if (userEntity.getMember() != null && userEntity.getMember() == 2) {
|
||||||
|
isVip = true;
|
||||||
|
}else{
|
||||||
|
isVip = false;
|
||||||
|
}
|
||||||
//查询用户是否购买了整集
|
//查询用户是否购买了整集
|
||||||
CourseUser courseUser = courseUserDao.selectCourseUser(courseId, userId);
|
CourseUser courseUser = courseUserDao.selectCourseUser(courseId, userId);
|
||||||
// 每天购买超过上限,获得免费时间段资格
|
// 每天购买超过上限,获得免费时间段资格
|
||||||
@@ -215,7 +222,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
|||||||
current.set(s);
|
current.set(s);
|
||||||
}
|
}
|
||||||
// 不免费 3集以后 (已买的不为空 并不在已买的包含)
|
// 不免费 3集以后 (已买的不为空 并不在已买的包含)
|
||||||
if (!freeWatch && s.getSort() > 3 && (CollectionUtil.isEmpty(finalDetailsId) || !finalDetailsId.contains(s.getCourseDetailsId())) && courseUser == null) {
|
if (!freeWatch && s.getSort() > 3 && (CollectionUtil.isEmpty(finalDetailsId) || !finalDetailsId.contains(s.getCourseDetailsId())) && courseUser == null && !isVip) {
|
||||||
s.setVideoUrl(null);
|
s.setVideoUrl(null);
|
||||||
}
|
}
|
||||||
if (s.getSort() > finalStartSort && s.getSort() < finalEndSort) {
|
if (s.getSort() > finalStartSort && s.getSort() < finalEndSort) {
|
||||||
@@ -239,7 +246,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
|||||||
map.put("list", courseDetailsSetVos);
|
map.put("list", courseDetailsSetVos);
|
||||||
return new Result().put("data", map);
|
return new Result().put("data", map);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("请求剧集异常打印:",e);
|
log.error("请求剧集异常打印:", e);
|
||||||
return Result.error("请求剧集失败");
|
return Result.error("请求剧集失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,10 +252,10 @@ public class DiscSpinningController {
|
|||||||
TaskCenterRecord centerRecord = new TaskCenterRecord();
|
TaskCenterRecord centerRecord = new TaskCenterRecord();
|
||||||
centerRecord.setUserId(userId);
|
centerRecord.setUserId(userId);
|
||||||
centerRecord.setTaskId(Long.valueOf(entry.getKey()));
|
centerRecord.setTaskId(Long.valueOf(entry.getKey()));
|
||||||
if (source.equals(2)) {
|
// if (source.equals(2)) {
|
||||||
sourceId = Long.valueOf(entry.getKey());
|
sourceId = Long.valueOf(entry.getKey());
|
||||||
centerRecord.setSourceId(sourceId);
|
centerRecord.setSourceId(sourceId);
|
||||||
}
|
// }
|
||||||
centerRecord.setName(source.equals(2) ? "周任务奖励" : "月任务奖励");
|
centerRecord.setName(source.equals(2) ? "周任务奖励" : "月任务奖励");
|
||||||
centerRecord.setType(9);
|
centerRecord.setType(9);
|
||||||
centerRecord.setNumber(1);
|
centerRecord.setNumber(1);
|
||||||
|
|||||||
@@ -137,11 +137,13 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||||||
double resultAmount = 0;
|
double resultAmount = 0;
|
||||||
if (prize.getType() == 2) {
|
if (prize.getType() == 2) {
|
||||||
double baseRandom = getRandomDouble();
|
double baseRandom = getRandomDouble();
|
||||||
|
double baseAmount = 0;
|
||||||
for (DiscSpinningAmount amount : amounts) {
|
for (DiscSpinningAmount amount : amounts) {
|
||||||
if (baseRandom < amount.getRandom()) {
|
if (baseRandom < amount.getRandom()) {
|
||||||
resultAmount = getRandomDouble() * amount.getMaxAmount();
|
resultAmount = baseAmount + getRandomDouble() * amount.getMaxAmount();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
baseAmount = amount.getMaxAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultAmount < 0.01) {
|
if (resultAmount < 0.01) {
|
||||||
@@ -208,7 +210,7 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
for (int i = 0; i < 500; i++) {
|
for (int i = 0; i < 500; i++) {
|
||||||
random.setSeed(UUID.randomUUID().hashCode());
|
random.setSeed(UUID.randomUUID().hashCode());
|
||||||
System.out.println(random.nextInt(100)*random.nextInt(100));
|
System.out.println(random.nextInt(100) * random.nextInt(100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class WuyouController {
|
|||||||
return Result.error("订单支付信息不存在");
|
return Result.error("订单支付信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payDetails.getState() == 1) {
|
if (payDetails.getState().equals(1)) {
|
||||||
return Result.success().put("data", 1);
|
return Result.success().put("data", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class TaskCenterController {
|
|||||||
@ApiImplicitParam(name = "sourceId", value = "实物(物品Id)", dataTypeClass = Long.class, paramType = "body")
|
@ApiImplicitParam(name = "sourceId", value = "实物(物品Id)", dataTypeClass = Long.class, paramType = "body")
|
||||||
})
|
})
|
||||||
@Debounce(interval = 600000, value = "#userId,#record.taskId")
|
@Debounce(interval = 600000, value = "#userId,#record.taskId")
|
||||||
public Result receiveGoods(@ApiIgnore @RequestAttribute("userId") Long userId,@ApiIgnore TaskCenterRecord record) {
|
public Result receiveGoods(@ApiIgnore @RequestAttribute("userId") Long userId,@ApiIgnore @RequestBody TaskCenterRecord record) {
|
||||||
TaskCenter task = taskCenterService.getById(record.getTaskId());
|
TaskCenter task = taskCenterService.getById(record.getTaskId());
|
||||||
if (Objects.isNull(task)) {
|
if (Objects.isNull(task)) {
|
||||||
return Result.error("任务不存在。");
|
return Result.error("任务不存在。");
|
||||||
|
|||||||
@@ -2,15 +2,17 @@ package com.sqx.modules.taskCenter.controller;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.sqx.common.utils.DateUtils;
|
||||||
|
import com.sqx.common.utils.PageUtils;
|
||||||
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.app.annotation.Login;
|
import com.sqx.modules.app.annotation.Login;
|
||||||
import com.sqx.modules.taskCenter.entity.TaskCenterRecord;
|
import com.sqx.modules.taskCenter.entity.TaskCenterRecord;
|
||||||
import com.sqx.modules.taskCenter.entity.TaskCenterReward;
|
import com.sqx.modules.taskCenter.entity.TaskCenterReward;
|
||||||
import com.sqx.modules.taskCenter.service.TaskCenterRecordService;
|
import com.sqx.modules.taskCenter.service.TaskCenterRecordService;
|
||||||
import com.sqx.modules.taskCenter.service.TaskCenterRewardService;
|
import com.sqx.modules.taskCenter.service.TaskCenterRewardService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.sqx.common.utils.DateUtils;
|
|
||||||
import com.sqx.common.utils.Result;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@@ -80,7 +82,10 @@ public class TaskCenterRewardController {
|
|||||||
@GetMapping("/selectTaskCenterReward")
|
@GetMapping("/selectTaskCenterReward")
|
||||||
@ApiOperation("查询任务奖励")
|
@ApiOperation("查询任务奖励")
|
||||||
public Result selectTaskCenterReward(Integer page, Integer limit, TaskCenterReward taskCenterReward) {
|
public Result selectTaskCenterReward(Integer page, Integer limit, TaskCenterReward taskCenterReward) {
|
||||||
return Result.success().put("data", taskCenterRewardService.page(new Page<>(page, limit), new QueryWrapper<>(taskCenterReward).orderByDesc("id")));
|
PageHelper.startPage(page == null ? 0 : page, limit == null ? 10 : limit);
|
||||||
|
List<TaskCenterReward> list = taskCenterRewardService.list(new QueryWrapper<>(taskCenterReward).orderByDesc("id"));
|
||||||
|
PageInfo<TaskCenterReward> pageInfo = new PageInfo<>(list);
|
||||||
|
return Result.success().put("data", PageUtils.page(pageInfo, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Login
|
@Login
|
||||||
@@ -106,7 +111,7 @@ public class TaskCenterRewardController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
map.put("receive", record.getSourceId());
|
map.put("receive", record.getSourceId());
|
||||||
map.put("record", record.getId());
|
map.put("record", record.getId()+"");
|
||||||
}
|
}
|
||||||
map.put("data", list);
|
map.put("data", list);
|
||||||
return Result.success(map);
|
return Result.success(map);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class TaskCenterReward extends Model<TaskCenterReward> {
|
|||||||
private String img;
|
private String img;
|
||||||
@ApiModelProperty("奖励名称")
|
@ApiModelProperty("奖励名称")
|
||||||
private String name;
|
private String name;
|
||||||
@ApiModelProperty("奖励类型 1 金币 2 现金红包 3 4 5 9 大转盘抽奖次数")
|
@ApiModelProperty("奖励类型 1 金币 2 现金红包 3实物 4 5 9 大转盘抽奖次数")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user