Browse Source

刷数据任务批量添加

master
nili 7 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 page = param.current;
int pageSize = param.pageSize; int pageSize = param.pageSize;
PageResult<MatrixAdvRecordBo> res = new PageResult<>(); PageResult<MatrixAdvRecordBo> res = new PageResult<>();
if (page == 1 && StringUtils.hasText(param.deviceId)) { if (page == 1) {
QueryWrapper<MatrixAdvRecord> sumQuery = wrapper.clone(); QueryWrapper<MatrixAdvRecord> sumQuery = wrapper.clone();
sumQuery.select("sum(ecpm) as ecpm"); sumQuery.select("sum(ecpm) as ecpm");
MatrixAdvRecord sum = advRecordMapper.selectOne(sumQuery); MatrixAdvRecord sum = advRecordMapper.selectOne(sumQuery);
@ -265,7 +265,9 @@ public class AdminService {
} }
public List<MatrixMockSchedule> mockScheduleList() { 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) { public void addMockSchedule(AddMockScheduleReq bo) {
@ -273,12 +275,15 @@ public class AdminService {
if (app == null || !StringUtils.hasText(app.getChannel())) { if (app == null || !StringUtils.hasText(app.getChannel())) {
throw new PaganiException(PaganiExceptionCode.ILLEGAL_REQUEST, "应用不存在或渠道为空"); throw new PaganiException(PaganiExceptionCode.ILLEGAL_REQUEST, "应用不存在或渠道为空");
} }
MatrixMockSchedule schedule = new MatrixMockSchedule(); bo.scheduleTime.forEach(x -> {
schedule.setAppId(bo.appId); MatrixMockSchedule schedule = new MatrixMockSchedule();
schedule.setScheduleTime(new Timestamp(bo.scheduleTime)); schedule.setAppId(bo.appId);
schedule.setChannel(app.getChannel()); schedule.setScheduleTime(new Timestamp(x));
schedule.setIncomeYuan(bo.incomeYuan); schedule.setChannel(app.getChannel());
mockScheduleMapper.insert(schedule); schedule.setIncomeYuan(bo.incomeYuan);
mockScheduleMapper.insert(schedule);
});
} }
public OverviewBo incomeOverview(int adminId, String code) { 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; package awesome.group.game.service.bo;
import java.util.List;
public class AddMockScheduleReq { public class AddMockScheduleReq {
public Integer appId; public Integer appId;
public Integer incomeYuan; public Integer incomeYuan;
public long scheduleTime;//毫秒 public List<Long> scheduleTime;//毫秒
} }

Loading…
Cancel
Save