Flagship
SDK Example

Initialization

Import Package

import com.syriusrobotics.flexgalaxy.sdk.warehouse.Config;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.FlagShipClient;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.binlocation.domain.request.*;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.binlocation.domain.response.*;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.common.SdkHttpResponse;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.storagetype.domain.StorageTypeAttributes;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.storagetype.domain.StorageTypeCell;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.storagetype.domain.StorageTypeRelations;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.storagetype.domain.request.*;
import com.syriusrobotics.flexgalaxy.sdk.warehouse.storagetype.domain.response.*;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

Init FlagShipClient

Config config =
Config.builder()
.endPoint("https://your-end-point/")
.clientId("your client id")
.clientSecret("your client secret")
.build();
FlagShipClient flexgalaxyRequest = FlagShipClient.getInstance(config);

BinLocations

createBinLocations

Create BinLocations.

// create binLocations
BinLocationCreateRequestVO binLocationCreateRequestVO = new BinLocationCreateRequestVO();
List<BinLocationCreateRequestVO> binLocationCreateRequests = new ArrayList<>();
BinLocationCreateRequestVO binLocationCreateRequest = new BinLocationCreateRequestVO();
binLocationCreateRequest.setBinLocationId("A01-B2-C3-001");
binLocationCreateRequest.setWareHouseId("A01");
binLocationCreateRequest.setWareHouseName("wareHouse-01");
BinLocationCreateAttributesRequest binLocationCreateAttributesRequest =
new BinLocationCreateAttributesRequest();
binLocationCreateAttributesRequest.setShelfId("A01-B2");
binLocationCreateAttributesRequest.setNumOfLayer(5);
binLocationCreateAttributesRequest.setShelfLayer(5);
binLocationCreateRequest.setAttributes(binLocationCreateAttributesRequest);
binLocationCreateRequests.add(binLocationCreateRequest);
SdkHttpResponse<List<BinLocationCreateResponseVO>> binLocations =
flexgalaxyRequest.createBinLocations(binLocationCreateRequests);

upload binLocations file(csv)

Upload binLocations file(csv).

File file = new File("your file path");
BinLocationCreateMultipartRequestVO binLocationCreateMultipartRequestVO =
new BinLocationCreateMultipartRequestVO();
binLocationCreateMultipartRequestVO.setBinLocationFile(file);
SdkHttpResponse<List<BinLocationCreateResponseVO>> multipartBinLocations =
flexgalaxyRequest.createMultipartBinLocations(binLocationCreateMultipartRequestVO);

get all binLocations

Get all binLocations.

BinLocationGetAllRequestVO binLocationGetAllRequestVO1 = new BinLocationGetAllRequestVO();
binLocationGetAllRequestVO1.setWarehouseId("A01");
binLocationGetAllRequestVO1.setBinLocationIds(Arrays.asList("A01-B2-C3-001"));
binLocationGetAllRequestVO1.setPageIndex(0);
binLocationGetAllRequestVO1.setPageSize(10);
SdkHttpResponse<BinLocationGetAllResponseVO> binLocationGetAllResponseVOSdkHttpResponse1 =
flexgalaxyRequest.getAllBinLocations(binLocationGetAllRequestVO1);

delete binLocation by binLocationId

Delete binLocation by binLocationId.

BinLocationDeleteRequestVO binLocationDeleteRequestVO = new BinLocationDeleteRequestVO();
binLocationDeleteRequestVO.setWarehouseId("A01");
binLocationDeleteRequestVO.setBinLocationIds(Arrays.asList("A01-B2-C3-001"));
SdkHttpResponse<Void> voidSdkHttpResponse =
flexgalaxyRequest.deleteBinLocationById(binLocationDeleteRequestVO);

StorageType

create storageType

Create storageType.

StorageTypeCreateRequestVO storageTypeCreateRequestVO = new StorageTypeCreateRequestVO();
storageTypeCreateRequestVO.setAttributes(
StorageTypeAttributes.builder()
.cellNumber(12)
.high(10F)
.icon("icon")
.layers(20)
.length(12F)
.maxLoad(12.9F)
.numOfLayerCell(18)
.openingDirection("BACK")
.quantity(12)
.toolType("standard")
.build());
StorageTypeCell storageTypeCell =
StorageTypeCell.builder()
.capacity(12)
.color("yellow")
.disassemble(false)
.high(12F)
.id("123")
.length(109F)
.name("name")
.width(132F)
.build();
ArrayList<StorageTypeCell> storageTypeCells = new ArrayList<>();
storageTypeCells.add(storageTypeCell);
storageTypeCreateRequestVO.setCells(storageTypeCells);
storageTypeCreateRequestVO.setName("name12334");
ArrayList<StorageTypeRelations> storageTypeRelations = new ArrayList<>();
StorageTypeRelations typeRelations =
StorageTypeRelations.builder()
.num(10)
.relationExpression("in")
.require(false)
.storageTypeId("relation storageTypeId")
.build();
storageTypeRelations.add(typeRelations);
storageTypeCreateRequestVO.setRelations(storageTypeRelations);
SdkHttpResponse<StorageTypeCreateResponseVO> storageType =
flexgalaxyRequest.createStorageType(storageTypeCreateRequestVO);

