|
@@ -138,26 +138,25 @@ public class YtAppUserServiceImpl implements YtAppUserService {
|
|
|
public ResultTable<YtUserEcpmListView> ecpmList(String userId) {
|
|
public ResultTable<YtUserEcpmListView> ecpmList(String userId) {
|
|
|
ResultTable<YtDyzAdRecord> table = appFeign.adRecords(userId);
|
|
ResultTable<YtDyzAdRecord> table = appFeign.adRecords(userId);
|
|
|
List<YtDyzAdRecord> data = table.getData();
|
|
List<YtDyzAdRecord> data = table.getData();
|
|
|
- if(CollUtil.isNotEmpty(data)){
|
|
|
|
|
|
|
+ if(CollUtil.isEmpty(data)){
|
|
|
return ResultTable.resultTableOk(new PageInfo<>(data));
|
|
return ResultTable.resultTableOk(new PageInfo<>(data));
|
|
|
}
|
|
}
|
|
|
//远程调用获取广告报告
|
|
//远程调用获取广告报告
|
|
|
- ComprehensiveReportView<ComprehensiveAdSourceReport> resultData = getComprehensiveReport(data);
|
|
|
|
|
- List<ComprehensiveAdSourceReport> records = resultData.getRecords();
|
|
|
|
|
|
|
+ List<ComprehensiveAppReport> resultData = getComprehensiveReport(data);
|
|
|
//组装数据返回前端
|
|
//组装数据返回前端
|
|
|
- combineEcpmData(records,data);
|
|
|
|
|
|
|
+ combineEcpmData(resultData,data);
|
|
|
return ResultTable.resultTableOk(new PageInfo<>(data));
|
|
return ResultTable.resultTableOk(new PageInfo<>(data));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 组装ECPM数据返回
|
|
* 组装ECPM数据返回
|
|
|
*/
|
|
*/
|
|
|
- private void combineEcpmData(List<ComprehensiveAdSourceReport> records, List<YtDyzAdRecord> data) {
|
|
|
|
|
- Map<Integer,ComprehensiveAdSourceReport> adSourceReportMap = records.stream().collect(
|
|
|
|
|
|
|
+ private void combineEcpmData(List<ComprehensiveAppReport> records, List<YtDyzAdRecord> data) {
|
|
|
|
|
+ Map<Integer,ComprehensiveAppReport> adSourceReportMap = records.stream().collect(
|
|
|
Collectors.toMap(s->s.getAdSource().getAdsource_id(), O->O));
|
|
Collectors.toMap(s->s.getAdSource().getAdsource_id(), O->O));
|
|
|
for (YtDyzAdRecord datum : data) {
|
|
for (YtDyzAdRecord datum : data) {
|
|
|
if(!adSourceReportMap.containsKey(datum.getAdSourceId()))continue;
|
|
if(!adSourceReportMap.containsKey(datum.getAdSourceId()))continue;
|
|
|
- ComprehensiveAdSourceReport report = adSourceReportMap.get(datum.getAdSourceId());
|
|
|
|
|
|
|
+ ComprehensiveAppReport report = adSourceReportMap.get(datum.getAdSourceId());
|
|
|
datum.setRequest(report.getRequest());
|
|
datum.setRequest(report.getRequest());
|
|
|
datum.setFillrate(report.getFillrate());
|
|
datum.setFillrate(report.getFillrate());
|
|
|
datum.setImpression(report.getImpression());
|
|
datum.setImpression(report.getImpression());
|
|
@@ -173,7 +172,7 @@ public class YtAppUserServiceImpl implements YtAppUserService {
|
|
|
/**
|
|
/**
|
|
|
* 远程调用广告API获取报告
|
|
* 远程调用广告API获取报告
|
|
|
*/
|
|
*/
|
|
|
- private ComprehensiveReportView<ComprehensiveAdSourceReport> getComprehensiveReport(List<YtDyzAdRecord> data) {
|
|
|
|
|
|
|
+ private List<ComprehensiveAppReport> getComprehensiveReport(List<YtDyzAdRecord> data) {
|
|
|
List<Integer> collect = data.stream().map(YtDyzAdRecord::getAdSourceId).collect(Collectors.toList());
|
|
List<Integer> collect = data.stream().map(YtDyzAdRecord::getAdSourceId).collect(Collectors.toList());
|
|
|
ComprehensiveReportParam param = new ComprehensiveReportParam();
|
|
ComprehensiveReportParam param = new ComprehensiveReportParam();
|
|
|
param.setStartdate(DateUtil.getDateNum(LocalDate.now().minusDays(7)));
|
|
param.setStartdate(DateUtil.getDateNum(LocalDate.now().minusDays(7)));
|
|
@@ -181,8 +180,7 @@ public class YtAppUserServiceImpl implements YtAppUserService {
|
|
|
param.setTime_zone("UTC-8");
|
|
param.setTime_zone("UTC-8");
|
|
|
param.setAdsource_id_list(collect);
|
|
param.setAdsource_id_list(collect);
|
|
|
param.setGroup_by(Collections.singletonList("adsource"));
|
|
param.setGroup_by(Collections.singletonList("adsource"));
|
|
|
- Result<ComprehensiveReportView> result = advertiseFeign.comprehensive(param);
|
|
|
|
|
- return result.getData();
|
|
|
|
|
|
|
+ return advertiseFeign.getAppReport(param);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|