Browse Source

刷数据任务批量添加

master
nili 8 months ago
parent
commit
1b8abd22de
  1. 21
      game-service/src/main/java/awesome/group/game/service/AdminService.java
  2. 4
      game-service/src/main/java/awesome/group/game/service/bo/AddMockScheduleReq.java

21
game-service/src/main/java/awesome/group/game/service/AdminService.java

@ -120,7 +120,7 @@ public class AdminService {
int page = param.current;
int pageSize = param.pageSize;
PageResult<MatrixAdvRecordBo> res = new PageResult<>();
if (page == 1 && StringUtils.hasText(param.deviceId)) {
if (page == 1) {
QueryWrapper<MatrixAdvRecord> sumQuery = wrapper.clone();
sumQuery.select("sum(ecpm) as ecpm");
MatrixAdvRecord sum = advRecordMapper.selectOne(sumQuery);
@ -265,7 +265,9 @@ public class AdminService {
}
public List<MatrixMockSchedule> mockScheduleList() {
return mockScheduleMapper.selectList(null);
List<MatrixMockSchedule> data = mockScheduleMapper.selectList(new QueryWrapper<MatrixMockSchedule>().last("limit 200"));
Collections.reverse(data);
return data;
}
public void addMockSchedule(AddMockScheduleReq bo) {
@ -273,12 +275,15 @@ public class AdminService {
if (app == null || !StringUtils.hasText(app.getChannel())) {
throw new PaganiException(PaganiExceptionCode.ILLEGAL_REQUEST, "应用不存在或渠道为空");
}
MatrixMockSchedule schedule = new MatrixMockSchedule();
schedule.setAppId(bo.appId);
schedule.setScheduleTime(new Timestamp(bo.scheduleTime));
schedule.setChannel(app.getChannel());
schedule.setIncomeYuan(bo.incomeYuan);
mockScheduleMapper.insert(schedule);
bo.scheduleTime.forEach(x -> {
MatrixMockSchedule schedule = new MatrixMockSchedule();
schedule.setAppId(bo.appId);
schedule.setScheduleTime(new Timestamp(x));
schedule.setChannel(app.getChannel());
schedule.setIncomeYuan(bo.incomeYuan);
mockScheduleMapper.insert(schedule);
});
}
public OverviewBo incomeOverview(int adminId, String code) {

4
game-service/src/main/java/awesome/group/game/service/bo/AddMockScheduleReq.java

@ -1,7 +1,9 @@
package awesome.group.game.service.bo;
import java.util.List;
public class AddMockScheduleReq {
public Integer appId;
public Integer incomeYuan;
public long scheduleTime;//毫秒
public List<Long> scheduleTime;//毫秒
}

Loading…
Cancel
Save