Commit c3746196 by zhaolianjie

卡片流程 - 抢 和 推迟

1 parent 9a658cb0
...@@ -117,18 +117,16 @@ public class FeiShuEventController { ...@@ -117,18 +117,16 @@ public class FeiShuEventController {
} else if ("wait".equals(actionTypeSecond)) { } else if ("wait".equals(actionTypeSecond)) {
// 推迟 将当前用户放到队列最后 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片 // 推迟 将当前用户放到队列最后 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片
String waitUserId = feiShuMsgCardEventDTO.getOpen_id(); 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"); String fileName1 = String.format("/templates/massage-singel-msg-card-end.json.json");
return getInteractiveCardStr(fileName1, "已为你推迟到最后"); return getInteractiveCardStr(fileName1, "已为你推迟到最后");
} else if ("rob".equals(actionTypeSecond)) { } else if ("rob".equals(actionTypeSecond)) {
// 抢名额 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片 // 抢名额 - 掉延迟更新卡片接口 更新大群、按摩群的按摩时间安排卡片
String oldUserId = feiShuMsgCardEventDTO.getAction().getValue().getKey().split("\\.")[2]; String oldUserId = feiShuMsgCardEventDTO.getAction().getValue().getKey().split("\\.")[2];
String robUserId = feiShuMsgCardEventDTO.getOpen_id(); String robUserId = feiShuMsgCardEventDTO.getOpen_id();
JSONObject oldObj = feiShuApiService.getUserInfo(oldUserId); Pain oldPain = painService.findByOpenId(oldUserId);
JSONObject robObj = feiShuApiService.getUserInfo(robUserId); oldPain.setOpenId(robUserId);
painService.update(oldPain);
String fileName1 = String.format("/templates/massage-msg-card-rob-end.json.json.json"); String fileName1 = String.format("/templates/massage-msg-card-rob-end.json.json.json");
return getInteractiveCardStr(fileName1, "已经被抢啦啦啦~"); return getInteractiveCardStr(fileName1, "已经被抢啦啦啦~");
} }
...@@ -172,7 +170,7 @@ public class FeiShuEventController { ...@@ -172,7 +170,7 @@ public class FeiShuEventController {
painService.create(pain); painService.create(pain);
}); });
/* massageService.sendMassageMsgCardToPiPiChat(userList);*/ /* massageService.sendMassageMsgCardToPiPiChat(userList);*/
List<FeiShuEmployeeDTO> dtos = feiShuApiService.getEmployeeList(); List<FeiShuEmployeeDTO> dtos = feiShuApiService.getEmployeeList();
return dtos; return dtos;
} }
......
...@@ -20,4 +20,6 @@ public interface PainDao { ...@@ -20,4 +20,6 @@ public interface PainDao {
List<Pain> findAll(); List<Pain> findAll();
void waitPain(Pain pain);
} }
...@@ -36,4 +36,12 @@ public class PainService { ...@@ -36,4 +36,12 @@ public class PainService {
public List<Pain> findAll() { public List<Pain> findAll() {
return painDao.findAll(); return painDao.findAll();
} }
public void waitPain(String openId) {
Pain pain = new Pain();
pain.setOpenId(openId);
painDao.waitPain(pain);
}
} }
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
</insert> </insert>
<update id="update" parameterType="com.pipihelper.project.feishu.entity.Pain"> <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 update t_pain
<set> <set>
<if test="openId != null"> <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!