月抽奖
抽奖记录 增加 图片
This commit is contained in:
@@ -26,6 +26,7 @@ public class DiscSpinningRecord extends Model<DiscSpinningRecord> {
|
|||||||
private Long sourceId;
|
private Long sourceId;
|
||||||
|
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
private String imgUrl;
|
||||||
//描述
|
//描述
|
||||||
private String name;
|
private String name;
|
||||||
//类型 1谢谢惠顾 2 红包 9 其它
|
//类型 1谢谢惠顾 2 红包 9 其它
|
||||||
@@ -46,11 +47,12 @@ public class DiscSpinningRecord extends Model<DiscSpinningRecord> {
|
|||||||
public DiscSpinningRecord() {
|
public DiscSpinningRecord() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiscSpinningRecord(String name, Long sourceId, Long userId, Integer type, BigDecimal number,
|
public DiscSpinningRecord(String name, Long sourceId, Long userId,String imgUrl, Integer type, BigDecimal number,
|
||||||
String drawDay, String createTime, Integer source) {
|
String drawDay, String createTime, Integer source) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.sourceId = sourceId;
|
this.sourceId = sourceId;
|
||||||
|
this.imgUrl = imgUrl;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.number = number;
|
this.number = number;
|
||||||
this.drawDay = drawDay;
|
this.drawDay = drawDay;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class DiscSpinningRecordServiceImpl extends ServiceImpl<DiscSpinningRecor
|
|||||||
public Integer countSourceRecord(Long sourceId) {
|
public Integer countSourceRecord(Long sourceId) {
|
||||||
QueryWrapper<DiscSpinningRecord> recordQuery = new QueryWrapper<>();
|
QueryWrapper<DiscSpinningRecord> recordQuery = new QueryWrapper<>();
|
||||||
recordQuery.eq("source_id", sourceId);
|
recordQuery.eq("source_id", sourceId);
|
||||||
|
recordQuery.eq("source", "taskM");
|
||||||
recordQuery.gt("create_time", DateUtil.beginOfMonth(new Date()));
|
recordQuery.gt("create_time", DateUtil.beginOfMonth(new Date()));
|
||||||
return discSpinningRecordDao.selectCount(recordQuery);
|
return discSpinningRecordDao.selectCount(recordQuery);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,12 +216,13 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||||||
} else {
|
} else {
|
||||||
if (source != 1) {
|
if (source != 1) {
|
||||||
result = prize;
|
result = prize;
|
||||||
|
result.setNumber(BigDecimal.ONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DiscSpinningRecord record = new DiscSpinningRecord(result.getName(), sourceId, userId, result.getType(),
|
DiscSpinningRecord record = new DiscSpinningRecord(result.getName(), sourceId, userId,result.getUrl(), result.getType(),
|
||||||
result.getNumber(), DateUtils.formatYMD(new Date()), DateUtils.format(new Date()), source);
|
result.getNumber(), DateUtils.formatYMD(new Date()), DateUtils.format(new Date()), source);
|
||||||
recordService.save(record);
|
recordService.save(record);
|
||||||
return record;
|
return record;
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class TaskCenterServiceImpl extends ServiceImpl<TaskCenterDao, TaskCenter
|
|||||||
} else {
|
} else {
|
||||||
if (rewardMap.containsKey(9)) {
|
if (rewardMap.containsKey(9)) {
|
||||||
Integer spinningCount = discSpinningRecordService.countSourceRecord(s.getId());
|
Integer spinningCount = discSpinningRecordService.countSourceRecord(s.getId());
|
||||||
if (spinningCount == null || spinningCount > 0) {
|
if (spinningCount == null || rewardMap.get(9) - spinningCount > 0) {
|
||||||
s.setDiscNumber(null);
|
s.setDiscNumber(null);
|
||||||
s.setNumber(null);
|
s.setNumber(null);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user