Authored by zhengwen.ge

Merge branch 'dev_0426_总成本报表需求'

... ... @@ -70,6 +70,10 @@
<artifactId>yoho-message-sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yoho.service.model</groupId>
<artifactId>union-service-model</artifactId>
</dependency>
</dependencies>
... ...
package com.yoho.unions.channel.restapi;
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.unions.channel.service.IMktCostReportFormService;
import com.yoho.unions.common.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
/**
* Created by yoho on 2017/4/26.
*/
@Controller
@RequestMapping("/mktReportForm")
public class MktCostReportFormController {
static Logger logger = LoggerFactory.getLogger(MktCostReportFormController.class);
@Autowired
IMktCostReportFormService mktCostReportFormService;
@RequestMapping("/getMktReportForm")
@ResponseBody
public ApiResponse getMktReportForm(MktReportFormReqVO mktReportFormReqVO){
logger.info("enter getMktReportForm. param mktReportFormReqVO={}", mktReportFormReqVO);
try {
MktReportFormRspBO mktReportFormRspBO = mktCostReportFormService.getMktReportForm(mktReportFormReqVO);
// MktReportFormRspBO mktReportFormRspBO = new MktReportFormRspBO();
// List<String> dateIdStrList = Lists.newArrayList();
// List<BigDecimal> totalActuralCostList = Lists.newArrayList();
// List<BigDecimal> iosActualCostList = Lists.newArrayList();
// List<BigDecimal> androidActualCostList = Lists.newArrayList();
// List<Integer> totalExpoureNumList = Lists.newArrayList();
// List<Integer> iosExpoureNumList = Lists.newArrayList();
// List<Integer> androidExpoureNumList = Lists.newArrayList();
// List<Integer> totalActiveList = Lists.newArrayList();
// List<Integer> iosActiveList = Lists.newArrayList();
// List<Integer> androidActiveList = Lists.newArrayList();
// List<Integer> totalNewUdidList = Lists.newArrayList();
// List<Integer> iosNewUdidList = Lists.newArrayList();
// List<Integer> androidNewUdidList = Lists.newArrayList();
// List<BigDecimal> totalActiveRatio = Lists.newArrayList();
// List<BigDecimal> iosActiveRatio = Lists.newArrayList();
// List<BigDecimal> androidActiveRatio = Lists.newArrayList();
// List<BigDecimal> totalExpoureRatio = Lists.newArrayList();
// List<BigDecimal> iosExpoureRatio = Lists.newArrayList();
// List<BigDecimal> androidExpoureRatio = Lists.newArrayList();
// List<BigDecimal> totalNewUdidRatio = Lists.newArrayList();
// List<BigDecimal> iosNewUdidRatio = Lists.newArrayList();
// List<BigDecimal> androidNewUdidRatio = Lists.newArrayList();
//
// for (Integer i = 0; i <=6; i++){
// dateIdStrList.add("2017042" + i.toString());
// totalActuralCostList.add(new BigDecimal(5000 - i * 100));
// iosActualCostList.add(new BigDecimal(4000 - i * 80));
// androidActualCostList.add(new BigDecimal(1000 - i * 20));
// totalExpoureNumList.add(1000 - i * 100);
// iosExpoureNumList.add(600 - i * 60);
// androidExpoureNumList.add(400 - i * 40);
// totalActiveList.add(2000 - i * 200);
// iosActiveList.add(1500 - i * 150);
// androidActiveList.add(500 - i * 50);
// totalNewUdidList.add(100 - i * 10);
// iosNewUdidList.add(70 - i * 7);
// androidNewUdidList.add(30 - i * 3);
//
// totalActiveRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalActiveList.get(i))));
// iosActiveRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosActiveList.get(i))));
// androidActiveRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidActiveList.get(i))));
// totalExpoureRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalExpoureNumList.get(i))));
// iosExpoureRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosExpoureNumList.get(i))));
// androidExpoureRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidExpoureNumList.get(i))));
// totalNewUdidRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalNewUdidList.get(i))));
// iosNewUdidRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosNewUdidList.get(i))));
// androidNewUdidRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidNewUdidList.get(i))));
// }
//
// mktReportFormRspBO.setDateIdStrList(dateIdStrList);
// mktReportFormRspBO.setTotalActualCostList(totalActuralCostList);
// mktReportFormRspBO.setIosActualCostList(iosActualCostList);
// mktReportFormRspBO.setAndroidActualCostList(androidActualCostList);
// mktReportFormRspBO.setTotalExposureNumList(totalExpoureNumList);
// mktReportFormRspBO.setIosExposureNumList(iosExpoureNumList);
// mktReportFormRspBO.setAndroidExposureNumList(androidExpoureNumList);
// mktReportFormRspBO.setTotalAppActiveList(totalActiveList);
// mktReportFormRspBO.setIosAppActiveList(iosActiveList);
// mktReportFormRspBO.setAndroidAppActiveList(androidActiveList);
// mktReportFormRspBO.setTotalNewUserList(totalNewUdidList);
// mktReportFormRspBO.setIosNewUserList(iosNewUdidList);
// mktReportFormRspBO.setAndroidNewUserList(androidNewUdidList);
//
// mktReportFormRspBO.setTopActualCost(Collections.max(totalActuralCostList));
//// mktReportFormRspBO.setTopAppActive(Collections.max(totalActiveList));
//// mktReportFormRspBO.setTopExpoureNum(Collections.max(totalExpoureNumList));
//// mktReportFormRspBO.setTopNewUdid(Collections.max(totalNewUdidList));
//
//
// mktReportFormRspBO.setTotalActiveRatioList(totalActiveRatio);
// mktReportFormRspBO.setIosActiveRatioList(iosActiveRatio);
// mktReportFormRspBO.setAndroidActiveRatioList(androidActiveRatio);
// mktReportFormRspBO.setTotalExposureRatioList(totalExpoureRatio);
// mktReportFormRspBO.setIosExposureRatioList(iosExpoureRatio);
// mktReportFormRspBO.setAndroidExposureRatioList(androidExpoureRatio);
// mktReportFormRspBO.setTotalNewUdidRatioList(totalNewUdidRatio);
// mktReportFormRspBO.setIosNewUdidRatioList(iosNewUdidRatio);
// mktReportFormRspBO.setAndroidNewUdidRatioList(androidNewUdidRatio);
//
//// mktReportFormRspBO.setTopActiveRatio(Collections.max(totalActiveRatio));
//// mktReportFormRspBO.setTopNewUdidRatio(Collections.max(totalNewUdidRatio));
//// mktReportFormRspBO.setTopExpoureRatio(Collections.max(totalExpoureRatio));
// BigDecimal topRatio = Collections.max(totalActiveRatio);
// if (topRatio.compareTo(Collections.max(totalNewUdidRatio)) < 0){
// topRatio = Collections.max(totalNewUdidRatio);
// } else if (topRatio.compareTo(Collections.max(totalExpoureRatio)) < 0){
// topRatio = Collections.max(totalExpoureRatio);
// }
// mktReportFormRspBO.setTopRatio(topRatio);
//
// Integer topExActNew = Collections.max(totalActiveList);
// if (topExActNew < Collections.max(totalExpoureNumList)){
// topExActNew = Collections.max(totalExpoureNumList);
// } else if (topExActNew < Collections.max(totalNewUdidList)){
// topExActNew = Collections.max(totalNewUdidList);
// }
// mktReportFormRspBO.setTopExposureActiveNewUdid(topExActNew);
return new ApiResponse.ApiResponseBuilder().code(200).data(mktReportFormRspBO).message("success").build();
} catch (Exception e){
logger.warn("getMktReportForm occurs Exception e {}",e.getMessage());
return new ApiResponse.ApiResponseBuilder().code(500).message("失败").build();
}
}
// private BigDecimal getDivideData(BigDecimal d1,BigDecimal d2){
//
// if(d2.compareTo(new BigDecimal(0)) == 0){
// return new BigDecimal(0);
// }
// return d1.divide(d2,2,BigDecimal.ROUND_HALF_UP);
// }
}
... ...
package com.yoho.unions.channel.service;
import com.yoho.service.model.union.request.MktReportFormReqVO;
import com.yoho.service.model.union.response.MktReportFormRspBO;
/**
* Created by yoho on 2017/4/26.
*/
public interface IMktCostReportFormService {
MktReportFormRspBO getMktReportForm(MktReportFormReqVO reportFormReqVO);
}
... ...
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.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.MktReportBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
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) {
Map<String, Integer> queryParam = new HashMap<>();
queryParam.put("beginTime", reportFormReqVO.getBeginTime());
queryParam.put("endTime", reportFormReqVO.getEndTime());
queryParam.put("channelCode", 1061);
List<AppActive> appActiveList = appActiveDAO.selectActivationAndActualCostByDateId(queryParam);
List<MktReportForm> mktReportFormList = mktReportFormDAO.selectMktReportFormByDateId(queryParam);
Map<Integer, MktReportBean> resultMap = mergeData(appActiveList, mktReportFormList);
if (!resultMap.isEmpty()){
logger.info("getMktReportForm impl resultMap size is : " + resultMap.size());
} else {
logger.info("getMktReportForm impl resultMap size is : zero");
}
MktReportFormRspBO rspBO = composingResult(resultMap);
return rspBO;
}
private Map<Integer, MktReportBean> mergeData(List<AppActive> appActiveList, List<MktReportForm> mktReportFormList) {
Map<Integer, MktReportBean> resultMap = new TreeMap<>();
if ((!appActiveList.isEmpty()) && !mktReportFormList.isEmpty())
{
setValueToMapForAppActive(resultMap, appActiveList);
for (MktReportForm mktReportForm : mktReportFormList){
Integer dateId = mktReportForm.getDateId();
MktReportBean mktReportBean = null;
if (!resultMap.containsKey(dateId)){
mktReportBean = new MktReportBean();
setMktReportData(mktReportForm, mktReportBean);
} else {
mktReportBean = resultMap.get(mktReportForm.getDateId());
setMktReportData(mktReportForm, mktReportBean);
}
resultMap.put(dateId, mktReportBean);
}
} else if (!appActiveList.isEmpty()){
setValueToMapForAppActive(resultMap, appActiveList);
} else if (!mktReportFormList.isEmpty()){
setValueToMapForMktReportForm(resultMap, mktReportFormList);
} else {
resultMap = null;
}
return resultMap;
}
private void setValueToMapForAppActive(Map<Integer, MktReportBean> resultMap, List<AppActive> appActiveList){
for (AppActive appActive : appActiveList) {
Integer dateId = appActive.getDateId();
MktReportBean mktReportBean = null;
if (resultMap.containsKey(dateId)){
mktReportBean = resultMap.get(dateId);
} else {
mktReportBean = new MktReportBean();
}
setAppActiveData(appActive, mktReportBean);
resultMap.put(dateId, mktReportBean);
}
}
private void setValueToMapForMktReportForm(Map<Integer, MktReportBean> resultMap, List<MktReportForm> mktReportFormList){
for (MktReportForm mktReportForm : mktReportFormList) {
Integer dateId = mktReportForm.getDateId();
MktReportBean mktReportBean = new MktReportBean();
setMktReportData(mktReportForm, mktReportBean);
resultMap.put(dateId, mktReportBean);
}
}
private void setAppActiveData(AppActive appActive, MktReportBean mktReportBean){
if (null != appActive){
if ("yohobuy_ios".equals(appActive.getAppKey())){
mktReportBean.setIosAppActive(appActive.getAppActive());
mktReportBean.setIosNewUdid(appActive.getNewUdid());
} else if ("yohobuy_android".equals(appActive.getAppKey())){
mktReportBean.setAndroidAppActive(appActive.getAppActive());
mktReportBean.setAndroidNewUdid(appActive.getNewUdid());
}
}
}
private void setMktReportData(MktReportForm mktReportForm, MktReportBean mktReportBean){
if (null != mktReportForm){
if (1 == mktReportForm.getDeviceType()){
mktReportBean.setIosActualCost(mktReportForm.getActualCost());
mktReportBean.setIosExposureNum(mktReportForm.getExposureNum());
} else if (2 == mktReportForm.getDeviceType()){
mktReportBean.setAndroidActualCost(mktReportForm.getActualCost());
mktReportBean.setAndroidExposureNum(mktReportForm.getExposureNum());
}
}
}
private MktReportFormRspBO composingResult(Map<Integer, MktReportBean> resultMap){
if (null == resultMap){
return null;
}
List<String> dateIdStrList = Lists.newArrayList();
List<BigDecimal> totalActualCostList = Lists.newArrayList();
List<BigDecimal> iosActualCostList = Lists.newArrayList();
List<BigDecimal> androidActualCostList = Lists.newArrayList();
List<Integer> totalAppActiveList = Lists.newArrayList();
List<Integer> iosAppActiveList = Lists.newArrayList();
List<Integer> androidAppActiveList = Lists.newArrayList();
List<Integer> totalExposureNumList = Lists.newArrayList();
List<Integer> iosExposureNumList = Lists.newArrayList();
List<Integer> androidExposureNumList = Lists.newArrayList();
List<Integer> totalNewUserList = Lists.newArrayList();
List<Integer> iosNewUserList = Lists.newArrayList();
List<Integer> androidNewUserList = Lists.newArrayList();
List<BigDecimal> totalActiveRatioList = Lists.newArrayList();
List<BigDecimal> iosActiveRatioList = Lists.newArrayList();
List<BigDecimal> androidActiveRatioList = Lists.newArrayList();
List<BigDecimal> totalExposureRatioList = Lists.newArrayList();
List<BigDecimal> iosExposureRatioList = Lists.newArrayList();
List<BigDecimal> androidExposureRatioList = Lists.newArrayList();
List<BigDecimal> totalNewUdidRatioList = Lists.newArrayList();
List<BigDecimal> iosNewUdidRatioList = Lists.newArrayList();
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);
//日期
dateIdStrList.add(dateId.toString());
//实际费用
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);
//曝光数
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);
//激活数
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);
//新客数
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(iosActualCost, new BigDecimal(iosAppActive)));
androidActiveRatioList.add(getDivideData(androidActualCost, new BigDecimal(androidActive)));
totalActiveRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalAppActive)));
//曝光转化率
iosExposureRatioList.add(getDivideData(iosActualCost, new BigDecimal(iosExposureNum)));
androidExposureRatioList.add(getDivideData(androidActualCost, new BigDecimal(androidExposureNum)));
totalExposureRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalExposureNum)));
//新客转化率
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();
//日期
mktReportFormRspBO.setDateIdStrList(dateIdStrList);
//实际费用
mktReportFormRspBO.setIosActualCostList(iosActualCostList);
mktReportFormRspBO.setAndroidActualCostList(androidActualCostList);
mktReportFormRspBO.setTotalActualCostList(totalActualCostList);
//曝光量
mktReportFormRspBO.setIosExposureNumList(iosExposureNumList);
mktReportFormRspBO.setAndroidExposureNumList(androidExposureNumList);
mktReportFormRspBO.setTotalExposureNumList(totalExposureNumList);
//激活量
mktReportFormRspBO.setIosAppActiveList(iosAppActiveList);
mktReportFormRspBO.setAndroidAppActiveList(androidAppActiveList);
mktReportFormRspBO.setTotalAppActiveList(totalAppActiveList);
//新客量
mktReportFormRspBO.setIosNewUserList(iosNewUserList);
mktReportFormRspBO.setAndroidNewUserList(androidNewUserList);
mktReportFormRspBO.setTotalNewUserList(totalNewUserList);
//曝光转化率
mktReportFormRspBO.setIosExposureRatioList(iosExposureRatioList);
mktReportFormRspBO.setAndroidExposureRatioList(androidExposureRatioList);
mktReportFormRspBO.setTotalExposureRatioList(totalExposureRatioList);
//激活转化率
mktReportFormRspBO.setIosActiveRatioList(iosActiveRatioList);
mktReportFormRspBO.setAndroidActiveRatioList(androidActiveRatioList);
mktReportFormRspBO.setTotalActiveRatioList(totalActiveRatioList);
//新客转化率
mktReportFormRspBO.setIosNewUdidRatioList(iosNewUdidRatioList);
mktReportFormRspBO.setAndroidNewUdidRatioList(androidNewUdidRatioList);
mktReportFormRspBO.setTotalNewUdidRatioList(totalNewUdidRatioList);
BigDecimal topRatio = Collections.max(totalExposureRatioList);
if (topRatio.compareTo(Collections.max(totalActiveRatioList)) < 0)
{
topRatio = Collections.max(totalActiveRatioList);
} else if (topRatio.compareTo(Collections.max(totalNewUdidRatioList)) < 0){
topRatio = Collections.max(totalNewUdidRatioList);
}
mktReportFormRspBO.setTopRatio(topRatio);
Integer topExActNew = Collections.max(totalAppActiveList);
if (topExActNew < Collections.max(totalExposureNumList)){
topExActNew = Collections.max(totalExposureNumList);
} else if (topExActNew < Collections.max(totalNewUserList)){
topExActNew = Collections.max(totalNewUserList);
}
mktReportFormRspBO.setTopExposureActiveNewUdid(topExActNew);
return mktReportFormRspBO;
}
private BigDecimal getDivideData(BigDecimal d1,BigDecimal d2){
if(d2.compareTo(new BigDecimal(0)) == 0){
return new BigDecimal(0);
}
return d1.divide(d2,4,BigDecimal.ROUND_HALF_UP);
}
}
... ...
... ... @@ -63,6 +63,7 @@
<value>/LoginController/loginForPid.do</value>
<value>/batch/export.do</value>
<value>/batch/import</value>
<value>/mktReportForm/getMktReportForm</value>
</list>
</property>
<property name="excludeMethods">
... ...
package com.yoho.unions.dal;
import com.yoho.unions.dal.model.AppActive;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface IAppActiveDAO {
int deleteByPrimaryKey(Integer id);
int insert(AppActive record);
int insertSelective(AppActive record);
AppActive selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AppActive record);
int updateByPrimaryKey(AppActive record);
List<AppActive> selectActivationAndActualCostByDateId(@Param("params") Map<String, Integer> params);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal;
import com.yoho.unions.dal.model.MktReportForm;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface IMktReportFormDAO {
int deleteByPrimaryKey(Integer id);
int insert(MktReportForm record);
int insertSelective(MktReportForm record);
MktReportForm selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(MktReportForm record);
int updateByPrimaryKey(MktReportForm record);
List<MktReportForm> selectMktReportFormByDateId(@Param("params") Map<String, Integer> params);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
public class AppActive {
private Integer id;
private Integer dateId;
private Integer appActive;
private String appKey;
private Integer newUdid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getDateId() {
return dateId;
}
public void setDateId(Integer dateId) {
this.dateId = dateId;
}
public Integer getAppActive() {
return appActive;
}
public void setAppActive(Integer appActive) {
this.appActive = appActive;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey == null ? null : appKey.trim();
}
public Integer getNewUdid() {
return newUdid;
}
public void setNewUdid(Integer newUdid) {
this.newUdid = newUdid;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof AppActive) {
AppActive appActive = (AppActive) obj;
return this.getDateId() == appActive.getDateId();
}
return super.equals(obj);
}
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
import java.math.BigDecimal;
/**
* Created by yoho on 2017/4/26.
*/
public class MktReportBean {
private Integer dateId;
private BigDecimal totalActualCost;
private BigDecimal iosActualCost;
private BigDecimal androidActualCost;
private Integer totalAppActive;
private Integer androidAppActive;
private Integer iosAppActive;
private Integer totalNewUdid;
private Integer iosNewUdid;
private Integer androidNewUdid;
private Integer totalExposureNum;
private Integer iosExposureNum;
private Integer androidExposureNum;
private Integer divisionCode;
private Integer businessCode;
private Integer classCode;
private Integer channelCode;
public Integer getDateId() {
return dateId;
}
public void setDateId(Integer dateId) {
this.dateId = dateId;
}
public BigDecimal getTotalActualCost() {
return totalActualCost;
}
public void setTotalActualCost(BigDecimal totalActualCost) {
this.totalActualCost = totalActualCost;
}
public BigDecimal getIosActualCost() {
return iosActualCost;
}
public void setIosActualCost(BigDecimal iosActualCost) {
this.iosActualCost = iosActualCost;
}
public BigDecimal getAndroidActualCost() {
return androidActualCost;
}
public void setAndroidActualCost(BigDecimal androidActualCost) {
this.androidActualCost = androidActualCost;
}
public Integer getTotalAppActive() {
return totalAppActive;
}
public void setTotalAppActive(Integer totalAppActive) {
this.totalAppActive = totalAppActive;
}
public Integer getAndroidAppActive() {
return androidAppActive;
}
public void setAndroidAppActive(Integer androidAppActive) {
this.androidAppActive = androidAppActive;
}
public Integer getIosAppActive() {
return iosAppActive;
}
public void setIosAppActive(Integer iosAppActive) {
this.iosAppActive = iosAppActive;
}
public Integer getTotalNewUdid() {
return totalNewUdid;
}
public void setTotalNewUdid(Integer totalNewUdid) {
this.totalNewUdid = totalNewUdid;
}
public Integer getIosNewUdid() {
return iosNewUdid;
}
public void setIosNewUdid(Integer iosNewUdid) {
this.iosNewUdid = iosNewUdid;
}
public Integer getAndroidNewUdid() {
return androidNewUdid;
}
public void setAndroidNewUdid(Integer androidNewUdid) {
this.androidNewUdid = androidNewUdid;
}
public Integer getTotalExposureNum() {
return totalExposureNum;
}
public void setTotalExposureNum(Integer totalExposureNum) {
this.totalExposureNum = totalExposureNum;
}
public Integer getIosExposureNum() {
return iosExposureNum;
}
public void setIosExposureNum(Integer iosExposureNum) {
this.iosExposureNum = iosExposureNum;
}
public Integer getAndroidExposureNum() {
return androidExposureNum;
}
public void setAndroidExposureNum(Integer androidExposureNum) {
this.androidExposureNum = androidExposureNum;
}
public Integer getDivisionCode() {
return divisionCode;
}
public void setDivisionCode(Integer divisionCode) {
this.divisionCode = divisionCode;
}
public Integer getBusinessCode() {
return businessCode;
}
public void setBusinessCode(Integer businessCode) {
this.businessCode = businessCode;
}
public Integer getClassCode() {
return classCode;
}
public void setClassCode(Integer classCode) {
this.classCode = classCode;
}
public Integer getChannelCode() {
return channelCode;
}
public void setChannelCode(Integer channelCode) {
this.channelCode = channelCode;
}
}
... ...
package com.yoho.unions.dal.model;
import java.math.BigDecimal;
public class MktReportForm {
private Integer id;
private BigDecimal bookConsum;
private BigDecimal actualCost;
private Integer dateId;
private Integer createTime;
private Integer deviceType;
private Integer divisionCode;
private Integer businessCode;
private Integer classCode;
private Integer channelCode;
private Integer exposureNum;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public BigDecimal getBookConsum() {
return bookConsum;
}
public void setBookConsum(BigDecimal bookConsum) {
this.bookConsum = bookConsum;
}
public BigDecimal getActualCost() {
return actualCost;
}
public void setActualCost(BigDecimal actualCost) {
this.actualCost = actualCost;
}
public Integer getDateId() {
return dateId;
}
public void setDateId(Integer dateId) {
this.dateId = dateId;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getDeviceType() {
return deviceType;
}
public void setDeviceType(Integer deviceType) {
this.deviceType = deviceType;
}
public Integer getDivisionCode() {
return divisionCode;
}
public void setDivisionCode(Integer divisionCode) {
this.divisionCode = divisionCode;
}
public Integer getBusinessCode() {
return businessCode;
}
public void setBusinessCode(Integer businessCode) {
this.businessCode = businessCode;
}
public Integer getClassCode() {
return classCode;
}
public void setClassCode(Integer classCode) {
this.classCode = classCode;
}
public Integer getChannelCode() {
return channelCode;
}
public void setChannelCode(Integer channelCode) {
this.channelCode = channelCode;
}
public Integer getExposureNum() {
return exposureNum;
}
public void setExposureNum(Integer exposureNum) {
this.exposureNum = exposureNum;
}
@Override
public String toString() {
return "MktReportForm{" +
"id=" + id +
", bookConsum=" + bookConsum +
", actualCost=" + actualCost +
", dateId=" + dateId +
", createTime=" + createTime +
", deviceType=" + deviceType +
", divisionCode=" + divisionCode +
", businessCode=" + businessCode +
", classCode=" + classCode +
", channelCode=" + channelCode +
", exposureNum=" + exposureNum +
'}';
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.IAppActiveDAO" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.AppActive" >
<id column="ID" property="id" jdbcType="INTEGER" />
<result column="DATE_ID" property="dateId" jdbcType="INTEGER" />
<result column="APP_ACTIVE" property="appActive" jdbcType="INTEGER" />
<result column="app_key" property="appKey" jdbcType="VARCHAR" />
<result column="NEW_UDID" property="newUdid" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
ID, DATE_ID, APP_ACTIVE, app_key, NEW_UDID
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from APP_ACTIVE
where ID = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from APP_ACTIVE
where ID = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.AppActive" >
insert into APP_ACTIVE (ID, DATE_ID, APP_ACTIVE,
app_key, NEW_UDID)
values (#{id,jdbcType=INTEGER}, #{dateId,jdbcType=INTEGER}, #{appActive,jdbcType=INTEGER},
#{appKey,jdbcType=VARCHAR}, #{newUdid,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.AppActive" >
insert into APP_ACTIVE
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="dateId != null" >
DATE_ID,
</if>
<if test="appActive != null" >
APP_ACTIVE,
</if>
<if test="appKey != null" >
app_key,
</if>
<if test="newUdid != null" >
NEW_UDID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="dateId != null" >
#{dateId,jdbcType=INTEGER},
</if>
<if test="appActive != null" >
#{appActive,jdbcType=INTEGER},
</if>
<if test="appKey != null" >
#{appKey,jdbcType=VARCHAR},
</if>
<if test="newUdid != null" >
#{newUdid,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.AppActive" >
update APP_ACTIVE
<set >
<if test="dateId != null" >
DATE_ID = #{dateId,jdbcType=INTEGER},
</if>
<if test="appActive != null" >
APP_ACTIVE = #{appActive,jdbcType=INTEGER},
</if>
<if test="appKey != null" >
app_key = #{appKey,jdbcType=VARCHAR},
</if>
<if test="newUdid != null" >
NEW_UDID = #{newUdid,jdbcType=INTEGER},
</if>
</set>
where ID = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.AppActive" >
update APP_ACTIVE
set DATE_ID = #{dateId,jdbcType=INTEGER},
APP_ACTIVE = #{appActive,jdbcType=INTEGER},
app_key = #{appKey,jdbcType=VARCHAR},
NEW_UDID = #{newUdid,jdbcType=INTEGER}
where ID = #{id,jdbcType=INTEGER}
</update>
<select id="selectActivationAndActualCostByDateId" parameterType="java.util.Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from APP_ACTIVE
<include refid="WHERE_CONDITION"/>
</select>
<sql id="WHERE_CONDITION">
<trim prefix="where" prefixOverrides="and | or">
<if test="params.beginTime != null and params.beginTime != ''"><![CDATA[ and DATE_ID>=#{params.beginTime}]]></if>
<if test="params.endTime != null and params.endTime != ''"><![CDATA[ and DATE_ID<=#{params.endTime}]]></if>
</trim>
</sql>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.IMktReportFormDAO" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.MktReportForm" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="book_consum" property="bookConsum" jdbcType="DECIMAL" />
<result column="actual_cost" property="actualCost" jdbcType="DECIMAL" />
<result column="date_id" property="dateId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="device_type" property="deviceType" jdbcType="INTEGER" />
<result column="division_code" property="divisionCode" jdbcType="INTEGER" />
<result column="business_code" property="businessCode" jdbcType="INTEGER" />
<result column="class_code" property="classCode" jdbcType="INTEGER" />
<result column="channel_code" property="channelCode" jdbcType="INTEGER" />
<result column="exposure_num" property="exposureNum" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, book_consum, actual_cost, date_id, create_time, device_type, division_code, business_code,
class_code, channel_code, exposure_num
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from mkt_report_form
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from mkt_report_form
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.MktReportForm" >
insert into mkt_report_form (id, book_consum, actual_cost,
date_id, create_time, device_type,
division_code, business_code, class_code,
channel_code, exposure_num)
values (#{id,jdbcType=INTEGER}, #{bookConsum,jdbcType=DECIMAL}, #{actualCost,jdbcType=DECIMAL},
#{dateId,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, #{deviceType,jdbcType=INTEGER},
#{divisionCode,jdbcType=INTEGER}, #{businessCode,jdbcType=INTEGER}, #{classCode,jdbcType=INTEGER},
#{channelCode,jdbcType=INTEGER}, #{exposureNum,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.MktReportForm" >
insert into mkt_report_form
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="bookConsum != null" >
book_consum,
</if>
<if test="actualCost != null" >
actual_cost,
</if>
<if test="dateId != null" >
date_id,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="deviceType != null" >
device_type,
</if>
<if test="divisionCode != null" >
division_code,
</if>
<if test="businessCode != null" >
business_code,
</if>
<if test="classCode != null" >
class_code,
</if>
<if test="channelCode != null" >
channel_code,
</if>
<if test="exposureNum != null" >
exposure_num,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="bookConsum != null" >
#{bookConsum,jdbcType=DECIMAL},
</if>
<if test="actualCost != null" >
#{actualCost,jdbcType=DECIMAL},
</if>
<if test="dateId != null" >
#{dateId,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="deviceType != null" >
#{deviceType,jdbcType=INTEGER},
</if>
<if test="divisionCode != null" >
#{divisionCode,jdbcType=INTEGER},
</if>
<if test="businessCode != null" >
#{businessCode,jdbcType=INTEGER},
</if>
<if test="classCode != null" >
#{classCode,jdbcType=INTEGER},
</if>
<if test="channelCode != null" >
#{channelCode,jdbcType=INTEGER},
</if>
<if test="exposureNum != null" >
#{exposureNum,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.MktReportForm" >
update mkt_report_form
<set >
<if test="bookConsum != null" >
book_consum = #{bookConsum,jdbcType=DECIMAL},
</if>
<if test="actualCost != null" >
actual_cost = #{actualCost,jdbcType=DECIMAL},
</if>
<if test="dateId != null" >
date_id = #{dateId,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="deviceType != null" >
device_type = #{deviceType,jdbcType=INTEGER},
</if>
<if test="divisionCode != null" >
division_code = #{divisionCode,jdbcType=INTEGER},
</if>
<if test="businessCode != null" >
business_code = #{businessCode,jdbcType=INTEGER},
</if>
<if test="classCode != null" >
class_code = #{classCode,jdbcType=INTEGER},
</if>
<if test="channelCode != null" >
channel_code = #{channelCode,jdbcType=INTEGER},
</if>
<if test="exposureNum != null" >
exposure_num = #{exposureNum,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.MktReportForm" >
update mkt_report_form
set book_consum = #{bookConsum,jdbcType=DECIMAL},
actual_cost = #{actualCost,jdbcType=DECIMAL},
date_id = #{dateId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=INTEGER},
device_type = #{deviceType,jdbcType=INTEGER},
division_code = #{divisionCode,jdbcType=INTEGER},
business_code = #{businessCode,jdbcType=INTEGER},
class_code = #{classCode,jdbcType=INTEGER},
channel_code = #{channelCode,jdbcType=INTEGER},
exposure_num = #{exposureNum,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectMktReportFormByDateId" parameterType="java.util.Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mkt_report_form
<include refid="WHERE_CONDITION"/>
</select>
<sql id="WHERE_CONDITION">
<trim prefix="where" prefixOverrides="and | or">
<if test="params.channelCode != null and params.channelCode != ''">and channel_code=#{params.channelCode}</if>
<if test="params.beginTime != null and params.beginTime != ''"><![CDATA[ and date_id>=#{params.beginTime}]]></if>
<if test="params.endTime != null and params.endTime != ''"><![CDATA[ and date_id<=#{params.endTime}]]></if>
</trim>
</sql>
</mapper>
\ No newline at end of file
... ...
... ... @@ -56,6 +56,7 @@ datasources:
- com.yoho.unions.dal.IMobilePanChannelDAO
- com.yoho.unions.dal.IChannelUserDAO
- com.yoho.unions.dal.IUnionUidTypeDAO
- com.yoho.unions.dal.IMktReportFormDAO
bigdata_yh_unions:
servers:
... ... @@ -68,6 +69,7 @@ datasources:
- com.yoho.unions.dal.AppAdSourceMonitorAnaMapper
- com.yoho.unions.dal.IBaseUdidRelationDAO
- com.yoho.unions.dal.BaseOrderShipmentUdidMapper
- com.yoho.unions.dal.IAppActiveDAO
erp_orders:
servers:
... ...
... ... @@ -54,6 +54,7 @@ datasources:
- com.yoho.unions.dal.IChannelGroupBatchDAO
- com.yoho.unions.dal.IChannelSmsBlackDAO
- com.yoho.unions.dal.IUnionUidTypeDAO
- com.yoho.unions.dal.IMktReportFormDAO
bigdata_yh_unions:
... ... @@ -67,6 +68,7 @@ datasources:
- com.yoho.unions.dal.AppAdSourceMonitorAnaMapper
- com.yoho.unions.dal.IBaseUdidRelationDAO
- com.yoho.unions.dal.BaseOrderShipmentUdidMapper
- com.yoho.unions.dal.IAppActiveDAO
bigdata_yoho_passport:
servers:
... ...
function getEchartOption(title, threeContext, xData, costData, numData, ratio, topCostData, topNumData, topRatio){
var colors = ['#5793f3', '#d14a61', '#675bba'];
var option = {
title:{
text:title
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: true, readOnly: false},
restore: {show: true},
saveAsImage: {show: true}
}
},
legend: {
data:threeContext
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xData
}
],
yAxis: [
{
type: 'value',
name: threeContext[1],
min: 0,
max: topNumData*1.2,
position: 'right',
axisLine: {
lineStyle: {
color: colors[0]
}
},
axisLabel: {
formatter: '{value} '
}
},
{
type: 'value',
name: threeContext[0],
min: 0,
max: topCostData*1.2,
position: 'right',
offset: 80,
axisLine: {
lineStyle: {
color: colors[1]
}
},
axisLabel: {
formatter: '{value} '
}
},
{
type: 'value',
name: threeContext[2],
min: 0,
max: topRatio*1.2,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: '{value}'
}
}
],
series: [
{
name:threeContext[1],
type:'bar',
data:numData
},
{
name:threeContext[0],
type:'bar',
yAxisIndex: 1,
data:costData
},
{
name:threeContext[2],
type:'line',
yAxisIndex: 2,
data:ratio
}
]
};
return option;
}
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ECharts</title>
<!-- 引入 echarts.js -->
<script src="/union/js/echarts.min.js"></script>
<script src="/union/js/include.js"></script>
<script src="/union/admin/echartJs.js"></script>
</head>
<body>
<table>
<tr>
<td>
<div id="exposure" style="width: 800px;height:400px;"></div>
</td>
<td>
<div id="active" style="width: 800px;height:400px;"></div>
</td>
<td>
<div id="newuser" style="width: 800px;height:400px;"></div>
</td>
</tr>
<tr>
<td>
<div id="exposure_ios" style="width: 800px;height:400px;"></div>
</td>
<td>
<div id="active_ios" style="width: 800px;height:400px;"></div>
</td>
<td>
<div id="newuser_ios" style="width: 800px;height:400px;"></div>
</td>
</tr>
<tr>
<td>
<div id="exposure_android" style="width: 800px;height:400px;"></div>
</td>
<td>
<div id="active_android" style="width: 800px;height:400px;"></div>
</td>
<td>
<div id="newuser_android" style="width: 800px;height:400px;"></div>
</td>
</tr>
</table>
<script type="text/javascript">
$(function(){
$.ajax({
type: "POST",
url: contextPath + "/mktReportForm/getMktReportForm",
// data: JSON.stringify(json),
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function(data){
if (data.code == 200) {
debugger;
// 曝光量
var exposureOption = getEchartOption("市场费用/曝光量",
['费用','曝光量','曝光成本'],
data.data.dateIdStrList,
data.data.totalActualCostList,
data.data.totalExposureNumList,
data.data.totalExposureRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,
data.data.topRatio);
drawEchart('exposure',exposureOption);
var exposureIosOption = getEchartOption("ios端市场费用/曝光量",
['费用','曝光量','曝光成本'],
data.data.dateIdStrList,
data.data.iosActualCostList,
data.data.iosExposureNumList,
data.data.iosExposureRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('exposure_ios',exposureIosOption);
var exposureAndroidOption = getEchartOption("android市场费用/曝光量",
['费用','曝光量','曝光成本'],
data.data.dateIdStrList,
data.data.androidActualCostList,
data.data.androidExposureNumList,
data.data.androidExposureRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('exposure_android',exposureAndroidOption);
// 激活
var activeOption = getEchartOption("市场费用/激活量",
['费用','激活量','激活成本'],
data.data.dateIdStrList,
data.data.totalActualCostList,
data.data.totalAppActiveList,
data.data.totalActiveRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,
data.data.topRatio);
drawEchart('active',activeOption);
var activeIosOption = getEchartOption("ios端市场费用/激活量",
['费用','激活量','激活成本'],
data.data.dateIdStrList,
data.data.iosActualCostList,
data.data.iosAppActiveList,
data.data.iosActiveRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('active_ios',activeIosOption);
var activeAndroidOption = getEchartOption("android端市场费用/激活量",
['费用','激活量','激活成本'],
data.data.dateIdStrList,
data.data.androidActualCostList,
data.data.androidAppActiveList,
data.data.androidActiveRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('active_android',activeAndroidOption);
// 新客
var newuserOption = getEchartOption("市场费用/新客量",
['费用','新客量','新客成本'],
data.data.dateIdStrList,
data.data.totalActualCostList,
data.data.totalNewUserList,
data.data.totalNewUdidRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('newuser',newuserOption);
var newuserIosOption = getEchartOption("ios端市场费用/新客量",
['费用','新客量','新客成本'],
data.data.dateIdStrList,
data.data.iosActualCostList,
data.data.iosNewUserList,
data.data.iosNewUdidRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('newuser_ios',newuserIosOption);
var newuserAndroidOption = getEchartOption("android市场费用/新客量",
['费用','新客量','新客成本'],
data.data.dateIdStrList,
data.data.androidActualCostList,
data.data.androidNewUserList,
data.data.androidNewUdidRatioList,
data.data.topActualCost,
data.data.topExposureActiveNewUdid,data.data.topRatio);
drawEchart('newuser_android',newuserAndroidOption);
} else {
window.self.$.messager.alert("失败", data.message, "error");
}
}
});
});
function drawEchart(ele, option){
var mychart = echarts.init(document.getElementById(ele));
mychart.setOption(option);
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>市场报表</title>
<script src="/union/js/include.js"></script>
<script src="/union/js/ajaxfileupload.js"></script>
<style>
.div_search input {
margin-top: 20px;
}
.div_search .textbox {
margin-top: 20px;
}
.div_search .easyui-linkbutton {
margin-top: 20px;
}
</style>
</head>
<body class="easyui-layout" fit="true">
<div class="easyui-layout" style="width:100%;height:100%;">
<div data-options="region:'north'" style="height: 100px;">
<div style="margin-left: 30px;" class="div_search">
<form id="mktReportFm">
<input id="beginTime" name="beginTime" class="easyui-datebox" defaultDate="true"
data-options="editable: false,prompt:'开始时间'">
<input name="endTime" class="easyui-datebox"
data-options="editable: false,prompt:'结束时间'">
<a id="searchButton" class="easyui-linkbutton btn-info"
data-options="iconCls:'icon-search'">查询</a>
<a id="exportButton" formType="8" style="margin-left: 20px" class="easyui-linkbutton btn-primary"
data-options="iconCls:'icon-more'">导出</a>
<a id="exportAllButton" formType="8" style="margin-left: 20px" class="easyui-linkbutton btn-primary"
data-options="iconCls:'icon-more'">全部导出</a>
</form>
</div>
</div>
<div data-options="region:'center'" style="height: 100%">
<table id="mktReportFormTable">
<thead>
<tr>
<th width="20" data-options="field:'ck',checkbox:true"></th>
<th width="18%" data-options="field:'dateIdStr',align:'center'">日期</th>
<th width="15%" data-options="field:'totalActualCost',align:'center'">实际总成本</th>
<th width="15%" data-options="field:'iosActualCost',align:'center'">ios实际成本</th>
<th width="15%" data-options="field:'androidActualCostList',align:'center'">android实际成本</th>
<th width="15%" data-options="field:'totalClickNum',align:'center'">总点击量</th>
<th width="15%" data-options="field:'iosClickNum',align:'center'">ios点击量</th>
<th width="15%" data-options="field:'androidClickNum',align:'center'">android点击量</th>
<th width="15%" data-options="field:'totalActivationNum',align:'center'">激活总量</th>
<th width="15%" data-options="field:'iosActivationNum',align:'center'">ios激活量</th>
<th width="15%" data-options="field:'androidActivationNum',align:'center'">android激活量</th>
<th width="15%" data-options="field:'totalNewUser',align:'center'">新客总量</th>
<th width="15%" data-options="field:'iosNewUser',align:'center'">ios新客总量</th>
<th width="15%" data-options="field:'androidNewUser',align:'center'">android新客总量</th>
</tr>
</thead>
</table>
</div>
</div>
</body>
<script>
$(function(){
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
$('#beginTime').datebox('setValue', year + '-' + month + '-' + (day-1));
})
</script>
\ No newline at end of file
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.