排队取号修改
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallQueue;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallTable;
|
||||
@@ -54,15 +55,15 @@ public class TbCallServiceImpl implements TbCallService {
|
||||
|
||||
if (setFlag) {
|
||||
return callTable.getPrefix() + callTable.getStart();
|
||||
}else if (StrUtil.isNotBlank(newVal.get())){
|
||||
} else if (StrUtil.isNotBlank(newVal.get())) {
|
||||
value = String.valueOf((Integer.parseInt(newVal.get()) + 1));
|
||||
redisTemplate.opsForValue().set(callNumKey, value);
|
||||
return callTable.getPrefix() + value;
|
||||
}else {
|
||||
} else {
|
||||
throw new MsgException("生成排队号码失败");
|
||||
}
|
||||
|
||||
}else {
|
||||
} else {
|
||||
value = String.valueOf((Integer.parseInt(value) + 1));
|
||||
redisTemplate.opsForValue().set(callNumKey, value);
|
||||
return callTable.getPrefix() + value;
|
||||
@@ -148,6 +149,12 @@ public class TbCallServiceImpl implements TbCallService {
|
||||
if (callQueueInfoVOS.isEmpty()) {
|
||||
callQueueInfoVOS = callQueueMapper.selectInfoByOpenId(shopId, openId, DateUtil.date().toString("yyyy-MM-dd"), null);
|
||||
}
|
||||
if (!callQueueInfoVOS.isEmpty()) {
|
||||
CallQueueInfoVO callQueueInfoVO = callQueueInfoVOS.get(0);
|
||||
callQueueMapper.update(null, new LambdaUpdateWrapper<TbCallQueue>()
|
||||
.eq(TbCallQueue::getId, callQueueInfoVO.getId())
|
||||
.set(TbCallQueue::getOpenId, openId));
|
||||
}
|
||||
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(shopId);
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("shopInfo", shopInfo);
|
||||
|
||||
Reference in New Issue
Block a user