|
|
|
@ -155,11 +155,15 @@ public class IoCollectLedGroupService extends ServiceImpl<IoCollectLedGroupMappe
|
|
|
|
|
.eq(SysOrderLed::getOrderId, "")
|
|
|
|
|
.orderByAsc(SysOrderLed::getLedNum));
|
|
|
|
|
//如果为null 当前灯组已满
|
|
|
|
|
if (orderLeds.isEmpty()) {
|
|
|
|
|
// 如果没有可用灯组,抛出异常或返回 null
|
|
|
|
|
throw new JsonException("当前灯组已满!");
|
|
|
|
|
}
|
|
|
|
|
SysOrderLed orderLed = orderLeds.get(0);
|
|
|
|
|
//if 没有满 设置订单id
|
|
|
|
|
orderLed.setOrderId(orderIdFk);
|
|
|
|
|
sysOrderLedService.updateById(orderLed);
|
|
|
|
|
//设置成功加入redis 一分钟超时时间 过期删除 然后根据订单id 清楚灯组
|
|
|
|
|
//设置成功加入redis 三分钟超时时间 过期删除 然后根据订单id 清楚灯组
|
|
|
|
|
redisDelayedQueue.addTaskToQueue(orderIdFk + ";" + mac + ";" + bizId,3 * 60,"led_queue");
|
|
|
|
|
return orderLed.getLedNum();
|
|
|
|
|
|
|
|
|
|