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
e326ba8c
Commit
e326ba8c
authored
Feb 11, 2020
by
裴大威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-zp-1002313new' into 'master'
feat 1002313 See merge request rays/pcloud-book!388
parents
7a22e2f6
0792ded9
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
304 additions
and
10 deletions
+304
-10
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+167
-3
PushCheck.java
...k/src/main/java/com/pcloud/book/push/check/PushCheck.java
+22
-2
SelfPushAddParamDTO.java
...in/java/com/pcloud/book/push/dto/SelfPushAddParamDTO.java
+17
-0
SelfPushRecordDTO.java
...main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
+21
-0
SelfPush.java
...k/src/main/java/com/pcloud/book/push/entity/SelfPush.java
+59
-0
SelfPushServiceImpl.java
...om/pcloud/book/push/service/impl/SelfPushServiceImpl.java
+1
-1
SelfPushItemMapper.xml
...ook/src/main/resources/mapper/push/SelfPushItemMapper.xml
+6
-1
SelfPushMapper.xml
...ce-book/src/main/resources/mapper/push/SelfPushMapper.xml
+11
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
e326ba8c
package
com
.
pcloud
.
book
.
push
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
push
.
biz
.
impl
;
import
com.pcloud.book.advertising.enums.PutTypeEnum
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.user.PartyConsr
;
import
com.pcloud.book.consumer.user.PartyConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
...
@@ -24,6 +25,7 @@ import com.pcloud.book.push.entity.SelfPushUser;
...
@@ -24,6 +25,7 @@ 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.aspect.ParamLog
;
import
com.pcloud.common.core.constant.SystemCode
;
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
;
...
@@ -40,6 +42,8 @@ import com.sdk.wxgroup.*;
...
@@ -40,6 +42,8 @@ import com.sdk.wxgroup.*;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -56,7 +60,7 @@ import java.util.stream.Collectors;
...
@@ -56,7 +60,7 @@ import java.util.stream.Collectors;
@Slf4j
@Slf4j
@Component
(
"selfPushBiz"
)
@Component
(
"selfPushBiz"
)
public
class
SelfPushBizImpl
implements
SelfPushBiz
{
public
class
SelfPushBizImpl
implements
SelfPushBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SelfPushBizImpl
.
class
);
@Autowired
@Autowired
private
SelfPushDao
selfPushDao
;
private
SelfPushDao
selfPushDao
;
@Autowired
@Autowired
...
@@ -80,6 +84,9 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -80,6 +84,9 @@ public class SelfPushBizImpl implements SelfPushBiz {
@Autowired
@Autowired
private
PartyConsr
partyConsr
;
private
PartyConsr
partyConsr
;
private
static
final
String
self_push_SCHEDULE_PRE
=
"self_push_"
;
@Override
@Override
public
void
createSelfPush
(
Long
partyId
,
SelfPushAddParamDTO
addParamDTO
)
{
public
void
createSelfPush
(
Long
partyId
,
SelfPushAddParamDTO
addParamDTO
)
{
Boolean
sendNow
=
addParamDTO
.
getSendNow
();
Boolean
sendNow
=
addParamDTO
.
getSendNow
();
...
@@ -103,7 +110,13 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -103,7 +110,13 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
sendNow
)
{
if
(
sendNow
)
{
selfPush
.
setSendTime
(
new
Date
());
selfPush
.
setSendTime
(
new
Date
());
}
else
{
}
else
{
selfPush
.
setSendTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getSendTime
()));
selfPush
.
setPushSendTime
(
addParamDTO
.
getSendTime
());
selfPush
.
setStartTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getStartTime
()));
selfPush
.
setEndTime
(
DateUtils
.
getDateByStr
(
addParamDTO
.
getEndTime
()));
selfPush
.
setPushType
(
addParamDTO
.
getPushType
());
if
(
addParamDTO
.
getPushType
()==
2
){
selfPush
.
setWeekDays
(
addParamDTO
.
getWeekDays
());
}
}
}
selfPushDao
.
insert
(
selfPush
);
selfPushDao
.
insert
(
selfPush
);
Long
pushId
=
selfPush
.
getId
();
Long
pushId
=
selfPush
.
getId
();
...
@@ -118,7 +131,108 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -118,7 +131,108 @@ public class SelfPushBizImpl implements SelfPushBiz {
msgPush
(
userIdList
,
itemList
,
pushId
);
msgPush
(
userIdList
,
itemList
,
pushId
);
}
else
{
}
else
{
//定时任务
//定时任务
addSendQuartzJob
(
pushId
,
addParamDTO
.
getSendTime
());
createSendQuartz
(
selfPush
);
}
}
@ParamLog
(
"设置定时任务"
)
private
void
createSendQuartz
(
SelfPush
addParamDTO
)
{
Integer
pushType
=
addParamDTO
.
getPushType
();
if
(
pushType
==
1
)
{
pushDay
(
addParamDTO
);
}
else
if
(
pushType
==
2
)
{
pushWeek
(
addParamDTO
);
}
}
@ParamLog
(
"按周设置定时任务"
)
private
void
pushWeek
(
SelfPush
addParamDTO
)
{
String
cron
;
String
putTime
=
addParamDTO
.
getPushSendTime
();
try
{
int
hour
=
Integer
.
parseInt
(
putTime
.
substring
(
0
,
2
));
int
minute
=
Integer
.
parseInt
(
putTime
.
substring
(
3
,
5
));
int
second
=
Integer
.
parseInt
(
putTime
.
substring
(
6
,
8
));
String
weekDays
=
addParamDTO
.
getWeekDays
();
String
weeks
=
""
;
String
[]
strs
=
new
String
[
20
];
if
(
weekDays
.
length
()!=
1
)
{
strs
=
weekDays
.
split
(
","
);
}
else
{
strs
[
0
]=
weekDays
;
}
for
(
int
i
=
0
;
i
<=
strs
.
length
-
1
;
i
++){
Integer
weekDay
=
Integer
.
valueOf
(
strs
[
i
]);
if
(
weekDay
==
7
){
weekDay
=
1
;
}
else
{
weekDay
=
weekDay
+
1
;
}
weeks
=
weeks
+
weekDay
+
","
;
}
weeks
=
weeks
.
substring
(
0
,
weeks
.
length
()-
1
);
cron
=
second
+
" "
+
minute
+
" "
+
hour
+
" ? * "
+
weeks
;
}
catch
(
Exception
e
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"时间格式错误"
);
}
ScheduleJob
scheduleJob
=
new
ScheduleJob
();
scheduleJob
.
setJobGroup
(
"book"
);
scheduleJob
.
setJobName
(
self_push_SCHEDULE_PRE
+
addParamDTO
.
getId
());
scheduleJob
.
setCronExpression
(
cron
);
CallBackParam
callBackParam
=
new
CallBackParam
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
//定时任务调用时用到的参数
paramMap
.
put
(
"selfPushId"
,
addParamDTO
.
getId
());
callBackParam
.
setParamMap
(
paramMap
);
callBackParam
.
setMethodName
(
"sendSelfMsgQuartz"
);
callBackParam
.
setBeanName
(
"selfPushService"
);
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
(
"按天设置定时任务"
)
private
void
pushDay
(
SelfPush
addParamDTO
)
{
String
cron
;
String
putTime
=
addParamDTO
.
getPushSendTime
();
try
{
int
hour
=
Integer
.
parseInt
(
putTime
.
substring
(
0
,
2
));
int
minute
=
Integer
.
parseInt
(
putTime
.
substring
(
3
,
5
));
int
second
=
Integer
.
parseInt
(
putTime
.
substring
(
6
,
8
));
cron
=
second
+
" "
+
minute
+
" "
+
hour
+
" * * ?"
;
}
catch
(
Exception
e
)
{
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"时间格式错误"
);
}
ScheduleJob
scheduleJob
=
new
ScheduleJob
();
scheduleJob
.
setJobGroup
(
"book"
);
scheduleJob
.
setJobName
(
self_push_SCHEDULE_PRE
+
addParamDTO
.
getId
());
scheduleJob
.
setCronExpression
(
cron
);
CallBackParam
callBackParam
=
new
CallBackParam
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
//定时任务调用时用到的参数
paramMap
.
put
(
"selfPushId"
,
addParamDTO
.
getId
());
callBackParam
.
setParamMap
(
paramMap
);
callBackParam
.
setMethodName
(
"sendSelfMsgQuartz"
);
callBackParam
.
setBeanName
(
"selfPushService"
);
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
,
"定时任务设置失败"
);
}
}
}
}
...
@@ -320,6 +434,44 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -320,6 +434,44 @@ public class SelfPushBizImpl implements SelfPushBiz {
map
.
put
(
"pushStatus"
,
status
);
map
.
put
(
"pushStatus"
,
status
);
map
.
put
(
"partyId"
,
partyId
);
map
.
put
(
"partyId"
,
partyId
);
PageBeanNew
<
SelfPushRecordDTO
>
pageBeanNew
=
selfPushItemDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listSelfPushRecord"
);
PageBeanNew
<
SelfPushRecordDTO
>
pageBeanNew
=
selfPushItemDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listSelfPushRecord"
);
for
(
SelfPushRecordDTO
dto:
pageBeanNew
.
getRecordList
())
{
String
realSendTime
=
""
;
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
1
){
realSendTime
=
DateUtils
.
formatDate
(
dto
.
getStartTime
(),
"yyyy-MM-dd"
)+
"至"
+
DateUtils
.
formatDate
(
dto
.
getEndTime
(),
"yyyy-MM-dd"
)+
";"
;
realSendTime
=
realSendTime
+
"每天;"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
}
else
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
2
){
String
weekDays
=
dto
.
getWeekDays
();
realSendTime
=
DateUtils
.
formatDate
(
dto
.
getStartTime
(),
"yyyy-MM-dd"
)+
"至"
+
DateUtils
.
formatDate
(
dto
.
getEndTime
(),
"yyyy-MM-dd"
)+
";"
;
if
(
weekDays
.
contains
(
"1"
)){
weekDays
=
weekDays
.
replace
(
"1"
,
"周一"
);
}
if
(
weekDays
.
contains
(
"2"
)){
weekDays
=
weekDays
.
replace
(
"2"
,
"周二"
);
}
if
(
weekDays
.
contains
(
"3"
)){
weekDays
=
weekDays
.
replace
(
"3"
,
"周三"
);
}
if
(
weekDays
.
contains
(
"4"
)){
weekDays
=
weekDays
.
replace
(
"4"
,
"周四"
);
}
if
(
weekDays
.
contains
(
"5"
)){
weekDays
=
weekDays
.
replace
(
"5"
,
"周五"
);
}
if
(
weekDays
.
contains
(
"6"
)){
weekDays
=
weekDays
.
replace
(
"6"
,
"周六"
);
}
if
(
weekDays
.
contains
(
"7"
)){
weekDays
=
weekDays
.
replace
(
"7"
,
"周日"
);
}
realSendTime
=
realSendTime
+
weekDays
+
";"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
}
else
{
dto
.
setRealSendTime
(
DateUtils
.
formatDate
(
dto
.
getSendTime
(),
"yyyy-MM-dd HH:mm:ss"
));
}
}
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
}
...
@@ -368,6 +520,18 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -368,6 +520,18 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
null
==
selfPush
)
{
if
(
null
==
selfPush
)
{
return
;
return
;
}
}
//判断时间范围
if
(
selfPush
.
getPushType
()!=
null
)
{
Date
dateNow
=
new
Date
();
Date
startTime
=
selfPush
.
getStartTime
();
Date
endTime
=
selfPush
.
getEndTime
();
if
(
startTime
!=
null
&&
dateNow
.
before
(
startTime
))
{
return
;
}
if
(
endTime
!=
null
&&
dateNow
.
after
(
endTime
))
{
return
;
}
}
List
<
String
>
userIdList
=
selfPushUserDao
.
getUserIdListByPushId
(
pushId
);
List
<
String
>
userIdList
=
selfPushUserDao
.
getUserIdListByPushId
(
pushId
);
if
(
selfPush
.
getSendAll
()
&&
!
StringUtil
.
isEmpty
(
selfPush
.
getAltId
())){
//群发所有好友,更新发送好友列表
if
(
selfPush
.
getSendAll
()
&&
!
StringUtil
.
isEmpty
(
selfPush
.
getAltId
())){
//群发所有好友,更新发送好友列表
userIdList
=
wechatGroupConsr
.
getFriendByRobotId
(
selfPush
.
getAltId
());
userIdList
=
wechatGroupConsr
.
getFriendByRobotId
(
selfPush
.
getAltId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/check/PushCheck.java
View file @
e326ba8c
...
@@ -310,9 +310,29 @@ public class PushCheck {
...
@@ -310,9 +310,29 @@ public class PushCheck {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少立即发送字段"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少立即发送字段"
);
}
}
if
(!
addParamDTO
.
getSendNow
())
{
if
(!
addParamDTO
.
getSendNow
())
{
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getSendTime
())
||
DateUtils
.
getDateByStr
(
addParamDTO
.
getSendTime
()).
before
(
new
Date
())
)
{
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getSendTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送时间
设置有误
"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送时间
不能为空
"
);
}
}
String
s
=
"00,01,02,03,04"
;
if
(
s
.
contains
(
addParamDTO
.
getSendTime
().
substring
(
0
,
2
)))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送时间不正确"
);
}
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getStartTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送开始时间不能为空"
);
}
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getEndTime
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送结束时间不能为空"
);
}
if
(
null
==
addParamDTO
.
getPushType
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"发送类型不能为空"
);
}
if
(
addParamDTO
.
getPushType
()==
2
)
{
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getWeekDays
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送周机不能为空"
);
}
}
}
}
if
(
ListUtils
.
isEmpty
(
addParamDTO
.
getPushItemList
()))
{
if
(
ListUtils
.
isEmpty
(
addParamDTO
.
getPushItemList
()))
{
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 @
e326ba8c
...
@@ -38,6 +38,23 @@ public class SelfPushAddParamDTO {
...
@@ -38,6 +38,23 @@ public class SelfPushAddParamDTO {
* 发送时间
* 发送时间
*/
*/
private
String
sendTime
;
private
String
sendTime
;
/**
* 开始时间
*/
private
String
startTime
;
/**
* 结束时间
*/
private
String
endTime
;
/**
推送时间类型(1:每天发送 2:每周发送)
*/
private
Integer
pushType
;
/**
*周几
*/
private
String
weekDays
;
private
String
systemCode
;
private
String
systemCode
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
View file @
e326ba8c
...
@@ -91,5 +91,26 @@ public class SelfPushRecordDTO extends BaseDto{
...
@@ -91,5 +91,26 @@ public class SelfPushRecordDTO extends BaseDto{
@ApiModelProperty
(
"创建人账号"
)
@ApiModelProperty
(
"创建人账号"
)
private
String
userName
;
private
String
userName
;
@ApiModelProperty
(
"计划发送时间"
)
private
String
pushSendTime
;
@ApiModelProperty
(
"周几"
)
private
String
weekDays
;
@ApiModelProperty
(
"时间推送类型"
)
private
Integer
pushType
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"开始时间"
)
private
Date
startTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"结束时间"
)
private
Date
endTime
;
@ApiModelProperty
(
"发送时间拼接"
)
private
String
realSendTime
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/SelfPush.java
View file @
e326ba8c
...
@@ -33,6 +33,25 @@ public class SelfPush extends BaseEntity{
...
@@ -33,6 +33,25 @@ public class SelfPush extends BaseEntity{
private
Boolean
sendNow
;
private
Boolean
sendNow
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@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
(
"推送时间类型(1:每天发送 2:每周发送)"
)
private
Integer
pushType
;
@ApiModelProperty
(
"周几"
)
private
String
weekDays
;
@ApiModelProperty
(
"计划发送时间(不带日期)"
)
private
String
pushSendTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
private
Date
sendTime
;
private
Date
sendTime
;
...
@@ -42,6 +61,46 @@ public class SelfPush extends BaseEntity{
...
@@ -42,6 +61,46 @@ public class SelfPush extends BaseEntity{
@ApiModelProperty
(
"是否发送所有好友"
)
@ApiModelProperty
(
"是否发送所有好友"
)
private
Boolean
sendAll
;
private
Boolean
sendAll
;
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
getPushType
()
{
return
pushType
;
}
public
void
setPushType
(
Integer
pushType
)
{
this
.
pushType
=
pushType
;
}
public
String
getWeekDays
()
{
return
weekDays
;
}
public
void
setWeekDays
(
String
weekDays
)
{
this
.
weekDays
=
weekDays
;
}
public
String
getPushSendTime
()
{
return
pushSendTime
;
}
public
void
setPushSendTime
(
String
pushSendTime
)
{
this
.
pushSendTime
=
pushSendTime
;
}
public
String
getAltId
()
{
public
String
getAltId
()
{
return
altId
;
return
altId
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/service/impl/SelfPushServiceImpl.java
View file @
e326ba8c
...
@@ -29,7 +29,7 @@ public class SelfPushServiceImpl implements SelfPushService {
...
@@ -29,7 +29,7 @@ public class SelfPushServiceImpl implements SelfPushService {
@Override
@Override
@RequestMapping
(
value
=
"/sendSelfMsgQuartz"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/sendSelfMsgQuartz"
,
method
=
RequestMethod
.
POST
)
public
void
sendSelfMsgQuartz
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
void
sendSelfMsgQuartz
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
Long
pushId
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
.
get
(
"
p
ushId"
)),
new
TypeReference
<
Long
>()
{});
Long
pushId
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
.
get
(
"
selfP
ushId"
)),
new
TypeReference
<
Long
>()
{});
if
(
null
==
pushId
){
if
(
null
==
pushId
){
return
;
return
;
}
}
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushItemMapper.xml
View file @
e326ba8c
...
@@ -114,7 +114,12 @@
...
@@ -114,7 +114,12 @@
i.create_time createTime,
i.create_time createTime,
i.send_time sendTime,
i.send_time sendTime,
p.send_all sendAll,
p.send_all sendAll,
p.create_user createUser
p.create_user createUser,
p.start_time startTime,
p.end_time endTime,
p.push_send_time pushSendTime,
p.week_days weekDays,
p.push_type pushType
FROM
FROM
self_push_item i
self_push_item i
LEFT JOIN self_push p ON i.push_id = p.id
LEFT JOIN self_push p ON i.push_id = p.id
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushMapper.xml
View file @
e326ba8c
...
@@ -12,20 +12,28 @@
...
@@ -12,20 +12,28 @@
<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"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
<result
column=
"send_all"
property=
"sendAll"
jdbcType=
"BIT"
/>
<result
column=
"send_all"
property=
"sendAll"
jdbcType=
"BIT"
/>
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"end_time"
property=
"endTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"push_type"
property=
"pushType"
jdbcType=
"BIT"
/>
<result
column=
"week_days"
property=
"weekDays"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_send_time"
property=
"pushSendTime"
jdbcType=
"VARCHAR"
/>
</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, book_group_id, send_all
id, alt_id, create_user, create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
push_type,week_days,push_send_time
</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, book_group_id, send_all
create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
push_type,week_days,push_send_time
)
)
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}, #{bookGroupId}, #{sendAll}
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}, #{bookGroupId}, #{sendAll},#{startTime},
#{endTime},#{pushType},#{weekDays},#{pushSendTime}
)
)
</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