Authored by wangshusheng

Merge branch 'dev_export_0220' into test6.8.6

... ... @@ -39,6 +39,7 @@
from mkt_marketing_url
where name = #{name} limit 1
</select>
<select id="selectByNameAndUnionType" resultType="java.lang.Integer" >
select count(1) from mkt_marketing_url
where name = #{name} and union_type = #{unionType,jdbcType=BIGINT}
... ...
... ... @@ -240,6 +240,9 @@
<if test="unionType !=null and unionType !='' ">
and union_type = #{unionType}
</if>
<if test="unionName !=null and unionName !='' ">
and union_name LIKE CONCAT('%',#{unionName,jdbcType=VARCHAR},'%')
</if>
<if test="idfa !=null and idfa !='' ">
and idfa = #{idfa}
</if>
... ... @@ -264,6 +267,9 @@
<if test="unionType !=null and unionType !='' ">
and union_type = #{unionType}
</if>
<if test="unionName !=null and unionName !='' ">
and union_name LIKE CONCAT('%',#{unionName,jdbcType=VARCHAR},'%')
</if>
<if test="idfa !=null and idfa !='' ">
and idfa = #{idfa}
</if>
... ...
... ... @@ -164,6 +164,9 @@
<if test="unionType !=null and unionType !='' ">
and union_type = #{unionType}
</if>
<if test="unionName !=null and unionName !='' ">
and union_name LIKE CONCAT('%',#{unionName,jdbcType=VARCHAR},'%')
</if>
group by union_type
order by count(*) desc,count(idfa) desc
</select>
... ...
... ... @@ -5,7 +5,7 @@
<parent>
<groupId>com.yoho</groupId>
<artifactId>parent</artifactId>
<version>1.5.1-SNAPSHOT</version>
<version>1.5.2-SNAPSHOT</version>
</parent>
<groupId>com.yoho.dsf</groupId>
<artifactId>yoho-unions</artifactId>
... ...
... ... @@ -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());
}
}
}
... ...
... ... @@ -122,6 +122,7 @@
<entry key="unionShareServiceImpl" value-ref="unionShareServiceImpl"/>
<entry key="unionShareApplyExportImpl" value-ref="unionShareApplyExportImpl"/>
<entry key="userRegisterBuyInfoserviceImpl" value-ref="userRegisterBuyInfoserviceImpl"/>
<entry key="activeClickExportImpl" value-ref="unionServiceImpl"/>
</util:map>
</beans>
... ...
... ... @@ -51,12 +51,15 @@
]"/>
<input name="unionType" type="text" class="easyui-textbox" data-options="prompt:'请输入渠道号'"
style="width: 200px;">
<input name="unionName" type="text" class="easyui-textbox" data-options="prompt:'请输入渠道名称'"
style="width: 200px;">
<input id="activateTimeBegin" name="activateTimeBegin" type="text" class="easyui-datetimebox" editable="false"
data-options="prompt:'激活开始时间'" style="width: 200px;">
<input id="activateTimeEnd" name="activateTimeEnd" type="text" class="easyui-datetimebox" editable="false"
data-options="prompt:'激活结束时间'" style="width: 200px;">
<a id="searchBtn" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
<a id="searchBtn3" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
<a id="exportButton1" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
</form>
</div>
</div>
... ... @@ -127,6 +130,8 @@
]"/>
<input name="unionType" type="text" class="easyui-textbox" data-options="prompt:'请输入渠道号'"
style="width: 200px;">
<input name="unionName" type="text" class="easyui-textbox" data-options="prompt:'请输入渠道名称'"
style="width: 200px;">
<input name="idfa" type="text" class="easyui-textbox" data-options="prompt:'请输入idfa'"
style="width: 200px;">
<input name="imei" type="text" class="easyui-textbox" data-options="prompt:'请输入imei'"
... ... @@ -881,6 +886,14 @@
)
$("#exportButton1").linkbutton({
iconCls: "icon-search",
text: "导出",
onClick : function() {
window.open(contextPath + "/batch/export.do?type=activeClickExportImpl&queryConf=" + escape(JSON.stringify(getParam("searchForm"))));
}
});
$("#searchBtn2").linkbutton({
iconCls: "icon-search",
text: "查询",
... ... @@ -971,6 +984,7 @@
$("#activateTalbe2").datagrid('loadData', data);
}
});
});
... ...