修复智能装柜日期筛选调用

This commit is contained in:
2026-09-03 22:05:27 +08:00
parent d3eaa901f5
commit 65b29adb01
3 changed files with 9 additions and 6 deletions
@@ -7,7 +7,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@@ -22,8 +21,8 @@ public interface PendingReviewOrderClient {
@RequestParam(required = false) Long warehouseId,
@RequestParam(required = false) Long customerId,
@RequestParam(required = false) String inboundCode,
@RequestParam(required = false) LocalDate createdStart,
@RequestParam(required = false) LocalDate createdEnd,
@RequestParam(required = false) String createdStart,
@RequestParam(required = false) String createdEnd,
@RequestParam long page,
@RequestParam long size);
@@ -183,7 +183,7 @@ public class SmartLoadingService {
ApiResponse<PageResult<PendingReviewOrderClient.Row>> response;
try {
response = pendingReviewOrders.page(internalToken, List.copyOf(actualChannels), query.warehouseId(),
query.customerId(), query.inboundCode(), query.createdStart(), query.createdEnd(),
query.customerId(), query.inboundCode(), isoDate(query.createdStart()), isoDate(query.createdEnd()),
page, size);
} catch (RuntimeException exception) {
throw new BizException(ResultCode.SERVICE_UNAVAILABLE, "待审核订单服务暂时不可用");
@@ -201,6 +201,10 @@ public class SmartLoadingService {
return new PageResult<>(records, source.page(), source.size(), source.total(), source.pages());
}
private static String isoDate(java.time.LocalDate value) {
return value == null ? null : value.toString();
}
private List<InboundCandidate> pendingReviewRange(InboundCandidateQuery query, Set<String> channels,
long offset, long limit) {
return pageRange(offset, limit, (page, size) -> pendingReviewCandidates(query, channels, page, size));
@@ -312,8 +312,8 @@ class SmartLoadingServiceTest {
"EXX_TRUCK", "EXX海卡", 100, LocalDateTime.parse("2026-09-02T15:31:36"),
"PENDING_REVIEW");
when(pendingReviewOrders.page(anyString(), anyList(), eq(193000000000200002L),
isNull(), eq("EXXHK2609020361"), eq(LocalDate.parse("2026-09-02")),
eq(LocalDate.parse("2026-09-02")), eq(1L), eq(20L)))
isNull(), eq("EXXHK2609020361"), eq("2026-09-02"),
eq("2026-09-02"), eq(1L), eq(20L)))
.thenReturn(ApiResponse.success(new PageResult<>(List.of(row), 1, 20, 1, 1)));
var result = service.inboundCandidates(query);