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
0792ded9
Commit
0792ded9
authored
Feb 11, 2020
by
曾迫
Committed by
裴大威
Feb 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat 1002313
parent
7a22e2f6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
345 additions
and
51 deletions
+345
-51
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+169
-5
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
+41
-36
SelfPushMapper.xml
...ce-book/src/main/resources/mapper/push/SelfPushMapper.xml
+15
-7
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
0792ded9
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/push/check/PushCheck.java
View file @
0792ded9
...
...
@@ -310,9 +310,29 @@ public class PushCheck {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少立即发送字段"
);
}
if
(!
addParamDTO
.
getSendNow
())
{
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getSendTime
())
||
DateUtils
.
getDateByStr
(
addParamDTO
.
getSendTime
()).
before
(
new
Date
())
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送时间
设置有误
"
);
if
(
StringUtil
.
isEmpty
(
addParamDTO
.
getSendTime
()))
{
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
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"发送消息为空"
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushAddParamDTO.java
View file @
0792ded9
...
...
@@ -38,6 +38,23 @@ public class SelfPushAddParamDTO {
* 发送时间
*/
private
String
sendTime
;
/**
* 开始时间
*/
private
String
startTime
;
/**
* 结束时间
*/
private
String
endTime
;
/**
推送时间类型(1:每天发送 2:每周发送)
*/
private
Integer
pushType
;
/**
*周几
*/
private
String
weekDays
;
private
String
systemCode
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
View file @
0792ded9
...
...
@@ -91,5 +91,26 @@ public class SelfPushRecordDTO extends BaseDto{
@ApiModelProperty
(
"创建人账号"
)
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 @
0792ded9
...
...
@@ -33,6 +33,25 @@ public class SelfPush extends BaseEntity{
private
Boolean
sendNow
;
@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
(
"发送时间"
)
private
Date
sendTime
;
...
...
@@ -42,6 +61,46 @@ public class SelfPush extends BaseEntity{
@ApiModelProperty
(
"是否发送所有好友"
)
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
()
{
return
altId
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/service/impl/SelfPushServiceImpl.java
View file @
0792ded9
...
...
@@ -29,7 +29,7 @@ public class SelfPushServiceImpl implements SelfPushService {
@Override
@RequestMapping
(
value
=
"/sendSelfMsgQuartz"
,
method
=
RequestMethod
.
POST
)
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
){
return
;
}
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushItemMapper.xml
View file @
0792ded9
...
...
@@ -24,26 +24,26 @@
</resultMap>
<sql
id=
"Base_Column_List"
>
id, push_id, item_type, text_content, link_url, link_title, link_description,
link_image_url, image_url, app_id, app_url, product_id, product_url, push_status,
id, push_id, item_type, text_content, link_url, link_title, link_description,
link_image_url, image_url, app_id, app_url, product_id, product_url, push_status,
create_user, create_time, update_user, update_time, send_time
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPushItem"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_push_item (push_id, item_type,
text_content, link_url, link_title,
link_description, link_image_url, image_url,
app_id, app_url, product_id,
product_url, push_status, create_user,
create_time, update_user, update_time, send_time
)
text_content, link_url, link_title,
link_description, link_image_url, image_url,
app_id, app_url, product_id,
product_url, push_status, create_user,
create_time, update_user, update_time, send_time
)
values (#{pushId,jdbcType=BIGINT}, #{itemType,jdbcType=INTEGER},
#{textContent,jdbcType=VARCHAR}, #{linkUrl,jdbcType=VARCHAR}, #{linkTitle,jdbcType=VARCHAR},
#{linkDescription,jdbcType=VARCHAR}, #{linkImageUrl,jdbcType=VARCHAR}, #{imageUrl,jdbcType=VARCHAR},
#{appId,jdbcType=BIGINT}, #{appUrl,jdbcType=VARCHAR}, #{productId,jdbcType=BIGINT},
#{productUrl,jdbcType=VARCHAR}, #{pushStatus,jdbcType=INTEGER}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendTime}
)
#{textContent,jdbcType=VARCHAR}, #{linkUrl,jdbcType=VARCHAR}, #{linkTitle,jdbcType=VARCHAR},
#{linkDescription,jdbcType=VARCHAR}, #{linkImageUrl,jdbcType=VARCHAR}, #{imageUrl,jdbcType=VARCHAR},
#{appId,jdbcType=BIGINT}, #{appUrl,jdbcType=VARCHAR}, #{productId,jdbcType=BIGINT},
#{productUrl,jdbcType=VARCHAR}, #{pushStatus,jdbcType=INTEGER}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendTime}
)
</insert>
<!--批量插入-->
...
...
@@ -95,31 +95,36 @@
<select
id=
"listSelfPushRecord"
parameterType=
"map"
resultType=
"com.pcloud.book.push.dto.SelfPushRecordDTO"
>
SELECT
p.alt_id altId,
p.book_group_id bookGroupId,
p.id pushId,
i.id pushItemId,
i.item_type itemType,
i.text_content textContent,
i.link_url linkUrl,
i.link_title linkTitle,
i.link_description linkDescription,
i.link_image_url linkImageUrl,
i.image_url imageUrl,
i.app_id appId,
i.app_url appUrl,
i.product_id productId,
i.product_url productUrl,
i.push_status pushStatus,
i.create_time createTime,
i.send_time sendTime,
p.send_all sendAll,
p.create_user createUser
p.alt_id altId,
p.book_group_id bookGroupId,
p.id pushId,
i.id pushItemId,
i.item_type itemType,
i.text_content textContent,
i.link_url linkUrl,
i.link_title linkTitle,
i.link_description linkDescription,
i.link_image_url linkImageUrl,
i.image_url imageUrl,
i.app_id appId,
i.app_url appUrl,
i.product_id productId,
i.product_url productUrl,
i.push_status pushStatus,
i.create_time createTime,
i.send_time sendTime,
p.send_all sendAll,
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
self_push_item i
self_push_item i
LEFT JOIN self_push p ON i.push_id = p.id
WHERE
1 = 1
1 = 1
<if
test=
"startTime != null and endTime != null"
>
AND i.send_time BETWEEN #{startTime} AND #{endTime}
</if>
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushMapper.xml
View file @
0792ded9
...
...
@@ -12,21 +12,29 @@
<result
column=
"send_time"
property=
"sendTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
<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>
<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>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPush"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_push (id, alt_id, create_user,
create_time, update_user, update_time, send_now, send_time, book_group_id, send_all
)
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}, #{bookGroupId}, #{sendAll}
)
insert into self_push (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
)
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}, #{bookGroupId}, #{sendAll},#{startTime},
#{endTime},#{pushType},#{weekDays},#{pushSendTime}
)
</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