Authored by zhouxiang

no message

package com.yoho.unions.dal;
import com.yoho.unions.dal.model.AppAdSourceMonitorAna;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AppAdSourceMonitorAnaMapper {
List<AppAdSourceMonitorAna> selectByUnionType(@Param("unionType") String unionType);
int selectCount(String unionType);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
public class AppAdSourceMonitorAna {
private Integer dateId;
private Integer hour;
private String unionType;
private String unionName;
private Integer pv;
private Integer infoPv;
private Integer cartPv;
private Integer orderNum;
private String ips;
private String skns;
public String getIps() {
return ips;
}
public void setIps(String ips) {
this.ips = ips;
}
public String getSkns() {
return skns;
}
public void setSkns(String skns) {
this.skns = skns;
}
public Integer getDateId() {
return dateId;
}
public void setDateId(Integer dateId) {
this.dateId = dateId;
}
public Integer getHour() {
return hour;
}
public void setHour(Integer hour) {
this.hour = hour;
}
public String getUnionType() {
return unionType;
}
public void setUnionType(String unionType) {
this.unionType = unionType == null ? null : unionType.trim();
}
public String getUnionName() {
return unionName;
}
public void setUnionName(String unionName) {
this.unionName = unionName == null ? null : unionName.trim();
}
public Integer getPv() {
return pv;
}
public void setPv(Integer pv) {
this.pv = pv;
}
public Integer getInfoPv() {
return infoPv;
}
public void setInfoPv(Integer infoPv) {
this.infoPv = infoPv;
}
public Integer getCartPv() {
return cartPv;
}
public void setCartPv(Integer cartPv) {
this.cartPv = cartPv;
}
public Integer getOrderNum() {
return orderNum;
}
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.AppAdSourceMonitorAnaMapper">
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.AppAdSourceMonitorAna">
<result column="date_id" property="dateId" jdbcType="INTEGER"/>
<result column="hour" property="hour" jdbcType="INTEGER"/>
<result column="union_type" property="unionType" jdbcType="VARCHAR"/>
<result column="union_name" property="unionName" jdbcType="VARCHAR"/>
<result column="pv" property="pv" jdbcType="INTEGER"/>
<result column="info_pv" property="infoPv" jdbcType="INTEGER"/>
<result column="cart_pv" property="cartPv" jdbcType="INTEGER"/>
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
<result column="ips" property="ips" jdbcType="LONGVARCHAR"/>
<result column="skns" property="skns" jdbcType="LONGVARCHAR"/>
</resultMap>
<sql id="Blob_Column_List">
date_id,hour,union_type,union_name,pv,info_pv,cart_pv,order_num,ips, skns
</sql>
<select id="selectByUnionType" resultMap="BaseResultMap"
parameterType="com.yoho.unions.dal.model.AppAdSourceMonitorAna">
select
<include refid="Blob_Column_List"/>
from APP_AD_SOURCE_MONITOR_ANA where union_type = #{unionType}
</select>
<select id="selectCount" resultType="java.lang.Integer">
select
COUNT(*)
from APP_AD_SOURCE_MONITOR_ANA where union_type = #{unionType}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -373,4 +373,13 @@ public class ActivateUnionRest {
return new ApiResponse.ApiResponseBuilder().code(200).message("成功").data(pageActivateDeviceIdResponseBO).build();
}
@RequestMapping("/queryMonitorList")
@ResponseBody
public ApiResponse queryMonitorList(ActivateDeviceIdReqBO activateDeviceIdReqBO) {
PageMonitorRspBO pageMonitorRspBO = unionService.queryMonitorList(activateDeviceIdReqBO.getUnionType(),activateDeviceIdReqBO.getPage(),activateDeviceIdReqBO.getRows());
return new ApiResponse.ApiResponseBuilder().code(200).message("成功").data(pageMonitorRspBO).build();
}
}
... ...
... ... @@ -11,7 +11,6 @@ import com.yoho.unions.interceptor.RemoteIPInterceptor;
import org.apache.commons.lang.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.InvocationTargetException;
/**
* 描述:联盟统一接口
... ... @@ -82,4 +81,6 @@ public interface IUnionService {
PageActivateDeviceIdRspBO queryActivateDay(ActivateDeviceIdReqBO activateDeviceIdReqBO);
PageYHActivateDeviceIdRspBO queryYHActivateDeviceId(YHActivateDeviceIdReqBO yhActivateDeviceIdReqBO, String unionType);
PageMonitorRspBO queryMonitorList(String unionType, int page, Integer rows);
}
... ...
... ... @@ -6,15 +6,14 @@ package com.yoho.unions.server.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.netflix.config.DynamicIntProperty;
import com.netflix.config.DynamicPropertyFactory;
import com.yoho.core.common.utils.MD5;
import com.yoho.core.common.utils.Marker;
import com.yoho.core.redis.YHRedisTemplate;
import com.yoho.core.redis.YHValueOperations;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.event.DeviceActiveEvent;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.union.UnionTypeModel;
... ... @@ -35,9 +34,9 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.BeanUtils;
import org.springframework.cache.interceptor.CacheableOperation;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Service;
... ... @@ -118,6 +117,9 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
@Resource(name="unionServiceImpl")
IUnionService unionService;
@Autowired
AppAdSourceMonitorAnaMapper appAdSourceMonitorAnaMapper;
// 记录付费渠道的redis
private static final String UNION_PAY_CHANNEL_KEY_PRE = "union:pay_channel:";
... ... @@ -979,4 +981,24 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
pageYHActivateDeviceIdRspBO.setList(yhActivateDeviceIdRspBOList);
return pageYHActivateDeviceIdRspBO;
}
@Override
public PageMonitorRspBO queryMonitorList(String unionType, int page, Integer rows) {
int count = appAdSourceMonitorAnaMapper.selectCount(unionType);
List<AppAdSourceMonitorAna> list = appAdSourceMonitorAnaMapper.selectByUnionType(unionType);
if(CollectionUtils.isEmpty(list)){
return null;
}
List<AppAdSourceMonitorAnaBO> anaBOList = Lists.transform(list, input -> {
AppAdSourceMonitorAnaBO bo = new AppAdSourceMonitorAnaBO();
BeanUtils.copyProperties(input,bo);
bo.setIps(StringUtils.isEmpty(bo.getIps()) ? "" : bo.getIps().replaceAll(",","\n"));
bo.setSkns(StringUtils.isEmpty(bo.getSkns()) ? "" : bo.getSkns().replaceAll(",","\n"));
return bo;
});
PageMonitorRspBO rspBO = new PageMonitorRspBO();
rspBO.setTotal(count);
rspBO.setList(anaBOList);
return rspBO;
}
}
... ...
... ... @@ -57,5 +57,15 @@ datasources:
- com.yoho.unions.dal.IChannelUserDAO
- com.yoho.unions.dal.IUnionUidTypeDAO
bigdata_yh_unions:
servers:
- 118.89.235.30
- 118.89.235.30
username: yh_test_bigdata
password: rALdkYPZCr4QyzBfVCGdXA==
daos:
- com.yoho.unions.dal.IChannelUserDAO
- com.yoho.unions.dal.AppAdSourceMonitorAnaMapper
readOnlyInSlave: true
\ No newline at end of file
... ...
... ... @@ -64,6 +64,7 @@ datasources:
password: ${jdbc.mysql.bigdataunion.password}
daos:
- com.yoho.unions.dal.IChannelUserDAO
- com.yoho.unions.dal.AppAdSourceMonitorAnaMapper
bigdata_yoho_passport:
servers:
... ...
... ... @@ -274,6 +274,15 @@
var str = "<a role='day' dataId='" + rowData.unionType + "' style='margin-left:10px'></a>";
return str;
}
}, {
title: "详细",
field: "op",
width: 180,
align: "center",
formatter: function (value, rowData, rowIndex) {
var str = "<a role='detial' href='/union/admin/monitorList.html?unionType=" + rowData.unionType + "' dataId='" + rowData.unionType + "' style='margin-left:10px'></a>";
return str;
}
}
]],
cache: false,
... ... @@ -328,6 +337,11 @@
}
});
$(this).myDatagrid("getPanel").find("a[role='detial']").linkbutton({
iconCls: "icon-more",
text: '查看'
});
$(this).myDatagrid("getPanel").find("a[role='day']").linkbutton({
iconCls: "icon-more",
text: '查看',
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/union/js/include.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="center">
<div style="margin-left: 30px;margin-top: 20px; height:500px;">
<table id="table"></table>
</div>
</div>
<div id="dd" class="easyui-dialog" title="详细" style="width:400px;height:200px;text-align: center"
data-options="resizable:true,modal:true">
<textarea id="tx" style="width: 360px; margin: 0px; height: 140px;"></textarea>
</div>
<script>
function getQueryStr(key) {
var svalue = window.location.search.match(new RegExp("[\?\&]" + key + "=([^\&]*)(\&?)", "i"));
var str = svalue ? svalue[1] : svalue;
return str == null ? "" : str;
}
$(function () {
$('#dd').dialog('close');
$("#table").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/ActivateUnionRest/queryMonitorList?unionType=" + getQueryStr("unionType"),
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "渠道Id",
field: "unionType",
width: 200,
align: "center"
}, {
title: "渠道名称",
field: "unionName",
width: 250,
align: "center"
}, {
title: "pv",
field: "pv",
width: 180,
align: "center"
}, {
title: "商品详情页pv",
field: "infoPv",
width: 180,
align: "center"
}, {
title: "加入购物车pv",
field: "cartPv",
width: 180,
align: "center"
}, {
title: "收订订单数据",
field: "orderNum",
width: 180,
align: "center"
}, {
title: "ip",
field: "ips",
width: 180,
align: "center",
formatter: function (value, row, index) {
var str = "<a role='ips' index='"+index+"' style='margin-left:10px'></a>";
return str;
}
}, {
title: "skn",
field: "skns",
width: 180,
align: "center",
formatter: function (value, row, index) {
var str = "<a role='skns' index='"+index+"' style='margin-left:10px'></a>";
return str;
}
}
]],
cache: false,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: true,
checkOnSelect: false,
onLoadSuccess: function (data) {
$(this).myDatagrid("getPanel").find("a[role='ips']").linkbutton({
iconCls: "icon-more",
text: '查看',
onClick: function () {
$('#tx').val(data.list[$(this).attr('index')].ips);
$('#dd').dialog('open');
}
});
$(this).myDatagrid("getPanel").find("a[role='skns']").linkbutton({
iconCls: "icon-more",
text: '查看',
onClick: function () {
$('#tx').val(data.list[$(this).attr('index')].skns);
$('#dd').dialog('open');
}
});
}
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...