Cargo-Planner Docs

示例

基于此处提供的初始配置,我们提供了一些数据结构,您可以在创建集成时从中获得灵感。

集装箱类型和托盘类型都可以引用一个id和/或内联数据。当使用id时,集装箱和托盘类型规格将从我们的集装箱库中获取。您可以通过id获取集装箱规格,并通过更改相应数据结构中的字段来覆盖属性。

请参考API文档以了解所有可用属性。

装载到自定义集装箱

let calculationData = {
  length_dim: 'M',
  weight_dim: 'KG',
  items: [
    {
      label: 'My cargo 1',
      l: 0.5,
      w: 0.4,
      h: 0.3,
      wt: 25,
      qty: 100,
    },
  ],
  container_types: [
    {
      name: 'My container',
      L: 12,
      W: 2,
      H: 2,
      payload: 20000,
    },
  ],
};

装载到库中的集装箱

这将把货物装载到库中的集装箱类型中,并覆盖有效载荷(最大重量)。您可以在此处找到可用类型:API文档

let calculationData = {
  length_dim: 'M',
  weight_dim: 'KG',
  items: [
    {
      label: 'My cargo 1',
      l: 0.5,
      w: 0.4,
      h: 0.3,
      wt: 25,
      qty: 100,
    },
  ],
  container_types: [
    {
      id: 1, //a 20ft DV - id found from the API
      payload: 20000,
    },
  ],
};

检查多少货物可以装入拖车

此示例将检查多少货物可以装入53英尺的半挂车

let calculationData = {
  length_dim: 'M',
  weight_dim: 'KG',
  items: [
    {
      label: 'My cargo 1',
      l: 0.5,
      w: 0.4,
      h: 0.3,
      wt: 25,
      tiltable: true,
      qty: undefined, // No limit load
    },
  ],
  container_types: [
    {
      id: 1080, //a 53ft Semi trailer - id found from the API
      payload: 1080,
    },
  ],
};

托盘化货物

下面的示例将首先将货物加载到托盘化字段设置为true的提供托盘类型中,然后将托盘和其他货物加载到我们的自定义集装箱类型中

let calculationData = {
  length_dim: 'M',
  weight_dim: 'KG',
  items: [
    {
      label: 'My cargo 1',
      l: 0.5,
      w: 0.4,
      h: 0.3,
      wt: 25,
      qty: 100,
      palletize: true,
    },
    {
      label: 'My cargo 2',
      l: 2,
      w: 1,
      h: 0.5,
      wt: 250,
      qty: 2,
      palletize: false, //default
    },
  ],
  container_types: [
    {
      name: 'My container',
      L: 12,
      W: 2,
      H: 2,
      payload: 20000,
    },
  ],
  pallet_types: [
    {
      name: 'EU',
      L: 1.2,
      W: 0.8,
      H: 0,
      max_height: 2,
      payload: 1000,
    },
  ],
};