Authored by Lixiaodi

修复数据

... ... @@ -8,7 +8,7 @@ public interface BaseUserActiveDayMapper {
BaseUserActiveDay selectByUdidAndAppKey(@Param("udid")String udid,@Param("appKey")String appKey);
BaseUserActiveDay selectByIdfaAndAppKey(@Param("idfa")String idfa,@Param("appKey")String appKey);
BaseUserActiveDay selectByIdfaAndAppKey(@Param("idfa")String idfa,@Param("appKey")String appKey, @Param("end_date")int end_date);
BaseUserActiveDay selectByUdidAndAppKeyDate(@Param("udid")String udid,@Param("appKey")String appKey,@Param("end_date")int end_date);
}
\ No newline at end of file
... ...
... ... @@ -17,6 +17,6 @@
</select>
<select id="selectByIdfaAndAppKey" resultMap="BaseResultMap">
select * from base_user_active_day where idfa=#{idfa} and app_key = #{appKey} limit 1
select * from base_user_active_day where idfa=#{idfa} and app_key = #{appKey} and date_id &lt;#{end_date} limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -162,12 +162,13 @@ public class ActivateUnionRest {
String deviceType = mul[1];
int beginTime = Integer.parseInt(mul[2]);
int endTime = Integer.parseInt(mul[3]);
int poolDate = Integer.parseInt(mul[4]);
Map<String, List<String>> resultMap = new HashMap<>();
for (int i = 1; i < array.length; i++) {
String deviceId = array[i];
log.info("fixUnion deviceId is {}", deviceId);
UnionResponse resp = fixService.fixUnion(unionType, beginTime, endTime, deviceType, deviceId);
UnionResponse resp = fixService.fixUnion(unionType, beginTime, endTime, poolDate, deviceType, deviceId);
log.info("fixUnion deviceId is {} result is {}", deviceId, resp);
List<String> uts = resultMap.get(resp.getMessage());
if (uts == null) {
... ... @@ -176,7 +177,9 @@ public class ActivateUnionRest {
}
uts.add(deviceId);
}
return JSON.toJSONString(resultMap);
String result = JSON.toJSONString(resultMap);
log.info("fixUnion all result is {}", result);
return result;
}
private UnionResponse getGoUrl(ActivateUnionRequestBO bo){
... ...
... ... @@ -50,7 +50,7 @@ public class UnionFixServiceImpl {
@Autowired
AppAdSourceMonitorAnaMapper appAdSourceMonitorAnaMapper;
public UnionResponse fixUnion(String unionType, int beginTime, int endTime, String deviceType, String deviceId) {
public UnionResponse fixUnion(String unionType, int beginTime, int endTime, int poolDate, String deviceType, String deviceId) {
UnionClickLogs log;
if (StringUtils.equalsIgnoreCase(deviceType, "android")) {
log = unionClickLogsDAO.selectByImei(deviceId, beginTime, endTime);
... ... @@ -68,7 +68,7 @@ public class UnionFixServiceImpl {
return new UnionResponse(500, "invalid:in union_logs");
}
BaseUserActiveDay baseUserActiveDay = baseUserActiveDayMapper.selectByIdfaAndAppKey(deviceId, "yohobuy");
BaseUserActiveDay baseUserActiveDay = baseUserActiveDayMapper.selectByIdfaAndAppKey(deviceId, "yohobuy_" + deviceType.toLowerCase(), poolDate);
if (baseUserActiveDay != null) {
return new UnionResponse(500, "invalid:in bigdata");
}
... ...