记得上下班打卡 | 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
d74036d4
Commit
d74036d4
authored
Feb 24, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加 sendOfActivityType
parent
8227b386
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
17 deletions
+89
-17
ISweetAppletSubMsgService.java
...dnet/service/sweet/service/ISweetAppletSubMsgService.java
+3
-1
SweetAppletSubMsgController.java
...service/sweet/controller/SweetAppletSubMsgController.java
+23
-10
SweetAppletSubMsgServiceImpl.java
...vice/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
+63
-6
No files found.
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetAppletSubMsgService.java
View file @
d74036d4
...
@@ -14,7 +14,9 @@ import com.liquidnet.service.sweet.entity.SweetAppletSubMsg;
...
@@ -14,7 +14,9 @@ import com.liquidnet.service.sweet.entity.SweetAppletSubMsg;
*/
*/
public
interface
ISweetAppletSubMsgService
extends
IService
<
SweetAppletSubMsg
>
{
public
interface
ISweetAppletSubMsgService
extends
IService
<
SweetAppletSubMsg
>
{
ResponseDto
sendMsg
(
Integer
type
,
String
targetId
);
ResponseDto
sendMsg
(
Integer
type
);
ResponseDto
sendOfActivityType
(
Integer
activityType
,
String
targetId
,
Integer
timeType
);
ResponseDto
sendOfMid
(
String
midList
,
String
targetId
,
Integer
timeType
);
ResponseDto
sendOfMid
(
String
midList
,
String
targetId
,
Integer
timeType
);
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetAppletSubMsgController.java
View file @
d74036d4
...
@@ -31,23 +31,36 @@ public class SweetAppletSubMsgController {
...
@@ -31,23 +31,36 @@ public class SweetAppletSubMsgController {
private
SweetAppletSubMsgServiceImpl
subMsgService
;
private
SweetAppletSubMsgServiceImpl
subMsgService
;
@GetMapping
(
"send"
)
@GetMapping
(
"send"
)
@ApiOperation
(
"发送
模版消息
定时任务使用"
)
@ApiOperation
(
"发送
订阅消息,
定时任务使用"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"活动类型"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"type"
,
value
=
"活动类型"
,
required
=
true
)
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出ID"
,
required
=
true
),
})
})
public
ResponseDto
send
(
public
ResponseDto
send
(
@RequestParam
Integer
type
,
@RequestParam
Integer
type
@RequestParam
String
targetId
)
{
)
{
return
subMsgService
.
sendMsg
(
type
,
targetId
);
return
subMsgService
.
sendMsg
(
type
);
}
@GetMapping
(
"sendOfActivityType"
)
@ApiOperation
(
"发送订阅消息OfActivityType,特殊情况手动调用使用"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"activityType"
,
value
=
"活动类型"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出ID 作为查询条件"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"timeType"
,
value
=
"是否判断演出时间 1判断 2不判断"
),
})
public
ResponseDto
sendOfActivityType
(
@RequestParam
Integer
activityType
,
@RequestParam
String
targetId
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
timeType
)
{
return
subMsgService
.
sendOfActivityType
(
activityType
,
targetId
,
timeType
);
}
}
@PostMapping
(
"sendOfMid"
)
@PostMapping
(
"sendOfMid"
)
@ApiOperation
(
"发送
模版消息OfMid,
特殊情况手动调用使用"
)
@ApiOperation
(
"发送
订阅消息OfMid,
特殊情况手动调用使用"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"midList"
,
value
=
"mid列表逗号分割"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"midList"
,
value
=
"mid列表逗号分割"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出ID"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出ID
不作为查询条件
"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"timeType"
,
value
=
"是否判断演出时间 1判断 2不判断"
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"timeType"
,
value
=
"是否判断演出时间 1判断 2不判断"
),
})
})
public
ResponseDto
sendOfMid
(
public
ResponseDto
sendOfMid
(
...
@@ -69,8 +82,8 @@ public class SweetAppletSubMsgController {
...
@@ -69,8 +82,8 @@ public class SweetAppletSubMsgController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"unionId"
,
value
=
"对应小程序的unionId"
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"unionId"
,
value
=
"对应小程序的unionId"
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"templateId"
,
value
=
"模版消息ID,多个用英文逗号分割"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"templateId"
,
value
=
"模版消息ID,多个用英文逗号分割"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"targetId"
,
value
=
"演出id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"
String
"
,
name
=
"appletType"
,
value
=
"小程序类型 1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"
Integer
"
,
name
=
"appletType"
,
value
=
"小程序类型 1草莓 2五百里 3mdsk 4正在 5跳飞船音乐节"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"
String
"
,
name
=
"activityType"
,
value
=
"活动类型"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"
Integer
"
,
name
=
"activityType"
,
value
=
"活动类型"
,
required
=
true
),
})
})
public
ResponseDto
<
Boolean
>
create
(
public
ResponseDto
<
Boolean
>
create
(
@RequestParam
()
String
openId
,
@RequestParam
()
String
openId
,
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetAppletSubMsgServiceImpl.java
View file @
d74036d4
...
@@ -58,8 +58,8 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -58,8 +58,8 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
private
RedisActivityUtils
redisActivityUtils
;
private
RedisActivityUtils
redisActivityUtils
;
@Override
@Override
public
ResponseDto
sendMsg
(
Integer
type
,
String
targetId
)
{
public
ResponseDto
sendMsg
(
Integer
type
)
{
List
<
SweetAppletSubMsg
>
msgList
=
subMsgMapper
.
selectList
(
/*
List<SweetAppletSubMsg> msgList = subMsgMapper.selectList(
Wrappers.lambdaQuery(SweetAppletSubMsg.class)
Wrappers.lambdaQuery(SweetAppletSubMsg.class)
.eq(SweetAppletSubMsg::getIsPush, 1)
.eq(SweetAppletSubMsg::getIsPush, 1)
.eq(SweetAppletSubMsg::getActivityType, type)
.eq(SweetAppletSubMsg::getActivityType, type)
...
@@ -102,6 +102,63 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -102,6 +102,63 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
.in(SweetAppletSubMsg::getMsgId, msgIdList)
.in(SweetAppletSubMsg::getMsgId, msgIdList)
);
);
}
}
}*/
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
sendOfActivityType
(
Integer
activityType
,
String
targetId
,
Integer
timeType
)
{
List
<
SweetAppletSubMsg
>
msgList
=
subMsgMapper
.
selectList
(
Wrappers
.
lambdaQuery
(
SweetAppletSubMsg
.
class
)
.
eq
(
SweetAppletSubMsg:
:
getIsPush
,
1
)
.
eq
(
SweetAppletSubMsg:
:
getActivityType
,
activityType
)
.
eq
(
SweetAppletSubMsg:
:
getTargetId
,
targetId
)
);
KylinPerformanceVo
performanceVoData
=
null
;
if
(!
targetId
.
isEmpty
())
{
ResponseDto
<
KylinPerformanceVo
>
kylinPerformanceVo
=
feignKylinPerformancesClient
.
detail
(
targetId
,
0
,
0
,
""
);
performanceVoData
=
kylinPerformanceVo
.
getData
();
if
(
null
==
performanceVoData
||
ObjectUtils
.
isEmpty
(
performanceVoData
))
{
log
.
info
(
"无演出数据:[performancesId={}]"
,
targetId
);
return
ResponseDto
.
failure
(
"无演出数据"
);
}
if
(
timeType
==
1
)
{
Integer
isPush
=
isPush
(
performanceVoData
,
targetId
);
if
(
isPush
!=
3
)
{
return
ResponseDto
.
failure
(
"当前演出还不能推送,状态"
.
concat
(
String
.
valueOf
(
isPush
)));
}
}
}
String
title
=
performanceVoData
.
getTitle
();
String
timeStart
=
performanceVoData
.
getTimeStart
();
ArrayList
<
String
>
msgIdList
=
CollectionUtil
.
arrayListString
();
if
(!
CollectionUtils
.
isEmpty
(
msgList
))
{
for
(
SweetAppletSubMsg
info
:
msgList
)
{
try
{
String
msgId
=
info
.
getMsgId
();
// 发送订阅消息接口
boolean
subMessage
=
sendSubMessage
(
info
,
targetId
,
title
,
timeStart
);
if
(
subMessage
)
{
redisActivityUtils
.
delSubscribe
(
info
.
getOpenId
(),
targetId
);
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
();
return
ResponseDto
.
success
();
}
}
...
@@ -119,6 +176,10 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -119,6 +176,10 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
if
(!
targetId
.
isEmpty
())
{
if
(!
targetId
.
isEmpty
())
{
ResponseDto
<
KylinPerformanceVo
>
kylinPerformanceVo
=
feignKylinPerformancesClient
.
detail
(
targetId
,
0
,
0
,
""
);
ResponseDto
<
KylinPerformanceVo
>
kylinPerformanceVo
=
feignKylinPerformancesClient
.
detail
(
targetId
,
0
,
0
,
""
);
performanceVoData
=
kylinPerformanceVo
.
getData
();
performanceVoData
=
kylinPerformanceVo
.
getData
();
if
(
null
==
performanceVoData
||
ObjectUtils
.
isEmpty
(
performanceVoData
))
{
log
.
info
(
"无演出数据:[performancesId={}]"
,
targetId
);
return
ResponseDto
.
failure
(
"无演出数据"
);
}
if
(
timeType
==
1
)
{
if
(
timeType
==
1
)
{
Integer
isPush
=
isPush
(
performanceVoData
,
targetId
);
Integer
isPush
=
isPush
(
performanceVoData
,
targetId
);
if
(
isPush
!=
3
)
{
if
(
isPush
!=
3
)
{
...
@@ -232,10 +293,6 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
...
@@ -232,10 +293,6 @@ public class SweetAppletSubMsgServiceImpl extends ServiceImpl<SweetAppletSubMsgM
* 判断演出时间 是否可以推送
* 判断演出时间 是否可以推送
*/
*/
private
Integer
isPush
(
KylinPerformanceVo
performanceVoData
,
String
targetId
)
{
private
Integer
isPush
(
KylinPerformanceVo
performanceVoData
,
String
targetId
)
{
if
(
null
==
performanceVoData
||
ObjectUtils
.
isEmpty
(
performanceVoData
))
{
log
.
info
(
"无演出数据:[performancesId={}]"
,
targetId
);
return
0
;
}
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
();
...
...
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