Merge remote-tracking branch 'origin/test' into test
# Conflicts: # deploy/sql/头程数据库统一增量-MySQL8.sql
This commit is contained in:
-2
@@ -16,8 +16,6 @@ class PdaConvergenceOpenApiContractTest {
|
||||
.contains("/api/platform/v1/first-leg/pda-loading/tasks:")
|
||||
.contains("/tasks/{taskId}/claim:")
|
||||
.contains("/tasks/{taskId}/assign:")
|
||||
.contains("/tasks/{taskId}/items/{itemId}/claim:")
|
||||
.contains("/tasks/{taskId}/items/{itemId}/assign:")
|
||||
.contains("/tasks/{taskId}/items/{itemId}/pick:")
|
||||
.contains("/tasks/{taskId}/items/{itemId}/partial:")
|
||||
.contains("/tasks/{taskId}/items/{itemId}/skip:")
|
||||
|
||||
-2
@@ -18,10 +18,8 @@ class PdaConvergenceSqlContractTest {
|
||||
.getContentAsString(StandardCharsets.UTF_8);
|
||||
assertThat(sql)
|
||||
.contains("CREATE TABLE IF NOT EXISTS fl_loading_pick_assignment")
|
||||
.contains("CREATE TABLE IF NOT EXISTS fl_loading_pick_item_assignment")
|
||||
.contains("CREATE TABLE IF NOT EXISTS fl_loading_pick_review")
|
||||
.contains("CREATE TABLE IF NOT EXISTS fl_loading_pick_operation")
|
||||
.contains("'ITEM_CLAIM', 'ITEM_ASSIGN'")
|
||||
.contains("UNIQUE KEY uk_loading_pick_operation_id")
|
||||
.contains("trg_loading_pick_review_before_update")
|
||||
.contains("trg_loading_pick_operation_before_delete")
|
||||
|
||||
@@ -3,13 +3,11 @@ package com.baiyue.firstleg.service;
|
||||
import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.firstleg.dto.LoadingPickDtos.PartialPickRequest;
|
||||
import com.baiyue.firstleg.dto.LoadingPickDtos.PickRequest;
|
||||
import com.baiyue.firstleg.dto.LoadingPickDtos.ClaimRequest;
|
||||
import com.baiyue.firstleg.dto.LoadingPickDtos.ReviewRequest;
|
||||
import com.baiyue.firstleg.dto.LoadingPickDtos.SkipRequest;
|
||||
import com.baiyue.firstleg.entity.LoadingPickAssignmentEntity;
|
||||
import com.baiyue.firstleg.entity.LoadingPickHistoryEntity;
|
||||
import com.baiyue.firstleg.entity.LoadingPickItemEntity;
|
||||
import com.baiyue.firstleg.entity.LoadingPickItemAssignmentEntity;
|
||||
import com.baiyue.firstleg.entity.LoadingPickOperationEntity;
|
||||
import com.baiyue.firstleg.entity.LoadingPickTaskEntity;
|
||||
import com.baiyue.firstleg.repository.LoadingPickRepository;
|
||||
@@ -112,47 +110,6 @@ class LoadingPickServiceTest {
|
||||
verify(settlementService, never()).settle(20L, 9L, "operator");
|
||||
}
|
||||
|
||||
@Test
|
||||
void permitsItemAssigneeWithoutCabinetAssignee() {
|
||||
LoadingPickTaskEntity task = task();
|
||||
LoadingPickItemEntity item = item();
|
||||
when(repository.history("item-owner-pick")).thenReturn(null);
|
||||
when(repository.task(20L)).thenReturn(task);
|
||||
when(repository.taskForUpdate(20L)).thenReturn(task);
|
||||
when(repository.item(20L, 30L, 101L)).thenReturn(item);
|
||||
when(repository.itemAssignment(30L)).thenReturn(itemAssignment(9L, "operator"));
|
||||
when(repository.pick(30L, 2, "MANUAL", "[]", 0, 101L)).thenReturn(1);
|
||||
when(repository.touchTask(20L, 0)).thenReturn(1);
|
||||
when(repository.items(20L, 101L)).thenReturn(List.of(item));
|
||||
|
||||
service.pick(20L, 30L, new PickRequest(101L, 2, List.of(), 0, "item-owner-pick"),
|
||||
9L, "operator");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void permitsTwoWorkersToClaimDifferentItemsInOneCabinet() {
|
||||
LoadingPickTaskEntity task = task();
|
||||
LoadingPickItemEntity first = item();
|
||||
LoadingPickItemEntity second = item();
|
||||
second.setId(31L);
|
||||
when(repository.taskForUpdate(20L)).thenReturn(task);
|
||||
when(repository.task(20L)).thenReturn(task);
|
||||
when(repository.item(20L, 30L)).thenReturn(first);
|
||||
when(repository.item(20L, 31L)).thenReturn(second);
|
||||
when(repository.itemAssignment(30L)).thenReturn(null);
|
||||
when(repository.itemAssignment(31L)).thenReturn(null);
|
||||
when(repository.createItemAssignment(30L, 9L, "worker-a", 9L, "worker-a", "CLAIMED")).thenReturn(1);
|
||||
when(repository.createItemAssignment(31L, 10L, "worker-b", 10L, "worker-b", "CLAIMED")).thenReturn(1);
|
||||
when(repository.items(20L)).thenReturn(List.of(first, second));
|
||||
|
||||
service.claimItem(20L, 30L, new ClaimRequest(0, "claim-a"), 9L, "worker-a");
|
||||
service.claimItem(20L, 31L, new ClaimRequest(0, "claim-b"), 10L, "worker-b");
|
||||
|
||||
verify(repository).createItemAssignment(30L, 9L, "worker-a", 9L, "worker-a", "CLAIMED");
|
||||
verify(repository).createItemAssignment(31L, 10L, "worker-b", 10L, "worker-b", "CLAIMED");
|
||||
}
|
||||
|
||||
@Test
|
||||
void reviewSettlesResolvedItemsAndCompletesPlan() {
|
||||
LoadingPickTaskEntity task = task();
|
||||
@@ -231,12 +188,4 @@ class LoadingPickServiceTest {
|
||||
return assignment;
|
||||
}
|
||||
|
||||
private static LoadingPickItemAssignmentEntity itemAssignment(long assigneeId, String assigneeName) {
|
||||
LoadingPickItemAssignmentEntity assignment = new LoadingPickItemAssignmentEntity();
|
||||
assignment.setPickItemId(30L);
|
||||
assignment.setAssigneeId(assigneeId);
|
||||
assignment.setAssigneeName(assigneeName);
|
||||
assignment.setVersion(0);
|
||||
return assignment;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user