Commit b239fabf by zhaolianjie

卡片流程 - 下一位

1 parent 4fa5f249
package com.pipihelper.project.feishu.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
......@@ -133,8 +134,19 @@ public class FeiShuEventController {
return getInteractiveCardStr(fileName1, "已经被抢啦啦啦~");
} else if ("next".equals(actionTypeSecond)) {
// 当前按完,有请下一位
String endUserId = feiShuMsgCardEventDTO.getOpen_id();
Pain oldPain = painService.findByOpenId(endUserId);
oldPain.setStatus(2);
painService.update(oldPain);
List<Pain> painList = painService.findBackIndex(oldPain.getIndex(), 1);
if (CollectionUtil.isNotEmpty(painList)) {
Pain noticePain = CollectionUtil.getFirst(painList);
noticePain.setStatus(1);
painService.update(noticePain);
massageService.updateSingleMassageMsgCardWhenBegin(noticePain.getMessageId());
}
String fileName1 = String.format("/templates/massage-singel-msg-card-end.json.json");
return getInteractiveCardStr(fileName1, "欢迎下次光临~");
}
default:
}
......
......@@ -25,5 +25,5 @@ public interface PainDao {
List<Pain> findListAsc(int limit);
List<Pain> findBackIndex(@Param(value = "openId") String openId, @Param(value = "limit") int limit);
List<Pain> findBackIndex(@Param(value = "index") Integer index, @Param(value = "limit") int limit);
}
......@@ -49,7 +49,7 @@ public class PainService {
return painDao.findListAsc(limit);
}
public List<Pain> findBackIndex(String openId,int limit) {
return painDao.findBackIndex(openId,limit);
public List<Pain> findBackIndex(Integer index,int limit) {
return painDao.findBackIndex(index,limit);
}
}
......@@ -36,6 +36,7 @@
from t_pain
<where>
index >= #{index}
and status = 0
order by index asc
limit #{limit}
</where>
......@@ -46,6 +47,7 @@
<include refid="Base_Column_List"/>
from t_pain
<where>
status = 0
order by index asc
limit #{limit}
</where>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!