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
bb3cf4a3
Commit
bb3cf4a3
authored
May 09, 2020
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002867社群学舍优化显示
parent
db969237
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
372 additions
and
65 deletions
+372
-65
AppletGroupSearchRecordBiz.java
...om/pcloud/book/applet/biz/AppletGroupSearchRecordBiz.java
+18
-0
AppletGroupManageBizImpl.java
...pcloud/book/applet/biz/impl/AppletGroupManageBizImpl.java
+10
-12
AppletGroupSearchRecordBizImpl.java
.../book/applet/biz/impl/AppletGroupSearchRecordBizImpl.java
+100
-30
AppletGroupStatementDao.java
...a/com/pcloud/book/applet/dao/AppletGroupStatementDao.java
+34
-0
AppletGroupStatementDaoImpl.java
...oud/book/applet/dao/impl/AppletGroupStatementDaoImpl.java
+30
-0
AppletGroupManageDTO.java
...java/com/pcloud/book/applet/dto/AppletGroupManageDTO.java
+4
-0
AppletGroupStatementDTO.java
...a/com/pcloud/book/applet/dto/AppletGroupStatementDTO.java
+37
-0
AppletGroupStatement.java
...a/com/pcloud/book/applet/entity/AppletGroupStatement.java
+37
-0
GroupQrcodeDao.java
...c/main/java/com/pcloud/book/group/dao/GroupQrcodeDao.java
+7
-0
GroupQrcodeDaoImpl.java
...va/com/pcloud/book/group/dao/impl/GroupQrcodeDaoImpl.java
+5
-0
GroupQrcodeDTO.java
...c/main/java/com/pcloud/book/group/dto/GroupQrcodeDTO.java
+16
-1
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+8
-11
PcloudGroupActivityBizImpl.java
...cloud/book/skill/biz/impl/PcloudGroupActivityBizImpl.java
+9
-10
GroupActivity4AppletDTO.java
...va/com/pcloud/book/skill/dto/GroupActivity4AppletDTO.java
+7
-0
AppletGroupStatement.xml
...src/main/resources/mapper/applet/AppletGroupStatement.xml
+27
-0
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+2
-1
GroupQrcode.Mapper.xml
...ok/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
+21
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletGroupSearchRecordBiz.java
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
biz
;
package
com
.
pcloud
.
book
.
applet
.
biz
;
import
com.pcloud.book.applet.dto.AppletGroupManageDTO
;
import
com.pcloud.book.applet.dto.AppletGroupManageDTO
;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
com.pcloud.book.applet.entity.AppletGroupSearchRecord
;
import
com.pcloud.book.applet.entity.AppletGroupSearchRecord
;
import
com.pcloud.book.skill.dto.GroupActivity4AppletDTO
;
import
com.pcloud.book.skill.dto.GroupActivity4AppletDTO
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
...
@@ -53,4 +54,20 @@ public interface AppletGroupSearchRecordBiz {
...
@@ -53,4 +54,20 @@ public interface AppletGroupSearchRecordBiz {
void
deleteByIds
(
List
<
Long
>
ids
);
void
deleteByIds
(
List
<
Long
>
ids
);
List
<
GroupActivity4AppletDTO
>
getTishBookSchoolList
(
Long
bookGroupId
);
List
<
GroupActivity4AppletDTO
>
getTishBookSchoolList
(
Long
bookGroupId
);
/**
* 群对话随机组装
* @author:zhuyajie
* @date:2020/5/8 15:23
* * @param null
*/
public
List
<
AppletGroupStatementDTO
>
getStatementList
(
Integer
userNum
,
List
<
String
>
headUrlList
,
Long
groupQrcodeId
);
/**
* 获取群头像
* @author:zhuyajie
* @date:2020/5/9
* * @param null
*/
public
List
<
String
>
getHeadUrlList
(
Integer
userNum
,
Long
groupQrcodeId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletGroupManageBizImpl.java
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.dto.AppletGroupManageDTO
;
import
com.pcloud.book.applet.dto.AppletGroupManageDTO
;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
com.pcloud.book.applet.dto.UpdateAppletGroupManageDTO
;
import
com.pcloud.book.applet.dto.UpdateAppletGroupManageDTO
;
import
com.pcloud.book.applet.entity.AppletGroupManage
;
import
com.pcloud.book.applet.entity.AppletGroupManage
;
import
com.pcloud.book.applet.dao.AppletGroupManageDao
;
import
com.pcloud.book.applet.dao.AppletGroupManageDao
;
...
@@ -13,8 +16,6 @@ import com.pcloud.common.page.PageParam;
...
@@ -13,8 +16,6 @@ import com.pcloud.common.page.PageParam;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -40,13 +41,14 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
...
@@ -40,13 +41,14 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletGroupManageBizImpl
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletGroupManageBizImpl
.
class
);
private
static
final
String
GROUP_HEAD_URL_REDIS
=
"BOOK:APPLET:appletGroupManage_groupHeadUrl"
;
@Autowired
@Autowired
private
AppletGroupManageDao
appletGroupManageDao
;
private
AppletGroupManageDao
appletGroupManageDao
;
@Autowired
@Autowired
private
LabelConsr
labelConsr
;
private
LabelConsr
labelConsr
;
@Autowired
@Autowired
private
ReaderConsr
readerConsr
;
private
ReaderConsr
readerConsr
;
@Autowired
private
AppletGroupSearchRecordBiz
appletGroupSearchRecordBiz
;
@Override
@Override
public
AppletGroupManage
getById
(
Long
id
)
{
public
AppletGroupManage
getById
(
Long
id
)
{
...
@@ -98,16 +100,10 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
...
@@ -98,16 +100,10 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
dto
.
setCutDesc
(
subStr
);
dto
.
setCutDesc
(
subStr
);
//头像列表从缓存里取
//头像列表从缓存里取
List
<
String
>
headUrlList
=
JedisClusterUtils
.
hgetJson2List
(
GROUP_HEAD_URL_REDIS
,
dto
.
getGroupActivityId
().
toString
(),
String
.
class
);
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
dto
.
getUserNumber
(),
dto
.
getBookGroupQrcodeId
());
//缓存为空或数量不一致,重新获取
if
(
ListUtils
.
isEmpty
(
headUrlList
)
||
(
headUrlList
.
size
()<
9
&&!
dto
.
getUserNumber
().
equals
(
headUrlList
.
size
()))){
headUrlList
=
readerConsr
.
getRandomHeadUrlList
(
dto
.
getUserNumber
()>
9
?
9
:
dto
.
getUserNumber
());
JedisClusterUtils
.
hset2Json
(
GROUP_HEAD_URL_REDIS
,
dto
.
getGroupActivityId
().
toString
(),
headUrlList
);
JedisClusterUtils
.
expire
(
GROUP_HEAD_URL_REDIS
,
3600
);
}
dto
.
setHeadUrlList
(
headUrlList
);
dto
.
setHeadUrlList
(
headUrlList
);
dto
.
setQrcodeHeadUrl
(
readerConsr
.
getNineHeadUrl
());
List
<
AppletGroupStatementDTO
>
statementDTOS
=
appletGroupSearchRecordBiz
.
getStatementList
(
dto
.
getUserNumber
(),
headUrlList
,
dto
.
getBookGroupQrcodeId
());
dto
.
setStatementDTOList
(
statementDTOS
);
}
}
return
recordList
;
return
recordList
;
}
}
...
@@ -149,4 +145,5 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
...
@@ -149,4 +145,5 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
public
void
deleteById
(
Long
id
)
{
public
void
deleteById
(
Long
id
)
{
appletGroupManageDao
.
deleteById
(
id
);
appletGroupManageDao
.
deleteById
(
id
);
}
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletGroupSearchRecordBizImpl.java
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
applet
.
biz
.
impl
;
import
com.pcloud.book.applet.dto.AppletGroupManageDTO
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.dao.AppletGroupSearchRecordDao
;
import
com.pcloud.book.applet.dao.AppletGroupStatementDao
;
import
com.pcloud.book.applet.dto.AppletGroupSearchRecordDTO
;
import
com.pcloud.book.applet.dto.AppletGroupSearchRecordDTO
;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
com.pcloud.book.applet.entity.AppletGroupSearchRecord
;
import
com.pcloud.book.applet.entity.AppletGroupSearchRecord
;
import
com.pcloud.book.applet.dao.AppletGroupSearchRecordDao
;
import
com.pcloud.book.applet.entity.AppletGroupStatement
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.book.dao.BookAdviserDao
;
import
com.pcloud.book.book.dao.BookAdviserDao
;
import
com.pcloud.book.book.dto.BookAdviserDto
;
import
com.pcloud.book.book.dto.BookAdviserDto
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.GroupQrcodeDTO
;
import
com.pcloud.book.group.enums.JoinGroupTypeEnum
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.entity.BaseTempletClassify
;
import
com.pcloud.book.rightsSetting.entity.BaseTempletClassify
;
import
com.pcloud.book.skill.dao.PcloudGroupActivityDao
;
import
com.pcloud.book.skill.dao.PcloudGroupActivityDao
;
import
com.pcloud.book.skill.dto.GroupActivity4AppletDTO
;
import
com.pcloud.book.skill.dto.GroupActivity4AppletDTO
;
import
com.pcloud.common.constant.CacheConstant
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.NumberUtil
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
com.pcloud.common.utils.string.StringUtilParent
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.annotation.Resource
;
/**
/**
* (AppletGroupSearchRecord)表服务实现类
* (AppletGroupSearchRecord)表服务实现类
*
*
...
@@ -45,7 +54,8 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -45,7 +54,8 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletGroupSearchRecordBizImpl
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AppletGroupSearchRecordBizImpl
.
class
);
private
static
final
String
GROUP_HEAD_URL_REDIS
=
"BOOK:APPLET:pcloudGroupActivityBizImpl_groupHeadUrl"
;
private
static
final
String
GROUP_HEAD_URL_REDIS
=
CacheConstant
.
BOOK
+
"APPLET:pcloudGroupActivity_groupHeadUrl"
;
private
static
final
String
GROUP_STATEMENT_REDIS
=
CacheConstant
.
BOOK
+
"APPLET:pcloudGroupActivity_statement"
;
@Autowired
@Autowired
private
AppletGroupSearchRecordDao
appletGroupSearchRecordDao
;
private
AppletGroupSearchRecordDao
appletGroupSearchRecordDao
;
...
@@ -65,6 +75,10 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -65,6 +75,10 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Autowired
@Autowired
private
ReaderConsr
readerConsr
;
private
ReaderConsr
readerConsr
;
@Autowired
private
GroupQrcodeDao
groupQrcodeDao
;
@Autowired
private
AppletGroupStatementDao
appletGroupStatementDao
;
@Override
@Override
...
@@ -76,16 +90,16 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -76,16 +90,16 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Override
@Override
@ParamLog
(
"查询多条数据"
)
@ParamLog
(
"查询多条数据"
)
public
PageBeanNew
getList
(
Long
wechatUserId
,
Integer
isMore
,
Integer
currentPage
,
Integer
numPerPage
)
{
public
PageBeanNew
getList
(
Long
wechatUserId
,
Integer
isMore
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
map
.
put
(
"wechatUserId"
,
wechatUserId
);
PageBeanNew
pageBeanNew
=
appletGroupSearchRecordDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getList"
);
PageBeanNew
pageBeanNew
=
appletGroupSearchRecordDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getList"
);
List
<
AppletGroupSearchRecordDTO
>
recordList
=
pageBeanNew
.
getRecordList
();
List
<
AppletGroupSearchRecordDTO
>
recordList
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
recordList
)){
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
pageBeanNew
;
return
pageBeanNew
;
}
}
// 填充分类信息
// 填充分类信息
for
(
AppletGroupSearchRecordDTO
dto
:
recordList
){
for
(
AppletGroupSearchRecordDTO
dto
:
recordList
)
{
if
(
isMore
==
1
)
{
if
(
isMore
==
1
)
{
dto
.
setClassifyCount
(
bookGroupClassifyBiz
.
getClassifyCount
(
dto
.
getBookGroupId
()));
dto
.
setClassifyCount
(
bookGroupClassifyBiz
.
getClassifyCount
(
dto
.
getBookGroupId
()));
}
else
{
}
else
{
dto
.
setClassify4WechatVOList
(
bookGroupClassifyBiz
.
listClassify4Wechat
(
dto
.
getBookGroupId
(),
dto
.
getWechatUserId
()));
dto
.
setClassify4WechatVOList
(
bookGroupClassifyBiz
.
listClassify4Wechat
(
dto
.
getBookGroupId
(),
dto
.
getWechatUserId
()));
...
@@ -97,11 +111,11 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -97,11 +111,11 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Override
@Override
@ParamLog
(
"新增"
)
@ParamLog
(
"新增"
)
public
Long
insert
(
AppletGroupSearchRecord
appletGroupSearchRecord
)
{
public
Long
insert
(
AppletGroupSearchRecord
appletGroupSearchRecord
)
{
if
(!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getBookId
())
||
!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getChannelId
())
||
!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getAdviserId
()))
{
if
(!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getBookId
())
||
!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getChannelId
())
||
!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getAdviserId
()))
{
throw
BizException
.
PARAM_DELETION
;
throw
BizException
.
PARAM_DELETION
;
}
}
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOByBookId
(
appletGroupSearchRecord
.
getBookId
(),
appletGroupSearchRecord
.
getChannelId
(),
appletGroupSearchRecord
.
getAdviserId
());
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOByBookId
(
appletGroupSearchRecord
.
getBookId
(),
appletGroupSearchRecord
.
getChannelId
(),
appletGroupSearchRecord
.
getAdviserId
());
if
(
bookGroupDTO
!=
null
&&
bookGroupDTO
.
getId
()
!=
null
&&
bookGroupDTO
.
getId
()
>
0
)
{
if
(
bookGroupDTO
!=
null
&&
bookGroupDTO
.
getId
()
!=
null
&&
bookGroupDTO
.
getId
()
>
0
)
{
appletGroupSearchRecord
.
setBookGroupId
(
bookGroupDTO
.
getId
());
appletGroupSearchRecord
.
setBookGroupId
(
bookGroupDTO
.
getId
());
appletGroupSearchRecordDao
.
insert
(
appletGroupSearchRecord
);
appletGroupSearchRecordDao
.
insert
(
appletGroupSearchRecord
);
return
appletGroupSearchRecord
.
getId
();
return
appletGroupSearchRecord
.
getId
();
...
@@ -112,7 +126,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -112,7 +126,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Override
@Override
@ParamLog
(
"修改"
)
@ParamLog
(
"修改"
)
public
void
update
(
AppletGroupSearchRecord
appletGroupSearchRecord
)
{
public
void
update
(
AppletGroupSearchRecord
appletGroupSearchRecord
)
{
if
(
appletGroupSearchRecord
==
null
||
!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getId
()))
{
if
(
appletGroupSearchRecord
==
null
||
!
NumberUtil
.
isNumber
(
appletGroupSearchRecord
.
getId
()))
{
throw
BizException
.
PARAM_DELETION
;
throw
BizException
.
PARAM_DELETION
;
}
}
appletGroupSearchRecordDao
.
update
(
appletGroupSearchRecord
);
appletGroupSearchRecordDao
.
update
(
appletGroupSearchRecord
);
...
@@ -127,7 +141,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -127,7 +141,7 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Override
@Override
@ParamLog
(
"删除"
)
@ParamLog
(
"删除"
)
public
void
deleteByIds
(
List
<
Long
>
ids
)
{
public
void
deleteByIds
(
List
<
Long
>
ids
)
{
if
(
ListUtils
.
isEmpty
(
ids
))
{
if
(
ListUtils
.
isEmpty
(
ids
))
{
throw
BizException
.
PARAM_DELETION
;
throw
BizException
.
PARAM_DELETION
;
}
}
appletGroupSearchRecordDao
.
deleteByIds
(
ids
);
appletGroupSearchRecordDao
.
deleteByIds
(
ids
);
...
@@ -136,36 +150,91 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
...
@@ -136,36 +150,91 @@ public class AppletGroupSearchRecordBizImpl implements AppletGroupSearchRecordBi
@Override
@Override
public
List
<
GroupActivity4AppletDTO
>
getTishBookSchoolList
(
Long
bookGroupId
)
{
public
List
<
GroupActivity4AppletDTO
>
getTishBookSchoolList
(
Long
bookGroupId
)
{
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getBookBaseInfoById
(
bookGroupId
);
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getBookBaseInfoById
(
bookGroupId
);
BookAdviserDto
adviserDto
=
bookAdviserDao
.
getBase
(
bookGroupDTO
.
getBookId
(),
bookGroupDTO
.
getChannelId
(),
bookGroupDTO
.
getCreateUser
());
BookAdviserDto
adviserDto
=
bookAdviserDao
.
getBase
(
bookGroupDTO
.
getBookId
(),
bookGroupDTO
.
getChannelId
(),
bookGroupDTO
.
getCreateUser
());
BaseTempletClassify
baseTempletClassify
=
new
BaseTempletClassify
();
BaseTempletClassify
baseTempletClassify
=
new
BaseTempletClassify
();
if
(
adviserDto
!=
null
)
{
if
(
adviserDto
!=
null
)
{
baseTempletClassify
.
setFirstClassify
(
adviserDto
.
getTempletId
());
baseTempletClassify
.
setFirstClassify
(
adviserDto
.
getTempletId
());
baseTempletClassify
.
setSecondClassify
(
adviserDto
.
getSecondTempletId
());
baseTempletClassify
.
setSecondClassify
(
adviserDto
.
getSecondTempletId
());
baseTempletClassify
.
setGradeLabelId
(
adviserDto
.
getGraLabelId
());
baseTempletClassify
.
setGradeLabelId
(
adviserDto
.
getGraLabelId
());
baseTempletClassify
.
setSubjectLabelId
(
adviserDto
.
getSubLabelId
());
baseTempletClassify
.
setSubjectLabelId
(
adviserDto
.
getSubLabelId
());
rightsSettingBiz
.
setClassifyAndLabel
(
baseTempletClassify
);
rightsSettingBiz
.
setClassifyAndLabel
(
baseTempletClassify
);
}
}
//设置头像
List
<
GroupActivity4AppletDTO
>
tishBookSchoolList
=
new
ArrayList
<>();
List
<
GroupActivity4AppletDTO
>
tishBookSchoolList
=
pcloudGroupActivityDao
.
getTishBookSchoolList
(
baseTempletClassify
);
//本书自带社群
if
(
ListUtils
.
isEmpty
(
tishBookSchoolList
)){
if
(
JoinGroupTypeEnum
.
GROUP_QRCODE
.
getCode
().
equals
(
bookGroupDTO
.
getJoinGroupType
()))
{
List
<
GroupQrcodeDTO
>
groupQrcodeDTOS
=
groupQrcodeDao
.
getGroupQrcodeListByBookGroupId
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
groupQrcodeDTOS
))
{
for
(
GroupQrcodeDTO
qrcodeDTO
:
groupQrcodeDTOS
)
{
GroupActivity4AppletDTO
appletDTO
=
new
GroupActivity4AppletDTO
();
BeanUtils
.
copyProperties
(
qrcodeDTO
,
appletDTO
);
appletDTO
.
setName
(
qrcodeDTO
.
getGroupName
());
appletDTO
.
setDesc
(
qrcodeDTO
.
getClassifyIntroduce
());
appletDTO
.
setBookGroupId
(
bookGroupId
);
appletDTO
.
setBookGroupQrcodeId
(
qrcodeDTO
.
getId
());
tishBookSchoolList
.
add
(
appletDTO
);
}
}
}
//根据分类推荐相关
List
<
GroupActivity4AppletDTO
>
groupActivity4AppletDTOS
=
pcloudGroupActivityDao
.
getTishBookSchoolList
(
baseTempletClassify
);
if
(!
ListUtils
.
isEmpty
(
groupActivity4AppletDTOS
))
{
tishBookSchoolList
.
addAll
(
groupActivity4AppletDTOS
);
}
if
(
ListUtils
.
isEmpty
(
tishBookSchoolList
))
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
for
(
GroupActivity4AppletDTO
groupActivity4AppletDTO
:
tishBookSchoolList
)
{
for
(
GroupActivity4AppletDTO
groupActivity4AppletDTO
:
tishBookSchoolList
)
{
String
filterStr
=
StringUtilParent
.
replaceHtml
(
groupActivity4AppletDTO
.
getDesc
());
String
filterStr
=
StringUtilParent
.
replaceHtml
(
groupActivity4AppletDTO
.
getDesc
());
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
//头像列表从缓存里取
//头像列表从缓存里取
List
<
String
>
headUrlList
=
JedisClusterUtils
.
hgetJson2List
(
GROUP_HEAD_URL_REDIS
,
groupActivity4AppletDTO
.
getGroupActivityId
().
toString
(),
String
.
class
);
List
<
String
>
headUrlList
=
this
.
getHeadUrlList
(
groupActivity4AppletDTO
.
getUserNumber
(),
groupActivity4AppletDTO
.
getBookGroupQrcodeId
());
//缓存为空或数量不一致,重新获取
if
(
ListUtils
.
isEmpty
(
headUrlList
)
||
(
headUrlList
.
size
()<
9
&&
!
groupActivity4AppletDTO
.
getUserNumber
().
equals
(
headUrlList
.
size
()))){
headUrlList
=
readerConsr
.
getRandomHeadUrlList
(
groupActivity4AppletDTO
.
getUserNumber
()>
9
?
9
:
groupActivity4AppletDTO
.
getUserNumber
());
JedisClusterUtils
.
hset2Json
(
GROUP_HEAD_URL_REDIS
,
groupActivity4AppletDTO
.
getGroupActivityId
().
toString
(),
headUrlList
);
JedisClusterUtils
.
expire
(
GROUP_HEAD_URL_REDIS
,
3600
);
}
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
List
<
AppletGroupStatementDTO
>
statementDTOS
=
this
.
getStatementList
(
groupActivity4AppletDTO
.
getUserNumber
(),
headUrlList
,
groupActivity4AppletDTO
.
getBookGroupQrcodeId
());
groupActivity4AppletDTO
.
setStatementDTOList
(
statementDTOS
);
}
}
return
tishBookSchoolList
;
return
tishBookSchoolList
;
}
}
@Override
public
List
<
String
>
getHeadUrlList
(
Integer
userNum
,
Long
groupQrcodeId
)
{
List
<
String
>
headUrlList
=
JedisClusterUtils
.
hgetJson2List
(
GROUP_HEAD_URL_REDIS
,
groupQrcodeId
.
toString
(),
String
.
class
);
if
(
ListUtils
.
isEmpty
(
headUrlList
)
||
(
headUrlList
.
size
()
<
9
&&
!
userNum
.
equals
(
headUrlList
.
size
())))
{
headUrlList
=
readerConsr
.
getRandomHeadUrlList
(
userNum
>
9
?
9
:
userNum
);
JedisClusterUtils
.
hset2Json
(
GROUP_HEAD_URL_REDIS
,
groupQrcodeId
.
toString
(),
headUrlList
);
JedisClusterUtils
.
expire
(
GROUP_HEAD_URL_REDIS
,
3600
);
}
return
headUrlList
;
}
@Override
public
List
<
AppletGroupStatementDTO
>
getStatementList
(
Integer
userNum
,
List
<
String
>
headUrlList
,
Long
groupQrcodeId
)
{
if
(
userNum
<=
0
)
{
return
new
ArrayList
<>();
}
List
<
AppletGroupStatementDTO
>
statementDTOS
=
JedisClusterUtils
.
hgetJson2List
(
GROUP_STATEMENT_REDIS
,
groupQrcodeId
.
toString
(),
AppletGroupStatementDTO
.
class
);
if
(
ListUtils
.
isEmpty
(
statementDTOS
)
||
(
statementDTOS
.
size
()
<
9
&&
!
userNum
.
equals
(
statementDTOS
.
size
())))
{
statementDTOS
=
new
ArrayList
<>();
userNum
=
userNum
>
50
?
50
:
userNum
;
//最多50条
List
<
String
>
headUrls
=
new
ArrayList
<>();
headUrls
.
addAll
(
headUrlList
);
if
(
headUrlList
.
size
()
<
userNum
)
{
headUrls
.
addAll
(
readerConsr
.
getRandomHeadUrlList
(
userNum
-
headUrlList
.
size
()));
}
List
<
AppletGroupStatement
>
statementList
=
appletGroupStatementDao
.
getRandom
(
userNum
);
for
(
int
i
=
0
;
i
<
userNum
;
i
++)
{
AppletGroupStatementDTO
statementDTO
=
new
AppletGroupStatementDTO
();
statementDTO
.
setHeadUrl
(
headUrls
.
get
(
i
));
AppletGroupStatement
statement
=
statementList
.
get
(
i
);
statementDTO
.
setStatement
(
statement
.
getStatement
());
statementDTO
.
setType
(
statement
.
getType
());
statementDTO
.
setDuration
(
statement
.
getDuration
());
statementDTOS
.
add
(
statementDTO
);
}
JedisClusterUtils
.
hset2Json
(
GROUP_STATEMENT_REDIS
,
groupQrcodeId
.
toString
(),
statementDTOS
);
JedisClusterUtils
.
expire
(
GROUP_STATEMENT_REDIS
,
3600
);
}
return
statementDTOS
;
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletGroupStatementDao.java
0 → 100644
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
com.pcloud.book.applet.entity.AppletGroupStatement
;
import
com.pcloud.common.core.dao.BaseDao
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 学舍群话语库(AppletGroupStatement)表数据库访问层
*
* @author makejava
* @since 2020-05-08 11:21:25
*/
public
interface
AppletGroupStatementDao
extends
BaseDao
<
AppletGroupStatement
>{
/**
* 通过实体作为筛选条件查询
*
* @return 对象列表
*/
List
<
AppletGroupStatement
>
getAll
();
/**
* 随机取n条
*
* @return 对象列表
*/
List
<
AppletGroupStatement
>
getRandom
(
Integer
count
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletGroupStatementDaoImpl.java
0 → 100644
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
dao
.
impl
;
import
com.pcloud.book.applet.dao.AppletGroupStatementDao
;
import
com.pcloud.book.applet.entity.AppletGroupStatement
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* @ClassName com.pcloud.book.applet.dao.impl.AppletGroupStatementDaoImpl
* @Author zhuyajie
* @Description 学舍群话语库
* @Date 2020/5/8 11:23
* @Version 1.0
**/
@Component
public
class
AppletGroupStatementDaoImpl
extends
BaseDaoImpl
<
AppletGroupStatement
>
implements
AppletGroupStatementDao
{
@Override
public
List
<
AppletGroupStatement
>
getAll
()
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAll"
));
}
@Override
public
List
<
AppletGroupStatement
>
getRandom
(
Integer
count
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getRandom"
),
count
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletGroupManageDTO.java
View file @
bb3cf4a3
...
@@ -81,4 +81,7 @@ public class AppletGroupManageDTO extends BaseEntity {
...
@@ -81,4 +81,7 @@ public class AppletGroupManageDTO extends BaseEntity {
@ApiModelProperty
(
"头像列表"
)
@ApiModelProperty
(
"头像列表"
)
private
List
<
String
>
headUrlList
;
private
List
<
String
>
headUrlList
;
@ApiModelProperty
(
"学舍群话语"
)
private
List
<
AppletGroupStatementDTO
>
statementDTOList
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletGroupStatementDTO.java
0 → 100644
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
java.math.BigDecimal
;
import
lombok.Data
;
/**
* @ClassName com.pcloud.book.applet.dto.AppletGroupStatementDTO
* @Author zhuyajie
* @Description 学社群对话
* @Date 2020/5/8 15:12
* @Version 1.0
**/
@Data
public
class
AppletGroupStatementDTO
extends
BaseDto
{
/**
* 头像
*/
private
String
headUrl
;
/**
* 语句
*/
private
String
statement
;
/**
* 类型
*/
private
Integer
type
;
/**
* 音频时长
*/
private
BigDecimal
duration
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/entity/AppletGroupStatement.java
0 → 100644
View file @
bb3cf4a3
package
com
.
pcloud
.
book
.
applet
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.math.BigDecimal
;
import
lombok.Data
;
/**
* 学舍群话语库(AppletGroupStatement)实体类
*
* @author zhuyajie
* @since 2020-05-08 11:21:25
*/
@Data
public
class
AppletGroupStatement
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
857680952758668647L
;
/**
* 语句
*/
private
String
statement
;
/**
* 类型
*/
private
Integer
type
;
/**
* 音频时长
*/
private
BigDecimal
duration
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/GroupQrcodeDao.java
View file @
bb3cf4a3
...
@@ -295,4 +295,11 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
...
@@ -295,4 +295,11 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
* 根据类型获取当前群总人数
* 根据类型获取当前群总人数
*/
*/
Integer
getUserCountByJoinGroupType
(
Integer
joinGroupType
);
Integer
getUserCountByJoinGroupType
(
Integer
joinGroupType
);
/**
* 根据社群书id查群
* @param bookGroupId
* @return
*/
List
<
GroupQrcodeDTO
>
getGroupQrcodeListByBookGroupId
(
Long
bookGroupId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/GroupQrcodeDaoImpl.java
View file @
bb3cf4a3
...
@@ -302,4 +302,9 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
...
@@ -302,4 +302,9 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
paramMap
.
put
(
"joinGroupType"
,
joinGroupType
);
paramMap
.
put
(
"joinGroupType"
,
joinGroupType
);
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getUserCountByJoinGroupType"
),
paramMap
);
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getUserCountByJoinGroupType"
),
paramMap
);
}
}
@Override
public
List
<
GroupQrcodeDTO
>
getGroupQrcodeListByBookGroupId
(
Long
bookGroupId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getGroupQrcodeListByBookGroupId"
),
bookGroupId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/GroupQrcodeDTO.java
View file @
bb3cf4a3
...
@@ -61,5 +61,20 @@ public class GroupQrcodeDTO implements Serializable {
...
@@ -61,5 +61,20 @@ public class GroupQrcodeDTO implements Serializable {
*/
*/
private
Integer
joinGroupType
;
private
Integer
joinGroupType
;
/**
*群分类
*/
private
String
classify
;
/**
*群二维码
*/
private
String
qrcodeUrl
;
/**
*群分类介绍
*/
private
String
classifyIntroduce
;
/**
*社群码id
*/
private
Long
bookGroupId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
bb3cf4a3
...
@@ -5,8 +5,10 @@ import com.google.common.collect.Lists;
...
@@ -5,8 +5,10 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.biz.AppletNewsBiz
;
import
com.pcloud.book.applet.biz.AppletNewsBiz
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
import
com.pcloud.book.applet.dao.AppletNewsDao
;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
...
@@ -95,8 +97,6 @@ import java.util.stream.Collectors;
...
@@ -95,8 +97,6 @@ import java.util.stream.Collectors;
@Slf4j
@Slf4j
public
class
RightsSettingBizImpl
implements
RightsSettingBiz
{
public
class
RightsSettingBizImpl
implements
RightsSettingBiz
{
private
static
final
String
GROUP_HEAD_URL_REDIS
=
"BOOK:APPLET:RIGHTSSETTINGBIZIMPL:SETGROUPACTIVITY"
;
@Autowired
@Autowired
private
RightsSettingDAO
rightsSettingDAO
;
private
RightsSettingDAO
rightsSettingDAO
;
@Autowired
@Autowired
...
@@ -150,6 +150,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -150,6 +150,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
@Autowired
@Autowired
private
RightsNowPicDao
rightsNowPicDao
;
private
RightsNowPicDao
rightsNowPicDao
;
@Autowired
private
AppletGroupSearchRecordBiz
appletGroupSearchRecordBiz
;
@Override
@Override
@ParamLog
(
"新增权益设置"
)
@ParamLog
(
"新增权益设置"
)
...
@@ -979,15 +981,10 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -979,15 +981,10 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
//头像列表从缓存里取
//头像列表从缓存里取
List
<
String
>
headUrlList
=
JedisClusterUtils
.
hgetJson2List
(
GROUP_HEAD_URL_REDIS
,
groupActivity4AppletDTO
.
getGroupActivityId
().
toString
(),
String
.
class
);
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
groupActivity4AppletDTO
.
getUserNumber
(),
groupActivity4AppletDTO
.
getBookGroupQrcodeId
());
//缓存为空或数量不一致,重新获取
if
(
ListUtils
.
isEmpty
(
headUrlList
)
||
(
headUrlList
.
size
()<
9
&&
!
groupActivity4AppletDTO
.
getUserNumber
().
equals
(
headUrlList
.
size
()))){
headUrlList
=
readerConsr
.
getRandomHeadUrlList
(
groupActivity4AppletDTO
.
getUserNumber
()>
9
?
9
:
groupActivity4AppletDTO
.
getUserNumber
());
JedisClusterUtils
.
hset2Json
(
GROUP_HEAD_URL_REDIS
,
groupActivity4AppletDTO
.
getGroupActivityId
().
toString
(),
headUrlList
);
JedisClusterUtils
.
expire
(
GROUP_HEAD_URL_REDIS
,
3600
);
}
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
List
<
AppletGroupStatementDTO
>
statementDTOS
=
appletGroupSearchRecordBiz
.
getStatementList
(
groupActivity4AppletDTO
.
getUserNumber
(),
headUrlList
,
groupActivity4AppletDTO
.
getBookGroupQrcodeId
());
groupActivity4AppletDTO
.
setStatementDTOList
(
statementDTOS
);
for
(
RightsSettingItem
rightsSettingItem
:
list
){
for
(
RightsSettingItem
rightsSettingItem
:
list
){
if
(
rightsSettingItemIds
.
contains
(
rightsSettingItem
.
getId
())){
if
(
rightsSettingItemIds
.
contains
(
rightsSettingItem
.
getId
())){
rightsSettingItem
.
setGroupActivity4AppletDTO
(
groupActivity4AppletDTO
);
rightsSettingItem
.
setGroupActivity4AppletDTO
(
groupActivity4AppletDTO
);
...
@@ -1065,7 +1062,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
...
@@ -1065,7 +1062,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
}
newsDTOS
=
dtos
;
newsDTOS
=
dtos
;
}
}
JedisClusterUtils
.
setJsonList
(
key
,
newsDTOS
,
CommonUtils
.
todayRemainingSeconds
()
);
JedisClusterUtils
.
setJsonList
(
key
,
newsDTOS
,
60
);
}
}
}
}
item
.
setAppletNewsDTOS
(
newsDTOS
);
item
.
setAppletNewsDTOS
(
newsDTOS
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/biz/impl/PcloudGroupActivityBizImpl.java
View file @
bb3cf4a3
...
@@ -5,6 +5,9 @@ import com.google.common.collect.Lists;
...
@@ -5,6 +5,9 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.dao.AppletGroupStatementDao
;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dao.BookLabelDao
;
import
com.pcloud.book.book.dao.BookLabelDao
;
...
@@ -67,7 +70,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -67,7 +70,6 @@ import lombok.extern.slf4j.Slf4j;
@Service
@Service
public
class
PcloudGroupActivityBizImpl
implements
PcloudGroupActivityBiz
{
public
class
PcloudGroupActivityBizImpl
implements
PcloudGroupActivityBiz
{
private
static
final
String
GROUP_HEAD_URL_REDIS
=
"BOOK:APPLET:pcloudGroupActivityBizImpl_groupHeadUrl"
;
@Resource
@Resource
private
PcloudSkillDao
pcloudSkillDao
;
private
PcloudSkillDao
pcloudSkillDao
;
...
@@ -93,6 +95,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
...
@@ -93,6 +95,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
private
BookBiz
bookBiz
;
private
BookBiz
bookBiz
;
@Autowired
@Autowired
private
RightsSettingTitleMapper
rightsSettingTitleMapper
;
private
RightsSettingTitleMapper
rightsSettingTitleMapper
;
@Autowired
private
AppletGroupSearchRecordBiz
appletGroupSearchRecordBiz
;
@ParamLog
(
"保存共读活动"
)
@ParamLog
(
"保存共读活动"
)
@Override
@Override
...
@@ -303,22 +307,17 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
...
@@ -303,22 +307,17 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
}
}
// 是否开启社群服务开关
// 是否开启社群服务开关
RightsSettingTitle
right
=
rightsSettingTitleMapper
.
getByRightSettingIdAndType
(
rightSettingId
,
RightsNowItemType
.
GROUP_SERVICE
.
value
);
RightsSettingTitle
right
=
rightsSettingTitleMapper
.
getByRightSettingIdAndType
(
rightSettingId
,
RightsNowItemType
.
GROUP_SERVICE
.
value
);
groupActivity4AppletDTO
.
setOpenStatus
(
Objects
.
isNull
(
right
)
?
false
:
right
.
getOpenState
());
groupActivity4AppletDTO
.
setOpenStatus
(
Objects
.
isNull
(
right
.
getOpenState
()
)
?
false
:
right
.
getOpenState
());
groupActivity4AppletDTO
.
setRightsSettingTitle
(
right
.
getRightsSettingTitle
());
groupActivity4AppletDTO
.
setRightsSettingTitle
(
right
.
getRightsSettingTitle
());
groupActivity4AppletDTO
.
setRightsSettingDesc
(
right
.
getRightsSettingDesc
());
groupActivity4AppletDTO
.
setRightsSettingDesc
(
right
.
getRightsSettingDesc
());
String
filterStr
=
StringUtilParent
.
replaceHtml
(
groupActivity4AppletDTO
.
getDesc
());
String
filterStr
=
StringUtilParent
.
replaceHtml
(
groupActivity4AppletDTO
.
getDesc
());
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
//头像列表从缓存里取
//头像列表从缓存里取
List
<
String
>
headUrlList
=
JedisClusterUtils
.
hgetJson2List
(
GROUP_HEAD_URL_REDIS
,
groupActivity4AppletDTO
.
getGroupActivityId
().
toString
(),
String
.
class
);
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
groupActivity4AppletDTO
.
getUserNumber
(),
groupActivity4AppletDTO
.
getBookGroupQrcodeId
());
//缓存为空或数量不一致,重新获取
if
(
ListUtils
.
isEmpty
(
headUrlList
)
||
(
headUrlList
.
size
()<
9
&&
!
groupActivity4AppletDTO
.
getUserNumber
().
equals
(
headUrlList
.
size
()))){
headUrlList
=
readerConsr
.
getRandomHeadUrlList
(
groupActivity4AppletDTO
.
getUserNumber
()>
9
?
9
:
groupActivity4AppletDTO
.
getUserNumber
());
JedisClusterUtils
.
hset2Json
(
GROUP_HEAD_URL_REDIS
,
groupActivity4AppletDTO
.
getGroupActivityId
().
toString
(),
headUrlList
);
JedisClusterUtils
.
expire
(
GROUP_HEAD_URL_REDIS
,
3600
);
}
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
List
<
AppletGroupStatementDTO
>
statementDTOS
=
appletGroupSearchRecordBiz
.
getStatementList
(
groupActivity4AppletDTO
.
getUserNumber
(),
headUrlList
,
groupActivity4AppletDTO
.
getBookGroupQrcodeId
());
groupActivity4AppletDTO
.
setStatementDTOList
(
statementDTOS
);
return
groupActivity4AppletDTO
;
return
groupActivity4AppletDTO
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/skill/dto/GroupActivity4AppletDTO.java
View file @
bb3cf4a3
...
@@ -2,6 +2,8 @@ package com.pcloud.book.skill.dto;
...
@@ -2,6 +2,8 @@ package com.pcloud.book.skill.dto;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -59,4 +61,9 @@ public class GroupActivity4AppletDTO implements Serializable {
...
@@ -59,4 +61,9 @@ public class GroupActivity4AppletDTO implements Serializable {
@ApiModelProperty
(
"权益描述"
)
@ApiModelProperty
(
"权益描述"
)
private
String
rightsSettingDesc
;
private
String
rightsSettingDesc
;
@ApiModelProperty
(
"学舍群话语"
)
private
List
<
AppletGroupStatementDTO
>
statementDTOList
;
}
}
pcloud-service-book/src/main/resources/mapper/applet/AppletGroupStatement.xml
0 → 100644
View file @
bb3cf4a3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pcloud.book.applet.dao.impl.AppletGroupStatementDaoImpl"
>
<resultMap
type=
"com.pcloud.book.applet.entity.AppletGroupStatement"
id=
"AppletGroupStatementMap"
>
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"statement"
column=
"statement"
jdbcType=
"VARCHAR"
/>
<result
property=
"type"
column=
"type"
jdbcType=
"INTEGER"
/>
<result
property=
"duration"
column=
"duration"
jdbcType=
"DECIMAL"
/>
</resultMap>
<select
id=
"getAll"
resultMap=
"AppletGroupStatementMap"
>
select
id, statement,type,duration
from book.applet_group_statement
</select>
<select
id=
"getRandom"
parameterType=
"integer"
resultMap=
"AppletGroupStatementMap"
>
SELECT id, statement,type, duration
FROM book.applet_group_statement
ORDER BY RAND()
LIMIT #{count}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
View file @
bb3cf4a3
...
@@ -461,7 +461,8 @@
...
@@ -461,7 +461,8 @@
b.cover_img book_img,
b.cover_img book_img,
b.isbn,
b.isbn,
bg.channel_id,
bg.channel_id,
bg.create_user
bg.create_user,
bg.join_group_type
FROM
FROM
book_group bg
book_group bg
LEFT JOIN book b ON bg.book_id = b.BOOK_ID
LEFT JOIN book b ON bg.book_id = b.BOOK_ID
...
...
pcloud-service-book/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
View file @
bb3cf4a3
...
@@ -842,4 +842,24 @@
...
@@ -842,4 +842,24 @@
and t2.join_group_type=#{joinGroupType}
and t2.join_group_type=#{joinGroupType}
</if>
</if>
</select>
</select>
<select
id=
"getGroupQrcodeListByBookGroupId"
parameterType=
"long"
resultType=
"com.pcloud.book.group.dto.GroupQrcodeDTO"
>
SELECT
q.id id,
q.classify_id classifyId,
q.weixin_group_id weixinGroupId,
q.group_name groupName,
q.user_number userNumber,
c.classify classify,
q.qrcode_url qrcodeUrl,
c.classify_introduce classifyIntroduce,
c.book_group_id bookGroupId
FROM
book_group_classify c
JOIN book_group_qrcode q ON c.id = q.classify_id
WHERE
c.book_group_id = #{bookGroupId}
AND c.is_delete = 0
AND q.is_delete = 0
</select>
</mapper>
</mapper>
\ No newline at end of file
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