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
a9dfe1ea
Commit
a9dfe1ea
authored
Jan 06, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002161个人号新增数据需求
parent
c113eb6c
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
116 additions
and
6 deletions
+116
-6
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+1
-1
AppClickRecordBiz.java
...ain/java/com/pcloud/book/group/biz/AppClickRecordBiz.java
+5
-0
AppClickRecordBizImpl.java
...com/pcloud/book/group/biz/impl/AppClickRecordBizImpl.java
+25
-0
BookGroupAppBizImpl.java
...a/com/pcloud/book/group/biz/impl/BookGroupAppBizImpl.java
+3
-3
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+1
-0
AppClickRecordDao.java
...ain/java/com/pcloud/book/group/dao/AppClickRecordDao.java
+5
-0
AppClickRecordDaoImpl.java
...com/pcloud/book/group/dao/impl/AppClickRecordDaoImpl.java
+9
-0
CountAndTimeDTO.java
.../main/java/com/pcloud/book/group/dto/CountAndTimeDTO.java
+12
-0
AppClickRecordFacade.java
...va/com/pcloud/book/group/facade/AppClickRecordFacade.java
+9
-0
AppClickRecordFacadeImpl.java
...loud/book/group/facade/impl/AppClickRecordFacadeImpl.java
+16
-0
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+6
-1
AppClickRecord.xml
...e-book/src/main/resources/mapper/group/AppClickRecord.xml
+20
-0
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+4
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
a9dfe1ea
...
...
@@ -1785,7 +1785,7 @@ public class BookBizImpl implements BookBiz {
if
(
adviserId
!=
null
)
{
paramMap
.
put
(
"adviserId"
,
adviserId
);
}
paramMap
.
put
(
"joinGroupType
"
,
JoinGroupTypeEnum
.
ROBOT
.
getCode
(
));
paramMap
.
put
(
"joinGroupType
s"
,
Arrays
.
asList
(
JoinGroupTypeEnum
.
ROBOT
.
getCode
(),
JoinGroupTypeEnum
.
AI_ROBOT
.
getCode
()
));
PageBeanNew
<
AdviserBookInfoDTO
>
pageBean
=
bookDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"getListPage4BookGroup"
);
if
(
null
==
pageBean
||
ListUtils
.
isEmpty
(
pageBean
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/AppClickRecordBiz.java
View file @
a9dfe1ea
...
...
@@ -18,4 +18,9 @@ public interface AppClickRecordBiz {
* 根据类型按照时间获取资源服务点击人数
*/
List
<
CountAndTimeDTO
>
getAppClickByTime
(
Integer
joinGroupType
,
Integer
timeType
,
String
startTime
,
String
endTime
);
/**
* 根据社群书id和应用或作品id获取各个时间段的点击次数
*/
List
<
CountAndTimeDTO
>
getAppClickGroupByTime
(
Long
bookGroupId
,
Long
serveId
,
String
serveType
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/AppClickRecordBizImpl.java
View file @
a9dfe1ea
...
...
@@ -69,4 +69,29 @@ public class AppClickRecordBizImpl implements AppClickRecordBiz {
list
=
list
.
stream
().
sorted
(
Comparator
.
comparing
(
CountAndTimeDTO:
:
getTime
)).
collect
(
Collectors
.
toList
());
return
list
;
}
@ParamLog
(
"根据社群书id和应用或作品id获取各个时间段的点击次数"
)
@Override
public
List
<
CountAndTimeDTO
>
getAppClickGroupByTime
(
Long
bookGroupId
,
Long
serveId
,
String
serveType
)
{
if
(
bookGroupId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"bookGroupId不能为空!"
);
}
List
<
CountAndTimeDTO
>
list
=
appClickRecordDao
.
getAppClickGroupByTime
(
bookGroupId
,
serveId
,
serveType
);
fill24Hour
(
list
);
list
=
list
.
stream
().
sorted
(
Comparator
.
comparing
(
CountAndTimeDTO:
:
getHour
)).
collect
(
Collectors
.
toList
());
return
list
;
}
@ParamLog
(
"填充24小时"
)
private
void
fill24Hour
(
List
<
CountAndTimeDTO
>
list
)
{
List
<
Integer
>
hours
=
list
.
stream
().
map
(
CountAndTimeDTO:
:
getHour
).
collect
(
Collectors
.
toList
());
for
(
int
i
=
0
;
i
<
24
;
i
++)
{
if
(!
hours
.
contains
(
i
))
{
CountAndTimeDTO
countAndTimeDTO
=
new
CountAndTimeDTO
();
countAndTimeDTO
.
setHour
(
i
);
countAndTimeDTO
.
setCount
(
0
);
list
.
add
(
countAndTimeDTO
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupAppBizImpl.java
View file @
a9dfe1ea
...
...
@@ -480,14 +480,14 @@ public class BookGroupAppBizImpl implements BookGroupAppBiz {
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equalsIgnoreCase
(
serveType
))
{
GroupMoneyDto
groupMoneyDto
=
appSaleMap
.
get
(
serveId
);
if
(
groupMoneyDto
!=
null
){
bookGroupAppDTO
.
setBuyPeopleCount
(
groupMoneyDto
.
get
Sale
Count
().
intValue
());
bookGroupAppDTO
.
setBuyPeopleCount
(
groupMoneyDto
.
get
PayUser
Count
().
intValue
());
bookGroupAppDTO
.
setSaleAmount
(
groupMoneyDto
.
getSaleMoney
());
}
}
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equalsIgnoreCase
(
serveType
))
{
GroupMoneyDto
groupMoneyDto
=
productSaleMap
.
get
(
serveId
);
if
(
groupMoneyDto
!=
null
){
bookGroupAppDTO
.
setBuyPeopleCount
(
groupMoneyDto
.
get
Sale
Count
().
intValue
());
bookGroupAppDTO
.
setBuyPeopleCount
(
groupMoneyDto
.
get
PayUser
Count
().
intValue
());
bookGroupAppDTO
.
setSaleAmount
(
groupMoneyDto
.
getSaleMoney
());
}
String
typeCode
=
bookGroupAppDTO
.
getTypeCode
();
...
...
@@ -579,7 +579,7 @@ public class BookGroupAppBizImpl implements BookGroupAppBiz {
bookGroupAppDTO
.
setBuyPeopleCount
(
0
);
}
if
(
groupMoneyDto
.
getSaleCount
()!=
null
){
bookGroupAppDTO
.
setBuyPeopleCount
(
bookGroupAppDTO
.
getBuyPeopleCount
()+
groupMoneyDto
.
get
Sale
Count
().
intValue
());
bookGroupAppDTO
.
setBuyPeopleCount
(
bookGroupAppDTO
.
getBuyPeopleCount
()+
groupMoneyDto
.
get
PayUser
Count
().
intValue
());
}
if
(
bookGroupAppDTO
.
getSaleAmount
()==
null
){
bookGroupAppDTO
.
setSaleAmount
(
0
D
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
a9dfe1ea
...
...
@@ -3171,6 +3171,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
PageParam
pageParam
=
new
PageParam
(
selfBookGroupStParamDTO
.
getCurrentPage
(),
selfBookGroupStParamDTO
.
getNumPerPage
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"joinGroupTypes"
,
Arrays
.
asList
(
JoinGroupTypeEnum
.
ROBOT
.
getCode
(),
JoinGroupTypeEnum
.
AI_ROBOT
.
getCode
()));
map
.
put
(
"name"
,
selfBookGroupStParamDTO
.
getName
());
map
.
put
(
"proLabelId"
,
selfBookGroupStParamDTO
.
getProLabelId
());
map
.
put
(
"depLabelId"
,
selfBookGroupStParamDTO
.
getDepLabelId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/AppClickRecordDao.java
View file @
a9dfe1ea
...
...
@@ -80,4 +80,9 @@ public interface AppClickRecordDao extends BaseDao<AppClickRecord> {
* 根据bookGroupIds获取应用点击人数
*/
List
<
BookGroupIdAndCountDTO
>
getClCoByBookGroupIds
(
List
<
Long
>
bookGroupIds
);
/**
* 根据社群书id和应用或作品id获取各个时间段的点击次数
*/
List
<
CountAndTimeDTO
>
getAppClickGroupByTime
(
Long
bookGroupId
,
Long
serveId
,
String
serveType
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/AppClickRecordDaoImpl.java
View file @
a9dfe1ea
...
...
@@ -133,4 +133,13 @@ public class AppClickRecordDaoImpl extends BaseDaoImpl<AppClickRecord> implement
return
getSessionTemplate
().
selectList
(
getStatement
(
"getClCoByBookGroupIds"
),
map
);
}
@Override
public
List
<
CountAndTimeDTO
>
getAppClickGroupByTime
(
Long
bookGroupId
,
Long
serveId
,
String
serveType
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"serveId"
,
serveId
);
map
.
put
(
"serveType"
,
serveType
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAppClickGroupByTime"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/CountAndTimeDTO.java
View file @
a9dfe1ea
...
...
@@ -16,6 +16,9 @@ public class CountAndTimeDTO implements Serializable {
@ApiModelProperty
(
"时间"
)
private
String
time
;
@ApiModelProperty
(
"小时"
)
private
Integer
hour
;
@ApiModelProperty
(
"数量"
)
private
Integer
count
;
...
...
@@ -30,6 +33,14 @@ public class CountAndTimeDTO implements Serializable {
this
.
time
=
time
;
}
public
Integer
getHour
()
{
return
hour
;
}
public
void
setHour
(
Integer
hour
)
{
this
.
hour
=
hour
;
}
public
Integer
getCount
()
{
return
count
;
}
...
...
@@ -50,6 +61,7 @@ public class CountAndTimeDTO implements Serializable {
public
String
toString
()
{
return
"CountAndTimeDTO{"
+
"time='"
+
time
+
'\''
+
", hour="
+
hour
+
", count="
+
count
+
", date='"
+
date
+
'\''
+
'}'
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/AppClickRecordFacade.java
View file @
a9dfe1ea
...
...
@@ -34,4 +34,13 @@ public interface AppClickRecordFacade {
@RequestParam
(
"endTime"
)
@ApiParam
(
"结束时间"
)
String
endTime
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"根据社群书id和应用或作品id获取各个时间段的点击次数"
)
@GetMapping
(
"getAppClickGroupByTime"
)
ResponseDto
<?>
getAppClickGroupByTime
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
,
@RequestParam
(
value
=
"serveId"
,
required
=
false
)
Long
serveId
,
@RequestParam
(
value
=
"serveType"
,
required
=
false
)
String
serveType
)
throws
BizException
,
PermissionException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/AppClickRecordFacadeImpl.java
View file @
a9dfe1ea
...
...
@@ -58,4 +58,20 @@ public class AppClickRecordFacadeImpl implements AppClickRecordFacade {
}
return
new
ResponseDto
<>(
appClickRecordBiz
.
getAppClickByTime
(
joinGroupType
,
timeType
,
startTime
,
endTime
));
}
@ApiOperation
(
"根据社群书id和应用或作品id获取各个时间段的点击次数"
)
@GetMapping
(
"getAppClickGroupByTime"
)
@Override
public
ResponseDto
<?>
getAppClickGroupByTime
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"bookGroupId"
)
Long
bookGroupId
,
@RequestParam
(
value
=
"serveId"
,
required
=
false
)
Long
serveId
,
@RequestParam
(
value
=
"serveType"
,
required
=
false
)
String
serveType
)
throws
BizException
,
PermissionException
{
String
systemCode
=
(
String
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
SYSTEM_CODE
);
if
(!
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
systemCode
))
{
throw
new
PermissionException
(
PermissionException
.
PERMISSION_NOT_FOUND
);
}
return
new
ResponseDto
<>(
appClickRecordBiz
.
getAppClickGroupByTime
(
bookGroupId
,
serveId
,
serveType
));
}
}
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
a9dfe1ea
...
...
@@ -1828,12 +1828,17 @@
FROM
book_group g
LEFT JOIN book_adviser a ON g.book_id = a.BOOK_ID
AND g.channel_id = a.CHANNEL_ID
AND g.create_user = a.ADVISER_ID
LEFT JOIN book b ON b.BOOK_ID = a.BOOK_ID
WHERE
b.IS_DELETE = 0
AND a.IS_DELETE = 0
AND g.is_delete = 0
AND g.join_group_type = #{joinGroupType}
AND g.join_group_type in
<foreach
collection=
"joinGroupTypes"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
<if
test=
"name!=null"
>
AND
(b.BOOK_NAME LIKE CONCAT('%', #{name},'%') OR b.ISBN LIKE CONCAT(#{name},'%'))
...
...
pcloud-service-book/src/main/resources/mapper/group/AppClickRecord.xml
View file @
a9dfe1ea
...
...
@@ -334,4 +334,23 @@
GROUP BY
t.book_group_id
</select>
<!--根据社群书id和应用或作品id获取各个时间段的点击次数-->
<select
id=
"getAppClickGroupByTime"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.CountAndTimeDTO"
>
SELECT
DATE_FORMAT(t.create_time, '%H') hour,
COUNT(1) count
FROM
app_click_record t
WHERE
t.book_group_id = #{bookGroupId}
<if
test=
"serveId!=null"
>
and serve_id=#{serveId}
</if>
<if
test=
"serveType!=null"
>
and serve_type=#{serveType}
</if>
GROUP BY
DATE_FORMAT(t.create_time, '%H');
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
View file @
a9dfe1ea
...
...
@@ -742,7 +742,10 @@
book_group t
INNER JOIN book t1 ON t.BOOK_ID = t1.BOOK_ID
WHERE
t.join_group_type=2
t.join_group_type in
<foreach
collection=
"joinGroupTypes"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
<if
test=
"depLabelId!=null"
>
AND t.dep_label_id = #{depLabelId}
</if>
...
...
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