过号发送过号模板消息

This commit is contained in:
2024-09-19 17:51:58 +08:00
parent aded35b3c1
commit 0d06185849

View File

@@ -252,9 +252,6 @@ public class TbCallServiceImpl implements TbCallService {
.orderByAsc(TbCallQueue::getCreateTime) .orderByAsc(TbCallQueue::getCreateTime)
.page(new Page<>(1, 1)).getRecords(); .page(new Page<>(1, 1)).getRecords();
if (current.isEmpty()) {
throw new BadRequestException("当前用户未排号");
}
if (StrUtil.isBlank(callQueue.getOpenId())) { if (StrUtil.isBlank(callQueue.getOpenId())) {
throw new BadRequestException("此用户未订阅微信小程序消息"); throw new BadRequestException("此用户未订阅微信小程序消息");
@@ -328,6 +325,23 @@ public class TbCallServiceImpl implements TbCallService {
break; break;
case 3: case 3:
callQueue.setPassTime(DateUtil.date()); callQueue.setPassTime(DateUtil.date());
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
if(StrUtil.isBlank(callQueue.getOpenId()) && callQueue.getSubState() != 1) {
break;
}
List<TbCallQueue> current = callQueueService.lambdaQuery()
.eq(TbCallQueue::getCallTableId, callQueue.getCallTableId())
.eq(TbCallQueue::getCreateDay, DateUtil.today())
.and(r -> {
r.eq(TbCallQueue::getState, 1)
.or()
.eq(TbCallQueue::getState, 0);
})
.orderByAsc(TbCallQueue::getCreateTime)
.page(new Page<>(1, 1)).getRecords();
wxMiniUtils.sendPassCallMsg(shopInfo.getShopName(), getStrByState(Integer.valueOf(updateCallQueueDTO.getState())),
callQueue.getCallNum(), current.isEmpty() ? "" : current.get(0).getCallNum(), "即将过号", callQueue.getOpenId());
break; break;
default: default:
throw new BadRequestException("错误类型"); throw new BadRequestException("错误类型");