记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
75a07099
Commit
75a07099
authored
Nov 24, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sendOfMid
parent
4df47a3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
7 deletions
+88
-7
ISweetAppletSubMsgService.java
...dnet/service/sweet/service/ISweetAppletSubMsgService.java
+2
-0
SweetAppletSubMsgController.java
...service/sweet/controller/SweetAppletSubMsgController.java
+10
-0
SweetAppletSubMsgServiceImpl.java
...vice/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
+76
-7
No files found.
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetAppletSubMsgService.java
View file @
75a07099
...
@@ -17,4 +17,6 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> {
...
@@ -17,4 +17,6 @@ public interface ISweetAppletSubMsgService extends IService<SweetAppletSubMsg> {
ResponseDto
sendMsg
(
Integer
type
,
String
targetId
);
ResponseDto
sendMsg
(
Integer
type
,
String
targetId
);
ResponseDto
<
Boolean
>
create
(
String
openId
,
String
templateId
,
String
targetId
,
Integer
appletType
,
Integer
activityType
);
ResponseDto
<
Boolean
>
create
(
String
openId
,
String
templateId
,
String
targetId
,
Integer
appletType
,
Integer
activityType
);
ResponseDto
sendOfMid
(
Integer
type
,
String
midList
,
String
targetId
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetAppletSubMsgController.java
View file @
75a07099
...
@@ -39,6 +39,16 @@ public class SweetAppletSubMsgController {
...
@@ -39,6 +39,16 @@ public class SweetAppletSubMsgController {
return
subMsgService
.
sendMsg
(
type
,
targetId
);
return
subMsgService
.
sendMsg
(
type
,
targetId
);
}
}
@GetMapping
(
"sendOfMid"
)
@ApiOperation
(
"发送模版消息OfMid"
)
public
ResponseDto
sendOfMid
(
@RequestParam
Integer
type
,
@RequestParam
String
midList
,
@RequestParam
String
targetId
)
{
return
subMsgService
.
sendOfMid
(
type
,
midList
,
targetId
);
}
// 一次订阅 可以多次发 直到用户取消订阅 所以正规做法应该是记录订阅模版 不关联任何推送数据 等推送的时候查是否订阅某模版
// 一次订阅 可以多次发 直到用户取消订阅 所以正规做法应该是记录订阅模版 不关联任何推送数据 等推送的时候查是否订阅某模版
// 然后发送判断失败是用户取消了 删除订阅记录 或者看取消是否有回调 利用回调处理也可
// 然后发送判断失败是用户取消了 删除订阅记录 或者看取消是否有回调 利用回调处理也可
// 现在的理解有误 已写完 先用
// 现在的理解有误 已写完 先用
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
View file @
75a07099
...
@@ -61,19 +61,21 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -61,19 +61,21 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
.
eq
(
SweetAppletSubMsg:
:
getIsPush
,
1
)
.
eq
(
SweetAppletSubMsg:
:
getIsPush
,
1
)
.
eq
(
SweetAppletSubMsg:
:
getActivityType
,
type
)
.
eq
(
SweetAppletSubMsg:
:
getActivityType
,
type
)
);
);
ArrayList
<
String
>
msgIdList
=
CollectionUtil
.
arrayListString
();
if
(!
CollectionUtils
.
isEmpty
(
msgList
))
{
for
(
SweetAppletSubMsg
info
:
msgList
)
{
try
{
String
msgId
=
info
.
getMsgId
();
ResponseDto
<
KylinPerformanceVo
>
kylinPerformanceVo
=
feignKylinPerformancesClient
.
detail
(
targetId
,
0
,
0
,
""
);
ResponseDto
<
KylinPerformanceVo
>
kylinPerformanceVo
=
feignKylinPerformancesClient
.
detail
(
targetId
,
0
,
0
,
""
);
KylinPerformanceVo
performanceVoData
=
kylinPerformanceVo
.
getData
();
KylinPerformanceVo
performanceVoData
=
kylinPerformanceVo
.
getData
();
if
(
null
==
performanceVoData
||
ObjectUtils
.
isEmpty
(
performanceVoData
))
{
if
(
null
==
performanceVoData
||
ObjectUtils
.
isEmpty
(
performanceVoData
))
{
log
.
info
(
"无演出数据:[getPerformancesId=[{}]"
,
info
.
getTargetId
()
);
log
.
info
(
"无演出数据:[getPerformancesId=[{}]"
,
targetId
);
continue
;
return
ResponseDto
.
success
()
;
}
}
KylinTicketTimesVo
kylinTicketTimesVo
=
performanceVoData
.
getTicketTimeList
().
get
(
0
);
KylinTicketTimesVo
kylinTicketTimesVo
=
performanceVoData
.
getTicketTimeList
().
get
(
0
);
ArrayList
<
String
>
msgIdList
=
CollectionUtil
.
arrayListString
();
if
(!
CollectionUtils
.
isEmpty
(
msgList
))
{
for
(
SweetAppletSubMsg
info
:
msgList
)
{
try
{
String
msgId
=
info
.
getMsgId
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
nowTimeStr
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
nowTime
);
String
nowTimeStr
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
nowTime
);
String
sellTime
=
performanceVoData
.
getSellTime
();
String
sellTime
=
performanceVoData
.
getSellTime
();
...
@@ -134,6 +136,73 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -134,6 +136,73 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
@Override
public
ResponseDto
sendOfMid
(
Integer
type
,
String
midList
,
String
targetId
)
{
String
[]
midListArray
=
midList
.
split
(
","
);
List
<
SweetAppletSubMsg
>
msgList
=
subMsgMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetAppletSubMsg
.
class
)
.
eq
(
SweetAppletSubMsg:
:
getIsPush
,
1
)
.
eq
(
SweetAppletSubMsg:
:
getActivityType
,
type
)
.
in
(
SweetAppletSubMsg:
:
getMid
,
midListArray
)
);
ResponseDto
<
KylinPerformanceVo
>
kylinPerformanceVo
=
feignKylinPerformancesClient
.
detail
(
targetId
,
0
,
0
,
""
);
KylinPerformanceVo
performanceVoData
=
kylinPerformanceVo
.
getData
();
if
(
null
==
performanceVoData
||
ObjectUtils
.
isEmpty
(
performanceVoData
))
{
log
.
info
(
"无演出数据:[getPerformancesId=[{}]"
,
targetId
);
return
ResponseDto
.
failure
(
"无演出数据"
);
}
KylinTicketTimesVo
kylinTicketTimesVo
=
performanceVoData
.
getTicketTimeList
().
get
(
0
);
ArrayList
<
String
>
msgIdList
=
CollectionUtil
.
arrayListString
();
if
(!
CollectionUtils
.
isEmpty
(
msgList
))
{
for
(
SweetAppletSubMsg
info
:
msgList
)
{
try
{
String
msgId
=
info
.
getMsgId
();
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
nowTimeStr
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
nowTime
);
String
sellTime
=
performanceVoData
.
getSellTime
();
LocalDateTime
sellTimeLocal
=
LocalDateTime
.
parse
(
sellTime
,
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
LocalDateTime
sellTimeLocalNew
=
sellTimeLocal
.
minusMinutes
(
5
);
String
sellTimeLocalNewStr
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
sellTimeLocalNew
);
String
stopSellTime
=
performanceVoData
.
getStopSellTime
();
if
(
1
==
DateUtil
.
compareStrDay
(
nowTimeStr
,
stopSellTime
))
{
// 超过售卖期 不推 删redis
log
.
info
(
"超过售卖期:[nowTimeStr=[{}], [stopSellTime=[{}]"
,
nowTimeStr
,
stopSellTime
);
msgIdList
.
add
(
msgId
);
continue
;
}
if
(-
1
==
DateUtil
.
compareStrDay
(
nowTimeStr
,
sellTimeLocalNewStr
))
{
// 还没到售卖期
log
.
info
(
"还没到售卖期:[nowTimeStr=[{}], [sellTimeLocalNewStr=[{}]"
,
nowTimeStr
,
sellTimeLocalNewStr
);
continue
;
}
// 发送订阅消息接口
boolean
subMessage
=
sendSubMessage
(
info
,
performanceVoData
);
if
(
subMessage
)
{
msgIdList
.
add
(
msgId
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"小程序演出订阅提醒消息处理异常"
,
e
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
msgIdList
))
{
SweetAppletSubMsg
update
=
new
SweetAppletSubMsg
();
update
.
setIsPush
(
2
);
update
.
setTargetId
(
targetId
);
update
.
setUpdatedAt
(
LocalDateTime
.
now
());
subMsgMapper
.
update
(
update
,
Wrappers
.
lambdaUpdate
(
SweetAppletSubMsg
.
class
)
.
in
(
SweetAppletSubMsg:
:
getMsgId
,
msgIdList
)
);
}
}
return
ResponseDto
.
success
();
}
/**
/**
* 微信小程序推送订阅消息
* 微信小程序推送订阅消息
*/
*/
...
...
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