parent
73631f76a7
commit
af71811487
|
|
@ -4,16 +4,13 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 现金红包 抽奖配置(DiscSpinningAmount)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-12-11 14:59:01
|
||||
* @since 2024-12-13 15:04:07
|
||||
*/
|
||||
@Data
|
||||
@TableName("disc_spinning_amount")
|
||||
|
|
@ -27,6 +24,7 @@ public class DiscSpinningAmount extends Model<DiscSpinningAmount> {
|
|||
private Double random;
|
||||
@ApiModelProperty("最大金额")
|
||||
private Double maxAmount;
|
||||
@ApiModelProperty("是否启动 0否1是")
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||
} while (randomDouble == 0);
|
||||
BigDecimal randomNum = new BigDecimal(randomDouble).multiply(new BigDecimal(10000)).divide(new BigDecimal(100));
|
||||
|
||||
List<DiscSpinningAmount> amounts = redisUtils.getDate(RedisKeys.getDateKey("spinning:amount"), ArrayList.class, "setDiscSpinningAmounts");
|
||||
List<DiscSpinningAmount> amounts = amountService.list(new QueryWrapper<DiscSpinningAmount>().eq("status",1).orderByAsc("max_amount"));
|
||||
for (DiscSpinning prize : prizes) {
|
||||
if (randomNum.compareTo(prize.getNumber()) < 0) {
|
||||
if (prize.getType() == 2) {
|
||||
|
|
@ -184,5 +184,6 @@ public class DiscSpinningServiceImpl extends ServiceImpl<DiscSpinningDao, DiscSp
|
|||
recordService.save(record);
|
||||
return record;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue