Commit c3746196 by zhaolianjie

卡片流程 - 抢 和 推迟

1 parent 9a658cb0
......@@ -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, "已经被抢啦啦啦~");
}
......
......@@ -20,4 +20,6 @@ public interface PainDao {
List<Pain> findAll();
void waitPain(Pain pain);
}
......@@ -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);
}
}
......@@ -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">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!