| | |
| | | System.out.println("订单[" + orderId + "]下无关键词,跳过状态更新"); |
| | | return; |
| | | } |
| | | boolean allValid2 = orderKeywords.stream() |
| | | .allMatch(k -> "completed".equals(k.getStatus()) || "false".equals(k.getStatus()) || "canceled".equals(k.getStatus())); |
| | | if (allValid2) { |
| | | Orders orders = orderService.getById(orderId); |
| | | if (orders != null) { |
| | | orders.setStatus(1); // 假设Orders有Integer类型的status字段 |
| | | orderService.updateById(orders); |
| | | System.out.println("订单[" + orderId + "]所有关键词采集完成或者取消,已更新状态为1"); |
| | | } else { |
| | | System.out.println("未找到订单[" + orderId + "],无法更新状态"); |
| | | } |
| | | } |
| | | // 3. 检查所有关键词的状态是否均为 completed 或 false |
| | | boolean allValid = orderKeywords.stream() |
| | | .allMatch(k -> "completed".equals(k.getStatus()) || "false".equals(k.getStatus())); |
| | |
| | | System.out.println("未找到订单[" + orderId + "],无法更新状态"); |
| | | } |
| | | } |
| | | boolean allValid2 = orderKeywords.stream() |
| | | .allMatch(k -> "completed".equals(k.getStatus()) || "false".equals(k.getStatus()) || "canceled".equals(k.getStatus())); |
| | | if (allValid) { |
| | | Orders orders = orderService.getById(orderId); |
| | | if (orders != null) { |
| | | orders.setStatus(1); // 假设Orders有Integer类型的status字段 |
| | | orderService.updateById(orders); |
| | | System.out.println("订单[" + orderId + "]所有关键词采集完成或者取消,已更新状态为1"); |
| | | } else { |
| | | System.out.println("未找到订单[" + orderId + "],无法更新状态"); |
| | | } |
| | | } |
| | | |
| | | |
| | | Orders orders = orderService.getById(keyword.getOrder_id()); |
| | | |