Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
26fbd94cd9
|
|
@ -43,6 +43,7 @@ public class UserMoneyDetailsServiceImpl extends ServiceImpl<UserMoneyDetailsDao
|
|||
arrayList.add(1);
|
||||
arrayList.add(6);
|
||||
arrayList.add(7);
|
||||
arrayList.add(8);
|
||||
queryWrapper.in("classify", arrayList);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
|
|
|||
|
|
@ -187,11 +187,11 @@ public class DiscSpinningController {
|
|||
}
|
||||
amount = orders.getPayMoney().doubleValue();
|
||||
sourceId = orders.getOrdersId();
|
||||
} else {
|
||||
} else {
|
||||
String redisKey = "";
|
||||
if (source.equals(2)){
|
||||
if (source.equals(2)) {
|
||||
redisKey = RedisKeys.getDateKey("spinning:amount:taskW") + userId;
|
||||
}else if(source.equals(3)){
|
||||
} else if (source.equals(3)) {
|
||||
redisKey = RedisKeys.getDateKey("spinning:amount:taskM") + userId;
|
||||
}
|
||||
Map<String, Object> week = redisUtils.get(redisKey, Map.class);
|
||||
|
|
@ -206,7 +206,7 @@ public class DiscSpinningController {
|
|||
TaskCenterRecord centerRecord = new TaskCenterRecord();
|
||||
centerRecord.setUserId(userId);
|
||||
centerRecord.setTaskId(Long.valueOf(entry.getKey()));
|
||||
if(source.equals(2)){
|
||||
if (source.equals(2)) {
|
||||
sourceId = Long.valueOf(entry.getKey());
|
||||
centerRecord.setSourceId(Long.getLong(entry.getKey()));
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ public class DiscSpinningController {
|
|||
break;
|
||||
}
|
||||
}
|
||||
redisUtils.set(redisKey,week,DateUtils.todayAfterSecond());
|
||||
redisUtils.set(redisKey, week, DateUtils.todayAfterSecond());
|
||||
}
|
||||
return new Result().put("data",
|
||||
discSpinningService.draws(i == null ? 1 : i + 1, amount, sourceId, userId, source));
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public class DiscSpinningRecord extends Model<DiscSpinningRecord> {
|
|||
private Long sourceId;
|
||||
|
||||
private Long userId;
|
||||
private String imgUrl;
|
||||
//描述
|
||||
private String name;
|
||||
//类型 1谢谢惠顾 2 红包 9 其它
|
||||
|
|
@ -41,11 +42,12 @@ public class DiscSpinningRecord extends Model<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) {
|
||||
this.name = name;
|
||||
this.userId = userId;
|
||||
this.sourceId = sourceId;
|
||||
this.imgUrl = imgUrl;
|
||||
this.type = type;
|
||||
this.number = number;
|
||||
this.drawDay = drawDay;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public class DiscSpinningRecordServiceImpl extends ServiceImpl<DiscSpinningRecor
|
|||
public Integer countSourceRecord(Long sourceId) {
|
||||
QueryWrapper<DiscSpinningRecord> recordQuery = new QueryWrapper<>();
|
||||
recordQuery.eq("source_id", sourceId);
|
||||
recordQuery.eq("source", "taskM");
|
||||
recordQuery.gt("create_time", DateUtil.beginOfMonth(new Date()));
|
||||
return discSpinningRecordDao.selectCount(recordQuery);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,12 +216,13 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||
} else {
|
||||
if (source != 1) {
|
||||
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);
|
||||
recordService.save(record);
|
||||
return record;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class RedisServiceImpl implements RedisService {
|
|||
}else {
|
||||
Long expire = redisUtils.getExpire(freeWatchKey);
|
||||
if (expire == null) {
|
||||
expire = Long.valueOf(second);
|
||||
expire = -1L;
|
||||
}else {
|
||||
expire += Long.valueOf(second);
|
||||
}
|
||||
|
|
@ -77,11 +77,11 @@ public class RedisServiceImpl implements RedisService {
|
|||
|
||||
String watchKey = RedisKeys.getFreeWatchKey(userId, false);
|
||||
String payFreeWatchInfo = redisUtils.get(watchKey);
|
||||
Integer expireTime = -1;
|
||||
Long expireTime = -1L;
|
||||
JSONObject jsonObject = null;
|
||||
if (StrUtil.isNotBlank(payFreeWatchInfo)) {
|
||||
jsonObject = JSONObject.parseObject(payFreeWatchInfo);
|
||||
expireTime = jsonObject.getInteger("expireTime");
|
||||
expireTime = jsonObject.getLong("expireTime");
|
||||
}
|
||||
|
||||
if ((StrUtil.isNotBlank(permanentlyFreeWatch) && redisUtils.isExpiredSet(freeWatchKey)) || (StrUtil.isNotBlank(permanentlyFreeWatch) && DateUtil.current() >= expireTime)) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class TaskCenterRewardServiceImpl extends ServiceImpl<TaskCenterRewardDao
|
|||
|
||||
|
||||
@Override
|
||||
public Map<Integer, Integer> getRewardMap(Long taskId) {
|
||||
public Map<Integer, Integer> getRewardMap(Long taskId) {
|
||||
List<TaskCenterReward> rewards = baseMapper.getRewardMap(taskId);
|
||||
|
||||
Map<Integer, Integer> map = rewards.stream()
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ public class TaskCenterServiceImpl extends ServiceImpl<TaskCenterDao, TaskCenter
|
|||
if (CollectionUtil.isNotEmpty(taskWCount)) {
|
||||
for (Integer value : taskWCount.values()) {
|
||||
if (value > 0) {
|
||||
isBreak=true;
|
||||
isBreak = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isBreak){
|
||||
if (isBreak) {
|
||||
s.setDiscNumber(null);
|
||||
s.setNumber(null);
|
||||
break;
|
||||
|
|
@ -129,7 +129,7 @@ public class TaskCenterServiceImpl extends ServiceImpl<TaskCenterDao, TaskCenter
|
|||
} else {
|
||||
if (rewardMap.containsKey(9)) {
|
||||
Integer spinningCount = discSpinningRecordService.countSourceRecord(s.getId());
|
||||
if (spinningCount == null || spinningCount > 0) {
|
||||
if (spinningCount == null || rewardMap.get(9) - spinningCount > 0) {
|
||||
s.setDiscNumber(null);
|
||||
s.setNumber(null);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
</select>
|
||||
|
||||
<select id="queryUserInviteMoney" resultType="Double">
|
||||
select sum(money) from user_money_details where user_id=#{userId} and classify in (1,6,7) and type=1 and state=2 and money_type=1
|
||||
select sum(money) from user_money_details where user_id=#{userId} and classify in (1,6,7,8) and type=1 and state=2 and money_type=1
|
||||
</select>
|
||||
|
||||
<select id="queryUserInviteGoldMoney" resultType="Double">
|
||||
select sum(money) from user_money_details where user_id=#{userId} and classify in (1,6,7) and type=1 and state=2 and money_type=2
|
||||
select sum(money) from user_money_details where user_id=#{userId} and classify in (1,6,7,8) and type=1 and state=2 and money_type=2
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue