...
|
...
|
@@ -5,6 +5,7 @@ package com.yoho.unions.server.service.impl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
...
|
...
|
@@ -23,6 +24,7 @@ import com.yoho.unions.common.enums.ClientTypeEnum; |
|
|
import com.yoho.unions.common.redis.RedisListCache;
|
|
|
import com.yoho.unions.common.redis.RedisTemplate;
|
|
|
import com.yoho.unions.common.redis.RedisValueCache;
|
|
|
import com.yoho.unions.common.service.IBusinessExportService;
|
|
|
import com.yoho.unions.common.utils.DateUtil;
|
|
|
import com.yoho.unions.common.utils.HttpUtils;
|
|
|
import com.yoho.unions.common.utils.SpringContextUtil;
|
...
|
...
|
@@ -59,7 +61,7 @@ import java.util.stream.Collectors; |
|
|
* 2016年5月10日
|
|
|
*/
|
|
|
@Service
|
|
|
public class UnionServiceImpl implements IUnionService,ApplicationEventPublisherAware {
|
|
|
public class UnionServiceImpl implements IUnionService, IBusinessExportService, ApplicationEventPublisherAware {
|
|
|
|
|
|
static Logger activeDingdang = LoggerFactory.getLogger("activeDingdang");
|
|
|
|
...
|
...
|
@@ -796,7 +798,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
@Override
|
|
|
public PageActivateDeviceIdRspBO queryActivateDeviceId(ActivateDeviceIdReqBO activateDeviceIdReqBO) {
|
|
|
log.info("enter queryActivateDeviceId. param activateDeviceIdReqBO={}", activateDeviceIdReqBO);
|
|
|
|
|
|
//(1).查询出各渠道激活的设备id数
|
|
|
List<ActivateDeviceIdRspBO> activateDeviceIdRspList = unionLogsDAO.selectListByParam(activateDeviceIdReqBO);
|
|
|
//查询自然量的激活数
|
...
|
...
|
@@ -1534,4 +1535,45 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Class getDataClass() {
|
|
|
return ActivateDeviceIdRspBO.class;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<? extends Object> batchExport(String confStr) {
|
|
|
try{
|
|
|
ActivateDeviceIdReqBO request = JSONObject.parseObject(confStr, ActivateDeviceIdReqBO.class);
|
|
|
// 查询渠道激活总数
|
|
|
PageActivateDeviceIdRspBO pageActivateDeviceIdRspBO = queryActivateDeviceId(request);
|
|
|
if(pageActivateDeviceIdRspBO==null){
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
// 查询渠道点击总数
|
|
|
List<ActivateDeviceIdRspBO> activateDeviceIdRspBOList = pageActivateDeviceIdRspBO.getList();
|
|
|
if(CollectionUtils.isEmpty(activateDeviceIdRspBOList)){
|
|
|
throw new ServiceException(400, "没有要导出的数据");
|
|
|
}
|
|
|
|
|
|
for(ActivateDeviceIdRspBO activateDeviceIdRspBO : activateDeviceIdRspBOList){
|
|
|
String unionType = activateDeviceIdRspBO.getUnionType();
|
|
|
// 点击IOS数
|
|
|
request.setUnionType(Long.valueOf(unionType));
|
|
|
request.setIsIdfa(1);
|
|
|
activateDeviceIdRspBO.setIdfaClick(queryActivateCount(request));
|
|
|
// 点击安卓数
|
|
|
request.setIsIdfa(0);
|
|
|
activateDeviceIdRspBO.setImeiClick(queryActivateCount(request));
|
|
|
}
|
|
|
return activateDeviceIdRspBOList;
|
|
|
}catch(JSONException e) {
|
|
|
log.warn("parse confStr error: confStr {}, e {}", confStr, e);
|
|
|
throw new ServiceException(400, "传入数据格式错误");
|
|
|
} catch (com.yoho.error.exception.ServiceException e) {
|
|
|
log.warn("make url error params is confStr {}, e {}", confStr, e);
|
|
|
throw new ServiceException(e.getCode(), e.getErrorMessage());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} |
...
|
...
|
|