update storageType by storageTypeId

Update storageType by storageTypeId.

StorageTypeUpdateRequestVO storageTypeUpdateRequestVO = new StorageTypeUpdateRequestVO();
storageTypeUpdateRequestVO.setAttributes(
StorageTypeAttributes.builder()
.cellNumber(12)
.high(10F)
.icon("icon")
.layers(20)
.length(12F)
.maxLoad(12.9F)
.numOfLayerCell(18)
.openingDirection("BACK")
.quantity(12)
.toolType("standard")
.build());
StorageTypeCell updateStorageTypeCell =
StorageTypeCell.builder()
.capacity(12)
.color("yellow")
.disassemble(false)
.high(12F)
.id("123")
.length(109F)
.name("name")
.width(132F)
.build();
ArrayList<StorageTypeCell> updateStorageTypeCells = new ArrayList<>();
updateStorageTypeCells.add(updateStorageTypeCell);
storageTypeUpdateRequestVO.setCells(updateStorageTypeCells);
storageTypeUpdateRequestVO.setName("name12334");
ArrayList<StorageTypeRelations> updateStorageTypeRelations = new ArrayList<>();
StorageTypeRelations updateTypeRelations =
StorageTypeRelations.builder()
.num(10)
.relationExpression("in")
.require(false)
.storageTypeId("relation your storageType Id")
.build();
updateStorageTypeRelations.add(updateTypeRelations);
storageTypeUpdateRequestVO.setRelations(updateStorageTypeRelations);
storageTypeUpdateRequestVO.setStorageTypeId("123456");
SdkHttpResponse<StorageTypeUpdateResponseVO> storageTypeUpdateResponseVOSdkHttpResponse =
flexgalaxyRequest.updateStorageType(storageTypeUpdateRequestVO);

get all storageType

Get all storageType.

StorageTypeGetAllRequestVO storageTypeGetAllRequestVO = new StorageTypeGetAllRequestVO();
storageTypeGetAllRequestVO.setName("name");
storageTypeGetAllRequestVO.setPageIndex(0);
storageTypeGetAllRequestVO.setPageSize(1);
SdkHttpResponse<StorageTypeGetAllResponseVO> sdkHttpResponse =
flexgalaxyRequest.getAllStorageType(storageTypeGetAllRequestVO);

delete storageType by storageTypeId

Delete storageType by storageTypeId.

StorageTypeDeleteRequestVO storageTypeDeleteRequestVO = new StorageTypeDeleteRequestVO();
storageTypeDeleteRequestVO.setStorageTypeId("demoid");
SdkHttpResponse<Void> deleteStorageTypeById =
flexgalaxyRequest.deleteStorageTypeById(storageTypeDeleteRequestVO);

get storageType by storageTypeId

Get storageType by storageTypeId.

StorageTypeGetRequestVO storageTypeGetRequestVO = new StorageTypeGetRequestVO();
storageTypeGetRequestVO.setStorageTypeId("demoid");
SdkHttpResponse<StorageTypeGetResponseVO> storageTypeGetResponseVOSdkHttpResponse =
flexgalaxyRequest.getStorageTypeById(storageTypeGetRequestVO);

Order

create Orders

private static OrdersCreationRequestVO buildSampleOrdersCreationRequestVO() {
Long now = System.currentTimeMillis();
Map<String, Object> attributes = new HashMap<>();
attributes.put("extendProperty", "sampleValue");
StorageRequestVO storageRequestVO = StorageRequestVO.builder().type("6A_storage").build();
ItemRequestVO itemRequestVO = ItemRequestVO.builder()
.name("banana")
.barcode("6971808583047")
.imageUrl("https://yourimagestoreagesyrius.syrius")
.quantity(5)
.binLocations(Arrays.asList("binLocation-id-01", "binLocation-id-02"))
.build();
SingleOrderRequestVO singleOrderRequestVO =
SingleOrderRequestVO.builder()
.id("sampleId")
.batchId(null)
.timestamp(now)
.expectedExecutionTime(now + 100000L)
.expectedFinishTime(now + 2 * 60 * 60 * 1000L)
.notifyUrl("https://samplesCustomerDomainForSyrius.sampleczs")
.priority("5")
.type("ORDER_PICKING")
.attributes(attributes)
.items(Arrays.asList(itemRequestVO))
.storages(Arrays.asList(storageRequestVO))
.build();
return OrdersCreationRequestVO.builder().orders(Arrays.asList(singleOrderRequestVO)).build();
}
SdkHttpResponse<OrdersCreationResponseVO> ordersCreationResponse = flagshipClient.createOrders(buildSampleOrdersCreationRequestVO());

get Order

SdkHttpResponse<SingleOrderResponseVO> orderGetResponse = flagshipClient.getOrderById(OrderGetRequestVO.builder().id("sampleId").build());