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
775e5765
Commit
775e5765
authored
Jul 04, 2020
by
pansy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
103095 社群共读模板支持第三方群分类接入
parent
2e032e52
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
441 additions
and
30 deletions
+441
-30
AppletGroupManageBizImpl.java
...pcloud/book/applet/biz/impl/AppletGroupManageBizImpl.java
+2
-0
AppletGroupManageDTO.java
...java/com/pcloud/book/applet/dto/AppletGroupManageDTO.java
+6
-0
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+1
-1
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+14
-0
PcloudGroupActivityBizImpl.java
...cloud/book/skill/biz/impl/PcloudGroupActivityBizImpl.java
+48
-9
PcloudGroupActivityDao.java
...ava/com/pcloud/book/skill/dao/PcloudGroupActivityDao.java
+11
-0
PcloudGroupActivityDaoImpl.java
...cloud/book/skill/dao/impl/PcloudGroupActivityDaoImpl.java
+31
-0
GroupActivity4AppletDTO.java
...va/com/pcloud/book/skill/dto/GroupActivity4AppletDTO.java
+5
-2
PcloudGroupActivity.java
...ava/com/pcloud/book/skill/entity/PcloudGroupActivity.java
+32
-0
PcloudGroupActivityFacade.java
...m/pcloud/book/skill/facade/PcloudGroupActivityFacade.java
+4
-0
GroupActivityClassifyVO.java
...ud/book/skill/facade/request/GroupActivityClassifyVO.java
+23
-0
GroupActivityShowStateVO.java
...d/book/skill/facade/request/GroupActivityShowStateVO.java
+25
-0
SaveGroupActivityRequestVO.java
...book/skill/facade/request/SaveGroupActivityRequestVO.java
+17
-1
UpdateGroupActivityRequestVO.java
...ok/skill/facade/request/UpdateGroupActivityRequestVO.java
+13
-2
QueryGroupActivityResponseVO.java
...k/skill/facade/response/QueryGroupActivityResponseVO.java
+8
-0
AppletGroupManage.Mapper.xml
...main/resources/mapper/applet/AppletGroupManage.Mapper.xml
+7
-3
PcloudGroupActivityDao.xml
...rc/main/resources/mapper/skill/PcloudGroupActivityDao.xml
+192
-11
BookKeywordWarehouseBizTest.java
...rvice-book/src/test/test/BookKeywordWarehouseBizTest.java
+2
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletGroupManageBizImpl.java
View file @
775e5765
...
...
@@ -78,12 +78,14 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
// 平台端共读模板创建修改为选择群分类自更新群 群变更为群分类 需要补充信息
for
(
AppletGroupManageDTO
appletGroupManageDTO
:
recordList
.
getRecordList
())
{
Long
classifyId
=
appletGroupManageDTO
.
getClassifyId
();
if
(
classifyId
!=
null
&&
classifyId
!=
0
)
{
String
groupQrCode
=
groupQrcodeBiz
.
getChangeGroupQrCode
(
classifyId
);
ClassifyQrcodeVO
groupQrcodeInfo
=
groupQrcodeBiz
.
getGroupQrcodeInfo
(
groupQrCode
,
classifyId
);
appletGroupManageDTO
.
setUserNumber
(
groupQrcodeInfo
.
getUserNumber
());
appletGroupManageDTO
.
setBookGroupQrcodeId
(
groupQrcodeInfo
.
getId
());
appletGroupManageDTO
.
setGroupPic
(
groupQrCode
);
}
}
// 组装标签名称
List
<
Long
>
labelId
=
Lists
.
newArrayList
();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/AppletGroupManageDTO.java
View file @
775e5765
...
...
@@ -19,6 +19,9 @@ public class AppletGroupManageDTO extends BaseEntity {
private
Long
id
;
@ApiModelProperty
(
"群类型 1:第三方群"
)
private
Long
groupType
;
@ApiModelProperty
(
"共读活动id"
)
private
Long
groupActivityId
;
...
...
@@ -94,4 +97,6 @@ public class AppletGroupManageDTO extends BaseEntity {
@ApiModelProperty
(
"关联"
)
private
Long
relatedBookGroupId
;
@ApiModelProperty
(
"第三方群链接"
)
private
String
groupLink
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
775e5765
...
...
@@ -1376,7 +1376,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
}
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
final
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"list"
,
ids
);
map
.
put
(
"list"
,
ids
);
map
.
put
(
"name"
,
StringUtil
.
isEmpty
(
name
)
?
null
:
name
);
map
.
put
(
"proLabelId"
,
proLabelId
);
map
.
put
(
"depLabelId"
,
depLabelId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
775e5765
...
...
@@ -850,6 +850,17 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private
void
fillGroupActivityHead
(
List
<
GroupActivity4AppletDTO
>
groupActivity4AppletList
)
{
if
(!
ListUtils
.
isEmpty
(
groupActivity4AppletList
))
{
for
(
GroupActivity4AppletDTO
groupActivity4AppletDTO
:
groupActivity4AppletList
)
{
//第三方群获取头像 end add by Pansy
Integer
integer
=
1
;
if
(
null
!=
groupActivity4AppletDTO
.
getGroupType
()
&&
groupActivity4AppletDTO
.
getGroupType
().
intValue
()
==
integer
.
intValue
()){
//头像列表从缓存里取
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
3
,
3
l
);
groupActivity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
}
//第三方群获取头像 end
String
filterStr
=
StringUtilParent
.
replaceHtml
(
groupActivity4AppletDTO
.
getDesc
());
String
subStr
=
filterStr
.
length
()
>
60
?
filterStr
.
substring
(
0
,
60
)
+
"..."
:
filterStr
;
groupActivity4AppletDTO
.
setCutDesc
(
subStr
);
...
...
@@ -1104,6 +1115,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
if
(
item
.
getServeId
()
!=
null
&&
RightsServeTypeEnum
.
GROUP
.
name
().
equals
(
item
.
getServeType
())
&&
!
groupIds
.
contains
(
item
.
getServeId
()))
{
// if (item.getGroup){
//
// }
groupIds
.
add
(
item
.
getServeId
());
}
if
(
item
.
getServeId
()
!=
null
&&
RightsServeTypeEnum
.
NEWS
.
name
().
equals
(
item
.
getServeType
())
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/biz/impl/PcloudGroupActivityBizImpl.java
View file @
775e5765
...
...
@@ -9,6 +9,7 @@ import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import
com.pcloud.book.applet.dto.AppletGroupStatementDTO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.dao.BookDao
;
import
com.pcloud.book.book.dao.BookLabelDao
;
import
com.pcloud.book.book.dto.BookDto
;
import
com.pcloud.book.book.entity.BookLabel
;
...
...
@@ -37,10 +38,13 @@ import com.pcloud.book.skill.dto.UpdateActivityShowStateDTO;
import
com.pcloud.book.skill.entity.PcloudGroupActivity
;
import
com.pcloud.book.skill.entity.PcloudSkill
;
import
com.pcloud.book.skill.enums.SkillTypeEnum
;
import
com.pcloud.book.skill.facade.request.GroupActivityClassifyVO
;
import
com.pcloud.book.skill.facade.request.GroupActivityShowStateVO
;
import
com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO
;
import
com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO
;
import
com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
...
...
@@ -55,6 +59,7 @@ import com.sdk.wxgroup.SendPicMessageVO;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -73,7 +78,6 @@ import java.util.UUID;
@Service
public
class
PcloudGroupActivityBizImpl
implements
PcloudGroupActivityBiz
{
@Resource
private
PcloudSkillDao
pcloudSkillDao
;
@Resource
...
...
@@ -115,6 +119,12 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@ParamLog
(
"保存共读活动"
)
@Override
public
void
saveGroupActivity
(
SaveGroupActivityRequestVO
vo
)
{
//校验编号是否重复
Integer
count
=
pcloudGroupActivityDao
.
getCountByNumber
(
vo
.
getNumber
());
if
(
count
>
0
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误,编号已存在!"
);
}
vo
.
checkParam
();
PcloudGroupActivity
entity
=
vo
.
getEntity
();
Date
now
=
new
Date
();
...
...
@@ -131,10 +141,17 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Override
public
void
updateGroupActivity
(
UpdateGroupActivityRequestVO
vo
)
{
vo
.
checkParam
();
PcloudGroupActivity
activity
=
pcloudGroupActivityDao
.
getById
(
vo
.
getId
());
if
(
null
==
activity
)
{
throw
new
BookBizException
(
BookBizException
.
ID_NOT_EXIST
,
"共读活动不存在"
);
}
//校验编号是否重复
Integer
count
=
pcloudGroupActivityDao
.
getCountByNumber
(
vo
.
getNumber
());
if
(
count
>
0
&&
(!
vo
.
getNumber
().
equals
(
activity
.
getNumber
()))){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误,编号已存在!"
);
}
PcloudGroupActivity
entity
=
vo
.
getEntity
();
Date
now
=
new
Date
();
entity
.
setUpdateUser
(
vo
.
getUserId
());
...
...
@@ -206,6 +223,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
Long
secondClassify
,
Long
gradeLabelId
,
Long
subjectLabelId
,
Integer
numPerPage
,
Integer
currentPage
)
{
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
BaseTempletClassify
baseTempletClassify
=
new
BaseTempletClassify
();
baseTempletClassify
.
setFirstClassify
(
firstClassify
);
...
...
@@ -348,11 +366,15 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Override
public
Map
<
Long
,
GroupActivity4AppletDTO
>
getByIds
(
List
<
Long
>
ids
)
{
if
(
ListUtils
.
isEmpty
(
ids
))
{
if
(
ListUtils
.
isEmpty
(
ids
))
{
return
new
HashMap
<>();
}
List
<
Long
>
activityGroupIds
=
new
ArrayList
<>();
List
<
Long
>
adviserGroupIds
=
rightsSettingItemDetailDao
.
getAdviserGroupIds
(
ids
);
List
<
Long
>
activityGroupIds
=
rightsSettingItemDetailDao
.
getActivityGroupIds
(
ids
);
if
(!
ListUtils
.
isEmpty
(
adviserGroupIds
))
{
ids
.
removeAll
(
adviserGroupIds
);
}
activityGroupIds
=
ids
;
// 合并
return
getGroupMap
(
adviserGroupIds
,
activityGroupIds
);
}
...
...
@@ -420,12 +442,25 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
// 通过 classifyId 获取群二维码链接
String
groupQrCode
=
groupQrcodeBiz
.
getChangeGroupQrCode
(
activity4AppletDTO
.
getClassifyId
());
// 通过群二维码链接反查群ID
ClassifyQrcodeVO
groupQrcodeInfo
=
groupQrcodeBiz
.
getGroupQrcodeInfo
(
groupQrCode
,
activity4AppletDTO
.
getClassifyId
());
if
(
activity4AppletDTO
.
getClassifyId
()
!=
null
&&
activity4AppletDTO
.
getClassifyId
()
!=
0
){
ClassifyQrcodeVO
groupQrcodeInfo
=
groupQrcodeBiz
.
getGroupQrcodeInfo
(
groupQrCode
,
activity4AppletDTO
.
getClassifyId
());
//头像、对话
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
groupQrcodeInfo
.
getUserNumber
(),
groupQrcodeInfo
.
getId
());
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
groupQrcodeInfo
.
getUserNumber
(),
groupQrcodeInfo
.
getId
());
activity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
List
<
AppletGroupStatementDTO
>
statementDTOS
=
appletGroupSearchRecordBiz
.
getStatementList
(
groupQrcodeInfo
.
getUserNumber
(),
headUrlList
,
groupQrcodeInfo
.
getId
());
List
<
AppletGroupStatementDTO
>
statementDTOS
=
appletGroupSearchRecordBiz
.
getStatementList
(
groupQrcodeInfo
.
getUserNumber
(),
headUrlList
,
groupQrcodeInfo
.
getId
());
activity4AppletDTO
.
setStatementDTOList
(
statementDTOS
);
}
else
{
//头像、对话
List
<
String
>
headUrlList
=
appletGroupSearchRecordBiz
.
getHeadUrlList
(
3
,
3L
);
activity4AppletDTO
.
setHeadUrlList
(
headUrlList
);
}
}
return
list
;
}
...
...
@@ -466,9 +501,13 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
if
(
ListUtils
.
isEmpty
(
ids
)){
return
new
HashMap
<>();
}
List
<
Long
>
adviserIds
=
rightsNowItemDao
.
getAdviserGroupIds
(
ids
);
List
<
Long
>
activityGroupIds
=
rightsNowItemDao
.
getActivityGroupIds
(
ids
);
return
getGroupMap
(
adviserIds
,
activityGroupIds
);
List
<
Long
>
adviserGroupIds
=
rightsNowItemDao
.
getAdviserGroupIds
(
ids
);
List
<
Long
>
activityGroupIds
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
adviserGroupIds
))
{
ids
.
removeAll
(
adviserGroupIds
);
}
activityGroupIds
=
ids
;
return
getGroupMap
(
adviserGroupIds
,
activityGroupIds
);
}
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/dao/PcloudGroupActivityDao.java
View file @
775e5765
...
...
@@ -3,12 +3,23 @@ package com.pcloud.book.skill.dao;
import
com.pcloud.book.rightsSetting.entity.BaseTempletClassify
;
import
com.pcloud.book.skill.dto.GroupActivity4AppletDTO
;
import
com.pcloud.book.skill.entity.PcloudGroupActivity
;
import
com.pcloud.book.skill.facade.request.GroupActivityClassifyVO
;
import
com.pcloud.book.skill.facade.request.GroupActivityShowStateVO
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
import
java.util.Map
;
public
interface
PcloudGroupActivityDao
extends
BaseDao
<
PcloudGroupActivity
>
{
Integer
getCountByNumber
(
String
number
);
void
batchUpdateShowState
(
GroupActivityClassifyVO
groupActivityClassifyVO
);
void
batchUpdateShowState
(
GroupActivityShowStateVO
appletNewsShowStateVO
);
void
deleteByIds
(
List
<
Long
>
ids
);
Map
<
Long
,
PcloudGroupActivity
>
mayByIds
(
List
<
Long
>
ids
);
void
updateByPrimaryKeySelective
(
PcloudGroupActivity
entity
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/dao/impl/PcloudGroupActivityDaoImpl.java
View file @
775e5765
...
...
@@ -4,6 +4,8 @@ import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import
com.pcloud.book.skill.dao.PcloudGroupActivityDao
;
import
com.pcloud.book.skill.dto.GroupActivity4AppletDTO
;
import
com.pcloud.book.skill.entity.PcloudGroupActivity
;
import
com.pcloud.book.skill.facade.request.GroupActivityClassifyVO
;
import
com.pcloud.book.skill.facade.request.GroupActivityShowStateVO
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -16,6 +18,35 @@ import java.util.Map;
public
class
PcloudGroupActivityDaoImpl
extends
BaseDaoImpl
<
PcloudGroupActivity
>
implements
PcloudGroupActivityDao
{
@Override
public
Integer
getCountByNumber
(
String
number
){
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getCountByNumber"
),
number
);
}
@Override
public
void
batchUpdateShowState
(
GroupActivityClassifyVO
groupActivityClassifyVO
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"ids"
,
groupActivityClassifyVO
.
getIds
());
map
.
put
(
"firstClassify"
,
groupActivityClassifyVO
.
getFirstClassify
());
map
.
put
(
"secondClassify"
,
groupActivityClassifyVO
.
getSecondClassify
());
map
.
put
(
"gradeLabelId"
,
groupActivityClassifyVO
.
getGradeLabelId
());
map
.
put
(
"subjectLabelId"
,
groupActivityClassifyVO
.
getSubjectLabelId
());
getSessionTemplate
().
update
(
getStatement
(
"batchUpdateClassify"
),
map
);
}
@Override
public
void
batchUpdateShowState
(
GroupActivityShowStateVO
groupActivityShowStateVO
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"ids"
,
groupActivityShowStateVO
.
getIds
());
map
.
put
(
"showState"
,
groupActivityShowStateVO
.
getShowState
());
getSessionTemplate
().
update
(
getStatement
(
"batchUpdateShowState"
),
map
);
}
@Override
public
void
deleteByIds
(
List
<
Long
>
ids
){
getSessionTemplate
().
update
(
getStatement
(
"deleteByIds"
),
ids
);
}
@Override
public
Map
<
Long
,
PcloudGroupActivity
>
mayByIds
(
List
<
Long
>
ids
)
{
return
super
.
getSqlSession
().
selectMap
(
getStatement
(
"mayByIds"
),
ids
,
"id"
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/dto/GroupActivity4AppletDTO.java
View file @
775e5765
...
...
@@ -19,6 +19,9 @@ import lombok.Data;
@JsonInclude
(
Include
.
NON_NULL
)
public
class
GroupActivity4AppletDTO
implements
Serializable
{
@ApiModelProperty
(
"群类型 1:第三方群"
)
private
Integer
groupType
;
private
Long
id
;
private
Boolean
openStatus
;
...
...
@@ -77,6 +80,6 @@ public class GroupActivity4AppletDTO implements Serializable {
@ApiModelProperty
(
"关联社群书ID"
)
private
Long
relatedBookGroupId
;
@ApiModelProperty
(
"群
类型
"
)
private
Integer
groupType
;
@ApiModelProperty
(
"群
链接
"
)
private
String
groupLink
;
}
pcloud-service-book/src/main/java/com/pcloud/book/skill/entity/PcloudGroupActivity.java
View file @
775e5765
...
...
@@ -4,6 +4,13 @@ import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
public
class
PcloudGroupActivity
extends
BaseTempletClassify
{
private
static
final
long
serialVersionUID
=
-
2579070770051745966L
;
private
String
number
;
private
String
groupExtLink
;
private
Integer
groupType
;
private
String
name
;
private
String
desc
;
...
...
@@ -133,4 +140,28 @@ public class PcloudGroupActivity extends BaseTempletClassify {
public
void
setIsDelete
(
Integer
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
String
getNumber
()
{
return
number
;
}
public
void
setNumber
(
String
number
)
{
this
.
number
=
number
;
}
public
String
getGroupExtLink
()
{
return
groupExtLink
;
}
public
void
setGroupExtLink
(
String
groupExtLink
)
{
this
.
groupExtLink
=
groupExtLink
;
}
public
Integer
getGroupType
()
{
return
groupType
;
}
public
void
setGroupType
(
Integer
groupType
)
{
this
.
groupType
=
groupType
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/skill/facade/PcloudGroupActivityFacade.java
View file @
775e5765
...
...
@@ -2,6 +2,8 @@ package com.pcloud.book.skill.facade;
import
com.pcloud.book.skill.biz.PcloudGroupActivityBiz
;
import
com.pcloud.book.skill.dto.UpdateActivityShowStateDTO
;
import
com.pcloud.book.skill.facade.request.GroupActivityClassifyVO
;
import
com.pcloud.book.skill.facade.request.GroupActivityShowStateVO
;
import
com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO
;
import
com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO
;
import
com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO
;
...
...
@@ -9,6 +11,7 @@ import com.pcloud.common.dto.ResponseDto;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
@RestController
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/facade/request/GroupActivityClassifyVO.java
0 → 100644
View file @
775e5765
package
com
.
pcloud
.
book
.
skill
.
facade
.
request
;
import
com.pcloud.book.rightsSetting.entity.BaseTempletClassify
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @ClassName com.pcloud.book.applet.vo.AppletNewsShowStateVO
* @Author ZhengYongQiang
* @Description 批量上下架
* @Date 2020/4/27 20:27
* @Version 1.0
**/
@Data
public
class
GroupActivityClassifyVO
extends
BaseTempletClassify
{
@ApiModelProperty
(
"修改的数据id"
)
private
List
<
Long
>
ids
;
}
pcloud-service-book/src/main/java/com/pcloud/book/skill/facade/request/GroupActivityShowStateVO.java
0 → 100644
View file @
775e5765
package
com
.
pcloud
.
book
.
skill
.
facade
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @ClassName com.pcloud.book.applet.vo.AppletNewsShowStateVO
* @Author ZhengYongQiang
* @Description 批量上下架
* @Date 2020/4/27 20:27
* @Version 1.0
**/
@Data
public
class
GroupActivityShowStateVO
implements
Serializable
{
@ApiModelProperty
(
"修改的数据id"
)
private
List
<
Long
>
ids
;
@ApiModelProperty
(
"是否展示"
)
private
Boolean
showState
;
}
pcloud-service-book/src/main/java/com/pcloud/book/skill/facade/request/SaveGroupActivityRequestVO.java
View file @
775e5765
...
...
@@ -22,6 +22,15 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify {
private
static
final
long
serialVersionUID
=
-
5370056714391879364L
;
@ApiModelProperty
(
"编号"
)
private
String
number
;
@ApiModelProperty
(
"第三方入群链接"
)
private
String
groupExtLink
;
@ApiModelProperty
(
"群类型 0官方群 1第三方入群指引"
)
private
Integer
groupType
;
@ApiModelProperty
(
"共度名称"
)
private
String
name
;
...
...
@@ -49,11 +58,18 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify {
public
void
checkParam
()
{
if
(
StringUtil
.
isBlank
(
this
.
getName
())
||
null
==
this
.
getProLabelId
()
||
null
==
this
.
getDepLabelId
()
||
null
==
this
.
getJoinType
()
||
null
==
this
.
getPurLabelId
()
||
null
==
this
.
getPurLabelId
()
||
null
==
this
.
getGroupType
()
||
null
==
this
.
getNumber
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请求参数缺失"
);
}
if
(
"0"
.
equals
(
this
.
getGroupType
())){
if
(
null
==
this
.
getJoinType
()
||
null
==
this
.
getBookGroupClassifyId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请求参数缺失"
);
}
}
}
/**
* 转换实体映射
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/facade/request/UpdateGroupActivityRequestVO.java
View file @
775e5765
...
...
@@ -22,6 +22,15 @@ public class UpdateGroupActivityRequestVO extends BaseTempletClassify {
private
static
final
long
serialVersionUID
=
3642060073527485455L
;
@ApiModelProperty
(
"编号"
)
private
String
number
;
@ApiModelProperty
(
"第三方入群链接"
)
private
String
groupExtLink
;
@ApiModelProperty
(
"群类型 0官方群 1第三方入群指引"
)
private
Integer
groupType
;
@ApiModelProperty
(
"主键"
)
private
Long
id
;
...
...
@@ -55,8 +64,10 @@ public class UpdateGroupActivityRequestVO extends BaseTempletClassify {
public
void
checkParam
()
{
if
(
null
==
id
||
StringUtil
.
isBlank
(
this
.
getName
())
||
null
==
this
.
getProLabelId
()
||
null
==
this
.
getDepLabelId
()
||
null
==
this
.
getJoinType
()
||
null
==
this
.
getPurLabelId
()
||
null
==
this
.
getBookGroupClassifyId
())
{
||
null
==
this
.
getPurLabelId
()
||
null
==
this
.
getBookGroupClassifyId
()
||
null
==
this
.
getJoinType
()
||
null
==
this
.
getNumber
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请求参数缺失"
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/skill/facade/response/QueryGroupActivityResponseVO.java
View file @
775e5765
...
...
@@ -6,6 +6,14 @@ import lombok.Data;
@Data
public
class
QueryGroupActivityResponseVO
{
@ApiModelProperty
(
"编号"
)
private
String
number
;
@ApiModelProperty
(
"群链接"
)
private
String
groupExtLink
;
@ApiModelProperty
(
"群类型"
)
private
Integer
groupType
;
@ApiModelProperty
(
"主键"
)
private
Integer
id
;
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletGroupManage.Mapper.xml
View file @
775e5765
...
...
@@ -62,13 +62,17 @@
b.book_group_classify_id AS classifyId,
c.book_group_id bookGroupId,
c.price,
g.related_book_group_id relatedBookGroupId
g.related_book_group_id relatedBookGroupId,
b.group_type as groupType,
b.group_extLink as groupLink
FROM
applet_group_manage a
LEFT JOIN pcloud_group_activity b ON a.group_activity_id = b.id AND b.is_delete = 0
LEFT JOIN book_group_classify c ON b.book_group_classify_id = c.id AND c.is_delete = 0
left JOIN pcloud_group_activity b ON a.group_activity_id = b.id
left JOIN book_group_classify c ON b.book_group_classify_id = c.id
LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE a.enable=1
AND b.is_delete = 0
AND (c.is_delete = 0 or c.is_delete is NULL)
<if
test=
"recommend!=null"
>
AND a.recommend=#{recommend}
</if>
...
...
pcloud-service-book/src/main/resources/mapper/skill/PcloudGroupActivityDao.xml
View file @
775e5765
...
...
@@ -3,6 +3,9 @@
<mapper
namespace=
"com.pcloud.book.skill.dao.impl.PcloudGroupActivityDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.skill.entity.PcloudGroupActivity"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"number"
property=
"number"
jdbcType=
"VARCHAR"
/>
<result
column=
"group_extLink"
property=
"groupExtLink"
jdbcType=
"VARCHAR"
/>
<result
column=
"group_type"
property=
"groupType"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"description"
property=
"desc"
jdbcType=
"VARCHAR"
/>
<result
column=
"join_type"
property=
"joinType"
jdbcType=
"INTEGER"
/>
...
...
@@ -29,6 +32,46 @@
first_classify, second_classify, grade_label_id, subject_label_id
</sql>
<update
id=
"batchUpdateClassify"
parameterType=
"map"
>
UPDATE pcloud_group_activity
SET
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
update_time=NOW()
WHERE id IN
<foreach
collection=
"ids"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
</update>
<select
id=
"getCountByNumber"
parameterType=
"String"
resultType=
"integer"
>
select count(1)
from pcloud_group_activity
where number=#{number}
</select>
<update
id=
"batchUpdateShowState"
parameterType=
"map"
>
UPDATE pcloud_group_activity
SET
is_show = #{showState},
update_time=NOW()
WHERE id IN
<foreach
collection=
"ids"
item=
"item"
separator=
","
open=
"("
close=
")"
>
${item}
</foreach>
</update>
<update
id=
"deleteByIds"
parameterType=
"long"
>
update pcloud_group_activity set is_delete = 1 where id in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</update>
<update
id=
"deleteById"
parameterType=
"long"
>
update pcloud_group_activity set is_delete = 1 where id = #{id}
</update>
...
...
@@ -67,6 +110,9 @@
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
a.number,
a.group_extLink as groupExtLink,
a.group_type as groupType,
is_show AS isShow
FROM
pcloud_group_activity a left join book_group_classify b on a.book_group_classify_id = b.id
...
...
@@ -102,6 +148,54 @@
order by a.id desc
</select>
<select
id=
"listGroupActivity"
resultType=
"com.pcloud.book.skill.facade.response.ListGroupActivityResponseVO"
parameterType=
"map"
>
SELECT
a.id,
a.name,
a.description,
a.number,
a.group_type groupType,
a.group_extLink groupExtLink,
b.id classifyId,
b.classify classifyName,
b.classify_introduce AS classifyIntroduce,
b.book_group_id bookGroupId,
b.price,
count(c.classify_id) AS groupCount
FROM
pcloud_group_activity a
LEFT JOIN book_group_classify b ON a.book_group_classify_id = b.id AND b.is_delete = 0
LEFT JOIN book_group_qrcode c ON b.id = c.classify_id AND c.is_delete = 0
LEFT JOIN book_group d ON b.book_group_id = d.id
<where>
<if
test=
"name!=null or bookIds != null and bookIds.size()>0"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"OR"
>
<if
test=
"name!=null"
>
a.name LIKE CONCAT("%",#{name},"%")
</if>
<if
test=
"bookIds.size()>0"
>
OR b.book_id IN
<foreach
collection=
"bookIds"
open=
"("
separator=
","
close=
")"
index=
"index"
item=
"item"
>
${item}
</foreach>
</if>
</trim>
</if>
<if
test=
"proLabelId!=null"
>
AND c.pro_label_id = #{proLabelId}
</if>
<if
test=
"depLabelId!=null"
>
AND c.dep_label_id = #{depLabelId}
</if>
<if
test=
"joinType != null"
>
AND a.join_type = #{joinType}
</if>
AND a.is_delete = 0
</where>
GROUP BY a.id
ORDER BY a.create_time DESC
</select>
<select
id=
"getTishBookSchoolList"
resultType=
"com.pcloud.book.skill.dto.GroupActivity4AppletDTO"
parameterType=
"map"
>
SELECT
a.id,
...
...
@@ -120,7 +214,9 @@
c.id AS classifyId,
c.book_group_id AS bookGroupId,
d.related_book_group_id AS relatedBookGroupId,
c.price AS price
c.price AS price,
a.group_type as grouType,
group_extLink as groupLink
FROM
pcloud_group_activity a
LEFT JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
...
...
@@ -145,6 +241,8 @@
LIMIT #{limit}
</select>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"long"
>
SELECT
a.id,
...
...
@@ -165,7 +263,10 @@
a.second_classify,
a.grade_label_id,
a.subject_label_id,
a.is_show
a.is_show,
a.number,
a.group_extLink,
a.group_type
FROM pcloud_group_activity a LEFT JOIN book_group_classify b ON a.book_group_classify_id = b.id
WHERE a.id = #{id,jdbcType=INTEGER}
</select>
...
...
@@ -216,14 +317,52 @@
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
c.price AS price,
d.related_book_group_id relatedBookGroupId
d.related_book_group_id relatedBookGroupId,
a.group_type as groupType,
a.group_extLink groupLink
FROM
pcloud_group_activity a
INNER
JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER
JOIN book_group_qrcode b on b.classify_id = c.id AND b.is_delete = 0
INNER
JOIN book_group d ON c.book_group_id = d.id
left
JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
left
JOIN book_group_qrcode b on b.classify_id = c.id AND b.is_delete = 0
left
JOIN book_group d ON c.book_group_id = d.id
WHERE
a.is_delete = 0
<if
test=
"isShow != null"
>
AND a.is_show = #{isShow}
</if>
AND a.id IN
<foreach
collection=
"list"
item=
"item"
open=
"("
close=
")"
separator=
","
>
${item}
</foreach>
GROUP BY a.id
ORDER BY a.id DESC
</select>
<!--根据id获取第三方群信息 -->
<select
id=
"getThridPartByIds"
resultType=
"com.pcloud.book.skill.dto.GroupActivity4AppletDTO"
>
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.`name` AS groupName,
null userNumber,
null classifyId,
null bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
null AS price,
null relatedBookGroupId,
a.group_type as groupType,
a.group_extLink as groupLink
FROM
pcloud_group_activity a
WHERE
a.is_delete = 0 AND a.is_show = 1
and group_type ='1'
AND a.id IN
<foreach
collection=
"list"
item=
"item"
open=
"("
close=
")"
separator=
","
>
${item}
...
...
@@ -276,13 +415,13 @@
description, join_type, group_pic, pro_label_id, dep_label_id,
pur_label_id, book_group_classify_id, create_time,
create_user, update_time, update_user,
is_delete, first_classify, second_classify, grade_label_id, subject_label_id)
is_delete, first_classify, second_classify, grade_label_id, subject_label_id
,number,group_type,group_extLink
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{desc,jdbcType=VARCHAR}, #{joinType,jdbcType=INTEGER}, #{groupPic,jdbcType=VARCHAR}, #{proLabelId,jdbcType=INTEGER}, #{depLabelId,jdbcType=INTEGER},
#{purLabelId,jdbcType=INTEGER}, #{bookGroupClassifyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{createUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
#{isDelete,jdbcType=BIT}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT})
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}
, #{number,jdbcType=BIGINT}, #{groupType,jdbcType=BIGINT}, #{groupExtLink,jdbcType=VARCHAR}
)
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.skill.entity.PcloudGroupActivity"
>
update pcloud_group_activity
...
...
@@ -329,6 +468,15 @@
<if
test=
"isShow != null"
>
is_show = #{isShow,jdbcType=BIT},
</if>
<if
test=
"number !=null"
>
number = #{number,jdbcType=VARCHAR},
</if>
<if
test=
"groupExtLink !=null"
>
group_extLink = #{groupExtLink,jdbcType=VARCHAR},
</if>
<if
test=
"groupType !=null"
>
group_type = #{groupType,jdbcType=BIT},
</if>
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
...
...
@@ -385,11 +533,13 @@
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
c.price,
g.related_book_group_id relatedBookGroupId
g.related_book_group_id relatedBookGroupId,
a.group_type as groupType,
a.group_extLink groupLink
FROM
pcloud_group_activity a
INNER
JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER
JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
LEFT
JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
LEFT
JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE
a.is_delete = 0 AND a.is_show = 1
...
...
@@ -409,4 +559,34 @@
ORDER BY a.id DESC
</select>
<select
id=
"getLocalGroup"
parameterType=
"map"
resultType=
"com.pcloud.book.applet.dto.AppletGroupManageDTO"
>
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.group_pic AS groupPic,
c.classify AS classifyName,
b.user_number userNumber,
b.classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
c.price,
g.related_book_group_id relatedBookGroupId
FROM
pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE
a.is_delete = 0 AND a.is_show = 1
and c.city_code = #{cityCode}
GROUP BY a.id
ORDER BY a.id DESC
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/test/test/BookKeywordWarehouseBizTest.java
View file @
775e5765
package
test
;
import
com.pcloud.book.BookApplication
;
import
com.pcloud.book.adnews.biz.AdNewsBiz
;
import
com.pcloud.book.book.biz.BookKeywordWarehouseBiz
;
import
com.pcloud.book.book.constant.BookConstant
;
import
com.pcloud.book.book.vo.BookKeywordDetailVO
;
...
...
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