修复智能装柜日期筛选调用
This commit is contained in:
@@ -7,7 +7,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -22,8 +21,8 @@ public interface PendingReviewOrderClient {
|
|||||||
@RequestParam(required = false) Long warehouseId,
|
@RequestParam(required = false) Long warehouseId,
|
||||||
@RequestParam(required = false) Long customerId,
|
@RequestParam(required = false) Long customerId,
|
||||||
@RequestParam(required = false) String inboundCode,
|
@RequestParam(required = false) String inboundCode,
|
||||||
@RequestParam(required = false) LocalDate createdStart,
|
@RequestParam(required = false) String createdStart,
|
||||||
@RequestParam(required = false) LocalDate createdEnd,
|
@RequestParam(required = false) String createdEnd,
|
||||||
@RequestParam long page,
|
@RequestParam long page,
|
||||||
@RequestParam long size);
|
@RequestParam long size);
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class SmartLoadingService {
|
|||||||
ApiResponse<PageResult<PendingReviewOrderClient.Row>> response;
|
ApiResponse<PageResult<PendingReviewOrderClient.Row>> response;
|
||||||
try {
|
try {
|
||||||
response = pendingReviewOrders.page(internalToken, List.copyOf(actualChannels), query.warehouseId(),
|
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);
|
page, size);
|
||||||
} catch (RuntimeException exception) {
|
} catch (RuntimeException exception) {
|
||||||
throw new BizException(ResultCode.SERVICE_UNAVAILABLE, "待审核订单服务暂时不可用");
|
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());
|
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,
|
private List<InboundCandidate> pendingReviewRange(InboundCandidateQuery query, Set<String> channels,
|
||||||
long offset, long limit) {
|
long offset, long limit) {
|
||||||
return pageRange(offset, limit, (page, size) -> pendingReviewCandidates(query, channels, page, size));
|
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"),
|
"EXX_TRUCK", "EXX海卡", 100, LocalDateTime.parse("2026-09-02T15:31:36"),
|
||||||
"PENDING_REVIEW");
|
"PENDING_REVIEW");
|
||||||
when(pendingReviewOrders.page(anyString(), anyList(), eq(193000000000200002L),
|
when(pendingReviewOrders.page(anyString(), anyList(), eq(193000000000200002L),
|
||||||
isNull(), eq("EXXHK2609020361"), eq(LocalDate.parse("2026-09-02")),
|
isNull(), eq("EXXHK2609020361"), eq("2026-09-02"),
|
||||||
eq(LocalDate.parse("2026-09-02")), eq(1L), eq(20L)))
|
eq("2026-09-02"), eq(1L), eq(20L)))
|
||||||
.thenReturn(ApiResponse.success(new PageResult<>(List.of(row), 1, 20, 1, 1)));
|
.thenReturn(ApiResponse.success(new PageResult<>(List.of(row), 1, 20, 1, 1)));
|
||||||
|
|
||||||
var result = service.inboundCandidates(query);
|
var result = service.inboundCandidates(query);
|
||||||
|
|||||||
Reference in New Issue
Block a user