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
f0f0b645
Commit
f0f0b645
authored
Jun 17, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C1000805_微信群群发支持计划式多次发送
parent
d536c7c9
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
1854 additions
and
48 deletions
+1854
-48
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+15
-0
BookGroupClassifyBiz.java
.../java/com/pcloud/book/group/biz/BookGroupClassifyBiz.java
+2
-2
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+62
-9
GroupQrcodeBizImpl.java
...va/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
+17
-0
GroupQrcodeDao.java
...c/main/java/com/pcloud/book/group/dao/GroupQrcodeDao.java
+8
-0
GroupQrcodeDaoImpl.java
...va/com/pcloud/book/group/dao/impl/GroupQrcodeDaoImpl.java
+6
-0
BookGroupClassifyFacade.java
...com/pcloud/book/group/facade/BookGroupClassifyFacade.java
+4
-7
BookGroupClassifyFacadeImpl.java
...d/book/group/facade/impl/BookGroupClassifyFacadeImpl.java
+3
-3
BookGroupClassifyVO.java
...in/java/com/pcloud/book/group/vo/BookGroupClassifyVO.java
+188
-0
ListGroupClassifyParam.java
...java/com/pcloud/book/group/vo/ListGroupClassifyParam.java
+92
-0
PushBiz.java
...-book/src/main/java/com/pcloud/book/push/biz/PushBiz.java
+30
-3
PushBizImpl.java
.../main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
+444
-3
PushCheck.java
...k/src/main/java/com/pcloud/book/push/check/PushCheck.java
+7
-2
PushDao.java
...-book/src/main/java/com/pcloud/book/push/dao/PushDao.java
+23
-0
PushGroupDao.java
.../src/main/java/com/pcloud/book/push/dao/PushGroupDao.java
+22
-0
PushPlanDao.java
...k/src/main/java/com/pcloud/book/push/dao/PushPlanDao.java
+7
-0
PushDaoImpl.java
.../main/java/com/pcloud/book/push/dao/impl/PushDaoImpl.java
+19
-0
PushGroupDaoImpl.java
.../java/com/pcloud/book/push/dao/impl/PushGroupDaoImpl.java
+18
-0
PushPlanDaoImpl.java
...n/java/com/pcloud/book/push/dao/impl/PushPlanDaoImpl.java
+15
-0
PlanClassifyDTO.java
...c/main/java/com/pcloud/book/push/dto/PlanClassifyDTO.java
+106
-0
PushDTO.java
...-book/src/main/java/com/pcloud/book/push/dto/PushDTO.java
+1
-1
PushPlanDTO.java
...k/src/main/java/com/pcloud/book/push/dto/PushPlanDTO.java
+131
-0
PushPlanItemDTO.java
...c/main/java/com/pcloud/book/push/dto/PushPlanItemDTO.java
+112
-0
Push.java
...-book/src/main/java/com/pcloud/book/push/entity/Push.java
+53
-1
PushPlan.java
...k/src/main/java/com/pcloud/book/push/entity/PushPlan.java
+58
-0
PushTypeEnum.java
...rc/main/java/com/pcloud/book/push/enums/PushTypeEnum.java
+5
-1
PushFacade.java
...src/main/java/com/pcloud/book/push/facade/PushFacade.java
+48
-0
PushFacadeImpl.java
...java/com/pcloud/book/push/facade/impl/PushFacadeImpl.java
+104
-0
BookGroupClassify.Mapper.xml
.../main/resources/mapper/group/BookGroupClassify.Mapper.xml
+22
-15
GroupQrcode.Mapper.xml
...ok/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
+6
-0
Keyword.Mapper.xml
...ook/src/main/resources/mapper/keywords/Keyword.Mapper.xml
+20
-0
PushGroupMapper.xml
...e-book/src/main/resources/mapper/push/PushGroupMapper.xml
+38
-0
PushMapper.xml
...ervice-book/src/main/resources/mapper/push/PushMapper.xml
+61
-1
PushPlanMapper.xml
...ce-book/src/main/resources/mapper/push/PushPlanMapper.xml
+107
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
f0f0b645
...
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -157,4 +158,18 @@ public class WechatGroupConsr {
...
@@ -157,4 +158,18 @@ public class WechatGroupConsr {
LOGGER
.
info
(
"【根据群号获取群主微信号,<END>--masterId="
+
masterId
);
LOGGER
.
info
(
"【根据群号获取群主微信号,<END>--masterId="
+
masterId
);
}
}
}
}
@ParamLog
(
value
=
"最近7天活跃人数"
)
public
Map
<
Long
,
Integer
>
get7DayActiveUserCountByClassify
(
List
<
Long
>
classifyIds
)
throws
BizException
{
Map
<
Long
,
Integer
>
map
=
new
HashMap
<>();
try
{
map
=
ResponseHandleUtil
.
parseMapResponse
(
messageService
.
get7DayActiveUserCountByClassify
(
classifyIds
),
Long
.
class
,
Integer
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取最近7天活跃人数失败.[get7DayActiveUserCountByClassify]:"
+
e
.
getMessage
(),
e
);
}
if
(
map
==
null
)
{
return
new
HashMap
<>();
}
return
map
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupClassifyBiz.java
View file @
f0f0b645
...
@@ -119,10 +119,10 @@ public interface BookGroupClassifyBiz {
...
@@ -119,10 +119,10 @@ public interface BookGroupClassifyBiz {
/**
/**
* @Author:lili
* @Author:lili
* @Desr:获取编辑所有的
群二维码
* @Desr:获取编辑所有的
分类
* @Date:2019/4/30 15:33
* @Date:2019/4/30 15:33
*/
*/
PageBeanNew
<
GroupQrcodeVO
>
listGroupQrcodeByAdviser
(
ListGroupQrParam
listGroupQr
Param
,
Long
adviserId
);
PageBeanNew
<
BookGroupClassifyVO
>
listGroupClassifyByAdviser
(
ListGroupClassifyParam
listGroupClassify
Param
,
Long
adviserId
);
/**
/**
* @Author:lili
* @Author:lili
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
f0f0b645
...
@@ -38,8 +38,10 @@ import com.pcloud.common.page.PageBeanNew;
...
@@ -38,8 +38,10 @@ import com.pcloud.common.page.PageBeanNew;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.facade.tradecenter.dto.QrGroupBuyDetailDto
;
import
com.pcloud.facade.tradecenter.dto.QrGroupBuyDetailDto
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
com.pcloud.readercenter.wechat.dto.WechatUserRobotDto
;
import
com.pcloud.readercenter.wechat.dto.WechatUserRobotDto
;
import
com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO
;
import
com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO
;
import
com.pcloud.resourcecenter.product.entity.Product
;
import
com.pcloud.resourcecenter.product.entity.Product
;
...
@@ -106,6 +108,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
...
@@ -106,6 +108,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private
TradeConsr
tradeConsr
;
private
TradeConsr
tradeConsr
;
@Autowired
@Autowired
private
GroupAnnouncementBiz
groupAnnouncementBiz
;
private
GroupAnnouncementBiz
groupAnnouncementBiz
;
@Autowired
private
LabelService
labelService
;
@Override
@Override
@ParamLog
(
"新增分类"
)
@ParamLog
(
"新增分类"
)
...
@@ -464,18 +468,67 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
...
@@ -464,18 +468,67 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
}
}
@Override
@Override
@ParamLog
(
"获取编辑所有的
群二维码
"
)
@ParamLog
(
"获取编辑所有的
分类
"
)
public
PageBeanNew
<
GroupQrcodeVO
>
listGroupQrcodeByAdviser
(
ListGroupQrParam
listGroupQr
Param
,
Long
adviserId
)
{
public
PageBeanNew
<
BookGroupClassifyVO
>
listGroupClassifyByAdviser
(
ListGroupClassifyParam
listGroupClassify
Param
,
Long
adviserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
if
(!
StringUtil
.
isEmpty
(
listGroupQrParam
.
getName
()))
{
if
(!
StringUtil
.
isEmpty
(
listGroupClassifyParam
.
getName
()))
{
paramMap
.
put
(
"name"
,
listGroupQrParam
.
getName
());
paramMap
.
put
(
"name"
,
listGroupClassifyParam
.
getName
());
}
}
paramMap
.
put
(
"bookIds"
,
listGroupQrParam
.
getBookIds
());
paramMap
.
put
(
"bookIds"
,
listGroupClassifyParam
.
getBookIds
());
PageParam
pageParam
=
new
PageParam
(
listGroupQrParam
.
getCurrentPage
(),
listGroupQrParam
.
getNumPerPage
());
paramMap
.
put
(
"proLabelId"
,
listGroupClassifyParam
.
getProLabelId
());
PageBeanNew
<
GroupQrcodeVO
>
pageBeanNew
=
bookGroupClassifyDao
.
listPageNew
(
pageParam
,
paramMap
,
"listGroupQrcodeByAdviser"
);
paramMap
.
put
(
"depLabelId"
,
listGroupClassifyParam
.
getDepLabelId
());
paramMap
.
put
(
"purLabelId"
,
listGroupClassifyParam
.
getPurLabelId
());
PageParam
pageParam
=
new
PageParam
(
listGroupClassifyParam
.
getCurrentPage
(),
listGroupClassifyParam
.
getNumPerPage
());
PageBeanNew
<
BookGroupClassifyVO
>
pageBeanNew
=
bookGroupClassifyDao
.
listPageNew
(
pageParam
,
paramMap
,
"listGroupClassifyByAdviser"
);
if
(
pageBeanNew
==
null
)
{
if
(
pageBeanNew
==
null
)
{
return
new
PageBeanNew
<>(
listGroupQrParam
.
getCurrentPage
(),
listGroupQrParam
.
getNumPerPage
(),
new
ArrayList
<>());
return
new
PageBeanNew
<>(
listGroupClassifyParam
.
getCurrentPage
(),
listGroupClassifyParam
.
getNumPerPage
(),
new
ArrayList
<>());
}
//遍历填充标签
List
<
BookGroupClassifyVO
>
bookGroupClassifyVOS
=
pageBeanNew
.
getRecordList
();
if
(!
ListUtils
.
isEmpty
(
bookGroupClassifyVOS
))
{
List
<
Long
>
labelIds
=
new
ArrayList
<>();
List
<
Long
>
classifyIds
=
new
ArrayList
<>();
for
(
BookGroupClassifyVO
bookGroupClassifyVO
:
bookGroupClassifyVOS
)
{
classifyIds
.
add
(
bookGroupClassifyVO
.
getClassifyId
());
if
(
bookGroupClassifyVO
.
getProLabelId
()
!=
null
)
{
labelIds
.
add
(
bookGroupClassifyVO
.
getProLabelId
());
}
if
(
bookGroupClassifyVO
.
getPurLabelId
()
!=
null
)
{
labelIds
.
add
(
bookGroupClassifyVO
.
getPurLabelId
());
}
if
(
bookGroupClassifyVO
.
getDepLabelId
()
!=
null
)
{
labelIds
.
add
(
bookGroupClassifyVO
.
getDepLabelId
());
}
}
Map
<
Long
,
Integer
>
activeCountMap
=
wechatGroupConsr
.
get7DayActiveUserCountByClassify
(
classifyIds
);
Map
<
Long
,
String
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
}
for
(
BookGroupClassifyVO
bookGroupClassifyVO
:
bookGroupClassifyVOS
)
{
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
Long
proLabelId
=
bookGroupClassifyVO
.
getProLabelId
();
Long
purLabelId
=
bookGroupClassifyVO
.
getPurLabelId
();
Long
depLabelId
=
bookGroupClassifyVO
.
getDepLabelId
();
if
(
proLabelId
!=
null
)
{
bookGroupClassifyVO
.
setProLabelName
(
labelMap
.
get
(
proLabelId
));
}
if
(
purLabelId
!=
null
)
{
bookGroupClassifyVO
.
setPurLabelName
(
labelMap
.
get
(
purLabelId
));
}
if
(
depLabelId
!=
null
)
{
bookGroupClassifyVO
.
setDepLabelName
(
labelMap
.
get
(
depLabelId
));
}
}
//最近7天活跃人数
Integer
count
=
activeCountMap
.
get
(
bookGroupClassifyVO
.
getClassifyId
());
if
(
count
==
null
)
{
bookGroupClassifyVO
.
setWeekActiveNumber
(
0
);
}
else
{
bookGroupClassifyVO
.
setWeekActiveNumber
(
count
);
}
}
}
}
return
pageBeanNew
;
return
pageBeanNew
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
View file @
f0f0b645
...
@@ -25,6 +25,8 @@ import com.pcloud.book.group.vo.ListQrcodeByClassifyParamVO;
...
@@ -25,6 +25,8 @@ import com.pcloud.book.group.vo.ListQrcodeByClassifyParamVO;
import
com.pcloud.book.keywords.dao.BookKeywordRecordDao
;
import
com.pcloud.book.keywords.dao.BookKeywordRecordDao
;
import
com.pcloud.book.keywords.dto.KeywordUserCountDTO
;
import
com.pcloud.book.keywords.dto.KeywordUserCountDTO
;
import
com.pcloud.book.mq.producer.BookMQProducer
;
import
com.pcloud.book.mq.producer.BookMQProducer
;
import
com.pcloud.book.push.dao.PushGroupDao
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
...
@@ -41,6 +43,8 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -41,6 +43,8 @@ import org.springframework.transaction.annotation.Transactional;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
/**
* @author lily
* @author lily
...
@@ -65,6 +69,10 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
...
@@ -65,6 +69,10 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
private
ReaderConsr
readerConsr
;
private
ReaderConsr
readerConsr
;
@Autowired
@Autowired
private
GroupAnnouncementBiz
groupAnnouncementBiz
;
private
GroupAnnouncementBiz
groupAnnouncementBiz
;
@Autowired
private
PushGroupDao
pushGroupDao
;
private
static
final
ExecutorService
EXECUTOR_SERVICE
=
Executors
.
newFixedThreadPool
(
5
);
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -260,9 +268,18 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
...
@@ -260,9 +268,18 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
groupQrcode
.
setGroupName
(
groupName
);
groupQrcode
.
setGroupName
(
groupName
);
groupQrcode
.
setClassifyId
(
classifyId
);
groupQrcode
.
setClassifyId
(
classifyId
);
this
.
insert
(
groupQrcode
);
this
.
insert
(
groupQrcode
);
EXECUTOR_SERVICE
.
execute
(()->{
//获取该社群书下是否有群公告
//获取该社群书下是否有群公告
ClassifyVO
classifyVO
=
bookGroupClassifyBiz
.
getClassify
(
classifyId
);
ClassifyVO
classifyVO
=
bookGroupClassifyBiz
.
getClassify
(
classifyId
);
groupAnnouncementBiz
.
setAnForGroup
(
classifyVO
.
getBookGroupId
(),
classifyId
,
oneQrcode
.
getWeixinGroupId
());
groupAnnouncementBiz
.
setAnForGroup
(
classifyVO
.
getBookGroupId
(),
classifyId
,
oneQrcode
.
getWeixinGroupId
());
//补充该分类下的群发关联
List
<
PushGroup
>
pushGroups
=
pushGroupDao
.
getListByClassifyId
(
classifyId
);
if
(!
ListUtils
.
isEmpty
(
pushGroups
)){
PushGroup
pushGroup
=
pushGroups
.
get
(
0
);
pushGroup
.
setBookGroupQrcodeId
(
groupQrcode
.
getId
());
pushGroupDao
.
insert
(
pushGroup
);
}
});
//String robotId = wechatGroupConsr.getRobotIdByGroupId(oneQrcode.getWeixinGroupId());
//String robotId = wechatGroupConsr.getRobotIdByGroupId(oneQrcode.getWeixinGroupId());
SendWeixinRequestTools
.
changeGroupName
(
oneQrcode
.
getRobotWxId
(),
oneQrcode
.
getWeixinGroupId
(),
groupName
);
SendWeixinRequestTools
.
changeGroupName
(
oneQrcode
.
getRobotWxId
(),
oneQrcode
.
getWeixinGroupId
(),
groupName
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/GroupQrcodeDao.java
View file @
f0f0b645
...
@@ -144,6 +144,14 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
...
@@ -144,6 +144,14 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
* @return
* @return
*/
*/
List
<
String
>
getWeixinGroupIdsByClassifyIdList
(
List
<
Long
>
classifyIds
);
List
<
String
>
getWeixinGroupIdsByClassifyIdList
(
List
<
Long
>
classifyIds
);
/**
* 根据群分类查询id集合
* @param classifyId
* @return
*/
List
<
Long
>
getIdsByClassifyId
(
Long
classifyId
);
/**
/**
* 修改群名称
* 修改群名称
* @param id
* @param id
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/GroupQrcodeDaoImpl.java
View file @
f0f0b645
...
@@ -129,6 +129,12 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
...
@@ -129,6 +129,12 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
public
List
<
String
>
getWeixinGroupIdsByClassifyIdList
(
List
<
Long
>
classifyIds
)
{
public
List
<
String
>
getWeixinGroupIdsByClassifyIdList
(
List
<
Long
>
classifyIds
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getWeixinGroupIdsByClassifyIdList"
),
classifyIds
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getWeixinGroupIdsByClassifyIdList"
),
classifyIds
);
}
}
@Override
public
List
<
Long
>
getIdsByClassifyId
(
Long
classifyId
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getIdsByClassifyId"
),
classifyId
);
}
@Override
@Override
public
void
updateGroupName
(
Long
id
,
String
groupName
)
{
public
void
updateGroupName
(
Long
id
,
String
groupName
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupClassifyFacade.java
View file @
f0f0b645
...
@@ -119,13 +119,10 @@ public interface BookGroupClassifyFacade {
...
@@ -119,13 +119,10 @@ public interface BookGroupClassifyFacade {
ResponseDto
<
GroupQrcode4ClassifyVO
>
getGroupQrcode4ClassifyWechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"classifyId"
)
Long
classifyId
);
ResponseDto
<
GroupQrcode4ClassifyVO
>
getGroupQrcode4ClassifyWechat
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
"classifyId"
)
Long
classifyId
);
@ApiOperation
(
value
=
"获取编辑所有的群二维码"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"获取编辑所有的分类"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"listGroupQrcodeByAdviser"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"listGroupClassifyByAdviser"
,
method
=
RequestMethod
.
POST
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
),
@PostMapping
(
"listGroupClassifyByAdviser"
)
@ApiImplicitParam
(
name
=
"listGroupQrParam"
,
value
=
"群二维码查询参数"
,
dataType
=
"ListGroupQrParam"
,
paramType
=
"body"
)
ResponseDto
<
PageBeanNew
<
BookGroupClassifyVO
>>
listGroupClassifyByAdviser
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
(
"获取分类列表参数"
)
ListGroupClassifyParam
listGroupClassifyParam
)
throws
PermissionException
;
})
@GetMapping
(
"listGroupQrcodeByAdviser"
)
ResponseDto
<
PageBeanNew
<
GroupQrcodeVO
>>
listGroupQrcodeByAdviser
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListGroupQrParam
listGroupQrParam
)
throws
PermissionException
;
@ApiOperation
(
value
=
"单个群统计"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"单个群统计"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"listBookGroupQrcodeStatistic"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"listBookGroupQrcodeStatistic"
,
method
=
RequestMethod
.
POST
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupClassifyFacadeImpl.java
View file @
f0f0b645
...
@@ -119,10 +119,10 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
...
@@ -119,10 +119,10 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
}
}
@Override
@Override
@PostMapping
(
"listGroup
Qrcode
ByAdviser"
)
@PostMapping
(
"listGroup
Classify
ByAdviser"
)
public
ResponseDto
<
PageBeanNew
<
GroupQrcodeVO
>>
listGroupQrcodeByAdviser
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListGroupQrParam
listGroupQr
Param
)
throws
PermissionException
{
public
ResponseDto
<
PageBeanNew
<
BookGroupClassifyVO
>>
listGroupClassifyByAdviser
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
(
"获取分类列表参数"
)
ListGroupClassifyParam
listGroupClassify
Param
)
throws
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
PageBeanNew
<
GroupQrcodeVO
>
pageBeanNew
=
bookGroupClassifyBiz
.
listGroupQrcodeByAdviser
(
listGroupQr
Param
,
adviserId
);
PageBeanNew
<
BookGroupClassifyVO
>
pageBeanNew
=
bookGroupClassifyBiz
.
listGroupClassifyByAdviser
(
listGroupClassify
Param
,
adviserId
);
return
new
ResponseDto
<>(
pageBeanNew
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/BookGroupClassifyVO.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/6 16:26
**/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
BookGroupClassifyVO
{
@ApiModelProperty
(
"分类标识"
)
private
Long
classifyId
;
@ApiModelProperty
(
"图书标识"
)
private
Long
bookId
;
@ApiModelProperty
(
"图书名称"
)
private
String
bookName
;
@ApiModelProperty
(
"群分类"
)
private
String
classify
;
@ApiModelProperty
(
"社群码标识"
)
private
String
bookGroupId
;
@ApiModelProperty
(
"群二维码名称"
)
private
String
groupQrcodeName
;
@ApiModelProperty
(
"群人数"
)
private
Integer
userNumber
;
@ApiModelProperty
(
"最近7天活跃分数"
)
private
Integer
weekActiveNumber
;
@ApiModelProperty
(
"专业标签ID"
)
private
Long
proLabelId
;
@ApiModelProperty
(
"深度标签ID"
)
private
Long
depLabelId
;
@ApiModelProperty
(
"目的标签ID"
)
private
Long
purLabelId
;
@ApiModelProperty
(
"专业标签名称"
)
private
String
proLabelName
;
@ApiModelProperty
(
"深度标签名称"
)
private
String
depLabelName
;
@ApiModelProperty
(
"目的标签名称"
)
private
String
purLabelName
;
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
String
getBookName
()
{
return
bookName
;
}
public
void
setBookName
(
String
bookName
)
{
this
.
bookName
=
bookName
;
}
public
String
getClassify
()
{
return
classify
;
}
public
void
setClassify
(
String
classify
)
{
this
.
classify
=
classify
;
}
public
String
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
String
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
String
getGroupQrcodeName
()
{
return
groupQrcodeName
;
}
public
void
setGroupQrcodeName
(
String
groupQrcodeName
)
{
this
.
groupQrcodeName
=
groupQrcodeName
;
}
public
Integer
getUserNumber
()
{
return
userNumber
;
}
public
void
setUserNumber
(
Integer
userNumber
)
{
this
.
userNumber
=
userNumber
;
}
public
Integer
getWeekActiveNumber
()
{
return
weekActiveNumber
;
}
public
void
setWeekActiveNumber
(
Integer
weekActiveNumber
)
{
this
.
weekActiveNumber
=
weekActiveNumber
;
}
public
Long
getProLabelId
()
{
return
proLabelId
;
}
public
void
setProLabelId
(
Long
proLabelId
)
{
this
.
proLabelId
=
proLabelId
;
}
public
Long
getDepLabelId
()
{
return
depLabelId
;
}
public
void
setDepLabelId
(
Long
depLabelId
)
{
this
.
depLabelId
=
depLabelId
;
}
public
Long
getPurLabelId
()
{
return
purLabelId
;
}
public
void
setPurLabelId
(
Long
purLabelId
)
{
this
.
purLabelId
=
purLabelId
;
}
public
String
getProLabelName
()
{
return
proLabelName
;
}
public
void
setProLabelName
(
String
proLabelName
)
{
this
.
proLabelName
=
proLabelName
;
}
public
String
getDepLabelName
()
{
return
depLabelName
;
}
public
void
setDepLabelName
(
String
depLabelName
)
{
this
.
depLabelName
=
depLabelName
;
}
public
String
getPurLabelName
()
{
return
purLabelName
;
}
public
void
setPurLabelName
(
String
purLabelName
)
{
this
.
purLabelName
=
purLabelName
;
}
@Override
public
String
toString
()
{
return
"BookGroupClassifyVO{"
+
"classifyId="
+
classifyId
+
", bookId="
+
bookId
+
", bookName='"
+
bookName
+
'\''
+
", classify='"
+
classify
+
'\''
+
", bookGroupId='"
+
bookGroupId
+
'\''
+
", groupQrcodeName='"
+
groupQrcodeName
+
'\''
+
", userNumber="
+
userNumber
+
", weekActiveNumber="
+
weekActiveNumber
+
", proLabelId="
+
proLabelId
+
", depLabelId="
+
depLabelId
+
", purLabelId="
+
purLabelId
+
", proLabelName='"
+
proLabelName
+
'\''
+
", depLabelName='"
+
depLabelName
+
'\''
+
", purLabelName='"
+
purLabelName
+
'\''
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ListGroupClassifyParam.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
group
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/6 16:33
**/
@ApiModel
(
"获取分类列表参数"
)
public
class
ListGroupClassifyParam
{
@ApiModelProperty
(
"当前页数"
)
private
Integer
currentPage
;
@ApiModelProperty
(
"每页条数"
)
private
Integer
numPerPage
;
@ApiModelProperty
(
"图书标识"
)
private
List
<
Long
>
bookIds
;
@ApiModelProperty
(
"分类名称或者书刊名称"
)
private
String
name
;
@ApiModelProperty
(
"专业标签ID"
)
private
Long
proLabelId
;
@ApiModelProperty
(
"深度标签ID"
)
private
Long
depLabelId
;
@ApiModelProperty
(
"目的标签ID"
)
private
Long
purLabelId
;
public
Integer
getCurrentPage
()
{
return
currentPage
;
}
public
void
setCurrentPage
(
Integer
currentPage
)
{
this
.
currentPage
=
currentPage
;
}
public
Integer
getNumPerPage
()
{
return
numPerPage
;
}
public
void
setNumPerPage
(
Integer
numPerPage
)
{
this
.
numPerPage
=
numPerPage
;
}
public
List
<
Long
>
getBookIds
()
{
return
bookIds
;
}
public
void
setBookIds
(
List
<
Long
>
bookIds
)
{
this
.
bookIds
=
bookIds
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Long
getProLabelId
()
{
return
proLabelId
;
}
public
void
setProLabelId
(
Long
proLabelId
)
{
this
.
proLabelId
=
proLabelId
;
}
public
Long
getDepLabelId
()
{
return
depLabelId
;
}
public
void
setDepLabelId
(
Long
depLabelId
)
{
this
.
depLabelId
=
depLabelId
;
}
public
Long
getPurLabelId
()
{
return
purLabelId
;
}
public
void
setPurLabelId
(
Long
purLabelId
)
{
this
.
purLabelId
=
purLabelId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/PushBiz.java
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
biz
;
package
com
.
pcloud
.
book
.
push
.
biz
;
import
com.pcloud.book.push.dto.PushDTO
;
import
com.pcloud.book.push.dto.*
;
import
com.pcloud.book.push.dto.PushGroupDTO
;
import
com.pcloud.book.push.dto.PushRecordDTO
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushItem
;
import
com.pcloud.book.push.entity.PushItem
;
...
@@ -114,4 +112,33 @@ public interface PushBiz {
...
@@ -114,4 +112,33 @@ public interface PushBiz {
* @return
* @return
*/
*/
PageBeanNew
<
PushRecordDTO
>
getPushRecordList
(
Long
partyId
,
Integer
currentPage
,
Integer
numPerPage
);
PageBeanNew
<
PushRecordDTO
>
getPushRecordList
(
Long
partyId
,
Integer
currentPage
,
Integer
numPerPage
);
/**
* 新增计划式群发
*/
void
createPushPlan
(
PushPlanDTO
pushPlanDTO
);
/**
* 修改计划式群发
*/
void
updatePushPlan
(
PushPlanDTO
pushPlanDTO
);
/**
* 获取计划式群发
*/
PushPlanDTO
getPushPlan
(
Long
pushPlanId
);
/**
* 删除计划式群发
*/
void
deletePushPlan
(
Long
pushPlanId
,
Long
partyId
);
/**
* 获取计划式群发列表
*/
PageBeanNew
<
PushPlanDTO
>
getPushPlanList
(
String
keyword
,
String
day
,
Integer
weekDay
,
Integer
currentPage
,
Integer
numPerPage
,
Long
partyId
);
/**
* 获取计划日历
*/
List
<
String
>
getPushPlanCalendar
(
Long
partyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
View file @
f0f0b645
...
@@ -10,7 +10,9 @@ import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
...
@@ -10,7 +10,9 @@ import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.dao.AppTouchRecordDao
;
import
com.pcloud.book.group.dao.AppTouchRecordDao
;
import
com.pcloud.book.group.dao.BookGroupClassifyDao
;
import
com.pcloud.book.group.dao.BookGroupClassifyDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.ClassifyDTO
;
import
com.pcloud.book.group.dto.ClassifyDTO
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.entity.AppTouchRecord
;
import
com.pcloud.book.group.entity.AppTouchRecord
;
...
@@ -91,6 +93,10 @@ public class PushBizImpl implements PushBiz {
...
@@ -91,6 +93,10 @@ public class PushBizImpl implements PushBiz {
private
BookGroupClassifyDao
bookGroupClassifyDao
;
private
BookGroupClassifyDao
bookGroupClassifyDao
;
@Autowired
@Autowired
private
AppTouchRecordDao
appTouchRecordDao
;
private
AppTouchRecordDao
appTouchRecordDao
;
@Autowired
private
PushPlanDao
pushPlanDao
;
@Autowired
private
BookGroupDao
bookGroupDao
;
private
static
final
String
PUSH_SCHEDULE_PRE
=
"BOOK_GROUP_PUSH_"
;
private
static
final
String
PUSH_SCHEDULE_PRE
=
"BOOK_GROUP_PUSH_"
;
...
@@ -102,6 +108,7 @@ public class PushBizImpl implements PushBiz {
...
@@ -102,6 +108,7 @@ public class PushBizImpl implements PushBiz {
@ParamLog
(
"创建群发"
)
@ParamLog
(
"创建群发"
)
@Override
@Override
public
void
createPush
(
Push
push
)
{
public
void
createPush
(
Push
push
)
{
changeQrcode
(
push
);
//校验参数
//校验参数
pushCheck
.
createPushParamCheck
(
push
);
pushCheck
.
createPushParamCheck
(
push
);
//插入群发
//插入群发
...
@@ -121,6 +128,37 @@ public class PushBizImpl implements PushBiz {
...
@@ -121,6 +128,37 @@ public class PushBizImpl implements PushBiz {
}
}
/**
/**
* 转换关联关系
*/
private
void
changeQrcode
(
Push
push
)
{
List
<
PushGroup
>
pushGroups
=
push
.
getPushGroups
();
List
<
PushGroup
>
pushGroupsNew
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
pushGroups
))
{
for
(
PushGroup
pushGroup
:
pushGroups
)
{
//如果只传了classifyId,补充微信二维码id
if
(
pushGroup
.
getClassifyId
()
!=
null
)
{
if
(
pushGroup
.
getBookGroupQrcodeId
()
==
null
)
{
List
<
Long
>
qrcodeIds
=
groupQrcodeDao
.
getIdsByClassifyId
(
pushGroup
.
getClassifyId
());
if
(!
ListUtils
.
isEmpty
(
qrcodeIds
))
{
for
(
Long
qrcodeId
:
qrcodeIds
)
{
PushGroup
pushGroupNew
=
new
PushGroup
();
BeanUtils
.
copyProperties
(
pushGroup
,
pushGroupNew
);
pushGroupNew
.
setBookGroupQrcodeId
(
qrcodeId
);
pushGroupsNew
.
add
(
pushGroupNew
);
}
}
}
else
{
pushGroupsNew
.
add
(
pushGroup
);
}
}
}
if
(!
ListUtils
.
isEmpty
(
pushGroupsNew
)){
push
.
setPushGroups
(
pushGroupsNew
);
}
}
}
/**
* 遍历,如果含有超级作者作品,自动上架
* 遍历,如果含有超级作者作品,自动上架
*/
*/
@ParamLog
(
"遍历,如果含有超级作者作品,自动上架"
)
@ParamLog
(
"遍历,如果含有超级作者作品,自动上架"
)
...
@@ -170,6 +208,8 @@ public class PushBizImpl implements PushBiz {
...
@@ -170,6 +208,8 @@ public class PushBizImpl implements PushBiz {
pushOne
(
push
);
pushOne
(
push
);
}
else
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
pushType
))
{
}
else
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
pushType
))
{
pushDay
(
push
);
pushDay
(
push
);
}
else
if
(
PushTypeEnum
.
WEEK
.
value
.
equals
(
pushType
))
{
pushWeek
(
push
);
}
}
}
}
...
@@ -181,6 +221,18 @@ public class PushBizImpl implements PushBiz {
...
@@ -181,6 +221,18 @@ public class PushBizImpl implements PushBiz {
if
(
push
==
null
){
if
(
push
==
null
){
return
;
return
;
}
}
//判断时间范围
if
(
PushTypeEnum
.
WEEK
.
value
.
equals
(
push
.
getPushType
())
||
PushTypeEnum
.
DAY
.
value
.
equals
(
push
.
getPushType
()))
{
Date
startTime
=
push
.
getStartTime
();
Date
endTime
=
push
.
getEndTime
();
Date
dateNow
=
new
Date
();
if
(
startTime
!=
null
&&
dateNow
.
before
(
startTime
))
{
return
;
}
if
(
endTime
!=
null
&&
dateNow
.
after
(
endTime
))
{
return
;
}
}
//查询关联群
//查询关联群
List
<
PushGroup
>
pushGroupList
=
pushGroupDao
.
getListByPushId
(
pushId
);
List
<
PushGroup
>
pushGroupList
=
pushGroupDao
.
getListByPushId
(
pushId
);
if
(
ListUtils
.
isEmpty
(
pushGroupList
)){
if
(
ListUtils
.
isEmpty
(
pushGroupList
)){
...
@@ -572,6 +624,322 @@ public class PushBizImpl implements PushBiz {
...
@@ -572,6 +624,322 @@ public class PushBizImpl implements PushBiz {
return
pageBeanNew
;
return
pageBeanNew
;
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"新增计划式群发"
)
@Override
public
void
createPushPlan
(
PushPlanDTO
pushPlanDTO
)
{
List
<
Long
>
classifyIds
=
pushPlanDTO
.
getClassifyIds
();
List
<
PushGroup
>
pushGroups
=
buildPushGroups
(
classifyIds
);
//新增计划
PushPlan
pushPlan
=
new
PushPlan
();
Long
partyId
=
pushPlanDTO
.
getCreateUser
();
pushPlan
.
setCreateUser
(
partyId
);
pushPlan
.
setUpdateUser
(
partyId
);
pushPlanDao
.
insert
(
pushPlan
);
Long
pushPlanId
=
pushPlan
.
getId
();
List
<
PushPlanItemDTO
>
pushPlanItemDTOS
=
pushPlanDTO
.
getPushPlanItemDTOList
();
for
(
PushPlanItemDTO
pushPlanItemDTO
:
pushPlanItemDTOS
)
{
Push
push
=
new
Push
();
//填充push基本信息
BeanUtils
.
copyProperties
(
pushPlanItemDTO
,
push
);
push
.
setPushPlanId
(
pushPlanId
);
push
.
setCreateUser
(
partyId
);
push
.
setUpdateUser
(
partyId
);
push
.
setPushGroups
(
pushGroups
);
push
.
setPushItems
(
pushPlanItemDTO
.
getPushItems
());
//创建群发
createPush
(
push
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"修改计划式群发"
)
@Override
public
void
updatePushPlan
(
PushPlanDTO
pushPlanDTO
)
{
Long
planId
=
pushPlanDTO
.
getPushPlanId
();
List
<
Push
>
pushes
=
pushDao
.
getByPushPlanId
(
planId
);
if
(
ListUtils
.
isEmpty
(
pushes
))
{
return
;
}
List
<
Long
>
classifyIds
=
pushPlanDTO
.
getClassifyIds
();
List
<
PushGroup
>
pushGroups
=
buildPushGroups
(
classifyIds
);
List
<
Long
>
oldPushIds
=
pushes
.
stream
().
map
(
Push:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
pushIds
=
new
ArrayList
<>();
Long
partyId
=
pushPlanDTO
.
getUpdateUser
();
PushPlan
pushPlan
=
new
PushPlan
();
pushPlan
.
setId
(
pushPlanDTO
.
getPushPlanId
());
pushPlan
.
setUpdateUser
(
partyId
);
pushPlanDao
.
update
(
pushPlan
);
List
<
PushPlanItemDTO
>
pushPlanItemDTOList
=
pushPlanDTO
.
getPushPlanItemDTOList
();
for
(
PushPlanItemDTO
pushPlanItemDTO
:
pushPlanItemDTOList
)
{
Push
push
=
new
Push
();
BeanUtils
.
copyProperties
(
pushPlanItemDTO
,
push
);
Long
pushId
=
pushPlanItemDTO
.
getPushId
();
pushIds
.
add
(
pushId
);
push
.
setId
(
pushId
);
push
.
setCreateUser
(
partyId
);
push
.
setUpdateUser
(
partyId
);
push
.
setPushGroups
(
pushGroups
);
push
.
setPushItems
(
pushPlanItemDTO
.
getPushItems
());
//没有id是新增
if
(
pushId
!=
null
)
{
updatePush
(
push
);
}
else
{
push
.
setPushPlanId
(
planId
);
createPush
(
push
);
}
}
//删除没有修改的
for
(
Long
oldPushId
:
oldPushIds
)
{
if
(!
pushIds
.
contains
(
oldPushId
))
{
deletePush
(
oldPushId
,
partyId
);
}
}
}
@ParamLog
(
"获取计划式群发"
)
@Override
public
PushPlanDTO
getPushPlan
(
Long
pushPlanId
)
{
PushPlanDTO
pushPlanDTO
=
new
PushPlanDTO
();
PushPlan
pushPlan
=
pushPlanDao
.
getById
(
pushPlanId
);
pushPlanDTO
.
setPushPlanId
(
pushPlan
.
getId
());
BeanUtils
.
copyProperties
(
pushPlan
,
pushPlanDTO
);
List
<
Push
>
pushList
=
pushDao
.
getByPushPlanId
(
pushPlanId
);
if
(!
ListUtils
.
isEmpty
(
pushList
)){
List
<
PushPlanItemDTO
>
pushPlanItemDTOList
=
new
ArrayList
<>();
List
<
Long
>
pushIds
=
new
ArrayList
<>();
for
(
Push
push
:
pushList
)
{
PushPlanItemDTO
pushPlanItemDTO
=
new
PushPlanItemDTO
();
BeanUtils
.
copyProperties
(
push
,
pushPlanItemDTO
);
pushPlanItemDTO
.
setPushId
(
push
.
getId
());
pushIds
.
add
(
push
.
getId
());
pushPlanItemDTOList
.
add
(
pushPlanItemDTO
);
}
List
<
PushItem
>
pushItemList
=
pushItemDao
.
getListByPushIds
(
pushIds
);
fillItemAPInfo
(
pushItemList
);
Map
<
Long
,
List
<
PushItem
>>
itemMap
=
pushItemList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PushItem:
:
getPushId
));
for
(
PushPlanItemDTO
pushPlanItemDTO
:
pushPlanItemDTOList
)
{
pushPlanItemDTO
.
setPushItems
(
itemMap
.
get
(
pushPlanItemDTO
.
getPushId
()));
}
pushPlanDTO
.
setPushPlanItemDTOList
(
pushPlanItemDTOList
);
List
<
PlanClassifyDTO
>
planClassifyDTOS
=
pushGroupDao
.
getPlanClassifyListByPlanId
(
pushPlanId
);
if
(!
ListUtils
.
isEmpty
(
planClassifyDTOS
))
{
pushPlanDTO
.
setClassifyIds
(
planClassifyDTOS
.
stream
().
filter
(
s
->
s
.
getClassifyId
()
!=
null
).
map
(
PlanClassifyDTO:
:
getClassifyId
).
collect
(
Collectors
.
toList
()));
}
}
return
pushPlanDTO
;
}
/**
* 填充应用信息
*/
private
void
fillItemAPInfo
(
List
<
PushItem
>
pushItemList
)
{
if
(
ListUtils
.
isEmpty
(
pushItemList
))
{
return
;
}
List
<
Long
>
appIds
=
pushItemList
.
stream
().
filter
(
s
->
ItemTypeEnum
.
APP
.
value
.
equals
(
s
.
getItemType
())
&&
s
.
getAppId
()
!=
null
).
map
(
PushItem:
:
getAppId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
productIds
=
pushItemList
.
stream
().
filter
(
s
->
ItemTypeEnum
.
APP
.
value
.
equals
(
s
.
getItemType
())
&&
s
.
getProductId
()
!=
null
).
map
(
PushItem:
:
getProductId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
AppDto
>
appDtoMap
=
null
;
Map
<
Long
,
ProductDto
>
productDtoMap
=
null
;
if
(!
appIds
.
isEmpty
())
{
appDtoMap
=
appConsr
.
mapByIds
(
appIds
);
}
if
(!
productIds
.
isEmpty
())
{
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
}
for
(
PushItem
pushItem
:
pushItemList
)
{
if
(
ItemTypeEnum
.
APP
.
value
.
equals
(
pushItem
.
getItemType
()))
{
Long
appId
=
pushItem
.
getAppId
();
Long
productId
=
pushItem
.
getProductId
();
String
apName
=
null
;
String
apTypeName
=
null
;
String
apImage
=
null
;
if
(
appId
!=
null
)
{
AppDto
appDto
=
appDtoMap
.
get
(
appId
);
apName
=
appDto
.
getTitle
();
apTypeName
=
appDto
.
getTypeName
();
apImage
=
appDto
.
getSquareImg
();
}
if
(
productId
!=
null
)
{
ProductDto
productDto
=
productDtoMap
.
get
(
productId
);
apName
=
productDto
.
getProductName
();
if
(
productDto
.
getProductTypeDto
()
!=
null
)
{
apTypeName
=
productDto
.
getProductTypeDto
().
getTypeName
();
}
apImage
=
productDto
.
getCoverImg
();
}
pushItem
.
setApTypeName
(
apTypeName
);
pushItem
.
setApName
(
apName
);
pushItem
.
setApImage
(
apImage
);
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"删除计划式群发"
)
@Override
public
void
deletePushPlan
(
Long
pushPlanId
,
Long
partyId
)
{
PushPlan
pushPlan
=
pushPlanDao
.
getById
(
pushPlanId
);
if
(
pushPlan
==
null
)
{
return
;
}
List
<
Push
>
pushList
=
pushDao
.
getByPushPlanId
(
pushPlanId
);
if
(
ListUtils
.
isEmpty
(
pushList
))
{
return
;
}
//删除计划
pushPlanDao
.
deleteById
(
pushPlanId
);
//循环删除群发
for
(
Push
push
:
pushList
)
{
deletePush
(
push
.
getId
(),
partyId
);
}
}
@ParamLog
(
"获取计划式群发列表"
)
@Override
public
PageBeanNew
<
PushPlanDTO
>
getPushPlanList
(
String
keyword
,
String
day
,
Integer
weekDay
,
Integer
currentPage
,
Integer
numPerPage
,
Long
partyId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"keyword"
,
keyword
);
paramMap
.
put
(
"day"
,
day
);
paramMap
.
put
(
"weekDay"
,
weekDay
);
paramMap
.
put
(
"partyId"
,
partyId
);
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
PageBeanNew
<
PushPlanDTO
>
pageBeanNew
=
pushPlanDao
.
listPageNew
(
pageParam
,
paramMap
,
"getPushPlanList"
);
List
<
PushPlanDTO
>
pushPlanDTOS
=
pageBeanNew
.
getRecordList
();
if
(!
ListUtils
.
isEmpty
(
pushPlanDTOS
))
{
List
<
Long
>
pushPlanIds
=
pushPlanDTOS
.
stream
().
map
(
PushPlanDTO:
:
getPushPlanId
).
collect
(
Collectors
.
toList
());
List
<
Push
>
pushList
=
pushDao
.
getByPushPlanIds
(
pushPlanIds
);
List
<
PlanClassifyDTO
>
planClassifyDTOS
=
pushGroupDao
.
getPlanClassifyListByPlanIds
(
pushPlanIds
);
List
<
Long
>
bookGroupIds
=
planClassifyDTOS
.
stream
().
filter
(
s
->
s
.
getBookGroupId
()!=
null
).
map
(
PlanClassifyDTO:
:
getBookGroupId
).
distinct
().
collect
(
Collectors
.
toList
());
if
(!
ListUtils
.
isEmpty
(
bookGroupIds
))
{
List
<
BookGroupDTO
>
bookGroupDTOS
=
bookGroupDao
.
getBookBaseInfoByIds
(
bookGroupIds
);
if
(!
ListUtils
.
isEmpty
(
bookGroupDTOS
)){
Map
<
Long
,
BookGroupDTO
>
bookGroupDTOMap
=
new
HashMap
<>();
for
(
BookGroupDTO
bookGroupDTO:
bookGroupDTOS
){
bookGroupDTOMap
.
put
(
bookGroupDTO
.
getId
(),
bookGroupDTO
);
}
for
(
PlanClassifyDTO
planClassifyDTO
:
planClassifyDTOS
)
{
BookGroupDTO
bookGroupDTO
=
bookGroupDTOMap
.
get
(
planClassifyDTO
.
getBookGroupId
());
if
(
bookGroupDTO
!=
null
){
planClassifyDTO
.
setGroupQrcodeName
(
bookGroupDTO
.
getGroupQrcodeName
());
planClassifyDTO
.
setBookName
(
bookGroupDTO
.
getBookName
());
}
}
}
}
Map
<
Long
,
List
<
PlanClassifyDTO
>>
planClassifyMap
=
planClassifyDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
PlanClassifyDTO:
:
getPushPlanId
));
if
(!
ListUtils
.
isEmpty
(
pushList
))
{
List
<
Long
>
pushIds
=
pushList
.
stream
().
map
(
Push:
:
getId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
List
<
Push
>>
pushMap
=
pushList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Push:
:
getPushPlanId
));
List
<
PushItem
>
pushItemList
=
pushItemDao
.
getListByPushIds
(
pushIds
);
fillItemAPInfo
(
pushItemList
);
Map
<
Long
,
List
<
PushItem
>>
pushItemMap
=
pushItemList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PushItem:
:
getPushId
));
for
(
PushPlanDTO
pushPlanDTO
:
pushPlanDTOS
)
{
Long
pushPlanId
=
pushPlanDTO
.
getPushPlanId
();
List
<
Push
>
pushes
=
pushMap
.
get
(
pushPlanId
);
if
(
ListUtils
.
isEmpty
(
pushes
)){
continue
;
}
List
<
PushPlanItemDTO
>
pushPlanItemDTOList
=
new
ArrayList
<>();
for
(
Push
push:
pushes
){
PushPlanItemDTO
pushPlanItemDTO
=
new
PushPlanItemDTO
();
List
<
PushItem
>
pushItems
=
pushItemMap
.
get
(
push
.
getId
());
pushPlanItemDTO
.
setPushId
(
push
.
getId
());
BeanUtils
.
copyProperties
(
push
,
pushPlanItemDTO
);
pushPlanItemDTO
.
setPushItems
(
pushItems
);
pushPlanItemDTOList
.
add
(
pushPlanItemDTO
);
}
pushPlanDTO
.
setPushPlanItemDTOList
(
pushPlanItemDTOList
);
pushPlanDTO
.
setPlanClassifyDTOList
(
planClassifyMap
.
get
(
pushPlanId
));
if
(!
ListUtils
.
isEmpty
(
planClassifyMap
.
get
(
pushPlanId
)))
{
List
<
Long
>
classifyIds
=
planClassifyMap
.
get
(
pushPlanId
).
stream
().
filter
(
s
->
s
.
getClassifyId
()
!=
null
).
map
(
PlanClassifyDTO:
:
getClassifyId
).
collect
(
Collectors
.
toList
());
pushPlanDTO
.
setClassifyIds
(
classifyIds
);
}
}
}
}
return
pageBeanNew
;
}
@ParamLog
(
"获取计划日历"
)
@Override
public
List
<
String
>
getPushPlanCalendar
(
Long
partyId
)
{
List
<
String
>
list
=
new
ArrayList
<>();
List
<
Push
>
pushList
=
pushDao
.
getPlanPushListPartyId
(
partyId
);
if
(
ListUtils
.
isEmpty
(
pushList
))
{
return
list
;
}
for
(
Push
push
:
pushList
)
{
Integer
pushType
=
push
.
getPushType
();
String
pushTime
=
push
.
getPushTime
();
Date
startTime
=
push
.
getStartTime
();
Date
endTime
=
push
.
getEndTime
();
Integer
weekDay
=
push
.
getWeekDay
();
Date
startDay
=
DateUtils
.
getYearStart
(
new
Date
());
Date
endDay
=
DateUtils
.
getYearEnd
(
new
Date
());
if
(
startTime
!=
null
)
{
startDay
=
startTime
;
}
if
(
endTime
!=
null
)
{
endDay
=
endTime
;
}
//如果是单次发送,直接截取时间
if
(
PushTypeEnum
.
ONE
.
value
.
equals
(
pushType
))
{
if
(
pushTime
.
length
()>=
10
){
list
.
add
(
pushTime
.
substring
(
0
,
10
));
}
}
//如果是按照天设置
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
pushType
))
{
for
(
Date
i
=
startDay
;
!
i
.
after
(
endDay
);
i
=
DateUtils
.
addDay
(
i
,
1
))
{
list
.
add
(
DateUtils
.
formatDate
(
i
,
"yyyy-MM-dd"
));
}
}
//如果是按照周设置
if
(
PushTypeEnum
.
WEEK
.
value
.
equals
(
pushType
))
{
if
(
weekDay
==
null
)
{
break
;
}
if
(
weekDay
==
7
)
{
weekDay
=
1
;
}
else
{
weekDay
=
weekDay
+
1
;
}
for
(
Date
i
=
startDay
;
!
i
.
after
(
endDay
);
i
=
DateUtils
.
addDay
(
i
,
1
))
{
if
(
weekDay
==
DateUtils
.
getWeekIndex
(
i
))
{
list
.
add
(
DateUtils
.
formatDate
(
i
,
"yyyy-MM-dd"
));
}
}
}
}
if
(!
ListUtils
.
isEmpty
(
list
)){
list
=
list
.
stream
().
distinct
().
sorted
().
collect
(
Collectors
.
toList
());
}
return
list
;
}
/**
* 构建关联表
*/
private
List
<
PushGroup
>
buildPushGroups
(
List
<
Long
>
classifyIds
){
List
<
PushGroup
>
pushGroups
=
new
ArrayList
<>();
for
(
Long
classifyId
:
classifyIds
)
{
ClassifyDTO
classifyDTO
=
bookGroupClassifyDao
.
getById
(
classifyId
);
List
<
Long
>
qrCodeIds
=
groupQrcodeDao
.
getIdsByClassifyId
(
classifyId
);
if
(
ListUtils
.
isEmpty
(
qrCodeIds
))
{
continue
;
}
for
(
Long
qrCodeId
:
qrCodeIds
)
{
PushGroup
pushGroup
=
new
PushGroup
();
pushGroup
.
setBookId
(
classifyDTO
.
getBookId
());
pushGroup
.
setClassifyId
(
classifyId
);
pushGroup
.
setBookGroupQrcodeId
(
qrCodeId
);
pushGroups
.
add
(
pushGroup
);
}
}
return
pushGroups
;
}
/**
/**
* 填充群发记录
* 填充群发记录
*
*
...
@@ -671,16 +1039,29 @@ public class PushBizImpl implements PushBiz {
...
@@ -671,16 +1039,29 @@ public class PushBizImpl implements PushBiz {
* 是否需要更新群发
* 是否需要更新群发
*/
*/
private
Boolean
isNeedupdatepushSchedule
(
Push
pushOld
,
Push
push
)
{
private
Boolean
isNeedupdatepushSchedule
(
Push
pushOld
,
Push
push
)
{
Boolean
need
=
true
;
if
(
pushOld
.
getPushType
().
equals
(
push
.
getPushType
()))
{
if
(
pushOld
.
getPushType
().
equals
(
push
.
getPushType
()))
{
if
(
pushOld
.
getPushTime
()
!=
null
&&
push
.
getPushTime
()
!=
null
)
{
if
(
pushOld
.
getPushTime
()
!=
null
&&
push
.
getPushTime
()
!=
null
)
{
if
(
pushOld
.
getPushTime
().
equals
(
push
.
getPushTime
()))
{
if
(
pushOld
.
getPushTime
().
equals
(
push
.
getPushTime
()))
{
return
false
;
if
(
pushOld
.
getWeekDay
()
!=
null
&&
push
.
getWeekDay
()
!=
null
)
{
if
(
pushOld
.
getWeekDay
().
equals
(
push
.
getWeekDay
()))
{
need
=
false
;
}
}
else
if
(
pushOld
.
getWeekDay
()
==
null
&&
push
.
getWeekDay
()
==
null
)
{
need
=
false
;
}
}
}
}
else
if
(
pushOld
.
getPushTime
()
==
null
&&
push
.
getPushTime
()
==
null
)
{
}
else
if
(
pushOld
.
getPushTime
()
==
null
&&
push
.
getPushTime
()
==
null
)
{
return
false
;
if
(
pushOld
.
getWeekDay
()
!=
null
&&
push
.
getWeekDay
()
!=
null
)
{
if
(
pushOld
.
getWeekDay
().
equals
(
push
.
getWeekDay
()))
{
need
=
false
;
}
}
else
if
(
pushOld
.
getWeekDay
()
==
null
&&
push
.
getWeekDay
()
==
null
)
{
need
=
false
;
}
}
}
}
}
return
true
;
return
need
;
}
}
/**
/**
...
@@ -776,6 +1157,66 @@ public class PushBizImpl implements PushBiz {
...
@@ -776,6 +1157,66 @@ public class PushBizImpl implements PushBiz {
}
}
/**
/**
* 每周发送
*/
@ParamLog
(
"每周发送"
)
private
void
pushWeek
(
Push
push
)
{
String
cron
;
String
pushTime
=
push
.
getPushTime
();
try
{
int
hour
=
Integer
.
parseInt
(
pushTime
.
substring
(
0
,
2
));
int
minute
=
Integer
.
parseInt
(
pushTime
.
substring
(
3
,
5
));
int
second
=
Integer
.
parseInt
(
pushTime
.
substring
(
6
,
8
));
String
weekS
=
""
;
int
weekDay
=
push
.
getWeekDay
();
if
(
weekDay
==
1
){
weekS
=
"MON"
;
}
if
(
weekDay
==
2
){
weekS
=
"TUE"
;
}
if
(
weekDay
==
3
){
weekS
=
"WED"
;
}
if
(
weekDay
==
4
){
weekS
=
"THU"
;
}
if
(
weekDay
==
5
){
weekS
=
"FRI"
;
}
if
(
weekDay
==
6
){
weekS
=
"SAT"
;
}
if
(
weekDay
==
7
){
weekS
=
"SUN"
;
}
cron
=
second
+
" "
+
minute
+
" "
+
hour
+
" ? * "
+
weekS
;
}
catch
(
Exception
e
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"时间格式错误"
);
}
ScheduleJob
scheduleJob
=
new
ScheduleJob
();
scheduleJob
.
setJobGroup
(
"book"
);
scheduleJob
.
setJobName
(
PUSH_SCHEDULE_PRE
+
push
.
getId
());
scheduleJob
.
setCronExpression
(
cron
);
CallBackParam
callBackParam
=
new
CallBackParam
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
//定时任务调用时用到的参数
paramMap
.
put
(
"pushId"
,
push
.
getId
());
callBackParam
.
setParamMap
(
paramMap
);
callBackParam
.
setMethodName
(
"sendGroupMessage"
);
callBackParam
.
setBeanName
(
"pushService"
);
Map
<
String
,
Object
>
scheduleMap
=
new
HashMap
<>();
scheduleMap
.
put
(
"scheduleJob"
,
scheduleJob
);
scheduleMap
.
put
(
"callBackParam"
,
callBackParam
);
try
{
scheduleService
.
addCronJob
(
scheduleMap
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"设置定时任务失败"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"定时任务设置失败"
);
}
}
/**
* 每天发送
* 每天发送
*/
*/
@ParamLog
(
"每天发送"
)
@ParamLog
(
"每天发送"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/check/PushCheck.java
View file @
f0f0b645
...
@@ -98,7 +98,7 @@ public class PushCheck {
...
@@ -98,7 +98,7 @@ public class PushCheck {
if
(
push
==
null
)
{
if
(
push
==
null
)
{
return
;
return
;
}
}
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
push
.
getPushType
())
||
PushTypeEnum
.
ONE
.
value
.
equals
(
push
.
getPushType
()))
{
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
push
.
getPushType
())
||
PushTypeEnum
.
ONE
.
value
.
equals
(
push
.
getPushType
())
||
PushTypeEnum
.
WEEK
.
value
.
equals
(
push
.
getPushType
())
)
{
if
(
StringUtil
.
isEmpty
(
push
.
getPushTime
()))
{
if
(
StringUtil
.
isEmpty
(
push
.
getPushTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"设置为定时发送时发送时间不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"设置为定时发送时发送时间不能为空!"
);
}
}
...
@@ -111,11 +111,16 @@ public class PushCheck {
...
@@ -111,11 +111,16 @@ public class PushCheck {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"发送时间不能早于当前时间!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"发送时间不能早于当前时间!"
);
}
}
}
}
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
push
.
getPushType
()))
{
if
(
PushTypeEnum
.
DAY
.
value
.
equals
(
push
.
getPushType
())
||
PushTypeEnum
.
WEEK
.
value
.
equals
(
push
.
getPushType
())
)
{
if
(!
push
.
getPushTime
().
matches
(
"([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"
))
{
if
(!
push
.
getPushTime
().
matches
(
"([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"时间格式不对,应为HH:mm:ss!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"时间格式不对,应为HH:mm:ss!"
);
}
}
}
}
if
(
PushTypeEnum
.
WEEK
.
value
.
equals
(
push
.
getPushType
()))
{
if
(
push
.
getWeekDay
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"周几不能为空!"
);
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/PushDao.java
View file @
f0f0b645
...
@@ -3,6 +3,8 @@ package com.pcloud.book.push.dao;
...
@@ -3,6 +3,8 @@ package com.pcloud.book.push.dao;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.common.core.dao.BaseDao
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
/**
* @Description
* @Description
* @Author ruansiyuan
* @Author ruansiyuan
...
@@ -28,4 +30,25 @@ public interface PushDao extends BaseDao<Push> {
...
@@ -28,4 +30,25 @@ public interface PushDao extends BaseDao<Push> {
* @param push
* @param push
*/
*/
void
updatePushTime
(
Push
push
);
void
updatePushTime
(
Push
push
);
/**
* 根据计划id查询
* @param pushPlanId
* @return
*/
List
<
Push
>
getByPushPlanId
(
Long
pushPlanId
);
/**
* 根据群发is集合查询
* @param pushPlanIds
* @return
*/
List
<
Push
>
getByPushPlanIds
(
List
<
Long
>
pushPlanIds
);
/**
* 根据创建人获取计划式群发
* @param partyId
* @return
*/
List
<
Push
>
getPlanPushListPartyId
(
Long
partyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/PushGroupDao.java
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dao
;
package
com
.
pcloud
.
book
.
push
.
dao
;
import
com.pcloud.book.push.dto.PlanClassifyDTO
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.common.core.dao.BaseDao
;
import
com.pcloud.common.core.dao.BaseDao
;
...
@@ -41,4 +42,25 @@ public interface PushGroupDao extends BaseDao<PushGroup> {
...
@@ -41,4 +42,25 @@ public interface PushGroupDao extends BaseDao<PushGroup> {
* @return
* @return
*/
*/
List
<
PushGroup
>
getListByPushIds
(
List
<
Long
>
pushIds
);
List
<
PushGroup
>
getListByPushIds
(
List
<
Long
>
pushIds
);
/**
* 根据群发计划id集合获取群发计划关联
* @param pushPlanIds
* @return
*/
List
<
PlanClassifyDTO
>
getPlanClassifyListByPlanIds
(
List
<
Long
>
pushPlanIds
);
/**
* 根据分类id查询
* @param classifyId
* @return
*/
List
<
PushGroup
>
getListByClassifyId
(
Long
classifyId
);
/**
* 根据群发计划id获取群发计划关联
* @param pushPlanId
* @return
*/
List
<
PlanClassifyDTO
>
getPlanClassifyListByPlanId
(
Long
pushPlanId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/PushPlanDao.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dao
;
import
com.pcloud.book.push.entity.PushPlan
;
import
com.pcloud.common.core.dao.BaseDao
;
public
interface
PushPlanDao
extends
BaseDao
<
PushPlan
>
{
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/impl/PushDaoImpl.java
View file @
f0f0b645
...
@@ -6,6 +6,7 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
...
@@ -6,6 +6,7 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -32,4 +33,22 @@ public class PushDaoImpl extends BaseDaoImpl<Push> implements PushDao {
...
@@ -32,4 +33,22 @@ public class PushDaoImpl extends BaseDaoImpl<Push> implements PushDao {
public
void
updatePushTime
(
Push
push
)
{
public
void
updatePushTime
(
Push
push
)
{
super
.
getSqlSession
().
update
(
getStatement
(
"updatePushTime"
),
push
);
super
.
getSqlSession
().
update
(
getStatement
(
"updatePushTime"
),
push
);
}
}
@Override
public
List
<
Push
>
getByPushPlanId
(
Long
pushPlanId
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getByPushPlanId"
),
pushPlanId
);
}
@Override
public
List
<
Push
>
getByPushPlanIds
(
List
<
Long
>
pushPlanIds
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pushPlanIds"
,
pushPlanIds
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getByPushPlanIds"
),
map
);
}
@Override
public
List
<
Push
>
getPlanPushListPartyId
(
Long
partyId
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getPlanPushListPartyId"
),
partyId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/impl/PushGroupDaoImpl.java
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dao
.
impl
;
package
com
.
pcloud
.
book
.
push
.
dao
.
impl
;
import
com.pcloud.book.push.dao.PushGroupDao
;
import
com.pcloud.book.push.dao.PushGroupDao
;
import
com.pcloud.book.push.dto.PlanClassifyDTO
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -48,4 +49,21 @@ public class PushGroupDaoImpl extends BaseDaoImpl<PushGroup> implements PushGrou
...
@@ -48,4 +49,21 @@ public class PushGroupDaoImpl extends BaseDaoImpl<PushGroup> implements PushGrou
map
.
put
(
"pushIds"
,
pushIds
);
map
.
put
(
"pushIds"
,
pushIds
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByPushIds"
),
map
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByPushIds"
),
map
);
}
}
@Override
public
List
<
PlanClassifyDTO
>
getPlanClassifyListByPlanIds
(
List
<
Long
>
pushPlanIds
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pushPlanIds"
,
pushPlanIds
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getPlanClassifyListByPlanIds"
),
map
);
}
@Override
public
List
<
PushGroup
>
getListByClassifyId
(
Long
classifyId
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getListByClassifyId"
),
classifyId
);
}
@Override
public
List
<
PlanClassifyDTO
>
getPlanClassifyListByPlanId
(
Long
pushPlanId
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getPlanClassifyListByPlanId"
),
pushPlanId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dao/impl/PushPlanDaoImpl.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dao
.
impl
;
import
com.pcloud.book.push.dao.PushPlanDao
;
import
com.pcloud.book.push.entity.PushPlan
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Repository
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/10 12:39
**/
@Repository
(
"pushPlanDao"
)
public
class
PushPlanDaoImpl
extends
BaseDaoImpl
<
PushPlan
>
implements
PushPlanDao
{
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/PlanClassifyDTO.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dto
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/10 19:34
**/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
PlanClassifyDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3890723321481608455L
;
@ApiModelProperty
(
"计划id"
)
private
Long
pushPlanId
;
@ApiModelProperty
(
"书id"
)
private
Long
bookId
;
@ApiModelProperty
(
"书名"
)
private
String
bookName
;
@ApiModelProperty
(
"社群码id"
)
private
Long
bookGroupId
;
@ApiModelProperty
(
"社群码名称"
)
private
String
groupQrcodeName
;
@ApiModelProperty
(
"分类id"
)
private
Long
classifyId
;
@ApiModelProperty
(
"分类名称"
)
private
String
classify
;
public
Long
getPushPlanId
()
{
return
pushPlanId
;
}
public
void
setPushPlanId
(
Long
pushPlanId
)
{
this
.
pushPlanId
=
pushPlanId
;
}
public
Long
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
String
getBookName
()
{
return
bookName
;
}
public
void
setBookName
(
String
bookName
)
{
this
.
bookName
=
bookName
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
String
getGroupQrcodeName
()
{
return
groupQrcodeName
;
}
public
void
setGroupQrcodeName
(
String
groupQrcodeName
)
{
this
.
groupQrcodeName
=
groupQrcodeName
;
}
public
Long
getClassifyId
()
{
return
classifyId
;
}
public
void
setClassifyId
(
Long
classifyId
)
{
this
.
classifyId
=
classifyId
;
}
public
String
getClassify
()
{
return
classify
;
}
public
void
setClassify
(
String
classify
)
{
this
.
classify
=
classify
;
}
@Override
public
String
toString
()
{
return
"PlanClassifyDTO{"
+
"pushPlanId="
+
pushPlanId
+
", bookId="
+
bookId
+
", bookName='"
+
bookName
+
'\''
+
", bookGroupId="
+
bookGroupId
+
", groupQrcodeName='"
+
groupQrcodeName
+
'\''
+
", classifyId="
+
classifyId
+
", classify='"
+
classify
+
'\''
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/PushDTO.java
View file @
f0f0b645
...
@@ -22,7 +22,7 @@ public class PushDTO implements Serializable {
...
@@ -22,7 +22,7 @@ public class PushDTO implements Serializable {
@ApiModelProperty
(
"主键"
)
@ApiModelProperty
(
"主键"
)
private
Long
id
;
private
Long
id
;
@ApiModelProperty
(
"发送类型(1:立即发送 2:单次发送 3:每天发送)"
)
@ApiModelProperty
(
"发送类型(1:立即发送 2:单次发送 3:每天发送
4:每周发送
)"
)
private
Integer
pushType
;
private
Integer
pushType
;
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/PushPlanDTO.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/10 12:57
**/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
PushPlanDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3956311764049212139L
;
@ApiModelProperty
(
"计划id"
)
private
Long
pushPlanId
;
@ApiModelProperty
(
"分类id"
)
private
List
<
Long
>
classifyIds
;
@ApiModelProperty
(
"是否删除"
)
private
Boolean
isDelete
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"修改人"
)
private
Long
updateUser
;
private
List
<
PushPlanItemDTO
>
pushPlanItemDTOList
;
private
List
<
PlanClassifyDTO
>
planClassifyDTOList
;
public
Long
getPushPlanId
()
{
return
pushPlanId
;
}
public
void
setPushPlanId
(
Long
pushPlanId
)
{
this
.
pushPlanId
=
pushPlanId
;
}
public
List
<
Long
>
getClassifyIds
()
{
return
classifyIds
;
}
public
void
setClassifyIds
(
List
<
Long
>
classifyIds
)
{
this
.
classifyIds
=
classifyIds
;
}
public
Boolean
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
Boolean
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
public
List
<
PushPlanItemDTO
>
getPushPlanItemDTOList
()
{
return
pushPlanItemDTOList
;
}
public
void
setPushPlanItemDTOList
(
List
<
PushPlanItemDTO
>
pushPlanItemDTOList
)
{
this
.
pushPlanItemDTOList
=
pushPlanItemDTOList
;
}
public
List
<
PlanClassifyDTO
>
getPlanClassifyDTOList
()
{
return
planClassifyDTOList
;
}
public
void
setPlanClassifyDTOList
(
List
<
PlanClassifyDTO
>
planClassifyDTOList
)
{
this
.
planClassifyDTOList
=
planClassifyDTOList
;
}
@Override
public
String
toString
()
{
return
"PushPlanDTO{"
+
"pushPlanId="
+
pushPlanId
+
", classifyIds="
+
classifyIds
+
", isDelete="
+
isDelete
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", createUser="
+
createUser
+
", updateUser="
+
updateUser
+
", pushPlanItemDTOList="
+
pushPlanItemDTOList
+
", planClassifyDTOList="
+
planClassifyDTOList
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/PushPlanItemDTO.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.pcloud.book.push.entity.PushItem
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/6 17:47
**/
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
PushPlanItemDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3956311764049212139L
;
@ApiModelProperty
(
"群发id"
)
private
Long
pushId
;
@ApiModelProperty
(
"发送类型(1:立即发送 2:单次发送 3:每天发送 4:每周发送)"
)
private
Integer
pushType
;
@ApiModelProperty
(
"发送时间"
)
private
String
pushTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"开始时间"
)
private
Date
startTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"结束时间"
)
private
Date
endTime
;
@ApiModelProperty
(
"周几"
)
private
Integer
weekDay
;
@ApiModelProperty
(
"消息推送项模型集合"
)
private
List
<
PushItem
>
pushItems
;
public
Long
getPushId
()
{
return
pushId
;
}
public
void
setPushId
(
Long
pushId
)
{
this
.
pushId
=
pushId
;
}
public
Integer
getPushType
()
{
return
pushType
;
}
public
void
setPushType
(
Integer
pushType
)
{
this
.
pushType
=
pushType
;
}
public
String
getPushTime
()
{
return
pushTime
;
}
public
void
setPushTime
(
String
pushTime
)
{
this
.
pushTime
=
pushTime
;
}
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
Integer
getWeekDay
()
{
return
weekDay
;
}
public
void
setWeekDay
(
Integer
weekDay
)
{
this
.
weekDay
=
weekDay
;
}
public
List
<
PushItem
>
getPushItems
()
{
return
pushItems
;
}
public
void
setPushItems
(
List
<
PushItem
>
pushItems
)
{
this
.
pushItems
=
pushItems
;
}
@Override
public
String
toString
()
{
return
"PushPlanItemDTO{"
+
"pushId="
+
pushId
+
", pushType="
+
pushType
+
", pushTime='"
+
pushTime
+
'\''
+
", startTime="
+
startTime
+
", endTime="
+
endTime
+
", weekDay="
+
weekDay
+
", pushItems="
+
pushItems
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/Push.java
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
entity
;
package
com
.
pcloud
.
book
.
push
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -14,12 +16,26 @@ import java.util.List;
...
@@ -14,12 +16,26 @@ import java.util.List;
@ApiModel
(
"消息推送模型"
)
@ApiModel
(
"消息推送模型"
)
public
class
Push
extends
BaseEntity
{
public
class
Push
extends
BaseEntity
{
@ApiModelProperty
(
"发送类型(1:立即发送 2:单次发送 3:每天发送)"
)
@ApiModelProperty
(
"发送类型(1:立即发送 2:单次发送 3:每天发送
4:每周发送
)"
)
private
Integer
pushType
;
private
Integer
pushType
;
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
private
String
pushTime
;
private
String
pushTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"开始时间"
)
private
Date
startTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"结束时间"
)
private
Date
endTime
;
@ApiModelProperty
(
"周几"
)
private
Integer
weekDay
;
@ApiModelProperty
(
"计划id"
)
private
Long
pushPlanId
;
@ApiModelProperty
(
"是否删除"
)
@ApiModelProperty
(
"是否删除"
)
private
Boolean
isDelete
;
private
Boolean
isDelete
;
...
@@ -51,6 +67,38 @@ public class Push extends BaseEntity {
...
@@ -51,6 +67,38 @@ public class Push extends BaseEntity {
this
.
pushTime
=
pushTime
;
this
.
pushTime
=
pushTime
;
}
}
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
Integer
getWeekDay
()
{
return
weekDay
;
}
public
void
setWeekDay
(
Integer
weekDay
)
{
this
.
weekDay
=
weekDay
;
}
public
Long
getPushPlanId
()
{
return
pushPlanId
;
}
public
void
setPushPlanId
(
Long
pushPlanId
)
{
this
.
pushPlanId
=
pushPlanId
;
}
public
Boolean
getIsDelete
()
{
public
Boolean
getIsDelete
()
{
return
isDelete
;
return
isDelete
;
}
}
...
@@ -96,6 +144,10 @@ public class Push extends BaseEntity {
...
@@ -96,6 +144,10 @@ public class Push extends BaseEntity {
return
"Push{"
+
return
"Push{"
+
"pushType="
+
pushType
+
"pushType="
+
pushType
+
", pushTime='"
+
pushTime
+
'\''
+
", pushTime='"
+
pushTime
+
'\''
+
", startTime="
+
startTime
+
", endTime="
+
endTime
+
", weekDay="
+
weekDay
+
", pushPlanId="
+
pushPlanId
+
", isDelete="
+
isDelete
+
", isDelete="
+
isDelete
+
", createUser="
+
createUser
+
", createUser="
+
createUser
+
", updateUser="
+
updateUser
+
", updateUser="
+
updateUser
+
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/PushPlan.java
0 → 100644
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/6/10 12:05
**/
@ApiModel
(
"计划模型"
)
public
class
PushPlan
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
8201420643667140625L
;
@ApiModelProperty
(
"是否删除"
)
private
Boolean
isDelete
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"修改人"
)
private
Long
updateUser
;
public
Boolean
getIsDelete
()
{
return
isDelete
;
}
public
void
setIsDelete
(
Boolean
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
@Override
public
String
toString
()
{
return
"PushPlan{"
+
"isDelete="
+
isDelete
+
", createUser="
+
createUser
+
", updateUser="
+
updateUser
+
"} "
+
super
.
toString
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/enums/PushTypeEnum.java
View file @
f0f0b645
...
@@ -18,7 +18,11 @@ public enum PushTypeEnum {
...
@@ -18,7 +18,11 @@ public enum PushTypeEnum {
/**
/**
* 每天发送
* 每天发送
*/
*/
DAY
(
3
);
DAY
(
3
),
/**
* 每周
*/
WEEK
(
4
);
public
final
Integer
value
;
public
final
Integer
value
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/facade/PushFacade.java
View file @
f0f0b645
package
com
.
pcloud
.
book
.
push
.
facade
;
package
com
.
pcloud
.
book
.
push
.
facade
;
import
com.pcloud.book.push.dto.PushPlanDTO
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushItem
;
import
com.pcloud.book.push.entity.PushItem
;
...
@@ -115,4 +116,51 @@ public interface PushFacade {
...
@@ -115,4 +116,51 @@ public interface PushFacade {
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"新增计划式群发"
)
@PostMapping
(
"/createPushPlan"
)
ResponseDto
<?>
createPushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"群发模型"
)
PushPlanDTO
pushPlanDTO
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"修改计划式群发"
)
@PostMapping
(
"/updatePushPlan"
)
ResponseDto
<?>
updatePushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"群发计划模型"
)
PushPlanDTO
pushPlanDTO
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"根据id获取计划式群发"
)
@GetMapping
(
"/getPushPlan"
)
ResponseDto
<?>
getPushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"pushPlanId"
)
Long
pushPlanId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"删除计划式群发"
)
@GetMapping
(
"/deletePushPlan"
)
ResponseDto
<?>
deletePushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"pushPlanId"
)
Long
pushPlanId
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取计划列表"
)
@GetMapping
(
"/getPushPlanList"
)
ResponseDto
<?>
getPushPlanList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
@ApiParam
(
"社群码名称、书名、分类名"
)
String
keyword
,
@RequestParam
(
value
=
"day"
,
required
=
false
)
@ApiParam
(
"日期"
)
String
day
,
@RequestParam
(
value
=
"weekDay"
,
required
=
false
)
@ApiParam
(
"周几"
)
Integer
weekDay
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
"获取计划日历"
)
@GetMapping
(
"/getPushPlanCalendar"
)
ResponseDto
<?>
getPushPlanCalendar
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
)
throws
BizException
,
PermissionException
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/facade/impl/PushFacadeImpl.java
View file @
f0f0b645
...
@@ -2,6 +2,7 @@ package com.pcloud.book.push.facade.impl;
...
@@ -2,6 +2,7 @@ package com.pcloud.book.push.facade.impl;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.push.biz.PushBiz
;
import
com.pcloud.book.push.biz.PushBiz
;
import
com.pcloud.book.push.dto.PushPlanDTO
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.Push
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushItem
;
import
com.pcloud.book.push.entity.PushItem
;
...
@@ -9,6 +10,7 @@ import com.pcloud.book.push.facade.PushFacade;
...
@@ -9,6 +10,7 @@ import com.pcloud.book.push.facade.PushFacade;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -221,4 +223,106 @@ public class PushFacadeImpl implements PushFacade {
...
@@ -221,4 +223,106 @@ public class PushFacadeImpl implements PushFacade {
return
new
ResponseDto
<>(
pushBiz
.
getPushRecordList
(
partyId
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
pushBiz
.
getPushRecordList
(
partyId
,
currentPage
,
numPerPage
));
}
}
@ApiOperation
(
"新增计划式群发"
)
@PostMapping
(
"/createPushPlan"
)
@Override
public
ResponseDto
<?>
createPushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"群发模型"
)
PushPlanDTO
pushPlanDTO
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
pushPlanDTO
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
if
(
ListUtils
.
isEmpty
(
pushPlanDTO
.
getClassifyIds
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
if
(
ListUtils
.
isEmpty
(
pushPlanDTO
.
getPushPlanItemDTOList
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
pushPlanDTO
.
setCreateUser
(
partyId
);
pushPlanDTO
.
setUpdateUser
(
partyId
);
pushBiz
.
createPushPlan
(
pushPlanDTO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"修改计划式群发"
)
@PostMapping
(
"/updatePushPlan"
)
@Override
public
ResponseDto
<?>
updatePushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"群发计划模型"
)
PushPlanDTO
pushPlanDTO
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
pushPlanDTO
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
if
(
ListUtils
.
isEmpty
(
pushPlanDTO
.
getClassifyIds
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
if
(
pushPlanDTO
.
getPushPlanId
()==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
if
(
ListUtils
.
isEmpty
(
pushPlanDTO
.
getPushPlanItemDTOList
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
pushPlanDTO
.
setUpdateUser
(
partyId
);
pushBiz
.
updatePushPlan
(
pushPlanDTO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"根据id获取计划式群发"
)
@GetMapping
(
"/getPushPlan"
)
@Override
public
ResponseDto
<?>
getPushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"pushPlanId"
)
Long
pushPlanId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
pushPlanId
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
return
new
ResponseDto
<>(
pushBiz
.
getPushPlan
(
pushPlanId
));
}
@ApiOperation
(
"删除计划式群发"
)
@GetMapping
(
"/deletePushPlan"
)
@Override
public
ResponseDto
<?>
deletePushPlan
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"pushPlanId"
)
Long
pushPlanId
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
if
(
pushPlanId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
pushBiz
.
deletePushPlan
(
pushPlanId
,
partyId
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"获取计划列表"
)
@GetMapping
(
"/getPushPlanList"
)
@Override
public
ResponseDto
<?>
getPushPlanList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
@ApiParam
(
"社群码名称、书名、分类名"
)
String
keyword
,
@RequestParam
(
value
=
"day"
,
required
=
false
)
@ApiParam
(
"日期"
)
String
day
,
@RequestParam
(
value
=
"weekDay"
,
required
=
false
)
@ApiParam
(
"周几"
)
Integer
weekDay
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pushBiz
.
getPushPlanList
(
keyword
,
day
,
weekDay
,
currentPage
,
numPerPage
,
partyId
));
}
@ApiOperation
(
"获取计划日历"
)
@GetMapping
(
"/getPushPlanCalendar"
)
@Override
public
ResponseDto
<?>
getPushPlanCalendar
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
)
throws
BizException
,
PermissionException
{
Long
partyId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pushBiz
.
getPushPlanCalendar
(
partyId
));
}
}
}
pcloud-service-book/src/main/resources/mapper/group/BookGroupClassify.Mapper.xml
View file @
f0f0b645
...
@@ -357,30 +357,27 @@
...
@@ -357,30 +357,27 @@
WHERE user_number
<![CDATA[ < ]]>
#{changeNumber} AND classify_id = #{classifyId} AND use_state = 1 AND is_delete = 0 limit 1
WHERE user_number
<![CDATA[ < ]]>
#{changeNumber} AND classify_id = #{classifyId} AND use_state = 1 AND is_delete = 0 limit 1
</select>
</select>
<select
id=
"listGroup
QrcodeByAdviser"
resultType=
"GroupQrcode
VO"
parameterType=
"map"
>
<select
id=
"listGroup
ClassifyByAdviser"
resultType=
"com.pcloud.book.group.vo.BookGroupClassify
VO"
parameterType=
"map"
>
SELECT
SELECT
g.id groupQrcodeId,
g.group_name groupName,
c.id classifyId,
c.id classifyId,
c.book_id bookId,
c.book_id bookId,
b.BOOK_NAME bookName,
b.BOOK_NAME bookName,
c.classify,
c.classify,
c.book_group_id bookGroupId,
c.book_group_id bookGroupId,
bg.group_qrcode_name groupQrcodeName
bg.group_qrcode_name groupQrcodeName,
FROM
sum(IFNULL(g.user_number,0)) userNumber,
book_group_classify c
bg.pro_label_id proLabelId,
JOIN
bg.dep_label_id depLabelId,
book_group_qrcode g ON c.id = g.classify_id
bg.pur_label_id purLabelId
FROM book_group_classify c
INNER JOIN book_group_qrcode g ON c.id = g.classify_id
LEFT JOIN BOOK_GROUP bg on bg.id = c.book_group_id
LEFT JOIN BOOK_GROUP bg on bg.id = c.book_group_id
LEFT JOIN book b ON c.book_id = b.book_id
LEFT JOIN book b ON c.book_id = b.book_id
WHERE
WHERE c.is_delete = 0
c.is_delete = 0
AND g.is_delete = 0
AND
g.is_delete = 0
AND bg.is_delete = 0
AND bg.is_delete = 0
AND b.is_delete = 0
AND b.is_delete = 0
AND
AND c.create_user = #{adviserId}
c.create_user = #{adviserId}
<if
test=
"bookIds != null"
>
<if
test=
"bookIds != null"
>
AND c.book_id IN
AND c.book_id IN
<foreach
collection =
"bookIds"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
<foreach
collection =
"bookIds"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
...
@@ -390,9 +387,19 @@
...
@@ -390,9 +387,19 @@
<if
test=
"name != null"
>
<if
test=
"name != null"
>
AND (
AND (
book_name LIKE CONCAT('%', #{name},'%')
book_name LIKE CONCAT('%', #{name},'%')
OR
group_name
LIKE CONCAT('%', #{name},'%')
OR
c.classify
LIKE CONCAT('%', #{name},'%')
)
)
</if>
</if>
<if
test=
"proLabelId!=null"
>
and bg.pro_label_id=#{proLabelId}
</if>
<if
test=
"depLabelId!=null"
>
and bg.dep_label_id=#{depLabelId}
</if>
<if
test=
"purLabelId!=null"
>
and bg.pur_label_id=#{purLabelId}
</if>
group by c.id
order by c.id desc, g.id desc
order by c.id desc, g.id desc
</select>
</select>
...
...
pcloud-service-book/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
View file @
f0f0b645
...
@@ -298,6 +298,12 @@
...
@@ -298,6 +298,12 @@
${item}
${item}
</foreach>
</foreach>
</select>
</select>
<!--根据群分类查询id集合-->
<select
id=
"getIdsByClassifyId"
parameterType=
"Long"
resultType=
"Long"
>
select id from book_group_qrcode where classify_id=#{classifyId}
</select>
<!--修改群名称-->
<!--修改群名称-->
<update
id=
"updateGroupName"
parameterType=
"map"
>
<update
id=
"updateGroupName"
parameterType=
"map"
>
update book_group_qrcode
update book_group_qrcode
...
...
pcloud-service-book/src/main/resources/mapper/keywords/Keyword.Mapper.xml
View file @
f0f0b645
...
@@ -69,6 +69,26 @@
...
@@ -69,6 +69,26 @@
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
<select
id=
"getById"
parameterType=
"Long"
resultType=
"com.pcloud.book.keywords.entity.Keyword"
>
select
id ,
guide guide,
keywords keywords,
matching_rule matchingRule,
reply_type replyType,
content content,
description description,
link_url linkUrl,
pic_url picUrl,
serve_id serveId,
serve_type serveType,
create_user createUser,
create_time createTime
from keyword
where is_delete=0
and id=#{id}
</select>
<update
id=
"updateServeInfo"
parameterType=
"map"
>
<update
id=
"updateServeInfo"
parameterType=
"map"
>
update
update
keyword
keyword
...
...
pcloud-service-book/src/main/resources/mapper/push/PushGroupMapper.xml
View file @
f0f0b645
...
@@ -190,4 +190,41 @@
...
@@ -190,4 +190,41 @@
t1.is_delete = 0
t1.is_delete = 0
AND t1.push_id = #{pushId}
AND t1.push_id = #{pushId}
</select>
</select>
<!--根据群发计划id集合获取群发计划关联-->
<select
id=
"getPlanClassifyListByPlanIds"
parameterType=
"map"
resultType=
"com.pcloud.book.push.dto.PlanClassifyDTO"
>
SELECT
t.classify_id classifyId, t2.classify, t2.book_group_id bookGroupId, t.book_id bookId, t1.push_plan_id pushPlanId
FROM
push_group t
LEFT JOIN push t1 ON t.push_id = t1.id
LEFT JOIN book_group_classify t2 ON t.classify_id = t2.id
where t.is_delete=0
and t1.is_delete=0
and t1.push_plan_id in
<foreach
collection=
"pushPlanIds"
index=
"index"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
GROUP BY t.classify_id,t1.push_plan_id
</select>
<!--根据分类id查询-->
<select
id=
"getListByClassifyId"
parameterType=
"Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from push_group t
where t.classify_id=#{classifyId}
</select>
<!--根据群发计划id获取群发计划关联-->
<select
id=
"getPlanClassifyListByPlanId"
parameterType=
"Long"
resultType=
"com.pcloud.book.push.dto.PlanClassifyDTO"
>
SELECT
t.classify_id classifyId, t2.classify, t2.book_group_id bookGroupId, t.book_id bookId, t1.push_plan_id pushPlanId
FROM
push_group t
LEFT JOIN push t1 ON t.push_id = t1.id
LEFT JOIN book_group_classify t2 ON t.classify_id = t2.id
where t.is_delete=0
and t1.is_delete=0
and t1.push_plan_id = #{pushPlanId}
GROUP BY t.classify_id
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/push/PushMapper.xml
View file @
f0f0b645
...
@@ -5,6 +5,10 @@
...
@@ -5,6 +5,10 @@
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"push_type"
property=
"pushType"
jdbcType=
"INTEGER"
/>
<result
column=
"push_type"
property=
"pushType"
jdbcType=
"INTEGER"
/>
<result
column=
"push_time"
property=
"pushTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_time"
property=
"pushTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"end_time"
property=
"endTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"week_day"
property=
"weekDay"
jdbcType=
"INTEGER"
/>
<result
column=
"push_plan_id"
property=
"pushPlanId"
jdbcType=
"BIGINT"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BOOLEAN"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BOOLEAN"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
...
@@ -13,7 +17,7 @@
...
@@ -13,7 +17,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, push_type, push_time, is_delete, create_user, create_time, update_user, update_time
id, push_type, push_time,
start_time, end_time, week_day, push_plan_id,
is_delete, create_user, create_time, update_user, update_time
</sql>
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -33,6 +37,10 @@
...
@@ -33,6 +37,10 @@
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
push_type,
push_type,
push_time,
push_time,
start_time,
end_time,
week_day,
push_plan_id,
is_delete,
is_delete,
create_user,
create_user,
create_time,
create_time,
...
@@ -42,6 +50,10 @@
...
@@ -42,6 +50,10 @@
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{pushType,jdbcType=INTEGER},
#{pushType,jdbcType=INTEGER},
#{pushTime,jdbcType=VARCHAR},
#{pushTime,jdbcType=VARCHAR},
#{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP},
#{weekDay,jdbcType=INTEGER},
#{pushPlanId,jdbcType=BIGINT},
0,
0,
#{createUser,jdbcType=BIGINT},
#{createUser,jdbcType=BIGINT},
NOW(),
NOW(),
...
@@ -59,6 +71,18 @@
...
@@ -59,6 +71,18 @@
<if
test=
"pushTime != null"
>
<if
test=
"pushTime != null"
>
push_time = #{pushTime,jdbcType=VARCHAR},
push_time = #{pushTime,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"startTime != null"
>
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"endTime != null"
>
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"weekDay != null"
>
week_day = #{weekDay,jdbcType=INTEGER},
</if>
<if
test=
"pushPlanId != null"
>
push_plan_id = #{pushPlanId,jdbcType=BIGINT},
</if>
<if
test=
"isDelete != null"
>
<if
test=
"isDelete != null"
>
is_delete = #{isDelete,jdbcType=BOOLEAN},
is_delete = #{isDelete,jdbcType=BOOLEAN},
</if>
</if>
...
@@ -119,4 +143,39 @@
...
@@ -119,4 +143,39 @@
update_time=now()
update_time=now()
where id = #{id} and is_delete = 0
where id = #{id} and is_delete = 0
</update>
</update>
<!--根据计划id查询-->
<select
id=
"getByPushPlanId"
parameterType=
"Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from push
where is_delete=0 and push_plan_id=#{pushPlanId}
</select>
<!--根据计划id集合查询-->
<select
id=
"getByPushPlanIds"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from push
where is_delete=0 and push_plan_id in
<foreach
collection=
"pushPlanIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</select>
<!--根据创建人获取计划式群发-->
<select
id=
"getPlanPushListPartyId"
parameterType=
"Long"
resultMap=
"BaseResultMap"
>
select
t1.id,
t1.push_type,
t1.push_time,
t1.start_time,
t1.end_time,
t1.week_day,
t1.push_plan_id,
t1.is_delete,
t1.create_user,
t1.create_time,
t1.update_user,
t1.update_time
from push t1
inner join push_plan t2 on t1.push_plan_id=t2.id
where t2.create_user=#{partyId}
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/push/PushPlanMapper.xml
0 → 100644
View file @
f0f0b645
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.push.dao.impl.PushPlanDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.push.entity.PushPlan"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"BOOLEAN"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_user"
property=
"updateUser"
jdbcType=
"BIGINT"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, is_delete, create_user, create_time, update_user, update_time
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
select
<include
refid=
"Base_Column_List"
/>
from push_plan
where is_delete=0 and id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteById"
parameterType=
"java.lang.Long"
>
update push_plan set is_delete = 1
where id = #{id,jdbcType=BIGINT} and is_delete = 0
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.PushPlan"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into push_plan
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
is_delete,
create_user,
create_time,
update_user,
update_time,
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
0,
#{createUser,jdbcType=BIGINT},
NOW(),
#{updateUser,jdbcType=BIGINT},
NOW(),
</trim>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.push.entity.PushPlan"
>
update push_plan
<set>
<if
test=
"isDelete != null"
>
is_delete = #{isDelete,jdbcType=BOOLEAN},
</if>
<if
test=
"updateUser != null"
>
update_user = #{updateUser,jdbcType=BIGINT},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<!--查询计划集合-->
<select
id=
"getPushPlanList"
parameterType=
"map"
resultType=
"com.pcloud.book.push.dto.PushPlanDTO"
>
SELECT
t.id pushPlanId,
t.is_delete isDelete,
t.create_user createUser,
t.create_time createTime,
t.update_user updateUser,
t.update_time updateTime
FROM
push_plan t
LEFT JOIN push t1 ON t.id = t1.push_plan_id
<if
test=
"keyword!=null"
>
LEFT JOIN push_group t2 ON t1.id = t2.push_id
LEFT JOIN book_group_classify t3 ON t2.classify_id = t3.id
LEFT JOIN book_group t4 ON t3.book_group_id = t4.id
LEFT JOIN book t5 ON t3.book_id = t5.BOOK_ID
</if>
WHERE
t.is_delete = 0
AND t.create_user=#{partyId}
AND t1.is_delete = 0
<if
test=
"keyword!=null"
>
AND t2.is_delete = 0
AND t3.is_delete = 0
AND t4.is_delete = 0
AND t5.IS_DELETE = 0
AND (
t5.BOOK_NAME LIKE concat('%', #{keyword}, '%')
OR t4.group_qrcode_name LIKE concat('%', #{keyword}, '%')
OR t3.classify LIKE concat('%', #{keyword}, '%')
)
</if>
<if
test=
"day!=null and weekDay!=null"
>
AND (
t1.push_type = 2 AND DATE_FORMAT(t1.push_time, '%Y-%m-%d') = #{day}
OR
t1.push_type = 3 AND #{day} BETWEEN t1.start_time AND t1.end_time
OR
t1.push_type = 4 AND #{day} BETWEEN t1.start_time AND t1.end_time AND t1.week_day = #{weekDay}
)
</if>
GROUP BY t.id
order by t.create_time desc
</select>
</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