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
b9292251
Commit
b9292251
authored
Sep 25, 2019
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好友数量
parent
71f3d401
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
74 deletions
+101
-74
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+10
-5
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+4
-2
BookGroupCipherUserDao.java
...ava/com/pcloud/book/group/dao/BookGroupCipherUserDao.java
+18
-0
JoinGroupCipherDao.java
...in/java/com/pcloud/book/group/dao/JoinGroupCipherDao.java
+0
-14
BookGroupCipherUserDaoImpl.java
...cloud/book/group/dao/impl/BookGroupCipherUserDaoImpl.java
+20
-0
JoinGroupCipherDaoImpl.java
...om/pcloud/book/group/dao/impl/JoinGroupCipherDaoImpl.java
+0
-14
BookGroupCipherUser.xml
...k/src/main/resources/mapper/group/BookGroupCipherUser.xml
+49
-0
JoinGroupCipher.xml
...-book/src/main/resources/mapper/group/JoinGroupCipher.xml
+0
-39
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
b9292251
...
...
@@ -24,7 +24,6 @@ import com.pcloud.book.consumer.user.AdviserConsr;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.dao.*
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.entity.JoinGroupCipher
;
...
...
@@ -36,9 +35,11 @@ import com.pcloud.book.group.vo.StatisticVO;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.dao.AppClickRecordDao
;
import
com.pcloud.book.group.dao.AppTouchRecordDao
;
import
com.pcloud.book.group.dao.BookGroupCipherUserDao
;
import
com.pcloud.book.group.dao.BookGroupClassifyDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.BookGroupServeDao
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dao.JoinGroupCipherDao
;
import
com.pcloud.book.group.dao.TempletRelevanceDao
;
import
com.pcloud.book.group.dao.WeixinQrcodeDao
;
...
...
@@ -232,7 +233,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
private
BookGroupServeDao
bookGroupServeDao
;
@Autowired
private
GroupQrcodeDao
groupQrcodeDao
;
@Autowired
private
BookGroupCipherUserDao
bookGroupCipherUserDao
;
@Override
...
...
@@ -610,7 +612,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookDto
.
setTotalIncome
(
BigDecimal
.
ZERO
);
}
//好友数量
Integer
friendsCount
=
joinGroupCiph
erDao
.
getFriendsCountByBookGroup
(
bookGroupId
);
Integer
friendsCount
=
bookGroupCipherUs
erDao
.
getFriendsCountByBookGroup
(
bookGroupId
);
bookDto
.
setFriendsCount
(
friendsCount
);
}
return
pageBean
;
...
...
@@ -1101,6 +1103,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
qrcodeName
=
"未命名"
+
noName
;
}
}
if
(
Integer
.
valueOf
(
2
).
equals
(
bookDto
.
getJoinGroupType
()))
{
qrcodeName
=
qrcodeName
+
"("
+
bookDto
.
getBookGroupCipher
()
+
")"
;
}
// 加入二维码图片
String
[]
qrcodePicurl
=
{
qrcodeName
,
qrcodeUrl
};
qrcodePicUrls
.
add
(
qrcodePicurl
);
...
...
@@ -2053,7 +2058,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
public
Map
<
String
,
Integer
>
getBookGroupFriendsCountByDay
(
Long
bookGroupId
,
String
startDate
,
String
endDate
)
{
String
startTime
=
DateUtils
.
formatDate
(
DateUtils
.
getDayStart
(
DateUtils
.
getDateByStr
(
startDate
)),
DateUtils
.
DATE_FORMAT_DATETIME
);
String
endTime
=
DateUtils
.
formatDate
(
DateUtils
.
getDayEnd
(
DateUtils
.
getDateByStr
(
endDate
)),
DateUtils
.
DATE_FORMAT_DATETIME
);
List
<
DayCountDTO
>
countDTOS
=
joinGroupCiph
erDao
.
getBookGroupFriendsCountByDay
(
bookGroupId
,
startTime
,
endTime
);
List
<
DayCountDTO
>
countDTOS
=
bookGroupCipherUs
erDao
.
getBookGroupFriendsCountByDay
(
bookGroupId
,
startTime
,
endTime
);
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
if
(
ListUtils
.
isEmpty
(
countDTOS
))
{
return
map
;
...
...
@@ -2068,7 +2073,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
public
PageBeanNew
<
FriendsVO
>
listPageFriendsStatistic
(
Long
bookGroupId
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookGroupId"
,
bookGroupId
);
PageBeanNew
<
FriendsVO
>
pageBeanNew
=
joinGroupCiph
erDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listPageFriendsStatistic"
);
PageBeanNew
<
FriendsVO
>
pageBeanNew
=
bookGroupCipherUs
erDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listPageFriendsStatistic"
);
List
<
FriendsVO
>
recordList
=
pageBeanNew
.
getRecordList
();
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
recordList
))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
b9292251
...
...
@@ -17,6 +17,7 @@ import com.pcloud.book.group.biz.GroupAnnouncementBiz;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.biz.WeixinQrcodeBiz
;
import
com.pcloud.book.group.dao.BookClassifyBuyRecordDao
;
import
com.pcloud.book.group.dao.BookGroupCipherUserDao
;
import
com.pcloud.book.group.dao.BookGroupClassifyDao
;
import
com.pcloud.book.group.dao.BookQrcodeUserDao
;
import
com.pcloud.book.group.dao.JoinGroupCipherDao
;
...
...
@@ -160,9 +161,10 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private
LearningReportTouchRecordDao
learningReportTouchRecordDao
;
@Autowired
private
JoinGroupCipherDao
joinGroupCipherDao
;
@Autowired
private
BookAuthUserBiz
bookAuthUserBiz
;
@Autowired
private
BookGroupCipherUserDao
bookGroupCipherUserDao
;
@Override
...
...
@@ -479,7 +481,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
classifyAndGroupCountVO
.
setClassifyCount
(
statistic
.
get
(
bookGroupId
).
getClassifyCount
());
}
classifyAndGroupCountVO
.
setGroupCount
(
groupCount
);
Integer
friendsCount
=
joinGroupCiph
erDao
.
getFriendsCountByBookGroup
(
bookGroupId
);
Integer
friendsCount
=
bookGroupCipherUs
erDao
.
getFriendsCountByBookGroup
(
bookGroupId
);
classifyAndGroupCountVO
.
setFriendsCount
(
friendsCount
);
return
classifyAndGroupCountVO
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupCipherUserDao.java
View file @
b9292251
package
com
.
pcloud
.
book
.
group
.
dao
;
import
com.pcloud.book.group.dto.DayCountDTO
;
import
com.pcloud.book.group.entity.BookGroupCipherUser
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @Description
* @Author ruansiyuan
...
...
@@ -12,4 +15,19 @@ public interface BookGroupCipherUserDao extends BaseDao<BookGroupCipherUser> {
Long
getBookGroupIdByWxUserId
(
String
wxUserId
);
/**
* 社群码好友数量
* @param bookGroupId
* @return
*/
public
Integer
getFriendsCountByBookGroup
(
Long
bookGroupId
);
/**
* 日加好友数量
* @param bookGroupId
* @param startTime
* @param endTime
* @return
*/
List
<
DayCountDTO
>
getBookGroupFriendsCountByDay
(
Long
bookGroupId
,
String
startTime
,
String
endTime
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/JoinGroupCipherDao.java
View file @
b9292251
...
...
@@ -33,21 +33,7 @@ public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> {
List
<
JoinGroupCipher
>
getListByAltIdAndWxIdAndType
(
String
robotId
,
String
userWxId
,
Integer
code
);
/**
* 社群码好友数量
* @param bookGroupId
* @return
*/
public
Integer
getFriendsCountByBookGroup
(
Long
bookGroupId
);
/**
* 日加好友数量
* @param bookGroupId
* @param startTime
* @param endTime
* @return
*/
List
<
DayCountDTO
>
getBookGroupFriendsCountByDay
(
Long
bookGroupId
,
String
startTime
,
String
endTime
);
JoinGroupCipher
getByWechatUserIdAndQrcodeId
(
Long
wechatUserId
,
Long
qrcodeId
,
Integer
type
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupCipherUserDaoImpl.java
View file @
b9292251
package
com
.
pcloud
.
book
.
group
.
dao
.
impl
;
import
com.pcloud.book.group.dao.BookGroupCipherUserDao
;
import
com.pcloud.book.group.dto.DayCountDTO
;
import
com.pcloud.book.group.entity.BookGroupCipherUser
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description
* @Author ruansiyuan
...
...
@@ -16,4 +21,19 @@ public class BookGroupCipherUserDaoImpl extends BaseDaoImpl<BookGroupCipherUser>
public
Long
getBookGroupIdByWxUserId
(
String
wxUserId
)
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getBookGroupIdByWxUserId"
),
wxUserId
);
}
@Override
public
Integer
getFriendsCountByBookGroup
(
Long
bookGroupId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getFriendsCountByBookGroup"
),
bookGroupId
);
}
@Override
public
List
<
DayCountDTO
>
getBookGroupFriendsCountByDay
(
Long
bookGroupId
,
String
startTime
,
String
endTime
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"startTime"
,
startTime
);
map
.
put
(
"endTime"
,
endTime
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getBookGroupFriendsCountByDay"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/JoinGroupCipherDaoImpl.java
View file @
b9292251
...
...
@@ -89,20 +89,6 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getListByAltIdAndWxIdAndType"
),
map
);
}
@Override
public
Integer
getFriendsCountByBookGroup
(
Long
bookGroupId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getFriendsCountByBookGroup"
),
bookGroupId
);
}
@Override
public
List
<
DayCountDTO
>
getBookGroupFriendsCountByDay
(
Long
bookGroupId
,
String
startTime
,
String
endTime
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
map
.
put
(
"startTime"
,
startTime
);
map
.
put
(
"endTime"
,
endTime
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getBookGroupFriendsCountByDay"
),
map
);
}
public
JoinGroupCipher
getByWechatUserIdAndQrcodeId
(
Long
wechatUserId
,
Long
qrcodeId
,
Integer
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
...
...
pcloud-service-book/src/main/resources/mapper/group/BookGroupCipherUser.xml
View file @
b9292251
...
...
@@ -38,4 +38,52 @@
<select
id=
"getBookGroupIdByWxUserId"
parameterType=
"String"
resultType=
"long"
>
select book_group_id from book_group_cipher_user t where t.wx_user_id=#{wxUserId} order by create_time desc limit 1
</select>
<select
id=
"getFriendsCountByBookGroup"
parameterType=
"long"
resultType=
"integer"
>
SELECT
COUNT(DISTINCT wx_user_id)
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
</select>
<select
id=
"getBookGroupFriendsCountByDay"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.DayCountDTO"
>
SELECT
COUNT(DISTINCT a.wx_user_id) count,
DATE_FORMAT(a.create_time, "%Y-%m-%d") date
FROM
(
SELECT
wx_user_id,create_time
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
GROUP BY
wx_user_id
) AS a
WHERE
a.create_time >= #{startTime}
AND a.create_time
<
= #{endTime}
GROUP BY
DATE_FORMAT(a.create_time, "%Y-%m-%d")
</select>
<select
id=
"listPageFriendsStatistic"
parameterType=
"map"
resultType=
"com.pcloud.book.group.vo.FriendsVO"
>
SELECT
wx_user_id wxUserId,
alt_id robotId,
create_time createTime
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
GROUP BY
wx_user_id,
alt_id
ORDER BY
create_time DESC,id DESC
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/JoinGroupCipher.xml
View file @
b9292251
...
...
@@ -128,45 +128,6 @@
type=#{type}
</select>
<select
id=
"getFriendsCountByBookGroup"
parameterType=
"long"
resultType=
"integer"
>
SELECT
COUNT(DISTINCT wx_id)
FROM
join_group_cipher
WHERE
book_group_id = #{bookGroupId}
AND has_used = 1
</select>
<select
id=
"getBookGroupFriendsCountByDay"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.DayCountDTO"
>
SELECT
COUNT(DISTINCT wx_id) count,
DATE_FORMAT(create_time, "%Y-%m-%d") date
FROM
join_group_cipher
WHERE
book_group_id = #{bookGroupId}
AND has_used = 1
AND create_time >= #{startTime}
AND create_time
<
= #{endTime}
GROUP BY
DATE_FORMAT(create_time, "%Y-%m-%d")
</select>
<select
id=
"listPageFriendsStatistic"
parameterType=
"map"
resultType=
"com.pcloud.book.group.vo.FriendsVO"
>
SELECT DISTINCT
wx_id wxUserId,
alt_id robotId,
create_time createTime
FROM
join_group_cipher
WHERE
book_group_id = 655
AND has_used = 1
ORDER BY
create_time DESC,id DESC
</select>
<!--根据用户id和群id获取基本信息-->
<select
id=
"getByWechatUserIdAndQrcodeId"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from join_group_cipher
...
...
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