Showing
4 changed files
with
9 additions
and
6 deletions
@@ -8,7 +8,7 @@ public interface BaseUserActiveDayMapper { | @@ -8,7 +8,7 @@ public interface BaseUserActiveDayMapper { | ||
8 | 8 | ||
9 | BaseUserActiveDay selectByUdidAndAppKey(@Param("udid")String udid,@Param("appKey")String appKey); | 9 | BaseUserActiveDay selectByUdidAndAppKey(@Param("udid")String udid,@Param("appKey")String appKey); |
10 | 10 | ||
11 | - BaseUserActiveDay selectByIdfaAndAppKey(@Param("idfa")String idfa,@Param("appKey")String appKey); | 11 | + BaseUserActiveDay selectByIdfaAndAppKey(@Param("idfa")String idfa,@Param("appKey")String appKey, @Param("end_date")int end_date); |
12 | 12 | ||
13 | BaseUserActiveDay selectByUdidAndAppKeyDate(@Param("udid")String udid,@Param("appKey")String appKey,@Param("end_date")int end_date); | 13 | BaseUserActiveDay selectByUdidAndAppKeyDate(@Param("udid")String udid,@Param("appKey")String appKey,@Param("end_date")int end_date); |
14 | } | 14 | } |
@@ -17,6 +17,6 @@ | @@ -17,6 +17,6 @@ | ||
17 | </select> | 17 | </select> |
18 | 18 | ||
19 | <select id="selectByIdfaAndAppKey" resultMap="BaseResultMap"> | 19 | <select id="selectByIdfaAndAppKey" resultMap="BaseResultMap"> |
20 | - select * from base_user_active_day where idfa=#{idfa} and app_key = #{appKey} limit 1 | 20 | + select * from base_user_active_day where idfa=#{idfa} and app_key = #{appKey} and date_id <#{end_date} limit 1 |
21 | </select> | 21 | </select> |
22 | </mapper> | 22 | </mapper> |
@@ -162,12 +162,13 @@ public class ActivateUnionRest { | @@ -162,12 +162,13 @@ public class ActivateUnionRest { | ||
162 | String deviceType = mul[1]; | 162 | String deviceType = mul[1]; |
163 | int beginTime = Integer.parseInt(mul[2]); | 163 | int beginTime = Integer.parseInt(mul[2]); |
164 | int endTime = Integer.parseInt(mul[3]); | 164 | int endTime = Integer.parseInt(mul[3]); |
165 | + int poolDate = Integer.parseInt(mul[4]); | ||
165 | 166 | ||
166 | Map<String, List<String>> resultMap = new HashMap<>(); | 167 | Map<String, List<String>> resultMap = new HashMap<>(); |
167 | for (int i = 1; i < array.length; i++) { | 168 | for (int i = 1; i < array.length; i++) { |
168 | String deviceId = array[i]; | 169 | String deviceId = array[i]; |
169 | log.info("fixUnion deviceId is {}", deviceId); | 170 | log.info("fixUnion deviceId is {}", deviceId); |
170 | - UnionResponse resp = fixService.fixUnion(unionType, beginTime, endTime, deviceType, deviceId); | 171 | + UnionResponse resp = fixService.fixUnion(unionType, beginTime, endTime, poolDate, deviceType, deviceId); |
171 | log.info("fixUnion deviceId is {} result is {}", deviceId, resp); | 172 | log.info("fixUnion deviceId is {} result is {}", deviceId, resp); |
172 | List<String> uts = resultMap.get(resp.getMessage()); | 173 | List<String> uts = resultMap.get(resp.getMessage()); |
173 | if (uts == null) { | 174 | if (uts == null) { |
@@ -176,7 +177,9 @@ public class ActivateUnionRest { | @@ -176,7 +177,9 @@ public class ActivateUnionRest { | ||
176 | } | 177 | } |
177 | uts.add(deviceId); | 178 | uts.add(deviceId); |
178 | } | 179 | } |
179 | - return JSON.toJSONString(resultMap); | 180 | + String result = JSON.toJSONString(resultMap); |
181 | + log.info("fixUnion all result is {}", result); | ||
182 | + return result; | ||
180 | } | 183 | } |
181 | 184 | ||
182 | private UnionResponse getGoUrl(ActivateUnionRequestBO bo){ | 185 | private UnionResponse getGoUrl(ActivateUnionRequestBO bo){ |
@@ -50,7 +50,7 @@ public class UnionFixServiceImpl { | @@ -50,7 +50,7 @@ public class UnionFixServiceImpl { | ||
50 | @Autowired | 50 | @Autowired |
51 | AppAdSourceMonitorAnaMapper appAdSourceMonitorAnaMapper; | 51 | AppAdSourceMonitorAnaMapper appAdSourceMonitorAnaMapper; |
52 | 52 | ||
53 | - public UnionResponse fixUnion(String unionType, int beginTime, int endTime, String deviceType, String deviceId) { | 53 | + public UnionResponse fixUnion(String unionType, int beginTime, int endTime, int poolDate, String deviceType, String deviceId) { |
54 | UnionClickLogs log; | 54 | UnionClickLogs log; |
55 | if (StringUtils.equalsIgnoreCase(deviceType, "android")) { | 55 | if (StringUtils.equalsIgnoreCase(deviceType, "android")) { |
56 | log = unionClickLogsDAO.selectByImei(deviceId, beginTime, endTime); | 56 | log = unionClickLogsDAO.selectByImei(deviceId, beginTime, endTime); |
@@ -68,7 +68,7 @@ public class UnionFixServiceImpl { | @@ -68,7 +68,7 @@ public class UnionFixServiceImpl { | ||
68 | return new UnionResponse(500, "invalid:in union_logs"); | 68 | return new UnionResponse(500, "invalid:in union_logs"); |
69 | } | 69 | } |
70 | 70 | ||
71 | - BaseUserActiveDay baseUserActiveDay = baseUserActiveDayMapper.selectByIdfaAndAppKey(deviceId, "yohobuy"); | 71 | + BaseUserActiveDay baseUserActiveDay = baseUserActiveDayMapper.selectByIdfaAndAppKey(deviceId, "yohobuy_" + deviceType.toLowerCase(), poolDate); |
72 | if (baseUserActiveDay != null) { | 72 | if (baseUserActiveDay != null) { |
73 | return new UnionResponse(500, "invalid:in bigdata"); | 73 | return new UnionResponse(500, "invalid:in bigdata"); |
74 | } | 74 | } |
-
Please register or login to post a comment