|
|
@ -27,7 +27,6 @@ import java.util.concurrent.ThreadLocalRandom; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static awesome.group.game.service.util.Constants.SUPER_ADMIN; |
|
|
|
import static java.util.concurrent.ThreadLocalRandom.current; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class SuperAdminService { |
|
|
@ -182,8 +181,8 @@ public class SuperAdminService { |
|
|
|
|
|
|
|
public void mockDay(int date, String appCode) { |
|
|
|
MatrixApp app = appMapper.queryByCode(appCode); |
|
|
|
long beginTime = 32400_000L + current().nextInt(0, 7200000);//9点到11点之间随机
|
|
|
|
beginTime += DateUtil.date2Long(date) + beginTime; |
|
|
|
long beginTime = 32400_000L + ThreadLocalRandom.current().nextInt(0, 7200_000);//9点到11点之间随机
|
|
|
|
beginTime = DateUtil.date2Long(date) + beginTime; |
|
|
|
int total = ThreadLocalRandom.current().nextInt(1000_000_00, 1500_000_00); |
|
|
|
int current = 0; |
|
|
|
List<Integer> userIds = innerUserMapper.queryByAppId(app.getId()); |
|
|
@ -205,7 +204,17 @@ public class SuperAdminService { |
|
|
|
return; |
|
|
|
} |
|
|
|
while (current < total) { |
|
|
|
int ecpm = 3000_00 + ThreadLocalRandom.current().nextInt(3000_00); |
|
|
|
int random = ThreadLocalRandom.current().nextInt(0, 14); |
|
|
|
int advType = Constants.BANNER; |
|
|
|
long ecpm = ThreadLocalRandom.current().nextInt(300, 600); |
|
|
|
if (random > 12) { |
|
|
|
advType = Constants.VIDEO; |
|
|
|
ecpm = ThreadLocalRandom.current().nextInt(3000_00, 6000_00); |
|
|
|
} else if (random > 9) { |
|
|
|
advType = Constants.POP_UP; |
|
|
|
ecpm = ThreadLocalRandom.current().nextInt(800, 1200); |
|
|
|
} |
|
|
|
|
|
|
|
current += ecpm; |
|
|
|
MatrixUser u = users.get(ThreadLocalRandom.current().nextInt(0, users.size())); |
|
|
|
MatrixAdvRecord record = map.get(u.getId()); |
|
|
@ -214,8 +223,8 @@ public class SuperAdminService { |
|
|
|
newRecord.setAppId(app.getId()); |
|
|
|
newRecord.setAdvId(null); |
|
|
|
newRecord.setPlatform(2); |
|
|
|
newRecord.setAdvType(Constants.VIDEO); |
|
|
|
newRecord.setEcpm((long) ecpm); |
|
|
|
newRecord.setAdvType(advType); |
|
|
|
newRecord.setEcpm(ecpm); |
|
|
|
AppNormalConfig config = AppNormalConfig.getConfig(app); |
|
|
|
long ecpmReal = config.getEcpmReal(ecpm, u); |
|
|
|
newRecord.setEcpmReal(ecpmReal); |
|
|
|