|
|
package com.yoho.unions.channel.service.impl;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.service.model.union.request.MktReportFormReqVO;
|
|
|
import com.yoho.service.model.union.response.MktReportFormRspBO;
|
|
|
import com.yoho.service.model.union.response.PageMktReportFormRspBO;
|
|
|
import com.yoho.unions.channel.service.IMktCostReportFormService;
|
|
|
import com.yoho.unions.dal.IAppActiveDAO;
|
|
|
import com.yoho.unions.dal.IMktReportFormDAO;
|
|
|
import com.yoho.unions.dal.model.AppActive;
|
|
|
import com.yoho.unions.dal.model.MktReportForm;
|
|
|
import com.yoho.unions.dal.model.MktReportWithAppActive;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by yoho on 2017/4/26.
|
|
|
*/
|
|
|
@Service
|
|
|
public class MktCostReportFormServiceImpl implements IMktCostReportFormService {
|
|
|
|
|
|
static Logger logger = LoggerFactory.getLogger(MktCostReportFormServiceImpl.class);
|
|
|
|
|
|
@Autowired
|
|
|
private IMktReportFormDAO mktReportFormDAO;
|
|
|
|
|
|
@Autowired
|
|
|
private IAppActiveDAO appActiveDAO;
|
|
|
|
|
|
@Override
|
|
|
public MktReportFormRspBO getMktReportForm(MktReportFormReqVO reportFormReqVO) {
|
|
|
MktReportFormRspBO pageMktReportFormRspBO = new MktReportFormRspBO();
|
|
|
|
|
|
//从APP_ACTIVE中获取数据
|
|
|
Map<String, Integer> queryParam = new HashMap<>();
|
|
|
queryParam.put("beginTime", reportFormReqVO.getBeginTime());
|
|
|
queryParam.put("endTime", reportFormReqVO.getEndTime());
|
|
|
|
|
|
List<AppActive> appActiveList = appActiveDAO.selectActivationAndActualCostByDateId(queryParam);
|
|
|
List<MktReportForm> mktReportFormList = mktReportFormDAO.selectMktReportFormByDateId(queryParam);
|
|
|
|
|
|
List<String> dateIdStrList = Lists.newArrayList();
|
|
|
List<String> totalActualCostList = Lists.newArrayList();
|
|
|
List<String> iosActualCostList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
// List<String> dateIdStrList = Lists.newArrayList();
|
|
|
|
|
|
// int resultSize = appActiveList.size() > mktReportFormList.size() ? appActiveList.size() : mktReportFormList.size();
|
|
|
//
|
|
|
//
|
|
|
// if ((!appActiveList.isEmpty()) && (!mktReportFormList.isEmpty())){
|
|
|
// boolean flag = appActiveList.size() > mktReportFormList.size() ? true : false;
|
|
|
// if (flag){
|
|
|
//
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
private void mergeData(List<AppActive> appActiveList, List<MktReportForm> mktReportFormList){
|
|
|
List<MktReportWithAppActive> mktReportWithAppActiveList = Lists.newArrayList();
|
|
|
Set<Integer> dateIdSet = new TreeSet<>();
|
|
|
|
|
|
for (AppActive active : appActiveList){
|
|
|
dateIdSet.add(active.getDateId());
|
|
|
}
|
|
|
|
|
|
for (MktReportForm mktReportForm : mktReportFormList){
|
|
|
dateIdSet.add(mktReportForm.getDateId());
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int minDateId = appActiveList.get(0).getDateId() < mktReportFormList.get(0).getDateId() ? appActiveList.get(0).getDateId() : mktReportFormList.get(0).getDateId();
|
|
|
int maxDateId = appActiveList.get(appActiveList.size() - 1).getDateId() > mktReportFormList.get(mktReportFormList.size() - 1).getDateId() ? appActiveList.get(appActiveList.size() - 1).getDateId() : mktReportFormList.get(mktReportFormList.size() - 1).getDateId();
|
|
|
|
|
|
for (int dateId = minDateId; maxDateId <= maxDateId){
|
|
|
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|