Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
zhangshaowu
/
pipi-helper
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c3746196
authored
Oct 15, 2022
by
zhaolianjie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
卡片流程 - 抢 和 推迟
1 parent
9a658cb0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
6 deletions
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
src/main/java/com/pipihelper/project/feishu/service/PainService.java
src/main/resources/mybatis/PainMapper.xml
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
View file @
c374619
...
...
@@ -117,18 +117,16 @@ public class FeiShuEventController {
}
else
if
(
"wait"
.
equals
(
actionTypeSecond
))
{
// 推迟 将当前用户放到队列最后 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片
String
waitUserId
=
feiShuMsgCardEventDTO
.
getOpen_id
();
JSONObject
waitObj
=
feiShuApiService
.
getUserInfo
(
waitUserId
);
painService
.
waitPain
(
waitUserId
);
String
fileName1
=
String
.
format
(
"/templates/massage-singel-msg-card-end.json.json"
);
return
getInteractiveCardStr
(
fileName1
,
"已为你推迟到最后"
);
}
else
if
(
"rob"
.
equals
(
actionTypeSecond
))
{
// 抢名额 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片
String
oldUserId
=
feiShuMsgCardEventDTO
.
getAction
().
getValue
().
getKey
().
split
(
"\\."
)[
2
];
String
robUserId
=
feiShuMsgCardEventDTO
.
getOpen_id
();
JSONObject
oldObj
=
feiShuApiService
.
getUserInfo
(
oldUserId
);
JSONObject
robObj
=
feiShuApiService
.
getUserInfo
(
robUserId
);
Pain
oldPain
=
painService
.
findByOpenId
(
oldUserId
);
oldPain
.
setOpenId
(
robUserId
);
painService
.
update
(
oldPain
);
String
fileName1
=
String
.
format
(
"/templates/massage-msg-card-rob-end.json.json.json"
);
return
getInteractiveCardStr
(
fileName1
,
"已经被抢啦啦啦~"
);
}
...
...
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
View file @
c374619
...
...
@@ -20,4 +20,6 @@ public interface PainDao {
List
<
Pain
>
findAll
();
void
waitPain
(
Pain
pain
);
}
src/main/java/com/pipihelper/project/feishu/service/PainService.java
View file @
c374619
...
...
@@ -36,4 +36,12 @@ public class PainService {
public
List
<
Pain
>
findAll
()
{
return
painDao
.
findAll
();
}
public
void
waitPain
(
String
openId
)
{
Pain
pain
=
new
Pain
();
pain
.
setOpenId
(
openId
);
painDao
.
waitPain
(
pain
);
}
}
src/main/resources/mybatis/PainMapper.xml
View file @
c374619
...
...
@@ -59,6 +59,14 @@
</insert>
<update
id=
"update"
parameterType=
"com.pipihelper.project.feishu.entity.Pain"
>
UPDATE t_pain set `index` = ((SELECT selected_value FROM (SELECT MAX(`index`) AS selected_value FROM t_pain) AS
sub_selected_value) + 1)
<where>
open_id = #{openId}
</where>
</update>
<update
id=
"update"
parameterType=
"com.pipihelper.project.feishu.entity.Pain"
>
update t_pain
<set>
<if
test=
"openId != null"
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment