Merge branch 'test' into dev

This commit is contained in:
GYJ 2025-01-31 16:00:46 +08:00
commit 2958e758f0
3 changed files with 11 additions and 5 deletions

View File

@ -1525,10 +1525,10 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
@Override
public int userMessage(String date, int type, String qdCode, Integer vipType) {
DateTime dateTime;
if (type == 0) {
if (type == 1) {
dateTime = DateUtil.beginOfDay(DateUtil.parseDate(date));
} else if (type == 1) {
} else if (type == 2) {
dateTime = DateUtil.beginOfMonth(DateUtil.parseDate(date));
} else {
dateTime = DateUtil.beginOfYear(DateUtil.parseDate(date));

View File

@ -137,11 +137,13 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
double resultAmount = 0;
if (prize.getType() == 2) {
double baseRandom = getRandomDouble();
double baseAmount = 0;
for (DiscSpinningAmount amount : amounts) {
if (baseRandom < amount.getRandom()) {
resultAmount = getRandomDouble() * amount.getMaxAmount();
resultAmount = baseAmount + getRandomDouble() * amount.getMaxAmount();
break;
}
baseAmount = amount.getMaxAmount();
}
if (resultAmount < 0.01) {
@ -165,6 +167,10 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
}
}
if (result.getName().contains("手机")) {
throw new RuntimeException("抽奖数据异常,请稍后再试");
}
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);
@ -208,7 +214,7 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
Random random = new Random();
for (int i = 0; i < 500; i++) {
random.setSeed(UUID.randomUUID().hashCode());
System.out.println(random.nextInt(100)*random.nextInt(100));
System.out.println(random.nextInt(100) * random.nextInt(100));
}
}
}

View File

@ -143,7 +143,7 @@ public class WuyouController {
return Result.error("订单支付信息不存在");
}
if (payDetails.getState() == 1) {
if (payDetails.getState().equals(1)) {
return Result.success().put("data", 1);
}