Merge branch 'dev_0426_总成本报表需求' of http://git.yoho.cn/yoho30/yohobuy-union into dev_0426_总成本报表需求
Showing
9 changed files
with
445 additions
and
213 deletions
@@ -35,106 +35,106 @@ public class MktCostReportFormController { | @@ -35,106 +35,106 @@ public class MktCostReportFormController { | ||
35 | logger.info("enter getMktReportForm. param mktReportFormReqVO={}", mktReportFormReqVO); | 35 | logger.info("enter getMktReportForm. param mktReportFormReqVO={}", mktReportFormReqVO); |
36 | 36 | ||
37 | try { | 37 | try { |
38 | -// PageMktReportFormRspBO result = mktCostReportFormService.getMktReportForm(mktReportFormReqVO); | ||
39 | - | ||
40 | - MktReportFormRspBO mktReportFormRspBO = new MktReportFormRspBO(); | ||
41 | - List<String> dateIdStrList = Lists.newArrayList(); | ||
42 | - List<BigDecimal> totalActuralCostList = Lists.newArrayList(); | ||
43 | - List<BigDecimal> iosActualCostList = Lists.newArrayList(); | ||
44 | - List<BigDecimal> androidActualCostList = Lists.newArrayList(); | ||
45 | - List<Integer> totalExpoureNumList = Lists.newArrayList(); | ||
46 | - List<Integer> iosExpoureNumList = Lists.newArrayList(); | ||
47 | - List<Integer> androidExpoureNumList = Lists.newArrayList(); | ||
48 | - List<Integer> totalActiveList = Lists.newArrayList(); | ||
49 | - List<Integer> iosActiveList = Lists.newArrayList(); | ||
50 | - List<Integer> androidActiveList = Lists.newArrayList(); | ||
51 | - List<Integer> totalNewUdidList = Lists.newArrayList(); | ||
52 | - List<Integer> iosNewUdidList = Lists.newArrayList(); | ||
53 | - List<Integer> androidNewUdidList = Lists.newArrayList(); | ||
54 | - List<BigDecimal> totalActiveRatio = Lists.newArrayList(); | ||
55 | - List<BigDecimal> iosActiveRatio = Lists.newArrayList(); | ||
56 | - List<BigDecimal> androidActiveRatio = Lists.newArrayList(); | ||
57 | - List<BigDecimal> totalExpoureRatio = Lists.newArrayList(); | ||
58 | - List<BigDecimal> iosExpoureRatio = Lists.newArrayList(); | ||
59 | - List<BigDecimal> androidExpoureRatio = Lists.newArrayList(); | ||
60 | - List<BigDecimal> totalNewUdidRatio = Lists.newArrayList(); | ||
61 | - List<BigDecimal> iosNewUdidRatio = Lists.newArrayList(); | ||
62 | - List<BigDecimal> androidNewUdidRatio = Lists.newArrayList(); | ||
63 | - | ||
64 | - for (Integer i = 0; i <=6; i++){ | ||
65 | - dateIdStrList.add("2017042" + i.toString()); | ||
66 | - totalActuralCostList.add(new BigDecimal(5000 - i * 100)); | ||
67 | - iosActualCostList.add(new BigDecimal(4000 - i * 80)); | ||
68 | - androidActualCostList.add(new BigDecimal(1000 - i * 20)); | ||
69 | - totalExpoureNumList.add(1000 - i * 100); | ||
70 | - iosExpoureNumList.add(600 - i * 60); | ||
71 | - androidExpoureNumList.add(400 - i * 40); | ||
72 | - totalActiveList.add(2000 - i * 200); | ||
73 | - iosActiveList.add(1500 - i * 150); | ||
74 | - androidActiveList.add(500 - i * 50); | ||
75 | - totalNewUdidList.add(100 - i * 10); | ||
76 | - iosNewUdidList.add(70 - i * 7); | ||
77 | - androidNewUdidList.add(30 - i * 3); | ||
78 | - | ||
79 | - totalActiveRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalActiveList.get(i)))); | ||
80 | - iosActiveRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosActiveList.get(i)))); | ||
81 | - androidActiveRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidActiveList.get(i)))); | ||
82 | - totalExpoureRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalExpoureNumList.get(i)))); | ||
83 | - iosExpoureRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosExpoureNumList.get(i)))); | ||
84 | - androidExpoureRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidExpoureNumList.get(i)))); | ||
85 | - totalNewUdidRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalNewUdidList.get(i)))); | ||
86 | - iosNewUdidRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosNewUdidList.get(i)))); | ||
87 | - androidNewUdidRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidNewUdidList.get(i)))); | ||
88 | - } | ||
89 | - | ||
90 | - mktReportFormRspBO.setDateIdStrList(dateIdStrList); | ||
91 | - mktReportFormRspBO.setTotalActualCostList(totalActuralCostList); | ||
92 | - mktReportFormRspBO.setIosActualCostList(iosActualCostList); | ||
93 | - mktReportFormRspBO.setAndroidActualCost(androidActualCostList); | ||
94 | - mktReportFormRspBO.setTotalExpoureNumList(totalExpoureNumList); | ||
95 | - mktReportFormRspBO.setIosExpoureNumList(iosExpoureNumList); | ||
96 | - mktReportFormRspBO.setAndroidExpoureNumList(androidExpoureNumList); | ||
97 | - mktReportFormRspBO.setTotalAppActiveList(totalActiveList); | ||
98 | - mktReportFormRspBO.setIosAppActiveList(iosActiveList); | ||
99 | - mktReportFormRspBO.setAndroidAppActiveList(androidActiveList); | ||
100 | - mktReportFormRspBO.setTotalNewUserList(totalNewUdidList); | ||
101 | - mktReportFormRspBO.setIosNewUserList(iosNewUdidList); | ||
102 | - mktReportFormRspBO.setAndroidNewUserList(androidNewUdidList); | ||
103 | - | ||
104 | - mktReportFormRspBO.setTopActualCost(Collections.max(totalActuralCostList)); | ||
105 | -// mktReportFormRspBO.setTopAppActive(Collections.max(totalActiveList)); | ||
106 | -// mktReportFormRspBO.setTopExpoureNum(Collections.max(totalExpoureNumList)); | ||
107 | -// mktReportFormRspBO.setTopNewUdid(Collections.max(totalNewUdidList)); | ||
108 | - | ||
109 | - | ||
110 | - mktReportFormRspBO.setTotalActiveRatio(totalActiveRatio); | ||
111 | - mktReportFormRspBO.setIosActiveRatio(iosActiveRatio); | ||
112 | - mktReportFormRspBO.setAndroidActiveRatio(androidActiveRatio); | ||
113 | - mktReportFormRspBO.setTotalExpoureRatio(totalExpoureRatio); | ||
114 | - mktReportFormRspBO.setIosExpoureRatio(iosExpoureRatio); | ||
115 | - mktReportFormRspBO.setAndroidExpoureRatio(androidExpoureRatio); | ||
116 | - mktReportFormRspBO.setTotalNewUdidRatio(totalNewUdidRatio); | ||
117 | - mktReportFormRspBO.setIosNewUdidRatio(iosNewUdidRatio); | ||
118 | - mktReportFormRspBO.setAndroidNewUdidRatio(androidNewUdidRatio); | ||
119 | - | ||
120 | -// mktReportFormRspBO.setTopActiveRatio(Collections.max(totalActiveRatio)); | ||
121 | -// mktReportFormRspBO.setTopNewUdidRatio(Collections.max(totalNewUdidRatio)); | ||
122 | -// mktReportFormRspBO.setTopExpoureRatio(Collections.max(totalExpoureRatio)); | ||
123 | - BigDecimal topRatio = Collections.max(totalActiveRatio); | ||
124 | - if (topRatio.compareTo(Collections.max(totalNewUdidRatio)) < 0){ | ||
125 | - topRatio = Collections.max(totalNewUdidRatio); | ||
126 | - } else if (topRatio.compareTo(Collections.max(totalExpoureRatio)) < 0){ | ||
127 | - topRatio = Collections.max(totalExpoureRatio); | ||
128 | - } | ||
129 | - mktReportFormRspBO.setTopRatio(topRatio); | ||
130 | - | ||
131 | - Integer topExActNew = Collections.max(totalActiveList); | ||
132 | - if (topExActNew < Collections.max(totalExpoureNumList)){ | ||
133 | - topExActNew = Collections.max(totalExpoureNumList); | ||
134 | - } else if (topExActNew < Collections.max(totalNewUdidList)){ | ||
135 | - topExActNew = Collections.max(totalNewUdidList); | ||
136 | - } | ||
137 | - mktReportFormRspBO.setTopExposureActiveNewUdid(topExActNew); | 38 | + MktReportFormRspBO mktReportFormRspBO = mktCostReportFormService.getMktReportForm(mktReportFormReqVO); |
39 | + | ||
40 | +// MktReportFormRspBO mktReportFormRspBO = new MktReportFormRspBO(); | ||
41 | +// List<String> dateIdStrList = Lists.newArrayList(); | ||
42 | +// List<BigDecimal> totalActuralCostList = Lists.newArrayList(); | ||
43 | +// List<BigDecimal> iosActualCostList = Lists.newArrayList(); | ||
44 | +// List<BigDecimal> androidActualCostList = Lists.newArrayList(); | ||
45 | +// List<Integer> totalExpoureNumList = Lists.newArrayList(); | ||
46 | +// List<Integer> iosExpoureNumList = Lists.newArrayList(); | ||
47 | +// List<Integer> androidExpoureNumList = Lists.newArrayList(); | ||
48 | +// List<Integer> totalActiveList = Lists.newArrayList(); | ||
49 | +// List<Integer> iosActiveList = Lists.newArrayList(); | ||
50 | +// List<Integer> androidActiveList = Lists.newArrayList(); | ||
51 | +// List<Integer> totalNewUdidList = Lists.newArrayList(); | ||
52 | +// List<Integer> iosNewUdidList = Lists.newArrayList(); | ||
53 | +// List<Integer> androidNewUdidList = Lists.newArrayList(); | ||
54 | +// List<BigDecimal> totalActiveRatio = Lists.newArrayList(); | ||
55 | +// List<BigDecimal> iosActiveRatio = Lists.newArrayList(); | ||
56 | +// List<BigDecimal> androidActiveRatio = Lists.newArrayList(); | ||
57 | +// List<BigDecimal> totalExpoureRatio = Lists.newArrayList(); | ||
58 | +// List<BigDecimal> iosExpoureRatio = Lists.newArrayList(); | ||
59 | +// List<BigDecimal> androidExpoureRatio = Lists.newArrayList(); | ||
60 | +// List<BigDecimal> totalNewUdidRatio = Lists.newArrayList(); | ||
61 | +// List<BigDecimal> iosNewUdidRatio = Lists.newArrayList(); | ||
62 | +// List<BigDecimal> androidNewUdidRatio = Lists.newArrayList(); | ||
63 | +// | ||
64 | +// for (Integer i = 0; i <=6; i++){ | ||
65 | +// dateIdStrList.add("2017042" + i.toString()); | ||
66 | +// totalActuralCostList.add(new BigDecimal(5000 - i * 100)); | ||
67 | +// iosActualCostList.add(new BigDecimal(4000 - i * 80)); | ||
68 | +// androidActualCostList.add(new BigDecimal(1000 - i * 20)); | ||
69 | +// totalExpoureNumList.add(1000 - i * 100); | ||
70 | +// iosExpoureNumList.add(600 - i * 60); | ||
71 | +// androidExpoureNumList.add(400 - i * 40); | ||
72 | +// totalActiveList.add(2000 - i * 200); | ||
73 | +// iosActiveList.add(1500 - i * 150); | ||
74 | +// androidActiveList.add(500 - i * 50); | ||
75 | +// totalNewUdidList.add(100 - i * 10); | ||
76 | +// iosNewUdidList.add(70 - i * 7); | ||
77 | +// androidNewUdidList.add(30 - i * 3); | ||
78 | +// | ||
79 | +// totalActiveRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalActiveList.get(i)))); | ||
80 | +// iosActiveRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosActiveList.get(i)))); | ||
81 | +// androidActiveRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidActiveList.get(i)))); | ||
82 | +// totalExpoureRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalExpoureNumList.get(i)))); | ||
83 | +// iosExpoureRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosExpoureNumList.get(i)))); | ||
84 | +// androidExpoureRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidExpoureNumList.get(i)))); | ||
85 | +// totalNewUdidRatio.add(getDivideData(totalActuralCostList.get(i), new BigDecimal(totalNewUdidList.get(i)))); | ||
86 | +// iosNewUdidRatio.add(getDivideData(iosActualCostList.get(i), new BigDecimal(iosNewUdidList.get(i)))); | ||
87 | +// androidNewUdidRatio.add(getDivideData(androidActualCostList.get(i), new BigDecimal(androidNewUdidList.get(i)))); | ||
88 | +// } | ||
89 | +// | ||
90 | +// mktReportFormRspBO.setDateIdStrList(dateIdStrList); | ||
91 | +// mktReportFormRspBO.setTotalActualCostList(totalActuralCostList); | ||
92 | +// mktReportFormRspBO.setIosActualCostList(iosActualCostList); | ||
93 | +// mktReportFormRspBO.setAndroidActualCostList(androidActualCostList); | ||
94 | +// mktReportFormRspBO.setTotalExposureNumList(totalExpoureNumList); | ||
95 | +// mktReportFormRspBO.setIosExposureNumList(iosExpoureNumList); | ||
96 | +// mktReportFormRspBO.setAndroidExposureNumList(androidExpoureNumList); | ||
97 | +// mktReportFormRspBO.setTotalAppActiveList(totalActiveList); | ||
98 | +// mktReportFormRspBO.setIosAppActiveList(iosActiveList); | ||
99 | +// mktReportFormRspBO.setAndroidAppActiveList(androidActiveList); | ||
100 | +// mktReportFormRspBO.setTotalNewUserList(totalNewUdidList); | ||
101 | +// mktReportFormRspBO.setIosNewUserList(iosNewUdidList); | ||
102 | +// mktReportFormRspBO.setAndroidNewUserList(androidNewUdidList); | ||
103 | +// | ||
104 | +// mktReportFormRspBO.setTopActualCost(Collections.max(totalActuralCostList)); | ||
105 | +//// mktReportFormRspBO.setTopAppActive(Collections.max(totalActiveList)); | ||
106 | +//// mktReportFormRspBO.setTopExpoureNum(Collections.max(totalExpoureNumList)); | ||
107 | +//// mktReportFormRspBO.setTopNewUdid(Collections.max(totalNewUdidList)); | ||
108 | +// | ||
109 | +// | ||
110 | +// mktReportFormRspBO.setTotalActiveRatioList(totalActiveRatio); | ||
111 | +// mktReportFormRspBO.setIosActiveRatioList(iosActiveRatio); | ||
112 | +// mktReportFormRspBO.setAndroidActiveRatioList(androidActiveRatio); | ||
113 | +// mktReportFormRspBO.setTotalExposureRatioList(totalExpoureRatio); | ||
114 | +// mktReportFormRspBO.setIosExposureRatioList(iosExpoureRatio); | ||
115 | +// mktReportFormRspBO.setAndroidExposureRatioList(androidExpoureRatio); | ||
116 | +// mktReportFormRspBO.setTotalNewUdidRatioList(totalNewUdidRatio); | ||
117 | +// mktReportFormRspBO.setIosNewUdidRatioList(iosNewUdidRatio); | ||
118 | +// mktReportFormRspBO.setAndroidNewUdidRatioList(androidNewUdidRatio); | ||
119 | +// | ||
120 | +//// mktReportFormRspBO.setTopActiveRatio(Collections.max(totalActiveRatio)); | ||
121 | +//// mktReportFormRspBO.setTopNewUdidRatio(Collections.max(totalNewUdidRatio)); | ||
122 | +//// mktReportFormRspBO.setTopExpoureRatio(Collections.max(totalExpoureRatio)); | ||
123 | +// BigDecimal topRatio = Collections.max(totalActiveRatio); | ||
124 | +// if (topRatio.compareTo(Collections.max(totalNewUdidRatio)) < 0){ | ||
125 | +// topRatio = Collections.max(totalNewUdidRatio); | ||
126 | +// } else if (topRatio.compareTo(Collections.max(totalExpoureRatio)) < 0){ | ||
127 | +// topRatio = Collections.max(totalExpoureRatio); | ||
128 | +// } | ||
129 | +// mktReportFormRspBO.setTopRatio(topRatio); | ||
130 | +// | ||
131 | +// Integer topExActNew = Collections.max(totalActiveList); | ||
132 | +// if (topExActNew < Collections.max(totalExpoureNumList)){ | ||
133 | +// topExActNew = Collections.max(totalExpoureNumList); | ||
134 | +// } else if (topExActNew < Collections.max(totalNewUdidList)){ | ||
135 | +// topExActNew = Collections.max(totalNewUdidList); | ||
136 | +// } | ||
137 | +// mktReportFormRspBO.setTopExposureActiveNewUdid(topExActNew); | ||
138 | 138 | ||
139 | 139 | ||
140 | return new ApiResponse.ApiResponseBuilder().code(200).data(mktReportFormRspBO).message("success").build(); | 140 | return new ApiResponse.ApiResponseBuilder().code(200).data(mktReportFormRspBO).message("success").build(); |
@@ -145,11 +145,11 @@ public class MktCostReportFormController { | @@ -145,11 +145,11 @@ public class MktCostReportFormController { | ||
145 | 145 | ||
146 | } | 146 | } |
147 | 147 | ||
148 | - private BigDecimal getDivideData(BigDecimal d1,BigDecimal d2){ | ||
149 | - | ||
150 | - if(d2.compareTo(new BigDecimal(0)) == 0){ | ||
151 | - return new BigDecimal(0); | ||
152 | - } | ||
153 | - return d1.divide(d2,2,BigDecimal.ROUND_HALF_UP); | ||
154 | - } | 148 | +// private BigDecimal getDivideData(BigDecimal d1,BigDecimal d2){ |
149 | +// | ||
150 | +// if(d2.compareTo(new BigDecimal(0)) == 0){ | ||
151 | +// return new BigDecimal(0); | ||
152 | +// } | ||
153 | +// return d1.divide(d2,2,BigDecimal.ROUND_HALF_UP); | ||
154 | +// } | ||
155 | } | 155 | } |
@@ -3,18 +3,18 @@ package com.yoho.unions.channel.service.impl; | @@ -3,18 +3,18 @@ package com.yoho.unions.channel.service.impl; | ||
3 | import com.google.common.collect.Lists; | 3 | import com.google.common.collect.Lists; |
4 | import com.yoho.service.model.union.request.MktReportFormReqVO; | 4 | import com.yoho.service.model.union.request.MktReportFormReqVO; |
5 | import com.yoho.service.model.union.response.MktReportFormRspBO; | 5 | import com.yoho.service.model.union.response.MktReportFormRspBO; |
6 | -import com.yoho.service.model.union.response.PageMktReportFormRspBO; | ||
7 | import com.yoho.unions.channel.service.IMktCostReportFormService; | 6 | import com.yoho.unions.channel.service.IMktCostReportFormService; |
8 | import com.yoho.unions.dal.IAppActiveDAO; | 7 | import com.yoho.unions.dal.IAppActiveDAO; |
9 | import com.yoho.unions.dal.IMktReportFormDAO; | 8 | import com.yoho.unions.dal.IMktReportFormDAO; |
10 | import com.yoho.unions.dal.model.AppActive; | 9 | import com.yoho.unions.dal.model.AppActive; |
11 | import com.yoho.unions.dal.model.MktReportForm; | 10 | import com.yoho.unions.dal.model.MktReportForm; |
12 | -import com.yoho.unions.dal.model.MktReportWithAppActive; | 11 | +import com.yoho.unions.dal.model.MktReportBean; |
13 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
14 | import org.slf4j.LoggerFactory; | 13 | import org.slf4j.LoggerFactory; |
15 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
16 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
17 | 16 | ||
17 | +import java.math.BigDecimal; | ||
18 | import java.util.*; | 18 | import java.util.*; |
19 | 19 | ||
20 | /** | 20 | /** |
@@ -33,8 +33,6 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { | @@ -33,8 +33,6 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { | ||
33 | 33 | ||
34 | @Override | 34 | @Override |
35 | public MktReportFormRspBO getMktReportForm(MktReportFormReqVO reportFormReqVO) { | 35 | public MktReportFormRspBO getMktReportForm(MktReportFormReqVO reportFormReqVO) { |
36 | - MktReportFormRspBO pageMktReportFormRspBO = new MktReportFormRspBO(); | ||
37 | - | ||
38 | //从APP_ACTIVE中获取数据 | 36 | //从APP_ACTIVE中获取数据 |
39 | Map<String, Integer> queryParam = new HashMap<>(); | 37 | Map<String, Integer> queryParam = new HashMap<>(); |
40 | queryParam.put("beginTime", reportFormReqVO.getBeginTime()); | 38 | queryParam.put("beginTime", reportFormReqVO.getBeginTime()); |
@@ -43,54 +41,223 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { | @@ -43,54 +41,223 @@ public class MktCostReportFormServiceImpl implements IMktCostReportFormService { | ||
43 | List<AppActive> appActiveList = appActiveDAO.selectActivationAndActualCostByDateId(queryParam); | 41 | List<AppActive> appActiveList = appActiveDAO.selectActivationAndActualCostByDateId(queryParam); |
44 | List<MktReportForm> mktReportFormList = mktReportFormDAO.selectMktReportFormByDateId(queryParam); | 42 | List<MktReportForm> mktReportFormList = mktReportFormDAO.selectMktReportFormByDateId(queryParam); |
45 | 43 | ||
46 | - List<String> dateIdStrList = Lists.newArrayList(); | ||
47 | - List<String> totalActualCostList = Lists.newArrayList(); | ||
48 | - List<String> iosActualCostList = Lists.newArrayList(); | ||
49 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
50 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
51 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
52 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
53 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
54 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
55 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
56 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
57 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
58 | -// List<String> dateIdStrList = Lists.newArrayList(); | ||
59 | - | ||
60 | -// int resultSize = appActiveList.size() > mktReportFormList.size() ? appActiveList.size() : mktReportFormList.size(); | ||
61 | -// | ||
62 | -// | ||
63 | -// if ((!appActiveList.isEmpty()) && (!mktReportFormList.isEmpty())){ | ||
64 | -// boolean flag = appActiveList.size() > mktReportFormList.size() ? true : false; | ||
65 | -// if (flag){ | ||
66 | -// | ||
67 | -// } | ||
68 | -// } | ||
69 | - | ||
70 | - | ||
71 | - | ||
72 | - return null; | 44 | + Map<Integer, MktReportBean> resultMap = mergeData(appActiveList, mktReportFormList); |
45 | + | ||
46 | + MktReportFormRspBO rspBO = composingResult(resultMap); | ||
47 | + | ||
48 | + return rspBO; | ||
49 | + } | ||
50 | + | ||
51 | + private Map<Integer, MktReportBean> mergeData(List<AppActive> appActiveList, List<MktReportForm> mktReportFormList) { | ||
52 | + Map<Integer, MktReportBean> resultMap = new TreeMap<>(); | ||
53 | + | ||
54 | + if ((!appActiveList.isEmpty()) && !mktReportFormList.isEmpty()) | ||
55 | + { | ||
56 | + setValueToMapForAppActive(resultMap, appActiveList); | ||
57 | + | ||
58 | + for (MktReportForm mktReportForm : mktReportFormList){ | ||
59 | + Integer dateId = mktReportForm.getDateId(); | ||
60 | + MktReportBean mktReportBean = null; | ||
61 | + if (!resultMap.containsKey(dateId)){ | ||
62 | + mktReportBean = new MktReportBean(); | ||
63 | + setMktReportData(mktReportForm, mktReportBean); | ||
64 | + } else { | ||
65 | + mktReportBean = resultMap.get(mktReportForm.getDateId()); | ||
66 | + setMktReportData(mktReportForm, mktReportBean); | ||
67 | + } | ||
68 | + | ||
69 | + resultMap.put(dateId, mktReportBean); | ||
70 | + } | ||
71 | + } else if (!appActiveList.isEmpty()){ | ||
72 | + setValueToMapForAppActive(resultMap, appActiveList); | ||
73 | + } else if (!mktReportFormList.isEmpty()){ | ||
74 | + setValueToMapForMktReportForm(resultMap, mktReportFormList); | ||
75 | + } else { | ||
76 | + resultMap = null; | ||
77 | + } | ||
78 | + | ||
79 | + return resultMap; | ||
73 | } | 80 | } |
74 | 81 | ||
75 | - private void mergeData(List<AppActive> appActiveList, List<MktReportForm> mktReportFormList){ | ||
76 | - List<MktReportWithAppActive> mktReportWithAppActiveList = Lists.newArrayList(); | ||
77 | - Set<Integer> dateIdSet = new TreeSet<>(); | 82 | + private void setValueToMapForAppActive(Map<Integer, MktReportBean> resultMap, List<AppActive> appActiveList){ |
83 | + for (AppActive appActive : appActiveList) { | ||
84 | + Integer dateId = appActive.getDateId(); | ||
85 | + MktReportBean mktReportBean = new MktReportBean(); | ||
86 | + setAppActiveData(appActive, mktReportBean); | ||
87 | + resultMap.put(dateId, mktReportBean); | ||
88 | + } | ||
89 | + } | ||
90 | + | ||
91 | + private void setValueToMapForMktReportForm(Map<Integer, MktReportBean> resultMap, List<MktReportForm> mktReportFormList){ | ||
92 | + for (MktReportForm mktReportForm : mktReportFormList) { | ||
93 | + Integer dateId = mktReportForm.getDateId(); | ||
94 | + MktReportBean mktReportBean = new MktReportBean(); | ||
95 | + setMktReportData(mktReportForm, mktReportBean); | ||
96 | + resultMap.put(dateId, mktReportBean); | ||
97 | + } | ||
98 | + } | ||
78 | 99 | ||
79 | - for (AppActive active : appActiveList){ | ||
80 | - dateIdSet.add(active.getDateId()); | 100 | + private void setAppActiveData(AppActive appActive, MktReportBean mktReportBean){ |
101 | + if (null != appActive){ | ||
102 | + if ("yohobuy_ios".equals(appActive.getAppKey())){ | ||
103 | + mktReportBean.setIosAppActive(appActive.getAppActive()); | ||
104 | + mktReportBean.setIosNewUdid(appActive.getNewUdid()); | ||
105 | + } else if ("yohobuy_android".equals(appActive.getAppKey())){ | ||
106 | + mktReportBean.setAndroidAppActive(appActive.getAppActive()); | ||
107 | + mktReportBean.setAndroidNewUdid(appActive.getNewUdid()); | ||
108 | + } | ||
81 | } | 109 | } |
110 | + } | ||
82 | 111 | ||
83 | - for (MktReportForm mktReportForm : mktReportFormList){ | ||
84 | - dateIdSet.add(mktReportForm.getDateId()); | 112 | + private void setMktReportData(MktReportForm mktReportForm, MktReportBean mktReportBean){ |
113 | + if (null != mktReportForm){ | ||
114 | + if (1 == mktReportForm.getDeviceType()){ | ||
115 | + mktReportBean.setIosActualCost(mktReportForm.getActualCost()); | ||
116 | + mktReportBean.setIosExposureNum(mktReportForm.getExposureNum()); | ||
117 | + } else if (2 == mktReportForm.getDeviceType()){ | ||
118 | + mktReportBean.setAndroidActualCost(mktReportForm.getActualCost()); | ||
119 | + mktReportBean.setAndroidExposureNum(mktReportForm.getExposureNum()); | ||
120 | + } | ||
85 | } | 121 | } |
122 | + } | ||
123 | + | ||
124 | + private MktReportFormRspBO composingResult(Map<Integer, MktReportBean> resultMap){ | ||
125 | + List<String> dateIdStrList = Lists.newArrayList(); | ||
126 | + List<BigDecimal> totalActualCostList = Lists.newArrayList(); | ||
127 | + List<BigDecimal> iosActualCostList = Lists.newArrayList(); | ||
128 | + List<BigDecimal> androidActualCostList = Lists.newArrayList(); | ||
129 | + List<Integer> totalAppActiveList = Lists.newArrayList(); | ||
130 | + List<Integer> iosAppActiveList = Lists.newArrayList(); | ||
131 | + List<Integer> androidAppActiveList = Lists.newArrayList(); | ||
132 | + List<Integer> totalExposureNumList = Lists.newArrayList(); | ||
133 | + List<Integer> iosExposureNumList = Lists.newArrayList(); | ||
134 | + List<Integer> androidExposureNumList = Lists.newArrayList(); | ||
135 | + List<Integer> totalNewUserList = Lists.newArrayList(); | ||
136 | + List<Integer> iosNewUserList = Lists.newArrayList(); | ||
137 | + List<Integer> androidNewUserList = Lists.newArrayList(); | ||
138 | + List<BigDecimal> totalActiveRatioList = Lists.newArrayList(); | ||
139 | + List<BigDecimal> iosActiveRatioList = Lists.newArrayList(); | ||
140 | + List<BigDecimal> androidActiveRatioList = Lists.newArrayList(); | ||
141 | + List<BigDecimal> totalExposureRatioList = Lists.newArrayList(); | ||
142 | + List<BigDecimal> iosExposureRatioList = Lists.newArrayList(); | ||
143 | + List<BigDecimal> androidExposureRatioList = Lists.newArrayList(); | ||
144 | + List<BigDecimal> totalNewUdidRatioList = Lists.newArrayList(); | ||
145 | + List<BigDecimal> iosNewUdidRatioList = Lists.newArrayList(); | ||
146 | + List<BigDecimal> androidNewUdidRatioList = Lists.newArrayList(); | ||
147 | + | ||
148 | + Iterator it = resultMap.keySet().iterator(); | ||
149 | + while (it.hasNext()){ | ||
150 | + Integer dateId = (Integer) it.next(); | ||
151 | + MktReportBean mktReportBean = resultMap.get(dateId); | ||
152 | + | ||
153 | + //日期 | ||
154 | + dateIdStrList.add(dateId.toString()); | ||
86 | 155 | ||
87 | - | 156 | + //实际费用 |
157 | + iosActualCostList.add(mktReportBean.getIosActualCost()); | ||
158 | + androidActualCostList.add(mktReportBean.getAndroidActualCost()); | ||
159 | + BigDecimal totalActualCost = mktReportBean.getIosActualCost().add(mktReportBean.getAndroidActualCost()); | ||
160 | + totalActualCostList.add(totalActualCost); | ||
88 | 161 | ||
89 | - int minDateId = appActiveList.get(0).getDateId() < mktReportFormList.get(0).getDateId() ? appActiveList.get(0).getDateId() : mktReportFormList.get(0).getDateId(); | ||
90 | - 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(); | 162 | + //曝光数 |
163 | + iosExposureNumList.add(mktReportBean.getIosExposureNum()); | ||
164 | + androidExposureNumList.add(mktReportBean.getAndroidExposureNum()); | ||
165 | + Integer totalExposureNum = mktReportBean.getIosExposureNum() +mktReportBean.getAndroidExposureNum(); | ||
166 | + totalExposureNumList.add(totalExposureNum); | ||
167 | + | ||
168 | + //激活数 | ||
169 | + iosAppActiveList.add(mktReportBean.getIosAppActive()); | ||
170 | + androidAppActiveList.add(mktReportBean.getAndroidAppActive()); | ||
171 | + Integer totalAppActive = mktReportBean.getIosAppActive() + mktReportBean.getAndroidAppActive(); | ||
172 | + totalAppActiveList.add(totalAppActive); | ||
173 | + | ||
174 | + //新客数 | ||
175 | + iosNewUserList.add(mktReportBean.getIosNewUdid()); | ||
176 | + androidNewUserList.add(mktReportBean.getAndroidNewUdid()); | ||
177 | + Integer totalNewUser = mktReportBean.getIosNewUdid() + mktReportBean.getAndroidNewUdid(); | ||
178 | + totalNewUserList.add(totalNewUser); | ||
179 | + | ||
180 | + //激活转化率 | ||
181 | + iosActiveRatioList.add(getDivideData(mktReportBean.getIosActualCost(), new BigDecimal(mktReportBean.getIosAppActive()))); | ||
182 | + androidActiveRatioList.add(getDivideData(mktReportBean.getAndroidActualCost(), new BigDecimal(mktReportBean.getAndroidAppActive()))); | ||
183 | + totalActiveRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalAppActive))); | ||
184 | + | ||
185 | + //曝光转化率 | ||
186 | + iosExposureRatioList.add(getDivideData(mktReportBean.getIosActualCost(), new BigDecimal(mktReportBean.getIosExposureNum()))); | ||
187 | + androidExposureRatioList.add(getDivideData(mktReportBean.getAndroidActualCost(), new BigDecimal(mktReportBean.getAndroidExposureNum()))); | ||
188 | + iosExposureRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalExposureNum))); | ||
189 | + | ||
190 | + //新客转化率 | ||
191 | + iosNewUdidRatioList.add(getDivideData(mktReportBean.getIosActualCost(), new BigDecimal(mktReportBean.getIosNewUdid()))); | ||
192 | + androidNewUdidRatioList.add(getDivideData(mktReportBean.getAndroidActualCost(), new BigDecimal(mktReportBean.getAndroidNewUdid()))); | ||
193 | + iosNewUdidRatioList.add(getDivideData(totalActualCost, new BigDecimal(totalNewUser))); | ||
194 | + } | ||
195 | + | ||
196 | + MktReportFormRspBO mktReportFormRspBO = new MktReportFormRspBO(); | ||
197 | + | ||
198 | + //日期 | ||
199 | + mktReportFormRspBO.setDateIdStrList(dateIdStrList); | ||
200 | + | ||
201 | + //实际费用 | ||
202 | + mktReportFormRspBO.setIosActualCostList(iosActualCostList); | ||
203 | + mktReportFormRspBO.setAndroidActualCostList(androidActualCostList); | ||
204 | + mktReportFormRspBO.setTotalActualCostList(totalActualCostList); | ||
205 | + | ||
206 | + //曝光量 | ||
207 | + mktReportFormRspBO.setIosExposureNumList(iosExposureNumList); | ||
208 | + mktReportFormRspBO.setAndroidExposureNumList(androidExposureNumList); | ||
209 | + mktReportFormRspBO.setTotalExposureNumList(totalExposureNumList); | ||
210 | + | ||
211 | + //激活量 | ||
212 | + mktReportFormRspBO.setIosAppActiveList(iosAppActiveList); | ||
213 | + mktReportFormRspBO.setAndroidAppActiveList(androidAppActiveList); | ||
214 | + mktReportFormRspBO.setTotalAppActiveList(totalAppActiveList); | ||
215 | + | ||
216 | + //新客量 | ||
217 | + mktReportFormRspBO.setIosNewUserList(iosNewUserList); | ||
218 | + mktReportFormRspBO.setAndroidNewUserList(androidNewUserList); | ||
219 | + mktReportFormRspBO.setTotalNewUserList(totalNewUserList); | ||
220 | + | ||
221 | + //曝光转化率 | ||
222 | + mktReportFormRspBO.setIosExposureRatioList(iosExposureRatioList); | ||
223 | + mktReportFormRspBO.setAndroidExposureRatioList(androidExposureRatioList); | ||
224 | + mktReportFormRspBO.setTotalExposureRatioList(totalExposureRatioList); | ||
225 | + | ||
226 | + //激活转化率 | ||
227 | + mktReportFormRspBO.setIosActiveRatioList(iosActiveRatioList); | ||
228 | + mktReportFormRspBO.setAndroidActiveRatioList(androidActiveRatioList); | ||
229 | + mktReportFormRspBO.setTotalActiveRatioList(totalActiveRatioList); | ||
230 | + | ||
231 | + //新客转化率 | ||
232 | + mktReportFormRspBO.setIosNewUdidRatioList(iosNewUdidRatioList); | ||
233 | + mktReportFormRspBO.setAndroidNewUdidRatioList(androidNewUdidRatioList); | ||
234 | + mktReportFormRspBO.setTotalNewUdidRatioList(totalNewUdidRatioList); | ||
235 | + | ||
236 | + BigDecimal topRatio = Collections.max(totalExposureRatioList); | ||
237 | + if (topRatio.compareTo(Collections.max(totalActiveRatioList)) < 0) | ||
238 | + { | ||
239 | + topRatio = Collections.max(totalActiveRatioList); | ||
240 | + } else if (topRatio.compareTo(Collections.max(totalNewUdidRatioList)) < 0){ | ||
241 | + topRatio = Collections.max(totalNewUdidRatioList); | ||
242 | + } | ||
243 | + mktReportFormRspBO.setTopRatio(topRatio); | ||
244 | + | ||
245 | + Integer topExActNew = Collections.max(totalAppActiveList); | ||
246 | + if (topExActNew < Collections.max(totalExposureNumList)){ | ||
247 | + topExActNew = Collections.max(totalExposureNumList); | ||
248 | + } else if (topExActNew < Collections.max(totalNewUserList)){ | ||
249 | + topExActNew = Collections.max(totalNewUserList); | ||
250 | + } | ||
251 | + mktReportFormRspBO.setTopExposureActiveNewUdid(topExActNew); | ||
252 | + | ||
253 | + return mktReportFormRspBO; | ||
254 | + } | ||
91 | 255 | ||
92 | - for (int dateId = minDateId; maxDateId <= maxDateId;){ | 256 | + private BigDecimal getDivideData(BigDecimal d1,BigDecimal d2){ |
93 | 257 | ||
258 | + if(d2.compareTo(new BigDecimal(0)) == 0){ | ||
259 | + return new BigDecimal(0); | ||
94 | } | 260 | } |
261 | + return d1.divide(d2,4,BigDecimal.ROUND_HALF_UP); | ||
95 | } | 262 | } |
96 | } | 263 | } |
@@ -2,6 +2,7 @@ package com.yoho.unions.dal; | @@ -2,6 +2,7 @@ package com.yoho.unions.dal; | ||
2 | 2 | ||
3 | 3 | ||
4 | import com.yoho.unions.dal.model.AppActive; | 4 | import com.yoho.unions.dal.model.AppActive; |
5 | +import org.apache.ibatis.annotations.Param; | ||
5 | 6 | ||
6 | import java.util.List; | 7 | import java.util.List; |
7 | import java.util.Map; | 8 | import java.util.Map; |
@@ -19,5 +20,5 @@ public interface IAppActiveDAO { | @@ -19,5 +20,5 @@ public interface IAppActiveDAO { | ||
19 | 20 | ||
20 | int updateByPrimaryKey(AppActive record); | 21 | int updateByPrimaryKey(AppActive record); |
21 | 22 | ||
22 | - List<AppActive> selectActivationAndActualCostByDateId(Map<String, Integer> timeParam); | 23 | + List<AppActive> selectActivationAndActualCostByDateId(@Param("params") Map<String, Integer> params); |
23 | } | 24 | } |
@@ -2,6 +2,7 @@ package com.yoho.unions.dal; | @@ -2,6 +2,7 @@ package com.yoho.unions.dal; | ||
2 | 2 | ||
3 | 3 | ||
4 | import com.yoho.unions.dal.model.MktReportForm; | 4 | import com.yoho.unions.dal.model.MktReportForm; |
5 | +import org.apache.ibatis.annotations.Param; | ||
5 | 6 | ||
6 | import java.util.List; | 7 | import java.util.List; |
7 | import java.util.Map; | 8 | import java.util.Map; |
@@ -19,5 +20,5 @@ public interface IMktReportFormDAO { | @@ -19,5 +20,5 @@ public interface IMktReportFormDAO { | ||
19 | 20 | ||
20 | int updateByPrimaryKey(MktReportForm record); | 21 | int updateByPrimaryKey(MktReportForm record); |
21 | 22 | ||
22 | - List<MktReportForm> selectMktReportFormByDateId(Map<String, Integer> param); | 23 | + List<MktReportForm> selectMktReportFormByDateId(@Param("params") Map<String, Integer> params); |
23 | } | 24 | } |
@@ -51,5 +51,13 @@ public class AppActive { | @@ -51,5 +51,13 @@ public class AppActive { | ||
51 | this.newUdid = newUdid; | 51 | this.newUdid = newUdid; |
52 | } | 52 | } |
53 | 53 | ||
54 | + @Override | ||
55 | + public boolean equals(Object obj) { | ||
56 | + if (obj instanceof AppActive) { | ||
57 | + AppActive appActive = (AppActive) obj; | ||
58 | + return this.getDateId() == appActive.getDateId(); | ||
59 | + } | ||
54 | 60 | ||
61 | + return super.equals(obj); | ||
62 | + } | ||
55 | } | 63 | } |
@@ -5,23 +5,33 @@ import java.math.BigDecimal; | @@ -5,23 +5,33 @@ import java.math.BigDecimal; | ||
5 | /** | 5 | /** |
6 | * Created by yoho on 2017/4/26. | 6 | * Created by yoho on 2017/4/26. |
7 | */ | 7 | */ |
8 | -public class MktReportWithAppActive { | 8 | +public class MktReportBean { |
9 | 9 | ||
10 | private Integer dateId; | 10 | private Integer dateId; |
11 | 11 | ||
12 | - private Integer appActive; | 12 | + private BigDecimal totalActualCost; |
13 | 13 | ||
14 | - private String appKey; | 14 | + private BigDecimal iosActualCost; |
15 | 15 | ||
16 | - private Integer newUdid; | 16 | + private BigDecimal androidActualCost; |
17 | 17 | ||
18 | - private BigDecimal bookConsum; | 18 | + private Integer totalAppActive; |
19 | 19 | ||
20 | - private BigDecimal actualCost; | 20 | + private Integer androidAppActive; |
21 | 21 | ||
22 | - private Integer createTime; | 22 | + private Integer iosAppActive; |
23 | 23 | ||
24 | - private Integer deviceType; | 24 | + private Integer totalNewUdid; |
25 | + | ||
26 | + private Integer iosNewUdid; | ||
27 | + | ||
28 | + private Integer androidNewUdid; | ||
29 | + | ||
30 | + private Integer totalExposureNum; | ||
31 | + | ||
32 | + private Integer iosExposureNum; | ||
33 | + | ||
34 | + private Integer androidExposureNum; | ||
25 | 35 | ||
26 | private Integer divisionCode; | 36 | private Integer divisionCode; |
27 | 37 | ||
@@ -31,8 +41,6 @@ public class MktReportWithAppActive { | @@ -31,8 +41,6 @@ public class MktReportWithAppActive { | ||
31 | 41 | ||
32 | private Integer channelCode; | 42 | private Integer channelCode; |
33 | 43 | ||
34 | - private Integer exposureNum; | ||
35 | - | ||
36 | public Integer getDateId() { | 44 | public Integer getDateId() { |
37 | return dateId; | 45 | return dateId; |
38 | } | 46 | } |
@@ -41,60 +49,100 @@ public class MktReportWithAppActive { | @@ -41,60 +49,100 @@ public class MktReportWithAppActive { | ||
41 | this.dateId = dateId; | 49 | this.dateId = dateId; |
42 | } | 50 | } |
43 | 51 | ||
44 | - public Integer getAppActive() { | ||
45 | - return appActive; | 52 | + public BigDecimal getTotalActualCost() { |
53 | + return totalActualCost; | ||
54 | + } | ||
55 | + | ||
56 | + public void setTotalActualCost(BigDecimal totalActualCost) { | ||
57 | + this.totalActualCost = totalActualCost; | ||
58 | + } | ||
59 | + | ||
60 | + public BigDecimal getIosActualCost() { | ||
61 | + return iosActualCost; | ||
62 | + } | ||
63 | + | ||
64 | + public void setIosActualCost(BigDecimal iosActualCost) { | ||
65 | + this.iosActualCost = iosActualCost; | ||
66 | + } | ||
67 | + | ||
68 | + public BigDecimal getAndroidActualCost() { | ||
69 | + return androidActualCost; | ||
70 | + } | ||
71 | + | ||
72 | + public void setAndroidActualCost(BigDecimal androidActualCost) { | ||
73 | + this.androidActualCost = androidActualCost; | ||
74 | + } | ||
75 | + | ||
76 | + public Integer getTotalAppActive() { | ||
77 | + return totalAppActive; | ||
78 | + } | ||
79 | + | ||
80 | + public void setTotalAppActive(Integer totalAppActive) { | ||
81 | + this.totalAppActive = totalAppActive; | ||
82 | + } | ||
83 | + | ||
84 | + public Integer getAndroidAppActive() { | ||
85 | + return androidAppActive; | ||
46 | } | 86 | } |
47 | 87 | ||
48 | - public void setAppActive(Integer appActive) { | ||
49 | - this.appActive = appActive; | 88 | + public void setAndroidAppActive(Integer androidAppActive) { |
89 | + this.androidAppActive = androidAppActive; | ||
50 | } | 90 | } |
51 | 91 | ||
52 | - public String getAppKey() { | ||
53 | - return appKey; | 92 | + public Integer getIosAppActive() { |
93 | + return iosAppActive; | ||
54 | } | 94 | } |
55 | 95 | ||
56 | - public void setAppKey(String appKey) { | ||
57 | - this.appKey = appKey; | 96 | + public void setIosAppActive(Integer iosAppActive) { |
97 | + this.iosAppActive = iosAppActive; | ||
58 | } | 98 | } |
59 | 99 | ||
60 | - public Integer getNewUdid() { | ||
61 | - return newUdid; | 100 | + public Integer getTotalNewUdid() { |
101 | + return totalNewUdid; | ||
62 | } | 102 | } |
63 | 103 | ||
64 | - public void setNewUdid(Integer newUdid) { | ||
65 | - this.newUdid = newUdid; | 104 | + public void setTotalNewUdid(Integer totalNewUdid) { |
105 | + this.totalNewUdid = totalNewUdid; | ||
66 | } | 106 | } |
67 | 107 | ||
68 | - public BigDecimal getBookConsum() { | ||
69 | - return bookConsum; | 108 | + public Integer getIosNewUdid() { |
109 | + return iosNewUdid; | ||
70 | } | 110 | } |
71 | 111 | ||
72 | - public void setBookConsum(BigDecimal bookConsum) { | ||
73 | - this.bookConsum = bookConsum; | 112 | + public void setIosNewUdid(Integer iosNewUdid) { |
113 | + this.iosNewUdid = iosNewUdid; | ||
74 | } | 114 | } |
75 | 115 | ||
76 | - public BigDecimal getActualCost() { | ||
77 | - return actualCost; | 116 | + public Integer getAndroidNewUdid() { |
117 | + return androidNewUdid; | ||
78 | } | 118 | } |
79 | 119 | ||
80 | - public void setActualCost(BigDecimal actualCost) { | ||
81 | - this.actualCost = actualCost; | 120 | + public void setAndroidNewUdid(Integer androidNewUdid) { |
121 | + this.androidNewUdid = androidNewUdid; | ||
82 | } | 122 | } |
83 | 123 | ||
84 | - public Integer getCreateTime() { | ||
85 | - return createTime; | 124 | + public Integer getTotalExposureNum() { |
125 | + return totalExposureNum; | ||
86 | } | 126 | } |
87 | 127 | ||
88 | - public void setCreateTime(Integer createTime) { | ||
89 | - this.createTime = createTime; | 128 | + public void setTotalExposureNum(Integer totalExposureNum) { |
129 | + this.totalExposureNum = totalExposureNum; | ||
90 | } | 130 | } |
91 | 131 | ||
92 | - public Integer getDeviceType() { | ||
93 | - return deviceType; | 132 | + public Integer getIosExposureNum() { |
133 | + return iosExposureNum; | ||
94 | } | 134 | } |
95 | 135 | ||
96 | - public void setDeviceType(Integer deviceType) { | ||
97 | - this.deviceType = deviceType; | 136 | + public void setIosExposureNum(Integer iosExposureNum) { |
137 | + this.iosExposureNum = iosExposureNum; | ||
138 | + } | ||
139 | + | ||
140 | + public Integer getAndroidExposureNum() { | ||
141 | + return androidExposureNum; | ||
142 | + } | ||
143 | + | ||
144 | + public void setAndroidExposureNum(Integer androidExposureNum) { | ||
145 | + this.androidExposureNum = androidExposureNum; | ||
98 | } | 146 | } |
99 | 147 | ||
100 | public Integer getDivisionCode() { | 148 | public Integer getDivisionCode() { |
@@ -128,12 +176,4 @@ public class MktReportWithAppActive { | @@ -128,12 +176,4 @@ public class MktReportWithAppActive { | ||
128 | public void setChannelCode(Integer channelCode) { | 176 | public void setChannelCode(Integer channelCode) { |
129 | this.channelCode = channelCode; | 177 | this.channelCode = channelCode; |
130 | } | 178 | } |
131 | - | ||
132 | - public Integer getExposureNum() { | ||
133 | - return exposureNum; | ||
134 | - } | ||
135 | - | ||
136 | - public void setExposureNum(Integer exposureNum) { | ||
137 | - this.exposureNum = exposureNum; | ||
138 | - } | ||
139 | } | 179 | } |
@@ -161,4 +161,19 @@ | @@ -161,4 +161,19 @@ | ||
161 | exposure_num = #{exposureNum,jdbcType=INTEGER} | 161 | exposure_num = #{exposureNum,jdbcType=INTEGER} |
162 | where id = #{id,jdbcType=INTEGER} | 162 | where id = #{id,jdbcType=INTEGER} |
163 | </update> | 163 | </update> |
164 | + | ||
165 | + <select id="selectMktReportFormByDateId" parameterType="java.util.Map" resultMap="BaseResultMap"> | ||
166 | + select | ||
167 | + <include refid="Base_Column_List" /> | ||
168 | + from mkt_report_form | ||
169 | + <include refid="WHERE_CONDITION"/> | ||
170 | + </select> | ||
171 | + | ||
172 | + <sql id="WHERE_CONDITION"> | ||
173 | + <trim prefix="where" prefixOverrides="and | or"> | ||
174 | + <if test="params.channelCode != null and params.channelCode != ''">and channel_code=#{params.channelCode}</if> | ||
175 | + <if test="params.beginTime != null and params.beginTime != ''"><![CDATA[ and date_id>=#{params.beginTime}]]></if> | ||
176 | + <if test="params.endTime != null and params.endTime != ''"><![CDATA[ and date_id<=#{params.endTime}]]></if> | ||
177 | + </trim> | ||
178 | + </sql> | ||
164 | </mapper> | 179 | </mapper> |
@@ -62,8 +62,8 @@ | @@ -62,8 +62,8 @@ | ||
62 | ['费用','曝光量','曝光成本'], | 62 | ['费用','曝光量','曝光成本'], |
63 | data.data.dateIdStrList, | 63 | data.data.dateIdStrList, |
64 | data.data.totalActualCostList, | 64 | data.data.totalActualCostList, |
65 | - data.data.totalExpoureNumList, | ||
66 | - data.data.totalExpoureRatio, | 65 | + data.data.totalExposureNumList, |
66 | + data.data.totalExposureRatioList, | ||
67 | data.data.topActualCost, | 67 | data.data.topActualCost, |
68 | data.data.topExposureActiveNewUdid, | 68 | data.data.topExposureActiveNewUdid, |
69 | data.data.topRatio); | 69 | data.data.topRatio); |
@@ -73,8 +73,8 @@ | @@ -73,8 +73,8 @@ | ||
73 | ['费用','曝光量','曝光成本'], | 73 | ['费用','曝光量','曝光成本'], |
74 | data.data.dateIdStrList, | 74 | data.data.dateIdStrList, |
75 | data.data.iosActualCostList, | 75 | data.data.iosActualCostList, |
76 | - data.data.iosExpoureNumList, | ||
77 | - data.data.iosExpoureRatio, | 76 | + data.data.iosExposureNumList, |
77 | + data.data.iosExposureRatioList, | ||
78 | data.data.topActualCost, | 78 | data.data.topActualCost, |
79 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 79 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
80 | drawEchart('exposure_ios',exposureIosOption); | 80 | drawEchart('exposure_ios',exposureIosOption); |
@@ -82,9 +82,9 @@ | @@ -82,9 +82,9 @@ | ||
82 | var exposureAndroidOption = getEchartOption("android市场费用/曝光量", | 82 | var exposureAndroidOption = getEchartOption("android市场费用/曝光量", |
83 | ['费用','曝光量','曝光成本'], | 83 | ['费用','曝光量','曝光成本'], |
84 | data.data.dateIdStrList, | 84 | data.data.dateIdStrList, |
85 | - data.data.androidActualCost, | ||
86 | - data.data.androidExpoureNumList, | ||
87 | - data.data.androidExpoureRatio, | 85 | + data.data.androidActualCostList, |
86 | + data.data.androidExposureNumList, | ||
87 | + data.data.androidExposureRatioList, | ||
88 | data.data.topActualCost, | 88 | data.data.topActualCost, |
89 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 89 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
90 | drawEchart('exposure_android',exposureAndroidOption); | 90 | drawEchart('exposure_android',exposureAndroidOption); |
@@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
95 | data.data.dateIdStrList, | 95 | data.data.dateIdStrList, |
96 | data.data.totalActualCostList, | 96 | data.data.totalActualCostList, |
97 | data.data.totalAppActiveList, | 97 | data.data.totalAppActiveList, |
98 | - data.data.totalActiveRatio, | 98 | + data.data.totalActiveRatioList, |
99 | data.data.topActualCost, | 99 | data.data.topActualCost, |
100 | data.data.topExposureActiveNewUdid, | 100 | data.data.topExposureActiveNewUdid, |
101 | data.data.topRatio); | 101 | data.data.topRatio); |
@@ -106,7 +106,7 @@ | @@ -106,7 +106,7 @@ | ||
106 | data.data.dateIdStrList, | 106 | data.data.dateIdStrList, |
107 | data.data.iosActualCostList, | 107 | data.data.iosActualCostList, |
108 | data.data.iosAppActiveList, | 108 | data.data.iosAppActiveList, |
109 | - data.data.iosActiveRatio, | 109 | + data.data.iosActiveRatioList, |
110 | data.data.topActualCost, | 110 | data.data.topActualCost, |
111 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 111 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
112 | drawEchart('active_ios',activeIosOption); | 112 | drawEchart('active_ios',activeIosOption); |
@@ -114,9 +114,9 @@ | @@ -114,9 +114,9 @@ | ||
114 | var activeAndroidOption = getEchartOption("android端市场费用/激活量", | 114 | var activeAndroidOption = getEchartOption("android端市场费用/激活量", |
115 | ['费用','激活量','激活成本'], | 115 | ['费用','激活量','激活成本'], |
116 | data.data.dateIdStrList, | 116 | data.data.dateIdStrList, |
117 | - data.data.androidActualCost, | 117 | + data.data.androidActualCostList, |
118 | data.data.androidAppActiveList, | 118 | data.data.androidAppActiveList, |
119 | - data.data.androidActiveRatio, | 119 | + data.data.androidActiveRatioList, |
120 | data.data.topActualCost, | 120 | data.data.topActualCost, |
121 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 121 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
122 | drawEchart('active_android',activeAndroidOption); | 122 | drawEchart('active_android',activeAndroidOption); |
@@ -127,7 +127,7 @@ | @@ -127,7 +127,7 @@ | ||
127 | data.data.dateIdStrList, | 127 | data.data.dateIdStrList, |
128 | data.data.totalActualCostList, | 128 | data.data.totalActualCostList, |
129 | data.data.totalNewUserList, | 129 | data.data.totalNewUserList, |
130 | - data.data.totalNewUdidRatio, | 130 | + data.data.totalNewUdidRatioList, |
131 | data.data.topActualCost, | 131 | data.data.topActualCost, |
132 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 132 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
133 | drawEchart('newuser',newuserOption); | 133 | drawEchart('newuser',newuserOption); |
@@ -137,7 +137,7 @@ | @@ -137,7 +137,7 @@ | ||
137 | data.data.dateIdStrList, | 137 | data.data.dateIdStrList, |
138 | data.data.iosActualCostList, | 138 | data.data.iosActualCostList, |
139 | data.data.iosNewUserList, | 139 | data.data.iosNewUserList, |
140 | - data.data.iosNewUdidRatio, | 140 | + data.data.iosNewUdidRatioList, |
141 | data.data.topActualCost, | 141 | data.data.topActualCost, |
142 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 142 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
143 | drawEchart('newuser_ios',newuserIosOption); | 143 | drawEchart('newuser_ios',newuserIosOption); |
@@ -145,9 +145,9 @@ | @@ -145,9 +145,9 @@ | ||
145 | var newuserAndroidOption = getEchartOption("android市场费用/新客量", | 145 | var newuserAndroidOption = getEchartOption("android市场费用/新客量", |
146 | ['费用','新客量','新客成本'], | 146 | ['费用','新客量','新客成本'], |
147 | data.data.dateIdStrList, | 147 | data.data.dateIdStrList, |
148 | - data.data.androidActualCost, | 148 | + data.data.androidActualCostList, |
149 | data.data.androidNewUserList, | 149 | data.data.androidNewUserList, |
150 | - data.data.androidNewUdidRatio, | 150 | + data.data.androidNewUdidRatioList, |
151 | data.data.topActualCost, | 151 | data.data.topActualCost, |
152 | data.data.topExposureActiveNewUdid,data.data.topRatio); | 152 | data.data.topExposureActiveNewUdid,data.data.topRatio); |
153 | drawEchart('newuser_android',newuserAndroidOption); | 153 | drawEchart('newuser_android',newuserAndroidOption); |
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | <th width="18%" data-options="field:'dateIdStr',align:'center'">日期</th> | 46 | <th width="18%" data-options="field:'dateIdStr',align:'center'">日期</th> |
47 | <th width="15%" data-options="field:'totalActualCost',align:'center'">实际总成本</th> | 47 | <th width="15%" data-options="field:'totalActualCost',align:'center'">实际总成本</th> |
48 | <th width="15%" data-options="field:'iosActualCost',align:'center'">ios实际成本</th> | 48 | <th width="15%" data-options="field:'iosActualCost',align:'center'">ios实际成本</th> |
49 | - <th width="15%" data-options="field:'androidActualCost',align:'center'">android实际成本</th> | 49 | + <th width="15%" data-options="field:'androidActualCostList',align:'center'">android实际成本</th> |
50 | <th width="15%" data-options="field:'totalClickNum',align:'center'">总点击量</th> | 50 | <th width="15%" data-options="field:'totalClickNum',align:'center'">总点击量</th> |
51 | <th width="15%" data-options="field:'iosClickNum',align:'center'">ios点击量</th> | 51 | <th width="15%" data-options="field:'iosClickNum',align:'center'">ios点击量</th> |
52 | <th width="15%" data-options="field:'androidClickNum',align:'center'">android点击量</th> | 52 | <th width="15%" data-options="field:'androidClickNum',align:'center'">android点击量</th> |
-
Please register or login to post a comment