Merge remote-tracking branch 'origin/test' into dev
# Conflicts: # lastleg-service/src/main/java/com/baiyue/lastleg/pda/move/service/PdaInventoryMoveService.java # lastleg-service/src/main/java/com/baiyue/lastleg/pda/stocktake/service/PdaStocktakeService.java # lastleg-service/src/test/java/com/baiyue/lastleg/palletops/service/PdaPalletOperationServiceTest.java # lastleg-service/src/test/java/com/baiyue/lastleg/pda/move/service/PdaInventoryMoveServiceTest.java # lastleg-service/src/test/java/com/baiyue/lastleg/pda/stocktake/service/PdaStocktakeServiceTest.java
This commit is contained in:
@@ -1327,18 +1327,19 @@ INSERT INTO iam_permission
|
||||
VALUES
|
||||
(5102019, 0, 'PLATFORM', 'BUTTON', 5102010, 'platform:order:create', '平台代客创建订单', NULL, NULL, 90, 'ACTIVE', 0),
|
||||
(5102024, 0, 'PLATFORM', 'BUTTON', 5102010, 'platform:order:edit', '平台编辑订单草稿', NULL, NULL, 100, 'ACTIVE', 0),
|
||||
(5102025, 0, 'PLATFORM', 'BUTTON', 5102010, 'platform:order:submit', '平台代客提交订单', NULL, NULL, 110, 'ACTIVE', 0)
|
||||
(5102025, 0, 'PLATFORM', 'BUTTON', 5102010, 'platform:order:submit', '平台代客提交订单', NULL, NULL, 110, 'ACTIVE', 0),
|
||||
(5102027, 0, 'PLATFORM', 'BUTTON', 5102010, 'platform:order:declaration:edit', '修改客户申报资料', NULL, NULL, 121, 'ACTIVE', 0)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
permission_name = VALUES(permission_name), parent_id = VALUES(parent_id), status = 'ACTIVE', deleted = 0;
|
||||
|
||||
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id)
|
||||
SELECT 4000001, id, 0 FROM iam_permission
|
||||
WHERE id IN (5102019, 5102024, 5102025)
|
||||
WHERE id IN (5102019, 5102024, 5102025, 5102027)
|
||||
ON DUPLICATE KEY UPDATE tenant_id = VALUES(tenant_id);
|
||||
|
||||
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id)
|
||||
SELECT 4000003, id, 0 FROM iam_permission
|
||||
WHERE id IN (5102019, 5102024, 5102025)
|
||||
WHERE id IN (5102019, 5102024, 5102025, 5102027)
|
||||
ON DUPLICATE KEY UPDATE tenant_id = VALUES(tenant_id);
|
||||
|
||||
INSERT INTO iam_membership_role (membership_id, role_id, tenant_id) VALUES
|
||||
|
||||
+2
-2
@@ -151,8 +151,8 @@ public class PdaInventoryMoveService {
|
||||
private void ledger(PdaInventoryMove operation, InventoryPosition position, InventoryBalance balance,
|
||||
String operator, String key, String reason, LocalDateTime now) {
|
||||
InventoryLedger row = new InventoryLedger(); row.setId(IdWorker.getId()); row.setCustomerId(position.getCustomerId());
|
||||
row.setCustomerName(balance.getCustomerName());
|
||||
row.setBalanceId(balance.getId()); row.setPositionId(position.getId());
|
||||
row.setCustomerName(balance.getCustomerName()); row.setBalanceId(balance.getId());
|
||||
row.setPositionId(position.getId());
|
||||
row.setOverseasWarehouseId(String.valueOf(operation.getOverseasWarehouseId()));
|
||||
row.setDestinationWarehouseCode(balance.getDestinationWarehouseCode()); row.setInboundOrderId(balance.getInboundOrderId());
|
||||
row.setPalletId(position.getPalletId()); row.setPalletNo(position.getPalletNo()); row.setBatchNo(position.getBatchNo());
|
||||
|
||||
+2
-2
@@ -281,8 +281,8 @@ public class PdaStocktakeService {
|
||||
InventoryBalance balance, String operator, String key, String reason,
|
||||
long before, long delta, long after, LocalDateTime now) {
|
||||
InventoryLedger row = new InventoryLedger();
|
||||
row.setId(IdWorker.getId()); row.setCustomerId(item.getCustomerId()); row.setCustomerName(balance.getCustomerName());
|
||||
row.setBalanceId(balance.getId());
|
||||
row.setId(IdWorker.getId()); row.setCustomerId(item.getCustomerId());
|
||||
row.setCustomerName(balance.getCustomerName()); row.setBalanceId(balance.getId());
|
||||
row.setPositionId(position.getId()); row.setOverseasWarehouseId(String.valueOf(task.getOverseasWarehouseId()));
|
||||
row.setDestinationWarehouseCode(balance.getDestinationWarehouseCode()); row.setInboundOrderId(balance.getInboundOrderId());
|
||||
row.setPalletId(position.getPalletId()); row.setPalletNo(position.getPalletNo()); row.setBatchNo(position.getBatchNo());
|
||||
|
||||
+2
-1
@@ -101,7 +101,7 @@ class PdaPalletOperationServiceTest {
|
||||
|
||||
@Test void inventoryLedgerStoresStateSemanticsInsteadOfLongPalletCodes() {
|
||||
InventoryBalance balance = new InventoryBalance(); balance.setId(200L); balance.setCustomerId("100");
|
||||
balance.setCustomerName("客户甲");
|
||||
balance.setCustomerName("Customer 100");
|
||||
balance.setOverseasWarehouseId("88"); balance.setInboundOrderId(300L); balance.setInboundCode("IN-1");
|
||||
InventoryPosition position = new InventoryPosition(); position.setId(100L); position.setPalletId(20L);
|
||||
position.setPalletNo("PDAOPS-ADMIN-API-20260825095854036-SWAP-TARGET");
|
||||
@@ -116,6 +116,7 @@ class PdaPalletOperationServiceTest {
|
||||
|
||||
ArgumentCaptor<InventoryLedger> ledger = ArgumentCaptor.forClass(InventoryLedger.class);
|
||||
verify(ledgers).insert(ledger.capture());
|
||||
assertEquals("Customer 100", ledger.getValue().getCustomerName());
|
||||
assertEquals("OCCUPIED", ledger.getValue().getStatusFrom());
|
||||
assertEquals("OCCUPIED", ledger.getValue().getStatusTo());
|
||||
assertEquals("PDAOPS-LONG-LOCATION-CODE", ledger.getValue().getWarehouseLocationCode());
|
||||
|
||||
+2
-1
@@ -71,7 +71,7 @@ class PdaInventoryMoveServiceTest {
|
||||
position.setPickedPackages(0L); position.setReceivingPackages(0L); position.setVersion(4L);
|
||||
when(moves.lockPositions("900", 30L)).thenReturn(List.of(position));
|
||||
InventoryBalance balance = new InventoryBalance(); balance.setId(10L); balance.setCustomerId("100");
|
||||
balance.setCustomerName("客户甲");
|
||||
balance.setCustomerName("Customer 100");
|
||||
balance.setOverseasWarehouseId("900"); balance.setInboundOrderId(50L); balance.setInboundCode("IN-1");
|
||||
when(balances.selectById(10L)).thenReturn(balance);
|
||||
when(physical.apply(eq(900L), any(PalletPhysicalGateway.PalletReference.class), eq("OCCUPIED"),
|
||||
@@ -92,6 +92,7 @@ class PdaInventoryMoveServiceTest {
|
||||
assertThat(response.status()).isEqualTo("COMPLETED");
|
||||
ArgumentCaptor<InventoryLedger> ledger = ArgumentCaptor.forClass(InventoryLedger.class);
|
||||
verify(ledgers).insert(ledger.capture());
|
||||
assertThat(ledger.getValue().getCustomerName()).isEqualTo("Customer 100");
|
||||
assertThat(ledger.getValue().getStatusFrom()).isEqualTo("OCCUPIED");
|
||||
assertThat(ledger.getValue().getStatusTo()).isEqualTo("OCCUPIED");
|
||||
assertThat(ledger.getValue().getWarehouseLocationCode()).isEqualTo(targetLocationCode);
|
||||
|
||||
+2
-2
@@ -123,7 +123,7 @@ class PdaStocktakeServiceTest {
|
||||
position.setAllocatedPackages(0L); position.setPickedPackages(0L); position.setReceivingPackages(0L);
|
||||
position.setVersion(3L);
|
||||
InventoryBalance balance = new InventoryBalance(); balance.setId(10L); balance.setCustomerId("100");
|
||||
balance.setCustomerName("客户甲");
|
||||
balance.setCustomerName("Customer 100");
|
||||
balance.setOverseasWarehouseId("900"); balance.setAvailablePackages(5L); balance.setVersion(8L);
|
||||
when(inventory.lockPosition(11L, "100", "900")).thenReturn(position);
|
||||
when(inventory.lockBalance(10L, "100", "900")).thenReturn(balance);
|
||||
@@ -142,7 +142,7 @@ class PdaStocktakeServiceTest {
|
||||
assertThat(ledger.getValue().getDeltaPackages()).isEqualTo(2L);
|
||||
assertThat(ledger.getValue().getAfterPackages()).isEqualTo(7L);
|
||||
assertThat(ledger.getValue().getBusinessType()).isEqualTo("STOCKTAKE_ADJUST");
|
||||
assertThat(ledger.getValue().getCustomerName()).isEqualTo("客户甲");
|
||||
assertThat(ledger.getValue().getCustomerName()).isEqualTo("Customer 100");
|
||||
assertThat(response.task().status()).isEqualTo("SUBMITTED");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user