Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
2af2c4be
Commit
2af2c4be
authored
Jul 22, 2019
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
广告投放数据监测
parent
afab787a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
2070 additions
and
63 deletions
+2070
-63
BookDto.java
...-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
+80
-0
GroupTopicDTO.java
...rc/main/java/com/pcloud/book/group/dto/GroupTopicDTO.java
+32
-0
AdvertisingSpaceBiz.java
.../com/pcloud/book/advertising/biz/AdvertisingSpaceBiz.java
+28
-0
BmBiz.java
.../src/main/java/com/pcloud/book/advertising/biz/BmBiz.java
+8
-0
AdvertisingSpaceBizImpl.java
...ud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
+0
-0
BmBizImpl.java
.../java/com/pcloud/book/advertising/biz/impl/BmBizImpl.java
+29
-28
AdvertisingBrowseRecordDao.java
...loud/book/advertising/dao/AdvertisingBrowseRecordDao.java
+57
-0
AdvertisingClickRecordDao.java
...cloud/book/advertising/dao/AdvertisingClickRecordDao.java
+11
-0
AdvertisingExposureRecordDao.java
...ud/book/advertising/dao/AdvertisingExposureRecordDao.java
+7
-0
AdvertisingPilotRecordDao.java
...cloud/book/advertising/dao/AdvertisingPilotRecordDao.java
+55
-0
AdvertisingPutDao.java
...va/com/pcloud/book/advertising/dao/AdvertisingPutDao.java
+11
-0
BmRegisterDao.java
...n/java/com/pcloud/book/advertising/dao/BmRegisterDao.java
+9
-0
AdvertisingBrowseRecordDaoImpl.java
.../advertising/dao/impl/AdvertisingBrowseRecordDaoImpl.java
+68
-0
AdvertisingClickRecordDaoImpl.java
...k/advertising/dao/impl/AdvertisingClickRecordDaoImpl.java
+12
-1
AdvertisingExposureRecordDaoImpl.java
...dvertising/dao/impl/AdvertisingExposureRecordDaoImpl.java
+14
-2
AdvertisingPilotRecordDaoImpl.java
...k/advertising/dao/impl/AdvertisingPilotRecordDaoImpl.java
+61
-0
AdvertisingPutDaoImpl.java
...loud/book/advertising/dao/impl/AdvertisingPutDaoImpl.java
+13
-0
BmRegisterDaoImpl.java
...m/pcloud/book/advertising/dao/impl/BmRegisterDaoImpl.java
+11
-0
AdvertisingDistributionDTO.java
...loud/book/advertising/dto/AdvertisingDistributionDTO.java
+117
-0
AdvertisingMasterDTO.java
...com/pcloud/book/advertising/dto/AdvertisingMasterDTO.java
+42
-0
AdvertisingSpaceDTO.java
.../com/pcloud/book/advertising/dto/AdvertisingSpaceDTO.java
+82
-0
AdvertisingBrowseRecord.java
...loud/book/advertising/entity/AdvertisingBrowseRecord.java
+261
-0
AdvertisingPilotRecord.java
...cloud/book/advertising/entity/AdvertisingPilotRecord.java
+248
-0
AdvertisingSpaceFacade.java
...cloud/book/advertising/facade/AdvertisingSpaceFacade.java
+58
-0
AdvertisingSpaceFacadeImpl.java
...k/advertising/facade/impl/AdvertisingSpaceFacadeImpl.java
+99
-0
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+1
-1
GroupQrcodeBiz.java
...c/main/java/com/pcloud/book/group/biz/GroupQrcodeBiz.java
+1
-1
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+5
-0
GroupQrcodeBizImpl.java
...va/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
+12
-7
AdGroupQrcodeDTO.java
...main/java/com/pcloud/book/group/dto/AdGroupQrcodeDTO.java
+93
-0
GroupQrcodeFacadeImpl.java
.../pcloud/book/group/facade/impl/GroupQrcodeFacadeImpl.java
+3
-3
GroupSet.java
...ook/src/main/java/com/pcloud/book/group/set/GroupSet.java
+41
-0
ThreadPoolUtils.java
...ain/java/com/pcloud/book/util/common/ThreadPoolUtils.java
+30
-0
AdvertisingBmOptionMapper.xml
...esources/mapper/advertising/AdvertisingBmOptionMapper.xml
+0
-1
AdvertisingBmRegisterMapper.xml
...ources/mapper/advertising/AdvertisingBmRegisterMapper.xml
+19
-0
AdvertisingBrowseRecordMapper.xml
...rces/mapper/advertising/AdvertisingBrowseRecordMapper.xml
+141
-0
AdvertisingClickRecordMapper.xml
...urces/mapper/advertising/AdvertisingClickRecordMapper.xml
+33
-0
AdvertisingDistributionBookMapper.xml
.../mapper/advertising/AdvertisingDistributionBookMapper.xml
+13
-0
AdvertisingExposureRecordMapper.xml
...es/mapper/advertising/AdvertisingExposureRecordMapper.xml
+17
-0
AdvertisingPilotRecordMapper.xml
...urces/mapper/advertising/AdvertisingPilotRecordMapper.xml
+173
-0
AdvertisingPutMapper.xml
...ain/resources/mapper/advertising/AdvertisingPutMapper.xml
+38
-0
AdvertisingSpaceMapper.xml
...n/resources/mapper/advertising/AdvertisingSpaceMapper.xml
+27
-17
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+7
-0
BookGroupClassify.Mapper.xml
.../main/resources/mapper/group/BookGroupClassify.Mapper.xml
+3
-2
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
View file @
2af2c4be
...
@@ -523,7 +523,33 @@ public class BookDto extends BaseDto {
...
@@ -523,7 +523,33 @@ public class BookDto extends BaseDto {
* 报名率
* 报名率
*/
*/
private
BigDecimal
registerRate
;
private
BigDecimal
registerRate
;
/**
* 点击读者量
*/
private
Long
clickUserNum
;
/**
* 试听完成人数(完课量)
*/
private
Long
pilotFinishUserNum
;
/**
* 试听完成比率(完课率)
*/
private
BigDecimal
pilotFinishRate
;
/**
* 平均浏览时长
*/
private
BigDecimal
avgBrowseTimes
;
/**
* 跳出量
*/
private
Long
outNum
;
/**
* 跳出率
*/
private
BigDecimal
outRate
;
public
String
getQrRemark
()
{
public
String
getQrRemark
()
{
return
qrRemark
;
return
qrRemark
;
...
@@ -1337,6 +1363,54 @@ public class BookDto extends BaseDto {
...
@@ -1337,6 +1363,54 @@ public class BookDto extends BaseDto {
this
.
registerRate
=
registerRate
;
this
.
registerRate
=
registerRate
;
}
}
public
Long
getClickUserNum
()
{
return
clickUserNum
;
}
public
void
setClickUserNum
(
Long
clickUserNum
)
{
this
.
clickUserNum
=
clickUserNum
;
}
public
Long
getPilotFinishUserNum
()
{
return
pilotFinishUserNum
;
}
public
void
setPilotFinishUserNum
(
Long
pilotFinishUserNum
)
{
this
.
pilotFinishUserNum
=
pilotFinishUserNum
;
}
public
BigDecimal
getPilotFinishRate
()
{
return
pilotFinishRate
;
}
public
void
setPilotFinishRate
(
BigDecimal
pilotFinishRate
)
{
this
.
pilotFinishRate
=
pilotFinishRate
;
}
public
BigDecimal
getAvgBrowseTimes
()
{
return
avgBrowseTimes
;
}
public
void
setAvgBrowseTimes
(
BigDecimal
avgBrowseTimes
)
{
this
.
avgBrowseTimes
=
avgBrowseTimes
;
}
public
Long
getOutNum
()
{
return
outNum
;
}
public
void
setOutNum
(
Long
outNum
)
{
this
.
outNum
=
outNum
;
}
public
BigDecimal
getOutRate
()
{
return
outRate
;
}
public
void
setOutRate
(
BigDecimal
outRate
)
{
this
.
outRate
=
outRate
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"BookDto{"
+
return
"BookDto{"
+
...
@@ -1441,6 +1515,12 @@ public class BookDto extends BaseDto {
...
@@ -1441,6 +1515,12 @@ public class BookDto extends BaseDto {
", secondTypeCode='"
+
secondTypeCode
+
'\''
+
", secondTypeCode='"
+
secondTypeCode
+
'\''
+
", registerNum="
+
registerNum
+
", registerNum="
+
registerNum
+
", registerRate="
+
registerRate
+
", registerRate="
+
registerRate
+
", clickUserNum="
+
clickUserNum
+
", pilotFinishUserNum="
+
pilotFinishUserNum
+
", pilotFinishRate="
+
pilotFinishRate
+
", avgBrowseTimes="
+
avgBrowseTimes
+
", outNum="
+
outNum
+
", outRate="
+
outRate
+
'}'
;
'}'
;
}
}
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/GroupTopicDTO.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
group
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
/**
* @描述:
* @作者:zhuyajie
* @创建时间:16:33 2019/7/16
* @版本:1.0
*/
public
class
GroupTopicDTO
extends
BaseDto
{
/**
* 分类标识
*/
private
Long
classifyId
;
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
@Override
public
String
toString
()
{
return
"GroupTopicDTO{"
+
"classifyId="
+
classifyId
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/AdvertisingSpaceBiz.java
View file @
2af2c4be
...
@@ -443,4 +443,32 @@ public interface AdvertisingSpaceBiz {
...
@@ -443,4 +443,32 @@ public interface AdvertisingSpaceBiz {
*/
*/
PageBeanNew
<
AdvertisingPlan
>
getAdvertisingPlanList
(
String
keyword
,
Long
partyId
,
Integer
currentPage
,
Integer
numPerPage
);
PageBeanNew
<
AdvertisingPlan
>
getAdvertisingPlanList
(
String
keyword
,
Long
partyId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 完课量埋点
* @param advertisingPilotRecord
*/
void
addPilotTrack
(
AdvertisingPilotRecord
advertisingPilotRecord
);
/**
* 浏览时长埋点
* @param advertisingBrowseRecord
*/
String
addBrowseTrack
(
AdvertisingBrowseRecord
advertisingBrowseRecord
);
/**
* 微信群广告投放详情
* @param qrcodeId
* @param statisMonth
* @param adId
* @param pageParam
* @return
*/
PageBean
advertisingDistributionDetail4WechatGroup
(
Long
qrcodeId
,
String
statisMonth
,
Long
adId
,
PageParam
pageParam
);
/**
* 更新曝光量
* @param qrcodeId
* @param peopleCounts
*/
void
updateExposureByQrcode
(
Long
qrcodeId
,
Integer
peopleCounts
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/BmBiz.java
View file @
2af2c4be
...
@@ -119,4 +119,12 @@ public interface BmBiz {
...
@@ -119,4 +119,12 @@ public interface BmBiz {
* @return
* @return
*/
*/
Long
getRegisterUserNumByAdIdQrcodeId
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
);
Long
getRegisterUserNumByAdIdQrcodeId
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
);
/**
* 获取书刊报名次数
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
View file @
2af2c4be
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/BmBizImpl.java
View file @
2af2c4be
...
@@ -144,7 +144,7 @@ public class BmBizImpl implements BmBiz {
...
@@ -144,7 +144,7 @@ public class BmBizImpl implements BmBiz {
@Override
@Override
public
void
addOptionList
(
List
<
AdvertisingBmOption
>
advertisingBmOptionList
,
Long
adId
)
{
public
void
addOptionList
(
List
<
AdvertisingBmOption
>
advertisingBmOptionList
,
Long
adId
)
{
if
(
ListUtils
.
isEmpty
(
advertisingBmOptionList
)
||
null
==
adId
)
{
if
(
ListUtils
.
isEmpty
(
advertisingBmOptionList
)
||
null
==
adId
)
{
return
;
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
)
;
}
}
List
<
Long
>
optionIds
=
bmOptionDao
.
getOptionIdsByAdId
(
adId
);
List
<
Long
>
optionIds
=
bmOptionDao
.
getOptionIdsByAdId
(
adId
);
for
(
AdvertisingBmOption
bmOption
:
advertisingBmOptionList
)
{
for
(
AdvertisingBmOption
bmOption
:
advertisingBmOptionList
)
{
...
@@ -158,7 +158,7 @@ public class BmBizImpl implements BmBiz {
...
@@ -158,7 +158,7 @@ public class BmBizImpl implements BmBiz {
}
}
if
(!
ListUtils
.
isEmpty
(
optionIds
))
{
//要删除的选项
if
(!
ListUtils
.
isEmpty
(
optionIds
))
{
//要删除的选项
bmOptionDao
.
deleteByIds
(
optionIds
);
bmOptionDao
.
deleteByIds
(
optionIds
);
for
(
Long
optionId
:
optionIds
)
{
for
(
Long
optionId
:
optionIds
)
{
bmOptionItemDao
.
deleteByOptionId
(
optionId
);
bmOptionItemDao
.
deleteByOptionId
(
optionId
);
}
}
}
}
...
@@ -171,9 +171,8 @@ public class BmBizImpl implements BmBiz {
...
@@ -171,9 +171,8 @@ public class BmBizImpl implements BmBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
addOption
(
AdvertisingBmOption
bmOption
)
throws
BizException
{
public
Long
addOption
(
AdvertisingBmOption
bmOption
)
throws
BizException
{
Long
adId
=
bmOption
.
getAdId
();
if
(
null
==
bmOption
.
getAdId
()
||
StringUtil
.
isEmpty
(
bmOption
.
getItemInputType
())
// 校验参数
||
StringUtil
.
isEmpty
(
bmOption
.
getItemDataType
())
||
StringUtil
.
isEmpty
(
bmOption
.
getItemTitle
()))
{
if
(
null
==
adId
||
null
==
bmOption
.
getItemInputType
()
||
null
==
bmOption
.
getItemTitle
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
}
// 新增选项
// 新增选项
...
@@ -196,28 +195,27 @@ public class BmBizImpl implements BmBiz {
...
@@ -196,28 +195,27 @@ public class BmBizImpl implements BmBiz {
* @throws BizException
* @throws BizException
*/
*/
public
void
addOptionItem
(
List
<
AdvertisingBmOptionItem
>
itemList
,
Long
partyId
,
Long
optionId
)
throws
BizException
{
public
void
addOptionItem
(
List
<
AdvertisingBmOptionItem
>
itemList
,
Long
partyId
,
Long
optionId
)
throws
BizException
{
if
(
itemList
!=
null
&&
itemList
.
size
()
>
0
)
{
if
(
ListUtils
.
isEmpty
(
itemList
))
{
Long
parentId
=
0L
;
return
;
for
(
int
i
=
0
;
i
<
itemList
.
size
();
i
++)
{
}
AdvertisingBmOptionItem
item
=
itemList
.
get
(
i
);
Long
parentId
=
0L
;
item
.
setOptionId
(
optionId
);
for
(
AdvertisingBmOptionItem
item
:
itemList
)
{
item
.
setCreateUser
(
partyId
);
item
.
setOptionId
(
optionId
);
item
.
setParentId
(
parentId
);
item
.
setCreateUser
(
partyId
);
String
text
=
item
.
getText
();
item
.
setParentId
(
parentId
);
if
(!
StringUtil
.
isEmpty
(
text
))
{
String
text
=
item
.
getText
();
item
.
setText
(
text
);
if
(!
StringUtil
.
isEmpty
(
text
))
{
}
item
.
setText
(
text
);
bmOptionItemDao
.
insert
(
item
);
}
}
bmOptionItemDao
.
insert
(
item
);
}
}
}
}
/**
/**
* 根据
应用
ID获取选项列表信息
* 根据
广告
ID获取选项列表信息
*/
*/
@Override
@Override
public
List
<
AdvertisingBmOption
>
getByAdId
(
Long
adId
)
public
List
<
AdvertisingBmOption
>
getByAdId
(
Long
adId
)
throws
BizException
{
throws
BizException
{
if
(
null
==
adId
){
if
(
null
==
adId
){
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
...
@@ -226,24 +224,22 @@ public class BmBizImpl implements BmBiz {
...
@@ -226,24 +224,22 @@ public class BmBizImpl implements BmBiz {
}
}
/**
/**
*
应用
修改选项
* 修改选项
*/
*/
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
modifyOption
(
AdvertisingBmOption
bmOption
)
throws
BizException
{
public
void
modifyOption
(
AdvertisingBmOption
bmOption
)
throws
BizException
{
Long
adId
=
bmOption
.
getAdId
();
Long
optionId
=
bmOption
.
getId
();
Long
id
=
bmOption
.
getId
();
// 校验参数
// 校验参数
if
(
adId
==
null
||
bmOption
.
getItemInputType
()
==
null
if
(
null
==
bmOption
.
getAdId
()
||
null
==
optionId
||
StringUtil
.
isEmpty
(
bmOption
.
getItemInputType
())
||
bmOption
.
getItemTitle
()
==
null
||
id
==
null
)
{
||
StringUtil
.
isEmpty
(
bmOption
.
getItemDataType
())
||
StringUtil
.
isEmpty
(
bmOption
.
getItemTitle
())
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
}
// 修改选项
// 修改选项
bmOption
.
setUpdateUser
(
0L
);
bmOption
.
setUpdateUser
(
0L
);
bmOptionDao
.
update
(
bmOption
);
bmOptionDao
.
update
(
bmOption
);
Long
optionId
=
bmOption
.
getId
();
// 删除之前的选项清单
// 删除之前的选项清单
bmOptionItemDao
.
deleteByOptionId
(
i
d
);
bmOptionItemDao
.
deleteByOptionId
(
optionI
d
);
// 添加选项清单
// 添加选项清单
addOptionItem
(
bmOption
.
getOptionItem
(),
bmOption
.
getUpdateUser
(),
optionId
);
addOptionItem
(
bmOption
.
getOptionItem
(),
bmOption
.
getUpdateUser
(),
optionId
);
}
}
...
@@ -516,6 +512,11 @@ public class BmBizImpl implements BmBiz {
...
@@ -516,6 +512,11 @@ public class BmBizImpl implements BmBiz {
@Override
@Override
public
Long
getRegisterUserNumByAdIdQrcodeId
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
)
{
public
Long
getRegisterUserNumByAdIdQrcodeId
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
)
{
return
bmRegisterDao
.
getRegisterUserNumByAdIdQrcodeId
(
qrcodeId
,
adId
,
statisMonth
);
return
bmRegisterDao
.
getRegisterUserNumByAdIdQrcodeId
(
qrcodeId
,
adId
,
statisMonth
);
}
@Override
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
return
bmRegisterDao
.
getRegisterCountByBookId
(
bookId
,
adviserId
,
channelId
,
adId
,
statisMonth
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/AdvertisingBrowseRecordDao.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
;
import
com.pcloud.book.advertising.entity.AdvertisingBrowseRecord
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* Description 广告位浏览记录数据访问层接口
* @author zhuyajie
* @date 2019/7/11
*/
public
interface
AdvertisingBrowseRecordDao
extends
BaseDao
<
AdvertisingBrowseRecord
>
{
/**
* 更新浏览时长
* @param recordId
* @param browseTimes
*/
public
void
addBrowseTimesByRecordId
(
String
recordId
,
Long
browseTimes
);
/**
* 查微信群浏览时长
* @param qrcodeId
* @param adId
* @param statisMonth
* @return
*/
Long
getBrowseTimesByQrcode
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
);
/**
* 查微信群浏览人数
* @param qrcodeId
* @param adId
* @param statisMonth
* @return
*/
Long
getBrowseUserCountByQrcode
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
);
/**
* 查书刊浏览时长
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
Long
getBrowseTimesByBook
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
/**
* 查书刊浏览人数
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
Long
getBrowseUserCountByBook
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/AdvertisingClickRecordDao.java
View file @
2af2c4be
...
@@ -46,4 +46,15 @@ public interface AdvertisingClickRecordDao extends BaseDao<AdvertisingClickRecor
...
@@ -46,4 +46,15 @@ public interface AdvertisingClickRecordDao extends BaseDao<AdvertisingClickRecor
* @param statisMonth @return
* @param statisMonth @return
*/
*/
Long
getClickUserNumByAdId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
);
Long
getClickUserNumByAdId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
);
/**
* 书刊点击人数
* @param adId
* @param bookId
* @param adviserId
* @param channelId
* @param statisMonth
* @return
*/
public
Long
getClickUserNumByBookId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/AdvertisingExposureRecordDao.java
View file @
2af2c4be
...
@@ -17,4 +17,11 @@ public interface AdvertisingExposureRecordDao extends BaseDao<AdvertisingExposur
...
@@ -17,4 +17,11 @@ public interface AdvertisingExposureRecordDao extends BaseDao<AdvertisingExposur
* @return
* @return
*/
*/
List
<
AdGroupQrcodeDTO
>
advertisingWechatGroupRankTop
();
List
<
AdGroupQrcodeDTO
>
advertisingWechatGroupRankTop
();
/**
* 更新之前为0的曝光量
* @param qrcodeId
* @param peopleCounts
*/
void
updateExposureByQrcode
(
Long
qrcodeId
,
Integer
peopleCounts
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/AdvertisingPilotRecordDao.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
;
import
com.pcloud.book.advertising.dto.WechatGroupClickUserDTO
;
import
com.pcloud.book.advertising.entity.AdvertisingClickRecord
;
import
com.pcloud.book.advertising.entity.AdvertisingPilotRecord
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
import
java.util.Map
;
/**
* Description 广告位点击记录数据访问层接口
* @author PENG
* @date 2019/2/28
*/
public
interface
AdvertisingPilotRecordDao
extends
BaseDao
<
AdvertisingPilotRecord
>
{
/**
* 获得试听人数
* @param masterId
* @return
*/
public
Long
getPilotUserNumByMasterId
(
Long
masterId
);
/**
* 微信群完课量
* @param qrcodeId
* @param adId
* @param statisMonth
* @return
*/
Long
getPilotUserNumByQrcode
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
);
/**
* 广告位完课量
* @param adId
* @param bookId
* @param adviserId
* @param channelId
* @param statisMonth
* @return
*/
Long
getPilotUserNumByAdId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
);
/**
* 书刊完课量
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
Long
getPilotUserNumByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/AdvertisingPutDao.java
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
;
package
com
.
pcloud
.
book
.
advertising
.
dao
;
import
com.pcloud.book.advertising.dto.AdvertisingDistributionDTO
;
import
com.pcloud.book.advertising.entity.AdvertisingPut
;
import
com.pcloud.book.advertising.entity.AdvertisingPut
;
import
com.pcloud.common.core.dao.BaseDao
;
import
com.pcloud.common.core.dao.BaseDao
;
...
@@ -22,4 +23,14 @@ public interface AdvertisingPutDao extends BaseDao<AdvertisingPut> {
...
@@ -22,4 +23,14 @@ public interface AdvertisingPutDao extends BaseDao<AdvertisingPut> {
* 根据计划id结合查询
* 根据计划id结合查询
*/
*/
List
<
AdvertisingPut
>
getListByPlanIds
(
List
<
Long
>
planIds
);
List
<
AdvertisingPut
>
getListByPlanIds
(
List
<
Long
>
planIds
);
/**
* 根据时间查发送计划
* @param adId
* @param qrcodeId
* @param dateTime
* @param timeOnly
* @return
*/
public
AdvertisingDistributionDTO
getPlanByTime
(
Long
adId
,
Long
qrcodeId
,
String
dateTime
,
String
timeOnly
,
String
dateOnly
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/BmRegisterDao.java
View file @
2af2c4be
...
@@ -73,4 +73,13 @@ public interface BmRegisterDao extends BaseDao<AdvertisingBmRegister> {
...
@@ -73,4 +73,13 @@ public interface BmRegisterDao extends BaseDao<AdvertisingBmRegister> {
* @return
* @return
*/
*/
List
<
BmRegisterDTO
>
getRegisterInfoListByAdId
(
Long
adId
,
String
statisMonth
,
Long
bookId
,
Long
adviserId
,
Long
channelId
);
List
<
BmRegisterDTO
>
getRegisterInfoListByAdId
(
Long
adId
,
String
statisMonth
,
Long
bookId
,
Long
adviserId
,
Long
channelId
);
/**
* 获取书刊报名次数
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/AdvertisingBrowseRecordDaoImpl.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
.
impl
;
import
com.pcloud.book.advertising.dao.AdvertisingBrowseRecordDao
;
import
com.pcloud.book.advertising.entity.AdvertisingBrowseRecord
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @描述:浏览记录
* @作者:zhuyajie
* @创建时间:17:20 2019/7/11
* @版本:1.0
*/
@Component
(
"advertisingBrowseRecordDao"
)
public
class
AdvertisingBrowseRecordDaoImpl
extends
BaseDaoImpl
<
AdvertisingBrowseRecord
>
implements
AdvertisingBrowseRecordDao
{
@Override
public
void
addBrowseTimesByRecordId
(
String
recordId
,
Long
browseTimes
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"recordId"
,
recordId
);
map
.
put
(
"browseTimes"
,
browseTimes
);
getSessionTemplate
().
update
(
getStatement
(
"addBrowseTimesByRecordId"
),
map
);
}
@Override
public
Long
getBrowseTimesByQrcode
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"adId"
,
adId
);
map
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBrowseTimesByQrcode"
),
map
);
}
@Override
public
Long
getBrowseUserCountByQrcode
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"adId"
,
adId
);
map
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBrowseUserCountByQrcode"
),
map
);
}
@Override
public
Long
getBrowseTimesByBook
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBrowseTimesByBook"
),
paramMap
);
}
@Override
public
Long
getBrowseUserCountByBook
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBrowseUserCountByBook"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/AdvertisingClickRecordDaoImpl.java
View file @
2af2c4be
...
@@ -48,10 +48,21 @@ public class AdvertisingClickRecordDaoImpl extends BaseDaoImpl<AdvertisingClickR
...
@@ -48,10 +48,21 @@ public class AdvertisingClickRecordDaoImpl extends BaseDaoImpl<AdvertisingClickR
public
Long
getClickUserNumByAdId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
)
{
public
Long
getClickUserNumByAdId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"
statisMonth"
,
statisMonth
);
paramMap
.
put
(
"
bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getClickUserNumByAdId"
),
paramMap
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getClickUserNumByAdId"
),
paramMap
);
}
}
@Override
public
Long
getClickUserNumByBookId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getClickUserNumByBookId"
),
paramMap
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/AdvertisingExposureRecordDaoImpl.java
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
.
impl
;
package
com
.
pcloud
.
book
.
advertising
.
dao
.
impl
;
import
java.util.List
;
import
org.springframework.stereotype.Repository
;
import
com.pcloud.book.advertising.dao.AdvertisingExposureRecordDao
;
import
com.pcloud.book.advertising.dao.AdvertisingExposureRecordDao
;
import
com.pcloud.book.advertising.entity.AdvertisingExposureRecord
;
import
com.pcloud.book.advertising.entity.AdvertisingExposureRecord
;
import
com.pcloud.book.group.dto.AdGroupQrcodeDTO
;
import
com.pcloud.book.group.dto.AdGroupQrcodeDTO
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Description 广告位曝光记录数据访问层接口实现类
* Description 广告位曝光记录数据访问层接口实现类
* @author PENG
* @author PENG
...
@@ -22,4 +26,12 @@ public class AdvertisingExposureRecordDaoImpl extends BaseDaoImpl<AdvertisingExp
...
@@ -22,4 +26,12 @@ public class AdvertisingExposureRecordDaoImpl extends BaseDaoImpl<AdvertisingExp
public
List
<
AdGroupQrcodeDTO
>
advertisingWechatGroupRankTop
()
{
public
List
<
AdGroupQrcodeDTO
>
advertisingWechatGroupRankTop
()
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"advertisingWechatGroupRankTop"
));
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"advertisingWechatGroupRankTop"
));
}
}
@Override
public
void
updateExposureByQrcode
(
Long
qrcodeId
,
Integer
peopleCounts
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"fromId"
,
qrcodeId
);
map
.
put
(
"count"
,
peopleCounts
);
getSessionTemplate
().
update
(
getStatement
(
"updateExposureByQrcode"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/AdvertisingPilotRecordDaoImpl.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
.
impl
;
import
com.pcloud.book.advertising.dao.AdvertisingClickRecordDao
;
import
com.pcloud.book.advertising.dao.AdvertisingPilotRecordDao
;
import
com.pcloud.book.advertising.dto.WechatGroupClickUserDTO
;
import
com.pcloud.book.advertising.entity.AdvertisingClickRecord
;
import
com.pcloud.book.advertising.entity.AdvertisingPilotRecord
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Description 广告位试听完成记录数据访问层接口实现类
*/
@Repository
(
"advertisingPilotRecordDao"
)
public
class
AdvertisingPilotRecordDaoImpl
extends
BaseDaoImpl
<
AdvertisingPilotRecord
>
implements
AdvertisingPilotRecordDao
{
@Override
public
Long
getPilotUserNumByMasterId
(
Long
masterId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"masterId"
,
masterId
);
Long
userNum
=
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getPilotUserNumByMasterId"
),
paramMap
);
return
null
==
userNum
?
0L
:
userNum
;
}
@Override
public
Long
getPilotUserNumByQrcode
(
Long
qrcodeId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"qrcodeId"
,
qrcodeId
);
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getPilotUserNumByQrcode"
),
paramMap
);
}
@Override
public
Long
getPilotUserNumByAdId
(
Long
adId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getPilotUserNumByAdId"
),
paramMap
);
}
@Override
public
Long
getPilotUserNumByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adId"
,
adId
);
paramMap
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getPilotUserNumByBookId"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/AdvertisingPutDaoImpl.java
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dao
.
impl
;
package
com
.
pcloud
.
book
.
advertising
.
dao
.
impl
;
import
com.pcloud.book.advertising.dao.AdvertisingPutDao
;
import
com.pcloud.book.advertising.dao.AdvertisingPutDao
;
import
com.pcloud.book.advertising.dto.AdvertisingDistributionDTO
;
import
com.pcloud.book.advertising.entity.AdvertisingPut
;
import
com.pcloud.book.advertising.entity.AdvertisingPut
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -40,4 +42,15 @@ public class AdvertisingPutDaoImpl extends BaseDaoImpl<AdvertisingPut> implement
...
@@ -40,4 +42,15 @@ public class AdvertisingPutDaoImpl extends BaseDaoImpl<AdvertisingPut> implement
map
.
put
(
"planIds"
,
planIds
);
map
.
put
(
"planIds"
,
planIds
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByPlanIds"
),
map
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByPlanIds"
),
map
);
}
}
@Override
public
AdvertisingDistributionDTO
getPlanByTime
(
Long
adId
,
Long
qrcodeId
,
String
dateTime
,
String
timeOnly
,
String
dateOnly
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"adId"
,
adId
);
map
.
put
(
"qrcodeId"
,
qrcodeId
);
map
.
put
(
"dateTime"
,
dateTime
);
map
.
put
(
"timeOnly"
,
timeOnly
);
map
.
put
(
"dateOnly"
,
dateOnly
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getPlanByTime"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dao/impl/BmRegisterDaoImpl.java
View file @
2af2c4be
...
@@ -78,5 +78,16 @@ public class BmRegisterDaoImpl extends BaseDaoImpl<AdvertisingBmRegister> implem
...
@@ -78,5 +78,16 @@ public class BmRegisterDaoImpl extends BaseDaoImpl<AdvertisingBmRegister> implem
return
getSessionTemplate
().
selectList
(
getStatement
(
"getRegisterInfoListByAdId"
),
map
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getRegisterInfoListByAdId"
),
map
);
}
}
@Override
public
Long
getRegisterCountByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Long
adId
,
String
statisMonth
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookId"
,
bookId
);
map
.
put
(
"adviserId"
,
adviserId
);
map
.
put
(
"channelId"
,
channelId
);
map
.
put
(
"adId"
,
adId
);
map
.
put
(
"statisMonth"
,
statisMonth
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getRegisterCountByBookId"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dto/AdvertisingDistributionDTO.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.dto.BaseDto
;
import
java.util.Date
;
/**
* @描述:投放详情
* @作者:zhuyajie
* @创建时间:9:15 2019/7/17
* @版本:1.0
*/
public
class
AdvertisingDistributionDTO
extends
BaseDto
{
private
Long
adId
;
/**
* 投放时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
distributionTime
;
/**
* 投放类型1:单次发送 2:每天发送 3:每周发送
*/
private
Integer
putType
;
/**
* 计划投放开始时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 计划投放结束时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
/**
* 计划投放时间
*/
private
String
putTime
;
/**
* 周几
*/
private
Integer
weekDay
;
public
Long
getAdId
()
{
return
adId
;
}
public
void
setAdId
(
Long
adId
)
{
this
.
adId
=
adId
;
}
public
Date
getDistributionTime
()
{
return
distributionTime
;
}
public
void
setDistributionTime
(
Date
distributionTime
)
{
this
.
distributionTime
=
distributionTime
;
}
public
Integer
getPutType
()
{
return
putType
;
}
public
void
setPutType
(
Integer
putType
)
{
this
.
putType
=
putType
;
}
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
String
getPutTime
()
{
return
putTime
;
}
public
void
setPutTime
(
String
putTime
)
{
this
.
putTime
=
putTime
;
}
public
Integer
getWeekDay
()
{
return
weekDay
;
}
public
void
setWeekDay
(
Integer
weekDay
)
{
this
.
weekDay
=
weekDay
;
}
@Override
public
String
toString
()
{
return
"AdvertisingDistributionDTO{"
+
"adId="
+
adId
+
", distributionTime="
+
distributionTime
+
", putType="
+
putType
+
", startTime="
+
startTime
+
", endTime="
+
endTime
+
", putTime="
+
putTime
+
", weekDay="
+
weekDay
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dto/AdvertisingMasterDTO.java
View file @
2af2c4be
...
@@ -70,6 +70,20 @@ public class AdvertisingMasterDTO extends BaseDto {
...
@@ -70,6 +70,20 @@ public class AdvertisingMasterDTO extends BaseDto {
*/
*/
private
BigDecimal
registerRate
;
private
BigDecimal
registerRate
;
/**
* 点击用户数(独立访客数)
*/
private
Long
clickUserNum
;
/**
* 试听完成人数(完课量)
*/
private
Long
pilotFinishUserNum
;
/**
* 试听完成比率(完课率)
*/
private
BigDecimal
pilotFinishRate
;
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
id
;
...
@@ -169,6 +183,30 @@ public class AdvertisingMasterDTO extends BaseDto {
...
@@ -169,6 +183,30 @@ public class AdvertisingMasterDTO extends BaseDto {
this
.
registerRate
=
registerRate
;
this
.
registerRate
=
registerRate
;
}
}
public
Long
getClickUserNum
()
{
return
clickUserNum
;
}
public
void
setClickUserNum
(
Long
clickUserNum
)
{
this
.
clickUserNum
=
clickUserNum
;
}
public
Long
getPilotFinishUserNum
()
{
return
pilotFinishUserNum
;
}
public
void
setPilotFinishUserNum
(
Long
pilotFinishUserNum
)
{
this
.
pilotFinishUserNum
=
pilotFinishUserNum
;
}
public
BigDecimal
getPilotFinishRate
()
{
return
pilotFinishRate
;
}
public
void
setPilotFinishRate
(
BigDecimal
pilotFinishRate
)
{
this
.
pilotFinishRate
=
pilotFinishRate
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"AdvertisingMasterDTO{"
+
return
"AdvertisingMasterDTO{"
+
...
@@ -184,6 +222,9 @@ public class AdvertisingMasterDTO extends BaseDto {
...
@@ -184,6 +222,9 @@ public class AdvertisingMasterDTO extends BaseDto {
", totalIncome="
+
totalIncome
+
", totalIncome="
+
totalIncome
+
", registerNum="
+
registerNum
+
", registerNum="
+
registerNum
+
", registerRate="
+
registerRate
+
", registerRate="
+
registerRate
+
", clickUserNum="
+
clickUserNum
+
", pilotFinishUserNum="
+
pilotFinishUserNum
+
", pilotFinishRate="
+
pilotFinishRate
+
'}'
;
'}'
;
}
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/advertising/dto/AdvertisingSpaceDTO.java
View file @
2af2c4be
...
@@ -285,6 +285,33 @@ public class AdvertisingSpaceDTO extends BaseDto {
...
@@ -285,6 +285,33 @@ public class AdvertisingSpaceDTO extends BaseDto {
*/
*/
private
Long
adDetailFileDuration
;
private
Long
adDetailFileDuration
;
/**
* 试听完成人数(完课量)
*/
private
Long
pilotFinishUserNum
;
/**
* 试听完成比率(完课率)
*/
private
BigDecimal
pilotFinishRate
;
/**
* 平均浏览时长
*/
private
BigDecimal
avgBrowseTimes
;
/**
* 跳出量
*/
private
Long
outNum
;
/**
* 跳出率
*/
private
BigDecimal
outRate
;
/**
* 投放次数
*/
private
Integer
distributionNum
;
public
Long
getId
()
{
public
Long
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -744,6 +771,54 @@ public class AdvertisingSpaceDTO extends BaseDto {
...
@@ -744,6 +771,54 @@ public class AdvertisingSpaceDTO extends BaseDto {
this
.
adDetailFileDuration
=
adDetailFileDuration
;
this
.
adDetailFileDuration
=
adDetailFileDuration
;
}
}
public
Long
getPilotFinishUserNum
()
{
return
pilotFinishUserNum
;
}
public
void
setPilotFinishUserNum
(
Long
pilotFinishUserNum
)
{
this
.
pilotFinishUserNum
=
pilotFinishUserNum
;
}
public
BigDecimal
getPilotFinishRate
()
{
return
pilotFinishRate
;
}
public
void
setPilotFinishRate
(
BigDecimal
pilotFinishRate
)
{
this
.
pilotFinishRate
=
pilotFinishRate
;
}
public
BigDecimal
getAvgBrowseTimes
()
{
return
avgBrowseTimes
;
}
public
void
setAvgBrowseTimes
(
BigDecimal
avgBrowseTimes
)
{
this
.
avgBrowseTimes
=
avgBrowseTimes
;
}
public
Long
getOutNum
()
{
return
outNum
;
}
public
void
setOutNum
(
Long
outNum
)
{
this
.
outNum
=
outNum
;
}
public
BigDecimal
getOutRate
()
{
return
outRate
;
}
public
void
setOutRate
(
BigDecimal
outRate
)
{
this
.
outRate
=
outRate
;
}
public
Integer
getDistributionNum
()
{
return
distributionNum
;
}
public
void
setDistributionNum
(
Integer
distributionNum
)
{
this
.
distributionNum
=
distributionNum
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"AdvertisingSpaceDTO{"
+
return
"AdvertisingSpaceDTO{"
+
...
@@ -804,6 +879,12 @@ public class AdvertisingSpaceDTO extends BaseDto {
...
@@ -804,6 +879,12 @@ public class AdvertisingSpaceDTO extends BaseDto {
", adDetailFileSize="
+
adDetailFileSize
+
", adDetailFileSize="
+
adDetailFileSize
+
", adDetailFileName='"
+
adDetailFileName
+
'\''
+
", adDetailFileName='"
+
adDetailFileName
+
'\''
+
", adDetailFileDuration="
+
adDetailFileDuration
+
", adDetailFileDuration="
+
adDetailFileDuration
+
", pilotFinishUserNum="
+
pilotFinishUserNum
+
", pilotFinishRate="
+
pilotFinishRate
+
", avgBrowseTimes="
+
avgBrowseTimes
+
", outNum="
+
outNum
+
", outRate="
+
outRate
+
", distributionNum="
+
distributionNum
+
'}'
;
'}'
;
}
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/advertising/entity/AdvertisingBrowseRecord.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
/**完整试听记录
* @author PENG
*/
public
class
AdvertisingBrowseRecord
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1236769572623516883L
;
/**
* 唯一标识
*/
private
Long
id
;
/**
* 广告位ID
*/
private
Long
adId
;
/**
* 书刊ID
*/
private
Long
bookId
;
/**
* 二维码ID
*/
private
Long
sceneId
;
/**
* 编辑ID
*/
private
Long
adviserId
;
/**
* 运营ID
*/
private
Long
channelId
;
/**
* 公众号ID
*/
private
Long
officialAccountId
;
/**
* 来源类型
*/
private
String
fromType
;
/**
* 来源ID
*/
private
Long
fromId
;
/**
* 读者ID
*/
private
Long
wechatUserId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 创建日期
*/
private
Date
createDay
;
/**
* 创建月份
*/
private
String
createMonth
;
/**
* 社群码ID
*/
private
Long
bookGroupId
;
/**
* 浏览时长
*/
private
Long
browseTimes
;
/**
* 临时标识
*/
private
String
tempMark
;
/**
* 唯一标识
*/
private
String
recordId
;
@Override
public
Long
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getAdId
()
{
return
adId
;
}
public
void
setAdId
(
Long
adId
)
{
this
.
adId
=
adId
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
Long
getOfficialAccountId
()
{
return
officialAccountId
;
}
public
void
setOfficialAccountId
(
Long
officialAccountId
)
{
this
.
officialAccountId
=
officialAccountId
;
}
public
String
getFromType
()
{
return
fromType
;
}
public
void
setFromType
(
String
fromType
)
{
this
.
fromType
=
fromType
;
}
public
Long
getFromId
()
{
return
fromId
;
}
public
void
setFromId
(
Long
fromId
)
{
this
.
fromId
=
fromId
;
}
public
Long
getWechatUserId
()
{
return
wechatUserId
;
}
public
void
setWechatUserId
(
Long
wechatUserId
)
{
this
.
wechatUserId
=
wechatUserId
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getCreateDay
()
{
return
createDay
;
}
public
void
setCreateDay
(
Date
createDay
)
{
this
.
createDay
=
createDay
;
}
public
Long
getSceneId
()
{
return
sceneId
;
}
public
void
setSceneId
(
Long
sceneId
)
{
this
.
sceneId
=
sceneId
;
}
public
String
getCreateMonth
()
{
return
createMonth
;
}
public
void
setCreateMonth
(
String
createMonth
)
{
this
.
createMonth
=
createMonth
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Long
getBrowseTimes
()
{
return
browseTimes
;
}
public
void
setBrowseTimes
(
Long
browseTimes
)
{
this
.
browseTimes
=
browseTimes
;
}
public
String
getTempMark
()
{
return
tempMark
;
}
public
void
setTempMark
(
String
tempMark
)
{
this
.
tempMark
=
tempMark
;
}
public
String
getRecordId
()
{
return
recordId
;
}
public
void
setRecordId
(
String
recordId
)
{
this
.
recordId
=
recordId
;
}
@Override
public
String
toString
()
{
return
"AdvertisingBrowseRecord{"
+
"id="
+
id
+
", adId="
+
adId
+
", bookId="
+
bookId
+
", sceneId="
+
sceneId
+
", adviserId="
+
adviserId
+
", channelId="
+
channelId
+
", officialAccountId="
+
officialAccountId
+
", fromType='"
+
fromType
+
'\''
+
", fromId="
+
fromId
+
", wechatUserId="
+
wechatUserId
+
", createTime="
+
createTime
+
", createDay="
+
createDay
+
", createMonth='"
+
createMonth
+
'\''
+
", bookGroupId="
+
bookGroupId
+
", browseTimes="
+
browseTimes
+
", tempMark='"
+
tempMark
+
'\''
+
", recordId='"
+
recordId
+
'\''
+
'}'
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/advertising/entity/AdvertisingPilotRecord.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
advertising
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.util.Date
;
/**完整试听记录
* @author PENG
*/
public
class
AdvertisingPilotRecord
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1236769572623516883L
;
/**
* 唯一标识
*/
private
Long
id
;
/**
* 广告位ID
*/
private
Long
adId
;
/**
* 书刊ID
*/
private
Long
bookId
;
/**
* 是否是社群书
*/
private
Boolean
isBookGroup
;
/**
* 二维码ID
*/
private
Long
sceneId
;
/**
* 编辑ID
*/
private
Long
adviserId
;
/**
*出版社ID
*/
private
Long
agentId
;
/**
* 运营ID
*/
private
Long
channelId
;
/**
* 公众号ID
*/
private
Long
officialAccountId
;
/**
* 来源类型
*/
private
String
fromType
;
/**
* 来源ID
*/
private
Long
fromId
;
/**
* 读者ID
*/
private
Long
wechatUserId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 创建日期
*/
private
Date
createDay
;
/**
* 创建月份
*/
private
String
createMonth
;
/**
* 社群码ID
*/
private
Long
bookGroupId
;
@Override
public
Long
getId
()
{
return
id
;
}
@Override
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getAdId
()
{
return
adId
;
}
public
void
setAdId
(
Long
adId
)
{
this
.
adId
=
adId
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Boolean
getIsBookGroup
()
{
return
isBookGroup
;
}
public
void
setIsBookGroup
(
Boolean
isBookGroup
)
{
this
.
isBookGroup
=
isBookGroup
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
public
Long
getAgentId
()
{
return
agentId
;
}
public
void
setAgentId
(
Long
agentId
)
{
this
.
agentId
=
agentId
;
}
public
Long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
Long
channelId
)
{
this
.
channelId
=
channelId
;
}
public
Long
getOfficialAccountId
()
{
return
officialAccountId
;
}
public
void
setOfficialAccountId
(
Long
officialAccountId
)
{
this
.
officialAccountId
=
officialAccountId
;
}
public
String
getFromType
()
{
return
fromType
;
}
public
void
setFromType
(
String
fromType
)
{
this
.
fromType
=
fromType
;
}
public
Long
getFromId
()
{
return
fromId
;
}
public
void
setFromId
(
Long
fromId
)
{
this
.
fromId
=
fromId
;
}
public
Long
getWechatUserId
()
{
return
wechatUserId
;
}
public
void
setWechatUserId
(
Long
wechatUserId
)
{
this
.
wechatUserId
=
wechatUserId
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getCreateDay
()
{
return
createDay
;
}
public
void
setCreateDay
(
Date
createDay
)
{
this
.
createDay
=
createDay
;
}
public
Long
getSceneId
()
{
return
sceneId
;
}
public
void
setSceneId
(
Long
sceneId
)
{
this
.
sceneId
=
sceneId
;
}
public
String
getCreateMonth
()
{
return
createMonth
;
}
public
void
setCreateMonth
(
String
createMonth
)
{
this
.
createMonth
=
createMonth
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
@Override
public
String
toString
()
{
return
"AdvertisingClickRecord{"
+
"id="
+
id
+
", adId="
+
adId
+
", bookId="
+
bookId
+
", isBookGroup="
+
isBookGroup
+
", sceneId="
+
sceneId
+
", adviserId="
+
adviserId
+
", agentId="
+
agentId
+
", channelId="
+
channelId
+
", officialAccountId="
+
officialAccountId
+
", fromType='"
+
fromType
+
'\''
+
", fromId="
+
fromId
+
", wechatUserId="
+
wechatUserId
+
", createTime="
+
createTime
+
", createDay="
+
createDay
+
", createMonth='"
+
createMonth
+
'\''
+
", bookGroupId="
+
bookGroupId
+
"} "
+
super
.
toString
();
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/advertising/facade/AdvertisingSpaceFacade.java
View file @
2af2c4be
...
@@ -895,4 +895,62 @@ public interface AdvertisingSpaceFacade {
...
@@ -895,4 +895,62 @@ public interface AdvertisingSpaceFacade {
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
)
throws
PermissionException
,
BizException
,
JsonParseException
;
)
throws
PermissionException
,
BizException
,
JsonParseException
;
/**
* 完课量埋点
* @param userInfo 用户身份信息
* @param advertisingPilotRecord 广告位试听实体
* @return
* @throws PermissionException
* @throws BizException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
" 完课量埋点"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"addPilotTrack"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
addPilotTrack
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
AdvertisingPilotRecord
advertisingPilotRecord
)
throws
PermissionException
,
BizException
,
JsonParseException
;
/**
* 浏览时长埋点
* @param userInfo
* @param advertisingBrowseRecord
* @return
* @throws PermissionException
* @throws BizException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
" 浏览时长埋点"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"addBrowseTrack"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<?>
addBrowseTrack
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
AdvertisingBrowseRecord
advertisingBrowseRecord
)
throws
PermissionException
,
BizException
,
JsonParseException
;
/**
* 微信群广告位明细-投放详情
* @param token
* @param qrcodeId
* @param statisMonth
* @param currentPage
* @param numPerPage
* @param adId
* @return
* @throws PermissionException
* @throws BizException
* @throws JsonParseException
*/
@ApiOperation
(
value
=
"微信群广告位明细-投放详情"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"qrcodeId"
,
value
=
"微信群ID"
,
dataType
=
"Long"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"statisMonth"
,
value
=
"统计月份"
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"currentPage"
,
value
=
"当前页"
,
dataType
=
"int"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"numPerPage"
,
value
=
"每页条数"
,
dataType
=
"int"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"adId"
,
value
=
"广告id"
,
dataType
=
"Long"
,
paramType
=
"query"
)
})
@RequestMapping
(
value
=
"advertisingDistributionDetail4WechatGroup"
,
method
=
RequestMethod
.
GET
)
ResponseDto
<?>
advertisingDistributionDetail4WechatGroup
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"qrcodeId"
,
required
=
false
)
Long
qrcodeId
,
@RequestParam
(
value
=
"statisMonth"
,
required
=
false
)
String
statisMonth
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
,
@RequestParam
(
value
=
"adId"
,
required
=
false
)
Long
adId
)
throws
PermissionException
,
BizException
,
JsonParseException
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/facade/impl/AdvertisingSpaceFacadeImpl.java
View file @
2af2c4be
...
@@ -8,6 +8,7 @@ import com.pcloud.book.advertising.facade.AdvertisingSpaceFacade;
...
@@ -8,6 +8,7 @@ import com.pcloud.book.advertising.facade.AdvertisingSpaceFacade;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.SessionUtil
;
...
@@ -781,4 +782,102 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
...
@@ -781,4 +782,102 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
}
}
return
new
ResponseDto
<>(
advertisingSpaceBiz
.
getAdvertisingPlanList
(
keyword
,
partyId
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
advertisingSpaceBiz
.
getAdvertisingPlanList
(
keyword
,
partyId
,
currentPage
,
numPerPage
));
}
}
/**
* 完课量埋点
*
* @param userInfo 用户身份信息
* @param advertisingPilotRecord 广告位试听实体
*/
@Override
@RequestMapping
(
value
=
"addPilotTrack"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
addPilotTrack
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
AdvertisingPilotRecord
advertisingPilotRecord
)
throws
PermissionException
,
BizException
,
JsonParseException
{
if
(
null
==
advertisingPilotRecord
||
null
==
advertisingPilotRecord
.
getAdId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
if
(
StringUtil
.
isEmpty
(
advertisingPilotRecord
.
getFromType
())
||
null
==
advertisingPilotRecord
.
getFromId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
Long
sceneId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_SCENE_ID
);
Long
adviserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_ADVISER_ID
);
Long
channelId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_CHANNEL_ID
);
Long
officialAccountsId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_OFFICIAL_ACCOUNTS_ID
);
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
bookGroupId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
BOOK_GROUP_ID
);
if
((
null
==
advertisingPilotRecord
.
getBookId
()
&&
!
"WECHAT_GROUP"
.
equals
(
advertisingPilotRecord
.
getFromType
()))
||
(
null
==
bookGroupId
&&
"WECHAT_GROUP"
.
equals
(
advertisingPilotRecord
.
getFromType
())))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
advertisingPilotRecord
.
setBookGroupId
(
bookGroupId
);
advertisingPilotRecord
.
setSceneId
(
sceneId
);
advertisingPilotRecord
.
setAdviserId
(
adviserId
);
advertisingPilotRecord
.
setChannelId
(
channelId
);
advertisingPilotRecord
.
setOfficialAccountId
(
officialAccountsId
);
advertisingPilotRecord
.
setWechatUserId
(
wechatUserId
);
advertisingSpaceBiz
.
addPilotTrack
(
advertisingPilotRecord
);
return
new
ResponseDto
<>();
}
/**
* 浏览时长埋点
* @param userInfo
* @param advertisingBrowseRecord
* @return
* @throws PermissionException
* @throws BizException
* @throws JsonParseException
*/
@Override
@RequestMapping
(
value
=
"addBrowseTrack"
,
method
=
RequestMethod
.
POST
)
public
ResponseDto
<?>
addBrowseTrack
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
AdvertisingBrowseRecord
advertisingBrowseRecord
)
throws
PermissionException
,
BizException
,
JsonParseException
{
if
(
null
==
advertisingBrowseRecord
||
null
==
advertisingBrowseRecord
.
getAdId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
if
(
StringUtil
.
isEmpty
(
advertisingBrowseRecord
.
getFromType
())
||
null
==
advertisingBrowseRecord
.
getFromId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
Long
sceneId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_SCENE_ID
);
Long
adviserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_ADVISER_ID
);
Long
channelId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_CHANNEL_ID
);
Long
officialAccountsId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_OFFICIAL_ACCOUNTS_ID
);
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
Long
bookGroupId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
BOOK_GROUP_ID
);
if
((
null
==
advertisingBrowseRecord
.
getBookId
()
&&
!
"WECHAT_GROUP"
.
equals
(
advertisingBrowseRecord
.
getFromType
()))
||
(
null
==
bookGroupId
&&
"WECHAT_GROUP"
.
equals
(
advertisingBrowseRecord
.
getFromType
())))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数有误!"
);
}
if
(
null
==
advertisingBrowseRecord
.
getBrowseTimes
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少浏览时长!"
);
}
advertisingBrowseRecord
.
setBookGroupId
(
bookGroupId
);
advertisingBrowseRecord
.
setSceneId
(
sceneId
);
advertisingBrowseRecord
.
setAdviserId
(
adviserId
);
advertisingBrowseRecord
.
setChannelId
(
channelId
);
advertisingBrowseRecord
.
setOfficialAccountId
(
officialAccountsId
);
advertisingBrowseRecord
.
setWechatUserId
(
wechatUserId
);
return
new
ResponseDto
<>(
advertisingSpaceBiz
.
addBrowseTrack
(
advertisingBrowseRecord
));
}
/**
* 微信群广告位明细-投放详情
*/
@Override
@RequestMapping
(
value
=
"advertisingDistributionDetail4WechatGroup"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
advertisingDistributionDetail4WechatGroup
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"qrcodeId"
,
required
=
false
)
Long
qrcodeId
,
@RequestParam
(
value
=
"statisMonth"
,
required
=
false
)
String
statisMonth
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
,
@RequestParam
(
value
=
"adId"
,
required
=
false
)
Long
adId
)
throws
PermissionException
,
BizException
,
JsonParseException
{
if
(
null
==
qrcodeId
||
null
==
adId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
if
(
currentPage
==
null
||
numPerPage
==
null
||
currentPage
<
0
||
numPerPage
<
0
)
{
throw
BookBizException
.
PAGE_PARAM_DELETION
;
}
SessionUtil
.
getToken4Redis
(
token
);
PageBean
pageBean
=
advertisingSpaceBiz
.
advertisingDistributionDetail4WechatGroup
(
qrcodeId
,
statisMonth
,
adId
,
new
PageParam
(
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
pageBean
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
2af2c4be
...
@@ -136,7 +136,7 @@ public class WechatGroupConsr {
...
@@ -136,7 +136,7 @@ public class WechatGroupConsr {
@ParamLog
(
value
=
"活跃人数与总发言数"
,
isBefore
=
false
,
isAfterReturn
=
false
)
@ParamLog
(
value
=
"活跃人数与总发言数"
,
isBefore
=
false
,
isAfterReturn
=
false
)
public
Map
<
Long
,
GroupChatCountDTO
>
getChatCountByGroup
(
List
<
Long
>
groupQrcodeIds
,
Long
bookGroupId
)
throws
BizException
{
public
Map
<
Long
,
GroupChatCountDTO
>
getChatCountByGroup
(
List
<
Long
>
groupQrcodeIds
,
Long
bookGroupId
)
throws
BizException
{
if
(
ListUtils
.
isEmpty
(
groupQrcodeIds
)
||
bookGroupId
==
null
)
{
if
(
ListUtils
.
isEmpty
(
groupQrcodeIds
))
{
return
null
;
return
null
;
}
}
try
{
try
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/GroupQrcodeBiz.java
View file @
2af2c4be
...
@@ -96,7 +96,7 @@ public interface GroupQrcodeBiz {
...
@@ -96,7 +96,7 @@ public interface GroupQrcodeBiz {
* @Desr:更新用户数
* @Desr:更新用户数
* @Date:2019/5/28 11:47
* @Date:2019/5/28 11:47
*/
*/
void
updateUserNumber
(
String
weixinGroupId
);
void
updateUserNumber
(
String
weixinGroupId
,
String
wxUserId
);
/**
/**
* 群信息及广告信息
* 群信息及广告信息
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
2af2c4be
...
@@ -29,6 +29,7 @@ import com.pcloud.book.group.entity.BookGroupClassify;
...
@@ -29,6 +29,7 @@ import com.pcloud.book.group.entity.BookGroupClassify;
import
com.pcloud.book.group.entity.BookQrcodeUser
;
import
com.pcloud.book.group.entity.BookQrcodeUser
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.enums.RankTypeEnum
;
import
com.pcloud.book.group.enums.RankTypeEnum
;
import
com.pcloud.book.group.set.GroupSet
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
...
@@ -113,6 +114,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
...
@@ -113,6 +114,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private
GroupAnnouncementBiz
groupAnnouncementBiz
;
private
GroupAnnouncementBiz
groupAnnouncementBiz
;
@Autowired
@Autowired
private
LabelService
labelService
;
private
LabelService
labelService
;
@Autowired
private
GroupSet
groupSet
;
@Override
@Override
@ParamLog
(
"新增分类"
)
@ParamLog
(
"新增分类"
)
...
@@ -309,6 +312,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
...
@@ -309,6 +312,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
groupQrcodeBiz
.
deleteByClassifyId
(
classifyId
);
groupQrcodeBiz
.
deleteByClassifyId
(
classifyId
);
//删除此商品对应规格
//删除此商品对应规格
deleteSpecification
(
classifyDTO
.
getProductId
(),
classifyDTO
.
getChannelId
(),
classifyDTO
.
getProductSpecId
());
deleteSpecification
(
classifyDTO
.
getProductId
(),
classifyDTO
.
getChannelId
(),
classifyDTO
.
getProductSpecId
());
//发送topic
groupSet
.
sendGroupClassifyDeleteTopic
(
classifyId
);
}
}
@Override
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
View file @
2af2c4be
...
@@ -289,13 +289,18 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
...
@@ -289,13 +289,18 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
}
}
@Override
@Override
public
void
updateUserNumber
(
String
weixinGroupId
)
{
public
void
updateUserNumber
(
String
weixinGroupId
,
String
wxUserId
)
{
String
robotIdByGroupId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
if
(
StringUtil
.
isEmpty
(
weixinGroupId
)
||
StringUtil
.
isEmpty
(
wxUserId
))
{
if
(
robotIdByGroupId
!=
null
){
return
;
Integer
peopleCounts
=
WxGroupSDK
.
getPeopleCounts
(
weixinGroupId
,
robotIdByGroupId
);
}
if
(
peopleCounts
!=
null
)
{
Integer
peopleCounts
=
WxGroupSDK
.
getPeopleCounts
(
weixinGroupId
,
wxUserId
);
//更新用户数
if
(
peopleCounts
!=
null
)
{
groupQrcodeDao
.
updateUserNumber
(
weixinGroupId
,
peopleCounts
);
//更新用户数
groupQrcodeDao
.
updateUserNumber
(
weixinGroupId
,
peopleCounts
);
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getGroupQrcodeByGroupId
(
weixinGroupId
);
if
(
null
!=
groupQrcode
)
{
//更新广告曝光量
advertisingSpaceBiz
.
updateExposureByQrcode
(
groupQrcode
.
getId
(),
peopleCounts
);
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/AdGroupQrcodeDTO.java
View file @
2af2c4be
...
@@ -118,6 +118,36 @@ public class AdGroupQrcodeDTO implements Serializable {
...
@@ -118,6 +118,36 @@ public class AdGroupQrcodeDTO implements Serializable {
* 报名率
* 报名率
*/
*/
private
BigDecimal
registerRate
;
private
BigDecimal
registerRate
;
/**
* 活跃度
*/
private
Integer
activeCount
;
/**
* 群人数
*/
private
Integer
userNumber
;
/**
* 试听完成人数(完课量)
*/
private
Long
pilotFinishUserNum
;
/**
* 试听完成比率(完课率)
*/
private
BigDecimal
pilotFinishRate
;
/**
* 平均浏览时长
*/
private
BigDecimal
avgBrowseTimes
;
/**
* 跳出量
*/
private
Long
outNum
;
/**
* 跳出率
*/
private
BigDecimal
outRate
;
public
Long
getGroupQrcodeId
()
{
public
Long
getGroupQrcodeId
()
{
return
groupQrcodeId
;
return
groupQrcodeId
;
...
@@ -296,6 +326,62 @@ public class AdGroupQrcodeDTO implements Serializable {
...
@@ -296,6 +326,62 @@ public class AdGroupQrcodeDTO implements Serializable {
this
.
registerRate
=
registerRate
;
this
.
registerRate
=
registerRate
;
}
}
public
Integer
getActiveCount
()
{
return
activeCount
;
}
public
void
setActiveCount
(
Integer
activeCount
)
{
this
.
activeCount
=
activeCount
;
}
public
Integer
getUserNumber
()
{
return
userNumber
;
}
public
void
setUserNumber
(
Integer
userNumber
)
{
this
.
userNumber
=
userNumber
;
}
public
Long
getPilotFinishUserNum
()
{
return
pilotFinishUserNum
;
}
public
void
setPilotFinishUserNum
(
Long
pilotFinishUserNum
)
{
this
.
pilotFinishUserNum
=
pilotFinishUserNum
;
}
public
BigDecimal
getPilotFinishRate
()
{
return
pilotFinishRate
;
}
public
void
setPilotFinishRate
(
BigDecimal
pilotFinishRate
)
{
this
.
pilotFinishRate
=
pilotFinishRate
;
}
public
BigDecimal
getAvgBrowseTimes
()
{
return
avgBrowseTimes
;
}
public
void
setAvgBrowseTimes
(
BigDecimal
avgBrowseTimes
)
{
this
.
avgBrowseTimes
=
avgBrowseTimes
;
}
public
Long
getOutNum
()
{
return
outNum
;
}
public
void
setOutNum
(
Long
outNum
)
{
this
.
outNum
=
outNum
;
}
public
BigDecimal
getOutRate
()
{
return
outRate
;
}
public
void
setOutRate
(
BigDecimal
outRate
)
{
this
.
outRate
=
outRate
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"AdGroupQrcodeDTO{"
+
return
"AdGroupQrcodeDTO{"
+
...
@@ -321,6 +407,13 @@ public class AdGroupQrcodeDTO implements Serializable {
...
@@ -321,6 +407,13 @@ public class AdGroupQrcodeDTO implements Serializable {
", distributionTime="
+
distributionTime
+
", distributionTime="
+
distributionTime
+
", registerNum="
+
registerNum
+
", registerNum="
+
registerNum
+
", registerRate="
+
registerRate
+
", registerRate="
+
registerRate
+
", activeCount="
+
activeCount
+
", userNumber="
+
userNumber
+
", pilotFinishUserNum="
+
pilotFinishUserNum
+
", pilotFinishRate="
+
pilotFinishRate
+
", avgBrowseTimes="
+
avgBrowseTimes
+
", outNum="
+
outNum
+
", outRate="
+
outRate
+
'}'
;
'}'
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/GroupQrcodeFacadeImpl.java
View file @
2af2c4be
...
@@ -100,9 +100,9 @@ public class GroupQrcodeFacadeImpl implements GroupQrcodeFacade {
...
@@ -100,9 +100,9 @@ public class GroupQrcodeFacadeImpl implements GroupQrcodeFacade {
}
}
@GetMapping
(
"updateUserNumber"
)
@GetMapping
(
"updateUserNumber"
)
ResponseDto
<?>
updateUserNumber
(
@RequestParam
(
"weixinGroupId"
)
String
weixinGroupId
)
ResponseDto
<?>
updateUserNumber
(
@RequestParam
(
"weixinGroupId"
)
String
weixinGroupId
,
@RequestParam
(
"wxUserId"
)
String
wxUserId
)
throws
BizException
{
throws
BizException
{
groupQrcodeBiz
.
updateUserNumber
(
weixinGroupId
);
groupQrcodeBiz
.
updateUserNumber
(
weixinGroupId
,
wxUserId
);
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/set/GroupSet.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
group
.
set
;
import
com.pcloud.book.group.dto.GroupTopicDTO
;
import
com.pcloud.common.core.constant.MQTopicProducer
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* @描述:
* @作者:zhuyajie
* @创建时间:16:26 2019/7/16
* @版本:1.0
*/
@Component
(
"groupSet"
)
public
class
GroupSet
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
GroupSet
.
class
);
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
* 群分类删除topic
* @param classifyId
*/
public
void
sendGroupClassifyDeleteTopic
(
Long
classifyId
)
{
LOGGER
.
info
(
"【社群书】发送群分类删除topic,<START>"
);
GroupTopicDTO
groupTopicDTO
=
new
GroupTopicDTO
();
groupTopicDTO
.
setClassifyId
(
classifyId
);
try
{
amqpTemplate
.
convertAndSend
(
MQTopicProducer
.
EXCHAGE
,
MQTopicProducer
.
GROUP_CLASSIFY_DELETE
,
groupTopicDTO
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【社群书】发送群分类删除topic,<ERROR>"
,
e
);
}
LOGGER
.
info
(
"【社群书】发送群分类删除topic,<END>"
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/util/common/ThreadPoolUtils.java
0 → 100644
View file @
2af2c4be
package
com
.
pcloud
.
book
.
util
.
common
;
import
com.google.common.util.concurrent.ThreadFactoryBuilder
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
public
class
ThreadPoolUtils
{
/**
* 异步导出线程池
*/
public
static
final
ExecutorService
EXPORT_THREAD_POOL
=
new
ThreadPoolExecutor
(
8
,
8
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ThreadFactoryBuilder
().
setNameFormat
(
"export-pool-%d"
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
/**
* 异步发送线程池
*/
public
static
final
ThreadPoolExecutor
SEND_MESSAGE_THREAD_POOL
=
new
ThreadPoolExecutor
(
8
,
8
,
0
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ThreadFactoryBuilder
().
setNameFormat
(
"send-message-pool-%d"
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
/**
* 异步导出线程池
*/
public
static
final
ExecutorService
OTHER_THREAD_POOL
=
new
ThreadPoolExecutor
(
8
,
8
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ThreadFactoryBuilder
().
setNameFormat
(
"other-pool-%d"
).
build
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
());
}
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingBmOptionMapper.xml
View file @
2af2c4be
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
<result
column=
"update_user"
property=
"updateUser"
jdbcType=
"BIGINT"
/>
<result
column=
"update_user"
property=
"updateUser"
jdbcType=
"BIGINT"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<collection
property=
"optionItem"
column=
"id"
<collection
property=
"optionItem"
column=
"id"
ofType=
"productMatchOptionItem"
select=
"com.pcloud.book.advertising.dao.impl.BmOptionItemDaoImpl.getByOptionId"
/>
select=
"com.pcloud.book.advertising.dao.impl.BmOptionItemDaoImpl.getByOptionId"
/>
</resultMap>
</resultMap>
...
...
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingBmRegisterMapper.xml
View file @
2af2c4be
...
@@ -183,4 +183,22 @@
...
@@ -183,4 +183,22 @@
ORDER BY create_time DESC
ORDER BY create_time DESC
</select>
</select>
<select
id=
"getRegisterCountByBookId"
parameterType=
"map"
resultType=
"Long"
>
SELECT
count(1)
FROM
advertising_bm_register
WHERE
book_id = #{bookId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId,jdbcType=BIGINT}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingBrowseRecordMapper.xml
0 → 100644
View file @
2af2c4be
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.advertising.dao.impl.AdvertisingBrowseRecordDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.advertising.entity.AdvertisingBrowseRecord"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_id"
property=
"adId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"scene_id"
property=
"sceneId"
jdbcType=
"BIGINT"
/>
<result
column=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"BIGINT"
/>
<result
column=
"official_account_id"
property=
"officialAccountId"
jdbcType=
"BIGINT"
/>
<result
column=
"from_type"
property=
"fromType"
jdbcType=
"VARCHAR"
/>
<result
column=
"from_id"
property=
"fromId"
jdbcType=
"BIGINT"
/>
<result
column=
"wechat_user_id"
property=
"wechatUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_day"
property=
"createDay"
jdbcType=
"DATE"
/>
<result
column=
"create_month"
property=
"createMonth"
jdbcType=
"VARCHAR"
/>
<result
column=
"browse_times"
property=
"browseTimes"
jdbcType=
"BIGINT"
/>
<result
column=
"temp_mark"
property=
"tempMark"
jdbcType=
"VARCHAR"
/>
<result
column=
"record_id"
property=
"recordId"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, ad_id, book_id, scene_id, adviser_id, channel_id, official_account_id, from_type,
from_id, wechat_user_id, create_time, create_day, create_month, browse_times, temp_mark, record_id
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingBrowseRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into advertising_browse_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
ad_id,
book_id,
scene_id,
adviser_id,
channel_id,
official_account_id,
from_type,
from_id,
wechat_user_id,
create_time,
create_day,
create_month,
browse_times,
temp_mark,
record_id,
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{adId,jdbcType=BIGINT},
#{bookId,jdbcType=BIGINT},
#{sceneId,jdbcType=BIGINT},
#{adviserId,jdbcType=BIGINT},
#{channelId,jdbcType=BIGINT},
#{officialAccountId,jdbcType=BIGINT},
#{fromType,jdbcType=VARCHAR},
#{fromId,jdbcType=BIGINT},
#{wechatUserId,jdbcType=BIGINT},
NOW(),
NOW(),
DATE_FORMAT(NOW(), '%Y-%m'),
#{browseTimes},
#{tempMark},
#{recordId},
</trim>
</insert>
<update
id=
"addBrowseTimesByRecordId"
parameterType=
"map"
>
update advertising_browse_record
set browse_times = browse_times + #{browseTimes}
where record_id = #{recordId}
</update>
<select
id=
"getBrowseTimesByQrcode"
parameterType=
"map"
resultType=
"Long"
>
SELECT
IFNULL(SUM(browse_times), 0)
FROM
advertising_browse_record
WHERE
from_id = #{qrcodeId}
AND from_type = 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
<select
id=
"getBrowseUserCountByQrcode"
parameterType=
"map"
resultType=
"Long"
>
SELECT
COUNT(DISTINCT wechat_user_id)
FROM
advertising_browse_record
WHERE
from_id = #{qrcodeId}
AND from_type = 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
<select
id=
"getBrowseTimesByBook"
resultType=
"Long"
parameterType=
"map"
>
SELECT
IFNULL(SUM(browse_times), 0)
FROM
advertising_browse_record
WHERE
book_id = #{bookId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
<select
id=
"getBrowseUserCountByBook"
parameterType=
"map"
resultType=
"Long"
>
SELECT
COUNT(DISTINCT wechat_user_id)
FROM
advertising_browse_record
WHERE
book_id = #{bookId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingClickRecordMapper.xml
View file @
2af2c4be
...
@@ -68,6 +68,12 @@
...
@@ -68,6 +68,12 @@
AND adviser_id = #{adviserId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
</select>
<select
id=
"getClickNumByGroupQrcodeId"
parameterType=
"map"
resultType=
"Long"
>
<select
id=
"getClickNumByGroupQrcodeId"
parameterType=
"map"
resultType=
"Long"
>
...
@@ -255,4 +261,30 @@
...
@@ -255,4 +261,30 @@
) AS a
) AS a
</select>
</select>
<!--计算点击人数-包含userId=null-->
<select
id=
"getClickUserNumByBookId"
parameterType=
"map"
resultType=
"Long"
>
SELECT
COUNT(1)
FROM
(
SELECT
wechat_user_id
FROM
advertising_click_record
WHERE
book_id = #{bookId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
and create_month = #{statisMonth}
</if>
GROUP BY
wechat_user_id
) AS a
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingDistributionBookMapper.xml
View file @
2af2c4be
...
@@ -286,4 +286,16 @@
...
@@ -286,4 +286,16 @@
qrcode_id
qrcode_id
</select>
</select>
<select
id=
"advertisingDistributionDetail4WechatGroup"
parameterType=
"map"
resultType=
"com.pcloud.book.advertising.dto.AdvertisingDistributionDTO"
>
SELECT
distribution_time distributionTime
FROM
advertising_distribution_book
WHERE
qrcode_id = #{qrcodeId}
AND ad_id = #{adId}
ORDER BY
distribution_time DESC
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingExposureRecordMapper.xml
View file @
2af2c4be
...
@@ -69,6 +69,12 @@
...
@@ -69,6 +69,12 @@
AND adviser_id = #{adviserId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
</select>
<select
id=
"getExposureNumByGroupQrcodeId"
parameterType=
"map"
resultType=
"Long"
>
<select
id=
"getExposureNumByGroupQrcodeId"
parameterType=
"map"
resultType=
"Long"
>
...
@@ -277,4 +283,14 @@
...
@@ -277,4 +283,14 @@
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
<update
id=
"updateExposureByQrcode"
parameterType=
"map"
>
UPDATE advertising_exposure_record
SET count = #{count}
WHERE
from_type = 'WECHAT_GROUP'
AND from_id = #{fromId}
AND count = 0
</update>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingPilotRecordMapper.xml
0 → 100644
View file @
2af2c4be
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.advertising.dao.impl.AdvertisingPilotRecordDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.advertising.entity.AdvertisingPilotRecord"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_id"
property=
"adId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"is_book_group"
property=
"isBookGroup"
jdbcType=
"BIT"
/>
<result
column=
"scene_id"
property=
"sceneId"
jdbcType=
"BIGINT"
/>
<result
column=
"adviser_id"
property=
"adviserId"
jdbcType=
"BIGINT"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"BIGINT"
/>
<result
column=
"official_account_id"
property=
"officialAccountId"
jdbcType=
"BIGINT"
/>
<result
column=
"from_type"
property=
"fromType"
jdbcType=
"VARCHAR"
/>
<result
column=
"from_id"
property=
"fromId"
jdbcType=
"BIGINT"
/>
<result
column=
"wechat_user_id"
property=
"wechatUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_day"
property=
"createDay"
jdbcType=
"DATE"
/>
<result
column=
"create_month"
property=
"createMonth"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, ad_id, book_id, is_book_group, scene_id, adviser_id, agent_id, channel_id, official_account_id, from_type,
from_id, wechat_user_id, create_time, create_day, create_month
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"Long"
>
select
<include
refid=
"Base_Column_List"
/>
from advertising_pilot_record
where id = #{id}
</select>
<select
id=
"getPilotUserNumByAdId"
parameterType=
"map"
resultType=
"Long"
>
SELECT
count(DISTINCT wechat_user_id)
FROM
advertising_pilot_record
WHERE
ad_id = #{adId}
<if
test=
"bookId != null"
>
AND book_id = #{bookId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
</if>
<if
test=
"statisMonth != null"
>
and create_month = #{statisMonth}
</if>
</select>
<select
id=
"getPilotUserNumByQrcode"
parameterType=
"map"
resultType=
"Long"
>
SELECT
count(DISTINCT wechat_user_id)
FROM
advertising_pilot_record
WHERE
from_id = #{qrcodeId}
AND from_type = 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
AND wechat_user_id IS NOT NULL
</select>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingPilotRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into advertising_pilot_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
ad_id,
book_id,
is_book_group,
scene_id,
adviser_id,
agent_id,
channel_id,
official_account_id,
from_type,
from_id,
wechat_user_id,
create_time,
create_day,
create_month,
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{adId,jdbcType=BIGINT},
#{bookId,jdbcType=BIGINT},
#{isBookGroup,jdbcType=BIT},
#{sceneId,jdbcType=BIGINT},
#{adviserId,jdbcType=BIGINT},
#{agentId,jdbcType=BIGINT},
#{channelId,jdbcType=BIGINT},
#{officialAccountId,jdbcType=BIGINT},
#{fromType,jdbcType=VARCHAR},
#{fromId,jdbcType=BIGINT},
#{wechatUserId,jdbcType=BIGINT},
NOW(),
NOW(),
DATE_FORMAT(NOW(), '%Y-%m'),
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.advertising.entity.AdvertisingPilotRecord"
>
update advertising_pilot_record
<set>
<if
test=
"adId != null"
>
ad_id = #{adId,jdbcType=BIGINT},
</if>
<if
test=
"bookId != null"
>
book_id = #{bookId,jdbcType=BIGINT},
</if>
<if
test=
"isBookGroup != null"
>
is_book_group = #{isBookGroup,jdbcType=BIT},
</if>
<if
test=
"sceneId != null"
>
scene_id = #{sceneId,jdbcType=BIGINT},
</if>
<if
test=
"adviserId != null"
>
adviser_id = #{adviserId,jdbcType=BIGINT},
</if>
<if
test=
"agentId != null"
>
agent_id = #{agentId,jdbcType=BIGINT},
</if>
<if
test=
"channelId != null"
>
channel_id = #{channelId,jdbcType=BIGINT},
</if>
<if
test=
"officialAccountId != null"
>
official_account_id = #{officialAccountId,jdbcType=BIGINT},
</if>
<if
test=
"fromType != null"
>
from_type = #{fromType,jdbcType=VARCHAR},
</if>
<if
test=
"fromId != null"
>
from_id = #{fromId,jdbcType=BIGINT},
</if>
<if
test=
"wechatUserId != null"
>
wechat_user_id = #{wechatUserId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"getPilotUserNumByMasterId"
parameterType=
"map"
resultType=
"Long"
>
SELECT
COUNT(DISTINCT wechat_user_id)
FROM
advertising_pilot_record r
INNER JOIN advertising_space s ON r.ad_id = s.id
WHERE
s.master_id = #{masterId}
</select>
<select
id=
"getPilotUserNumByBookId"
parameterType=
"map"
resultType=
"Long"
>
SELECT
count(DISTINCT wechat_user_id)
FROM
advertising_pilot_record
WHERE
book_id = #{bookId}
AND adviser_id = #{adviserId}
AND channel_id = #{channelId}
AND from_type != 'WECHAT_GROUP'
<if
test=
"adId != null"
>
AND ad_id = #{adId}
</if>
<if
test=
"statisMonth != null"
>
AND create_month = #{statisMonth}
</if>
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingPutMapper.xml
View file @
2af2c4be
...
@@ -164,4 +164,41 @@
...
@@ -164,4 +164,41 @@
${item}
${item}
</foreach>
</foreach>
</select>
</select>
<!--根据发送时间查对应的发送计划-->
<resultMap
id=
"DistributionMap"
type=
"AdvertisingDistributionDTO"
>
<id
column=
"advertising_space_id"
property=
"adId"
jdbcType=
"BIGINT"
/>
<result
column=
"put_type"
property=
"putType"
jdbcType=
"INTEGER"
/>
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"end_time"
property=
"endTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"put_time"
property=
"putTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"week_day"
property=
"weekDay"
jdbcType=
"INTEGER"
/>
</resultMap>
<select
id=
"getPlanByTime"
parameterType=
"map"
resultMap=
"DistributionMap"
>
SELECT
p.advertising_space_id,
p.put_type,
p.start_time,
p.end_time,
p.put_time,
p.week_day
FROM
advertising_put p
LEFT JOIN advertising_plan_group g ON g.advertising_plan_id = p.advertising_plan_id
WHERE
g.qrcode_id = #{qrcodeId}
AND p.advertising_space_id = #{adId}
AND (
TIMEDIFF(#{timeOnly}, put_time) BETWEEN '00:00:00' AND '00:00:05'
OR
TIMEDIFF(#{dateTime},put_time) BETWEEN '00:00:00' AND '00:00:05'
)
AND
IF (
p.put_type = 3, p.week_day = WEEKDAY(#{dateOnly}) + 1, p.put_type > 0
)
LIMIT 1
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingSpaceMapper.xml
View file @
2af2c4be
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
<result
column=
"ad_detail_file_size"
property=
"adDetailFileSize"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_detail_file_size"
property=
"adDetailFileSize"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_detail_file_name"
property=
"adDetailFileName"
jdbcType=
"VARCHAR"
/>
<result
column=
"ad_detail_file_name"
property=
"adDetailFileName"
jdbcType=
"VARCHAR"
/>
<result
column=
"ad_detail_file_duration"
property=
"adDetailFileDuration"
jdbcType=
"BIGINT"
/>
<result
column=
"ad_detail_file_duration"
property=
"adDetailFileDuration"
jdbcType=
"BIGINT"
/>
<result
column=
"settlement_method"
property=
"settlementMethod"
jdbcType=
"VARCHAR"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
...
@@ -210,6 +211,9 @@
...
@@ -210,6 +211,9 @@
<if
test=
"filterTest == 1"
>
<if
test=
"filterTest == 1"
>
AND (is_test = 0 OR is_test IS NULL)
AND (is_test = 0 OR is_test IS NULL)
</if>
</if>
<if
test=
"adPosition !=null"
>
AND ad_position = #{adPosition}
</if>
order by
order by
create_time desc
create_time desc
</select>
</select>
...
@@ -249,7 +253,8 @@
...
@@ -249,7 +253,8 @@
s.ad_pic,
s.ad_pic,
s.ad_link,
s.ad_link,
s.is_open,
s.is_open,
b.distribution_time distributionTime
MAX(b.distribution_time) distributionTime,
COUNT(1) distributionNum
FROM
FROM
advertising_distribution_book b,
advertising_distribution_book b,
advertising_space s
advertising_space s
...
@@ -257,30 +262,35 @@
...
@@ -257,30 +262,35 @@
b.ad_id = s.id
b.ad_id = s.id
AND b.qrcode_id = #{qrcodeId}
AND b.qrcode_id = #{qrcodeId}
AND s.ad_position = 'WECHAT_GROUP_MSG'
AND s.ad_position = 'WECHAT_GROUP_MSG'
GROUP BY
s.id
ORDER BY
ORDER BY
b.distribution_time DESC
b.distribution_time DESC
</select>
</select>
<select
id=
"advertisingDetail4Master"
parameterType=
"map"
resultMap=
"AdvertisingSpaceDTO"
>
<select
id=
"advertisingDetail4Master"
parameterType=
"map"
resultMap=
"AdvertisingSpaceDTO"
>
SELECT
SELECT
s.id,
s.id,
s.ad_name,
s.ad_name,
s.ad_position,
s.ad_position,
s.ad_position_detail,
s.ad_position_detail,
s.ad_position_mode,
s.ad_position_mode,
s.master_id,
s.master_id,
s.source_id,
s.source_id,
s.ad_pic,
s.ad_pic,
s.is_open,
s.is_open,
b.distribution_time distributionTime,
b.distribution_time distributionTime,
b.book_id bookId,
b.book_id bookId,
b.qrcode_id qrcodeId,
b.qrcode_id qrcodeId,
b.agent_id agentId,
b.agent_id agentId,
b.adviser_id adviserId,
b.adviser_id adviserId,
b. channel_id channelId
b.channel_id channelId,
m.settlement_method
FROM
FROM
advertising_space s
advertising_space s
LEFT JOIN advertising_distribution_book b ON b.ad_id = s.id
LEFT JOIN advertising_distribution_book b ON b.ad_id = s.id
LEFT JOIN advertising_settlement_method m ON s.id = m.ad_id
AND s.master_id = m.master_id
WHERE
WHERE
s.master_id = #{masterId}
s.master_id = #{masterId}
GROUP BY
GROUP BY
...
...
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
2af2c4be
...
@@ -831,8 +831,15 @@
...
@@ -831,8 +831,15 @@
) t ON t.adviser_id = a.ADVISER_ID
) t ON t.adviser_id = a.ADVISER_ID
AND t.channel_id = a.CHANNEL_ID
AND t.channel_id = a.CHANNEL_ID
AND t.book_id = a.BOOK_ID
AND t.book_id = a.BOOK_ID
LEFT JOIN advertising_adviser_permission adp ON a.BOOK_ID = adp.book_id
AND a.ADVISER_ID = adp.adviser_id
AND a.CHANNEL_ID = adp.channel_id
WHERE
WHERE
a.IS_MAIN_EDITOR = 1
a.IS_MAIN_EDITOR = 1
AND (
adp.is_open IS NULL
OR adp.is_open = 1
)
<if
test=
"adviserId != null"
>
<if
test=
"adviserId != null"
>
AND a.ADVISER_ID = #{adviserId}
AND a.ADVISER_ID = #{adviserId}
</if>
</if>
...
...
pcloud-service-book/src/main/resources/mapper/group/BookGroupClassify.Mapper.xml
View file @
2af2c4be
...
@@ -450,7 +450,7 @@
...
@@ -450,7 +450,7 @@
AND t.classify_id = c.id
AND t.classify_id = c.id
AND t.qrcode_id = g.id
AND t.qrcode_id = g.id
WHERE
WHERE
1 = 1
1 = 1
<if
test=
"name != null"
>
<if
test=
"name != null"
>
AND (
AND (
book_name LIKE CONCAT('%', #{name},'%')
book_name LIKE CONCAT('%', #{name},'%')
...
@@ -496,7 +496,8 @@
...
@@ -496,7 +496,8 @@
),
),
0,
0,
1
1
) isOpen
) isOpen,
g.user_number userNumber
FROM
FROM
book_group_classify c
book_group_classify c
JOIN book_group_qrcode g ON c.id = g.classify_id
JOIN book_group_qrcode g ON c.id = g.classify_id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment