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
a4091391
Commit
a4091391
authored
Jan 30, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人号群发
parent
f7af4ffd
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
601 additions
and
19 deletions
+601
-19
AdviserBookInfoDTO.java
...ain/java/com/pcloud/book/book/dto/AdviserBookInfoDTO.java
+11
-0
SelfRobotBookGroupDTO.java
...java/com/pcloud/book/group/dto/SelfRobotBookGroupDTO.java
+48
-1
PushConstant.java
...main/java/com/pcloud/book/push/constant/PushConstant.java
+4
-0
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+63
-6
PushCheck.java
...k/src/main/java/com/pcloud/book/push/check/PushCheck.java
+7
-0
SelfPushAddParamDTO.java
...in/java/com/pcloud/book/push/dto/SelfPushAddParamDTO.java
+63
-4
SelfPushRecordDTO.java
...main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
+173
-1
SelfPush.java
...k/src/main/java/com/pcloud/book/push/entity/SelfPush.java
+72
-1
SelfPushItem.java
...c/main/java/com/pcloud/book/push/entity/SelfPushItem.java
+149
-1
SelfPushFacade.java
...main/java/com/pcloud/book/push/facade/SelfPushFacade.java
+3
-1
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+2
-1
SelfPushItemMapper.xml
...ook/src/main/resources/mapper/push/SelfPushItemMapper.xml
+1
-0
SelfPushMapper.xml
...ce-book/src/main/resources/mapper/push/SelfPushMapper.xml
+5
-3
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/AdviserBookInfoDTO.java
View file @
a4091391
...
@@ -40,6 +40,8 @@ public class AdviserBookInfoDTO extends BaseDto {
...
@@ -40,6 +40,8 @@ public class AdviserBookInfoDTO extends BaseDto {
*/
*/
private
String
agentName
;
private
String
agentName
;
private
Long
bookGroupId
;
public
Long
getBookId
()
{
public
Long
getBookId
()
{
return
bookId
;
return
bookId
;
}
}
...
@@ -128,6 +130,14 @@ public class AdviserBookInfoDTO extends BaseDto {
...
@@ -128,6 +130,14 @@ public class AdviserBookInfoDTO extends BaseDto {
this
.
agentName
=
agentName
;
this
.
agentName
=
agentName
;
}
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"AdviserBookInfoDTO{"
+
return
"AdviserBookInfoDTO{"
+
...
@@ -142,6 +152,7 @@ public class AdviserBookInfoDTO extends BaseDto {
...
@@ -142,6 +152,7 @@ public class AdviserBookInfoDTO extends BaseDto {
", adviserName='"
+
adviserName
+
'\''
+
", adviserName='"
+
adviserName
+
'\''
+
", agentId="
+
agentId
+
", agentId="
+
agentId
+
", agentName='"
+
agentName
+
'\''
+
", agentName='"
+
agentName
+
'\''
+
", bookGroupId="
+
bookGroupId
+
'}'
;
'}'
;
}
}
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/SelfRobotBookGroupDTO.java
View file @
a4091391
...
@@ -10,7 +10,6 @@ import lombok.Data;
...
@@ -10,7 +10,6 @@ import lombok.Data;
* @创建时间:15:31 2020/1/2
* @创建时间:15:31 2020/1/2
* @版本:1.0
* @版本:1.0
*/
*/
@Data
public
class
SelfRobotBookGroupDTO
extends
BaseDto
{
public
class
SelfRobotBookGroupDTO
extends
BaseDto
{
/**
/**
...
@@ -39,4 +38,52 @@ public class SelfRobotBookGroupDTO extends BaseDto {
...
@@ -39,4 +38,52 @@ public class SelfRobotBookGroupDTO extends BaseDto {
* 编辑id
* 编辑id
*/
*/
private
Long
adviserId
;
private
Long
adviserId
;
public
String
getWxId
()
{
return
wxId
;
}
public
void
setWxId
(
String
wxId
)
{
this
.
wxId
=
wxId
;
}
public
String
getWxNickName
()
{
return
wxNickName
;
}
public
void
setWxNickName
(
String
wxNickName
)
{
this
.
wxNickName
=
wxNickName
;
}
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
getBookId
()
{
return
bookId
;
}
public
void
setBookId
(
Long
bookId
)
{
this
.
bookId
=
bookId
;
}
public
Long
getAdviserId
()
{
return
adviserId
;
}
public
void
setAdviserId
(
Long
adviserId
)
{
this
.
adviserId
=
adviserId
;
}
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/push/constant/PushConstant.java
View file @
a4091391
...
@@ -15,4 +15,8 @@ public class PushConstant {
...
@@ -15,4 +15,8 @@ public class PushConstant {
* 个人号定时群发-定时器方法名
* 个人号定时群发-定时器方法名
*/
*/
public
static
final
String
JOB_NAME_SELF_PUSH
=
"judgeSelfPushTime"
;
public
static
final
String
JOB_NAME_SELF_PUSH
=
"judgeSelfPushTime"
;
public
static
final
Long
[]
pro_demo_book_group_id
=
{
23722L
,
23721L
,
23720L
,
23718L
};
public
static
final
Long
[]
uat_demo_book_group_id
=
{
441L
,
442L
};
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
a4091391
package
com
.
pcloud
.
book
.
push
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
push
.
biz
.
impl
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.dao.BookGroupCipherUserDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.WeixinQrcodeGenerationDao
;
import
com.pcloud.book.group.dao.WeixinQrcodeGenerationDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.SelfRobotBookGroupDTO
;
import
com.pcloud.book.group.entity.WeixinQrcodeGeneration
;
import
com.pcloud.book.group.entity.WeixinQrcodeGeneration
;
import
com.pcloud.book.group.set.GroupSet
;
import
com.pcloud.book.group.set.GroupSet
;
import
com.pcloud.book.group.tools.SendSelfMsgTools
;
import
com.pcloud.book.group.tools.SendSelfMsgTools
;
...
@@ -19,10 +23,12 @@ import com.pcloud.book.push.entity.SelfPushUser;
...
@@ -19,10 +23,12 @@ import com.pcloud.book.push.entity.SelfPushUser;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.PushStatusEnum
;
import
com.pcloud.book.push.enums.PushStatusEnum
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.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.string.StringUtil
;
import
com.pcloud.facade.quartz.entity.CallBackParam
;
import
com.pcloud.facade.quartz.entity.CallBackParam
;
import
com.pcloud.facade.quartz.entity.ScheduleJob
;
import
com.pcloud.facade.quartz.entity.ScheduleJob
;
import
com.pcloud.facade.quartz.service.ScheduleService
;
import
com.pcloud.facade.quartz.service.ScheduleService
;
...
@@ -35,7 +41,9 @@ import com.sdk.wxgroup.SendTextMessageVO;
...
@@ -35,7 +41,9 @@ import com.sdk.wxgroup.SendTextMessageVO;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -71,6 +79,12 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -71,6 +79,12 @@ public class SelfPushBizImpl implements SelfPushBiz {
private
WeixinQrcodeGenerationDao
weixinQrcodeGenerationDao
;
private
WeixinQrcodeGenerationDao
weixinQrcodeGenerationDao
;
@Autowired
@Autowired
private
ScheduleService
scheduleService
;
private
ScheduleService
scheduleService
;
@Autowired
private
BookGroupCipherUserDao
bookGroupCipherUserDao
;
@Value
(
"${system.env}"
)
private
String
envStr
;
@Autowired
private
BookGroupDao
bookGroupDao
;
@Override
@Override
public
void
createSelfPush
(
Long
partyId
,
SelfPushAddParamDTO
addParamDTO
)
{
public
void
createSelfPush
(
Long
partyId
,
SelfPushAddParamDTO
addParamDTO
)
{
...
@@ -79,7 +93,12 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -79,7 +93,12 @@ public class SelfPushBizImpl implements SelfPushBiz {
SelfPush
selfPush
=
new
SelfPush
();
SelfPush
selfPush
=
new
SelfPush
();
selfPush
.
setCreateUser
(
partyId
);
selfPush
.
setCreateUser
(
partyId
);
selfPush
.
setUpdateUser
(
partyId
);
selfPush
.
setUpdateUser
(
partyId
);
if
(
SystemCode
.
adviser
.
code
.
equalsIgnoreCase
(
addParamDTO
.
getSystemCode
())){
selfPush
.
setBookGroupId
(
addParamDTO
.
getBookGroupId
());
}
if
(
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
addParamDTO
.
getSystemCode
())){
selfPush
.
setAltId
(
addParamDTO
.
getAltId
());
selfPush
.
setAltId
(
addParamDTO
.
getAltId
());
}
selfPush
.
setSendNow
(
sendNow
);
selfPush
.
setSendNow
(
sendNow
);
if
(
sendNow
)
{
if
(
sendNow
)
{
selfPush
.
setSendTime
(
new
Date
());
selfPush
.
setSendTime
(
new
Date
());
...
@@ -96,7 +115,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -96,7 +115,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
setSelfPushUser
(
userIdList
,
partyId
,
pushId
);
setSelfPushUser
(
userIdList
,
partyId
,
pushId
);
if
(
sendNow
)
{
if
(
sendNow
)
{
//微信立即发送
//微信立即发送
msgPush
(
userIdList
,
itemList
,
selfPush
.
getAltId
(),
pushId
);
msgPush
(
userIdList
,
itemList
,
pushId
);
}
else
{
}
else
{
//定时任务
//定时任务
addSendQuartzJob
(
pushId
,
addParamDTO
.
getSendTime
());
addSendQuartzJob
(
pushId
,
addParamDTO
.
getSendTime
());
...
@@ -137,9 +156,35 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -137,9 +156,35 @@ public class SelfPushBizImpl implements SelfPushBiz {
/**
/**
* 微信群消息推送
* 微信群消息推送
*/
*/
private
void
msgPush
(
List
<
String
>
userIdList
,
List
<
SelfPushItem
>
itemList
,
String
altId
,
Long
pushId
)
{
private
void
msgPush
(
List
<
String
>
userIdList
,
List
<
SelfPushItem
>
itemList
,
Long
pushId
)
{
SelfPush
selfPush
=
selfPushDao
.
getById
(
pushId
);
if
(!
StringUtil
.
isEmpty
(
selfPush
.
getAltId
())){
//平台端群发
String
altId
=
selfPush
.
getAltId
();
List
<
String
>
sendUserIds
=
new
ArrayList
<>();
sendUserIds
.
addAll
(
userIdList
);
ThreadPoolUtils
.
SEND_MESSAGE_THREAD_POOL
.
execute
(()
->
{
ThreadPoolUtils
.
SEND_MESSAGE_THREAD_POOL
.
execute
(()
->
{
for
(
String
userId
:
userIdList
)
{
for
(
String
userId
:
sendUserIds
)
{
for
(
SelfPushItem
pushItem
:
itemList
)
{
sendSelfMsg
(
userId
,
altId
,
pushItem
);
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
});
}
else
if
(
null
!=
selfPush
.
getBookGroupId
()){
//编辑端群发
Long
bookGroupId
=
selfPush
.
getBookGroupId
();
if
(
"pro"
.
equals
(
envStr
)
&&
ArrayUtils
.
contains
(
PushConstant
.
pro_demo_book_group_id
,
bookGroupId
))
{
//生产环境特定社群书,发给所有好友
userIdList
=
bookGroupCipherUserDao
.
getFriendIdsByBookGroupId
(
bookGroupId
);
}
else
if
(
"uat"
.
equalsIgnoreCase
(
envStr
)
&&
ArrayUtils
.
contains
(
PushConstant
.
uat_demo_book_group_id
,
bookGroupId
)){
userIdList
=
bookGroupCipherUserDao
.
getFriendIdsByBookGroupId
(
bookGroupId
);
}
List
<
String
>
sendUserIds
=
new
ArrayList
<>();
sendUserIds
.
addAll
(
userIdList
);
ThreadPoolUtils
.
SEND_MESSAGE_THREAD_POOL
.
execute
(()
->
{
for
(
String
userId
:
sendUserIds
)
{
//查好友对应的小号
SelfRobotBookGroupDTO
bookGroupDTO
=
bookGroupCipherUserDao
.
getSelfRobotBookGroupInfoByUser
(
userId
,
bookGroupId
);
String
altId
=
bookGroupDTO
.
getWxId
();
for
(
SelfPushItem
pushItem
:
itemList
)
{
for
(
SelfPushItem
pushItem
:
itemList
)
{
sendSelfMsg
(
userId
,
altId
,
pushItem
);
sendSelfMsg
(
userId
,
altId
,
pushItem
);
}
}
...
@@ -148,6 +193,8 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -148,6 +193,8 @@ public class SelfPushBizImpl implements SelfPushBiz {
});
});
}
}
}
/**
/**
* 群发项设置
* 群发项设置
*/
*/
...
@@ -191,6 +238,9 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -191,6 +238,9 @@ public class SelfPushBizImpl implements SelfPushBiz {
* @param selfPushItem
* @param selfPushItem
*/
*/
public
void
sendSelfMsg
(
String
userWxId
,
String
altId
,
SelfPushItem
selfPushItem
)
{
public
void
sendSelfMsg
(
String
userWxId
,
String
altId
,
SelfPushItem
selfPushItem
)
{
if
(
StringUtil
.
isEmpty
(
userWxId
)
||
StringUtil
.
isEmpty
(
altId
)){
return
;
}
Integer
code
=
SendMessageTypeEnum
.
SELF
.
getCode
();
Integer
code
=
SendMessageTypeEnum
.
SELF
.
getCode
();
Integer
itemType
=
selfPushItem
.
getItemType
();
Integer
itemType
=
selfPushItem
.
getItemType
();
if
(
ItemTypeEnum
.
TEXT
.
value
.
equals
(
itemType
))
{
if
(
ItemTypeEnum
.
TEXT
.
value
.
equals
(
itemType
))
{
...
@@ -274,14 +324,21 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -274,14 +324,21 @@ public class SelfPushBizImpl implements SelfPushBiz {
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
}
List
<
String
>
wxIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->
s
!=
null
).
map
(
SelfPushRecordDTO:
:
getAltId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
wxIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->
s
!=
null
).
map
(
SelfPushRecordDTO:
:
getAltId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
GroupUserDTO
>
robotMap
=
wechatGroupConsr
.
mapRobotInfoByIdList
(
wxIds
);
Map
<
String
,
GroupUserDTO
>
robotMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
wxIds
)){
robotMap
=
wechatGroupConsr
.
mapRobotInfoByIdList
(
wxIds
);
}
for
(
SelfPushRecordDTO
dto
:
pageBeanNew
.
getRecordList
())
{
for
(
SelfPushRecordDTO
dto
:
pageBeanNew
.
getRecordList
())
{
Integer
userCount
=
selfPushUserDao
.
getCountByPushId
(
dto
.
getPushId
());
Integer
userCount
=
selfPushUserDao
.
getCountByPushId
(
dto
.
getPushId
());
dto
.
setUserCount
(
userCount
);
dto
.
setUserCount
(
userCount
);
if
(!
MapUtils
.
isEmpty
(
robotMap
)
&&
robotMap
.
containsKey
(
dto
.
getAltId
()))
{
if
(!
MapUtils
.
isEmpty
(
robotMap
)
&&
!
StringUtil
.
isEmpty
(
dto
.
getAltId
())
&&
robotMap
.
containsKey
(
dto
.
getAltId
()))
{
GroupUserDTO
userDTO
=
robotMap
.
get
(
dto
.
getAltId
());
GroupUserDTO
userDTO
=
robotMap
.
get
(
dto
.
getAltId
());
dto
.
setRobotName
(
userDTO
.
getNickName
());
dto
.
setRobotName
(
userDTO
.
getNickName
());
}
}
if
(
null
!=
dto
.
getBookGroupId
()){
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getBookBaseInfoById
(
dto
.
getBookGroupId
());
dto
.
setBookName
(
bookGroupDTO
.
getBookName
());
}
}
}
return
pageBeanNew
;
return
pageBeanNew
;
}
}
...
@@ -298,6 +355,6 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -298,6 +355,6 @@ public class SelfPushBizImpl implements SelfPushBiz {
return
;
return
;
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
PUSHING
.
value
,
pushId
);
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
PUSHING
.
value
,
pushId
);
msgPush
(
userIdList
,
itemList
,
selfPush
.
getAltId
(),
pushId
);
msgPush
(
userIdList
,
itemList
,
pushId
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/check/PushCheck.java
View file @
a4091391
...
@@ -10,6 +10,7 @@ import com.pcloud.book.push.entity.SelfPushItem;
...
@@ -10,6 +10,7 @@ import com.pcloud.book.push.entity.SelfPushItem;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.PushTypeEnum
;
import
com.pcloud.book.push.enums.PushTypeEnum
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.SystemCode
;
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.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
...
@@ -289,6 +290,12 @@ public class PushCheck {
...
@@ -289,6 +290,12 @@ public class PushCheck {
if
(
null
==
addParamDTO
)
{
if
(
null
==
addParamDTO
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空"
);
}
}
if
(
SystemCode
.
adviser
.
code
.
equalsIgnoreCase
(
addParamDTO
.
getSystemCode
())
&&
null
==
addParamDTO
.
getBookGroupId
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少bookGroupId"
);
}
if
(
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
addParamDTO
.
getSystemCode
())
&&
StringUtil
.
isEmpty
(
addParamDTO
.
getAltId
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少个人号id"
);
}
if
(
null
==
addParamDTO
.
getSendNow
())
{
if
(
null
==
addParamDTO
.
getSendNow
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少立即发送字段"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少立即发送字段"
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushAddParamDTO.java
View file @
a4091391
...
@@ -13,23 +13,22 @@ import lombok.Data;
...
@@ -13,23 +13,22 @@ import lombok.Data;
* @创建时间:9:49 2019/11/27
* @创建时间:9:49 2019/11/27
* @版本:1.0
* @版本:1.0
*/
*/
@Data
public
class
SelfPushAddParamDTO
{
public
class
SelfPushAddParamDTO
{
/**
/**
* 推送小号id
* 推送小号id
*/
*/
p
ublic
String
altId
;
p
rivate
String
altId
;
/**
/**
* 推送用户id
* 推送用户id
*/
*/
p
ublic
List
<
String
>
userIdList
;
p
rivate
List
<
String
>
userIdList
;
/**
/**
* 推送信息
* 推送信息
*/
*/
p
ublic
List
<
SelfPushItem
>
pushItemList
;
p
rivate
List
<
SelfPushItem
>
pushItemList
;
/**
/**
* 立即发送
* 立即发送
*/
*/
...
@@ -38,4 +37,64 @@ public class SelfPushAddParamDTO {
...
@@ -38,4 +37,64 @@ public class SelfPushAddParamDTO {
* 发送时间
* 发送时间
*/
*/
private
String
sendTime
;
private
String
sendTime
;
private
String
systemCode
;
private
Long
bookGroupId
;
public
String
getAltId
()
{
return
altId
;
}
public
void
setAltId
(
String
altId
)
{
this
.
altId
=
altId
;
}
public
List
<
String
>
getUserIdList
()
{
return
userIdList
;
}
public
void
setUserIdList
(
List
<
String
>
userIdList
)
{
this
.
userIdList
=
userIdList
;
}
public
List
<
SelfPushItem
>
getPushItemList
()
{
return
pushItemList
;
}
public
void
setPushItemList
(
List
<
SelfPushItem
>
pushItemList
)
{
this
.
pushItemList
=
pushItemList
;
}
public
Boolean
getSendNow
()
{
return
sendNow
;
}
public
void
setSendNow
(
Boolean
sendNow
)
{
this
.
sendNow
=
sendNow
;
}
public
String
getSendTime
()
{
return
sendTime
;
}
public
void
setSendTime
(
String
sendTime
)
{
this
.
sendTime
=
sendTime
;
}
public
String
getSystemCode
()
{
return
systemCode
;
}
public
void
setSystemCode
(
String
systemCode
)
{
this
.
systemCode
=
systemCode
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
View file @
a4091391
...
@@ -14,7 +14,6 @@ import lombok.Data;
...
@@ -14,7 +14,6 @@ import lombok.Data;
* @创建时间:16:50 2019/11/27
* @创建时间:16:50 2019/11/27
* @版本:1.0
* @版本:1.0
*/
*/
@Data
public
class
SelfPushRecordDTO
extends
BaseDto
{
public
class
SelfPushRecordDTO
extends
BaseDto
{
@ApiModelProperty
(
"群发小号id"
)
@ApiModelProperty
(
"群发小号id"
)
...
@@ -76,4 +75,177 @@ public class SelfPushRecordDTO extends BaseDto{
...
@@ -76,4 +75,177 @@ public class SelfPushRecordDTO extends BaseDto{
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
private
Date
sendTime
;
private
Date
sendTime
;
@ApiModelProperty
(
"bookGroupId"
)
private
Long
bookGroupId
;
@ApiModelProperty
(
"bookName"
)
private
String
bookName
;
public
String
getAltId
()
{
return
altId
;
}
public
void
setAltId
(
String
altId
)
{
this
.
altId
=
altId
;
}
public
String
getRobotName
()
{
return
robotName
;
}
public
void
setRobotName
(
String
robotName
)
{
this
.
robotName
=
robotName
;
}
public
Long
getPushId
()
{
return
pushId
;
}
public
void
setPushId
(
Long
pushId
)
{
this
.
pushId
=
pushId
;
}
public
Long
getPushItemId
()
{
return
pushItemId
;
}
public
void
setPushItemId
(
Long
pushItemId
)
{
this
.
pushItemId
=
pushItemId
;
}
public
Integer
getItemType
()
{
return
itemType
;
}
public
void
setItemType
(
Integer
itemType
)
{
this
.
itemType
=
itemType
;
}
public
String
getTextContent
()
{
return
textContent
;
}
public
void
setTextContent
(
String
textContent
)
{
this
.
textContent
=
textContent
;
}
public
String
getLinkUrl
()
{
return
linkUrl
;
}
public
void
setLinkUrl
(
String
linkUrl
)
{
this
.
linkUrl
=
linkUrl
;
}
public
String
getLinkTitle
()
{
return
linkTitle
;
}
public
void
setLinkTitle
(
String
linkTitle
)
{
this
.
linkTitle
=
linkTitle
;
}
public
String
getLinkDescription
()
{
return
linkDescription
;
}
public
void
setLinkDescription
(
String
linkDescription
)
{
this
.
linkDescription
=
linkDescription
;
}
public
String
getLinkImageUrl
()
{
return
linkImageUrl
;
}
public
void
setLinkImageUrl
(
String
linkImageUrl
)
{
this
.
linkImageUrl
=
linkImageUrl
;
}
public
String
getImageUrl
()
{
return
imageUrl
;
}
public
void
setImageUrl
(
String
imageUrl
)
{
this
.
imageUrl
=
imageUrl
;
}
public
Long
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Long
appId
)
{
this
.
appId
=
appId
;
}
public
Long
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
String
getAppUrl
()
{
return
appUrl
;
}
public
void
setAppUrl
(
String
appUrl
)
{
this
.
appUrl
=
appUrl
;
}
public
String
getProductUrl
()
{
return
productUrl
;
}
public
void
setProductUrl
(
String
productUrl
)
{
this
.
productUrl
=
productUrl
;
}
public
Integer
getPushStatus
()
{
return
pushStatus
;
}
public
void
setPushStatus
(
Integer
pushStatus
)
{
this
.
pushStatus
=
pushStatus
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getUserCount
()
{
return
userCount
;
}
public
void
setUserCount
(
Integer
userCount
)
{
this
.
userCount
=
userCount
;
}
public
Date
getSendTime
()
{
return
sendTime
;
}
public
void
setSendTime
(
Date
sendTime
)
{
this
.
sendTime
=
sendTime
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
String
getBookName
()
{
return
bookName
;
}
public
void
setBookName
(
String
bookName
)
{
this
.
bookName
=
bookName
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/SelfPush.java
View file @
a4091391
...
@@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
@ApiModel
(
"个人号群发"
)
@ApiModel
(
"个人号群发"
)
@Data
public
class
SelfPush
extends
BaseEntity
{
public
class
SelfPush
extends
BaseEntity
{
@ApiModelProperty
(
"群发小号id"
)
@ApiModelProperty
(
"群发小号id"
)
...
@@ -36,4 +35,75 @@ public class SelfPush extends BaseEntity{
...
@@ -36,4 +35,75 @@ public class SelfPush extends BaseEntity{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
private
Date
sendTime
;
private
Date
sendTime
;
@ApiModelProperty
(
"bookGroupId"
)
private
Long
bookGroupId
;
public
String
getAltId
()
{
return
altId
;
}
public
void
setAltId
(
String
altId
)
{
this
.
altId
=
altId
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
@Override
public
Date
getUpdateTime
()
{
return
updateTime
;
}
@Override
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Boolean
getSendNow
()
{
return
sendNow
;
}
public
void
setSendNow
(
Boolean
sendNow
)
{
this
.
sendNow
=
sendNow
;
}
public
Date
getSendTime
()
{
return
sendTime
;
}
public
void
setSendTime
(
Date
sendTime
)
{
this
.
sendTime
=
sendTime
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/SelfPushItem.java
View file @
a4091391
...
@@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
@ApiModel
(
"个人号群发项"
)
@ApiModel
(
"个人号群发项"
)
@Data
public
class
SelfPushItem
extends
BaseEntity
{
public
class
SelfPushItem
extends
BaseEntity
{
@ApiModelProperty
(
"推送id"
)
@ApiModelProperty
(
"推送id"
)
...
@@ -69,4 +68,152 @@ public class SelfPushItem extends BaseEntity{
...
@@ -69,4 +68,152 @@ public class SelfPushItem extends BaseEntity{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
private
Date
sendTime
;
private
Date
sendTime
;
public
Long
getPushId
()
{
return
pushId
;
}
public
void
setPushId
(
Long
pushId
)
{
this
.
pushId
=
pushId
;
}
public
Integer
getItemType
()
{
return
itemType
;
}
public
void
setItemType
(
Integer
itemType
)
{
this
.
itemType
=
itemType
;
}
public
String
getTextContent
()
{
return
textContent
;
}
public
void
setTextContent
(
String
textContent
)
{
this
.
textContent
=
textContent
;
}
public
String
getLinkUrl
()
{
return
linkUrl
;
}
public
void
setLinkUrl
(
String
linkUrl
)
{
this
.
linkUrl
=
linkUrl
;
}
public
String
getLinkTitle
()
{
return
linkTitle
;
}
public
void
setLinkTitle
(
String
linkTitle
)
{
this
.
linkTitle
=
linkTitle
;
}
public
String
getLinkDescription
()
{
return
linkDescription
;
}
public
void
setLinkDescription
(
String
linkDescription
)
{
this
.
linkDescription
=
linkDescription
;
}
public
String
getLinkImageUrl
()
{
return
linkImageUrl
;
}
public
void
setLinkImageUrl
(
String
linkImageUrl
)
{
this
.
linkImageUrl
=
linkImageUrl
;
}
public
String
getImageUrl
()
{
return
imageUrl
;
}
public
void
setImageUrl
(
String
imageUrl
)
{
this
.
imageUrl
=
imageUrl
;
}
public
Long
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
Long
appId
)
{
this
.
appId
=
appId
;
}
public
Long
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
Long
productId
)
{
this
.
productId
=
productId
;
}
public
String
getAppUrl
()
{
return
appUrl
;
}
public
void
setAppUrl
(
String
appUrl
)
{
this
.
appUrl
=
appUrl
;
}
public
String
getProductUrl
()
{
return
productUrl
;
}
public
void
setProductUrl
(
String
productUrl
)
{
this
.
productUrl
=
productUrl
;
}
public
Integer
getPushStatus
()
{
return
pushStatus
;
}
public
void
setPushStatus
(
Integer
pushStatus
)
{
this
.
pushStatus
=
pushStatus
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
@Override
public
Date
getUpdateTime
()
{
return
updateTime
;
}
@Override
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Date
getSendTime
()
{
return
sendTime
;
}
public
void
setSendTime
(
Date
sendTime
)
{
this
.
sendTime
=
sendTime
;
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/push/facade/SelfPushFacade.java
View file @
a4091391
...
@@ -45,9 +45,11 @@ public class SelfPushFacade {
...
@@ -45,9 +45,11 @@ public class SelfPushFacade {
@ApiOperation
(
"创建个人号群发"
)
@ApiOperation
(
"创建个人号群发"
)
@PostMapping
(
"createSelfPush"
)
@PostMapping
(
"createSelfPush"
)
public
ResponseDto
<?>
createSelfPush
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
SelfPushAddParamDTO
addParamDTO
)
throws
PermissionException
{
public
ResponseDto
<?>
createSelfPush
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
SelfPushAddParamDTO
addParamDTO
)
throws
PermissionException
{
pushCheck
.
selfPushParamCheck
(
addParamDTO
);
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Map
<
String
,
Object
>
map
=
SessionUtil
.
getToken4Redis
(
token
);
Long
partyId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
Long
partyId
=
(
Long
)
map
.
get
(
SessionUtil
.
PARTY_ID
);
String
systemCode
=
(
String
)
map
.
get
(
SessionUtil
.
SYSTEM_CODE
);
addParamDTO
.
setSystemCode
(
systemCode
);
pushCheck
.
selfPushParamCheck
(
addParamDTO
);
if
(
partyId
==
0
){
if
(
partyId
==
0
){
String
isSystem
=
(
String
)
map
.
get
(
SessionUtil
.
IS_SYSTEM
);
String
isSystem
=
(
String
)
map
.
get
(
SessionUtil
.
IS_SYSTEM
);
if
(
"0"
.
equals
(
isSystem
))
{
if
(
"0"
.
equals
(
isSystem
))
{
...
...
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
a4091391
...
@@ -1824,7 +1824,8 @@
...
@@ -1824,7 +1824,8 @@
b.ISBN isbn,
b.ISBN isbn,
b.BOOK_NAME bookName,
b.BOOK_NAME bookName,
a.ADVISER_ID adviserId,
a.ADVISER_ID adviserId,
g.agent_id agentId
g.agent_id agentId,
g.id bookGroupId
FROM
FROM
book_group g
book_group g
LEFT JOIN book_adviser a ON g.book_id = a.BOOK_ID
LEFT JOIN book_adviser a ON g.book_id = a.BOOK_ID
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushItemMapper.xml
View file @
a4091391
...
@@ -96,6 +96,7 @@
...
@@ -96,6 +96,7 @@
<select
id=
"listSelfPushRecord"
parameterType=
"map"
resultType=
"com.pcloud.book.push.dto.SelfPushRecordDTO"
>
<select
id=
"listSelfPushRecord"
parameterType=
"map"
resultType=
"com.pcloud.book.push.dto.SelfPushRecordDTO"
>
SELECT
SELECT
p.alt_id altId,
p.alt_id altId,
p.book_group_id bookGroupId,
p.id pushId,
p.id pushId,
i.id pushItemId,
i.id pushItemId,
i.item_type itemType,
i.item_type itemType,
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushMapper.xml
View file @
a4091391
...
@@ -10,19 +10,21 @@
...
@@ -10,19 +10,21 @@
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"send_now"
property=
"sendNow"
jdbcType=
"BIT"
/>
<result
column=
"send_now"
property=
"sendNow"
jdbcType=
"BIT"
/>
<result
column=
"send_time"
property=
"sendTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"send_time"
property=
"sendTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, alt_id, create_user, create_time, update_user, update_time, send_now, send_time
id, alt_id, create_user, create_time, update_user, update_time, send_now, send_time
, book_group_id
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPush"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPush"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_push (id, alt_id, create_user,
insert into self_push (id, alt_id, create_user,
create_time, update_user, update_time, send_now, send_time
create_time, update_user, update_time, send_now, send_time
, book_group_id
)
)
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}
, #{bookGroupId}
)
)
</insert>
</insert>
...
...
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