@@ -51,6 +51,7 @@ public interface OrderInfoRepo extends JpaRepository<OrderInfo, Long>, JpaSpecif
//骑手未接单的订单
List<OrderInfo> findAllByStatusAndMerchantStatus(OrderStatus status, MerchantStatus merchantStatus);
+ List<OrderInfo> findAllByRiderIdIsNull();
//按商家和时间内的订单泪飙
List<OrderInfo> findAllByMerchantIdAndOrderTimeAfter(Long merchantId, LocalDateTime dateTime);
@@ -164,7 +164,7 @@ public class OrderInfoController extends BaseController {
@GetMapping("/riderReceived")
@ApiOperation("骑手端,未接单的订单")
public List<OrderInfo> riderReceived() {
- return orderInfoRepo.findAllByStatusAndMerchantStatus(OrderStatus.PAID, MerchantStatus.RECEIVED);
+ return orderInfoRepo.findAllByRiderIdIsNull();
}
@GetMapping("/blackAll")
@@ -29,4 +29,9 @@ public class OrderInfoRepoTest {
.plusMinutes(5), MerchantStatus.RECEIVED));
+ @Test
+ public void test1(){
+ System.out.println(orderInfoRepo.findAllByRiderIdIsNull());
+ }
+