...
|
...
|
@@ -35,8 +35,9 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { |
|
|
public MktReportFormRspBO getMktReportForm(MktReportFormReqVO reportFormReqVO) {
|
|
|
//从APP_ACTIVE中获取数据
|
|
|
Map<String, Integer> queryParam = new HashMap<>();
|
|
|
queryParam.put("beginTime", reportFormReqVO.getBeginTime());
|
|
|
queryParam.put("endTime", reportFormReqVO.getEndTime());
|
|
|
queryParam.put("beginTime", 20170322);
|
|
|
queryParam.put("endTime", 20170427);
|
|
|
queryParam.put("channelCode", 1061);
|
|
|
|
|
|
List<AppActive> appActiveList = appActiveDAO.selectActivationAndActualCostByDateId(queryParam);
|
|
|
List<MktReportForm> mktReportFormList = mktReportFormDAO.selectMktReportFormByDateId(queryParam);
|
...
|
...
|
@@ -82,7 +83,13 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { |
|
|
private void setValueToMapForAppActive(Map<Integer, MktReportBean> resultMap, List<AppActive> appActiveList){
|
|
|
for (AppActive appActive : appActiveList) {
|
|
|
Integer dateId = appActive.getDateId();
|
|
|
MktReportBean mktReportBean = new MktReportBean();
|
|
|
MktReportBean mktReportBean = null;
|
|
|
if (resultMap.containsKey(dateId)){
|
|
|
mktReportBean = resultMap.get(dateId);
|
|
|
} else {
|
|
|
mktReportBean = new MktReportBean();
|
|
|
}
|
|
|
|
|
|
setAppActiveData(appActive, mktReportBean);
|
|
|
resultMap.put(dateId, mktReportBean);
|
|
|
}
|
...
|
...
|
@@ -146,6 +153,7 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { |
|
|
List<BigDecimal> androidNewUdidRatioList = Lists.newArrayList();
|
|
|
|
|
|
Iterator it = resultMap.keySet().iterator();
|
|
|
BigDecimal initBigDemical = new BigDecimal(0);
|
|
|
while (it.hasNext()){
|
|
|
Integer dateId = (Integer) it.next();
|
|
|
MktReportBean mktReportBean = resultMap.get(dateId);
|
...
|
...
|
@@ -154,43 +162,59 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { |
|
|
dateIdStrList.add(dateId.toString());
|
|
|
|
|
|
//实际费用
|
|
|
iosActualCostList.add(mktReportBean.getIosActualCost());
|
|
|
androidActualCostList.add(mktReportBean.getAndroidActualCost());
|
|
|
BigDecimal totalActualCost = mktReportBean.getIosActualCost().add(mktReportBean.getAndroidActualCost());
|
|
|
BigDecimal iosActualCost = mktReportBean.getIosActualCost() == null ? new BigDecimal(0) : mktReportBean.getIosActualCost();
|
|
|
iosActualCostList.add(iosActualCost);
|
|
|
|
|
|
BigDecimal androidActualCost = mktReportBean.getAndroidActualCost() == null ? new BigDecimal(0) : mktReportBean.getAndroidActualCost();
|
|
|
androidActualCostList.add(androidActualCost);
|
|
|
|
|
|
BigDecimal totalActualCost = iosActualCost.add(androidActualCost);
|
|
|
totalActualCostList.add(totalActualCost);
|
|
|
|
|
|
//曝光数
|
|
|
iosExposureNumList.add(mktReportBean.getIosExposureNum());
|
|
|
androidExposureNumList.add(mktReportBean.getAndroidExposureNum());
|
|
|
Integer totalExposureNum = mktReportBean.getIosExposureNum() +mktReportBean.getAndroidExposureNum();
|
|
|
Integer iosExposureNum = mktReportBean.getIosExposureNum() == null ? 0 : mktReportBean.getIosExposureNum();
|
|
|
iosExposureNumList.add(iosExposureNum);
|
|
|
|
|
|
Integer androidExposureNum = mktReportBean.getAndroidExposureNum() == null ? 0 : mktReportBean.getAndroidExposureNum();
|
|
|
androidExposureNumList.add(androidExposureNum);
|
|
|
|
|
|
Integer totalExposureNum = iosExposureNum + androidExposureNum;
|
|
|
totalExposureNumList.add(totalExposureNum);
|
|
|
|
|
|
//激活数
|
|
|
iosAppActiveList.add(mktReportBean.getIosAppActive());
|
|
|
androidAppActiveList.add(mktReportBean.getAndroidAppActive());
|
|
|
Integer totalAppActive = mktReportBean.getIosAppActive() + mktReportBean.getAndroidAppActive();
|
|
|
Integer iosAppActive = mktReportBean.getIosAppActive() == null ? 0 : mktReportBean.getIosAppActive();
|
|
|
iosAppActiveList.add(iosAppActive);
|
|
|
|
|
|
Integer androidActive = mktReportBean.getAndroidAppActive() == null ? 0 : mktReportBean.getAndroidAppActive();
|
|
|
androidAppActiveList.add(androidActive);
|
|
|
|
|
|
Integer totalAppActive = iosAppActive + androidActive;
|
|
|
totalAppActiveList.add(totalAppActive);
|
|
|
|
|
|
//新客数
|
|
|
iosNewUserList.add(mktReportBean.getIosNewUdid());
|
|
|
androidNewUserList.add(mktReportBean.getAndroidNewUdid());
|
|
|
Integer totalNewUser = mktReportBean.getIosNewUdid() + mktReportBean.getAndroidNewUdid();
|
|
|
Integer iosNewUser = mktReportBean.getIosNewUdid() == null ? 0 : mktReportBean.getIosNewUdid();
|
|
|
iosNewUserList.add(iosNewUser);
|
|
|
|
|
|
Integer androidNewUser = mktReportBean.getAndroidNewUdid() == null ? 0 : mktReportBean.getAndroidNewUdid();
|
|
|
androidNewUserList.add(androidNewUser);
|
|
|
|
|
|
Integer totalNewUser = iosNewUser + androidNewUser;
|
|
|
totalNewUserList.add(totalNewUser);
|
|
|
|
|
|
//激活转化率
|
|
|
iosActiveRatioList.add(getDivideData(mktReportBean.getIosActualCost(), new BigDecimal(mktReportBean.getIosAppActive())));
|
|
|
androidActiveRatioList.add(getDivideData(mktReportBean.getAndroidActualCost(), new BigDecimal(mktReportBean.getAndroidAppActive())));
|
|
|
iosActiveRatioList.add(getDivideData(iosActualCost, new BigDecimal(iosAppActive)));
|
|
|
androidActiveRatioList.add(getDivideData(androidActualCost, new BigDecimal(androidActive)));
|
|
|
totalActiveRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalAppActive)));
|
|
|
|
|
|
//曝光转化率
|
|
|
iosExposureRatioList.add(getDivideData(mktReportBean.getIosActualCost(), new BigDecimal(mktReportBean.getIosExposureNum())));
|
|
|
androidExposureRatioList.add(getDivideData(mktReportBean.getAndroidActualCost(), new BigDecimal(mktReportBean.getAndroidExposureNum())));
|
|
|
iosExposureRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalExposureNum)));
|
|
|
iosExposureRatioList.add(getDivideData(iosActualCost, new BigDecimal(iosExposureNum)));
|
|
|
androidExposureRatioList.add(getDivideData(androidActualCost, new BigDecimal(androidExposureNum)));
|
|
|
totalExposureRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalExposureNum)));
|
|
|
|
|
|
//新客转化率
|
|
|
iosNewUdidRatioList.add(getDivideData(mktReportBean.getIosActualCost(), new BigDecimal(mktReportBean.getIosNewUdid())));
|
|
|
androidNewUdidRatioList.add(getDivideData(mktReportBean.getAndroidActualCost(), new BigDecimal(mktReportBean.getAndroidNewUdid())));
|
|
|
iosNewUdidRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalNewUser)));
|
|
|
iosNewUdidRatioList.add(getDivideData(iosActualCost, new BigDecimal(iosNewUser)));
|
|
|
androidNewUdidRatioList.add(getDivideData(androidActualCost, new BigDecimal(androidNewUser)));
|
|
|
totalNewUdidRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalNewUser)));
|
|
|
}
|
|
|
|
|
|
MktReportFormRspBO mktReportFormRspBO = new MktReportFormRspBO();
|
...
|
...
|
|