Skip to content

Warehouse Service

API คลังสินค้า และพื้นที่เก็บสินค้า


Header Request

FieldValue
GUIDGUID สำหรับการเชื่อมต่อ (smlx เสมอ)
providerชื่อผู้ใช้บริการ
databaseNameชื่อฐานข้อมูล
configFileNameไฟล์ตั้งค่าผู้ให้บริการ
ใส่ SMLConfig และตามด้วยชื่อผู้ให้บริการ และตามด้วย .xml (SMLConfig___.xml)

Header Example

{
  "GUID" : "smlx"
  "provider" : "DATA"
  "databaseName" : "data1"
  "configFileName" : "SMLConfigDATA.xml"
}

HTTP Response

StatusDescription
200Success return with data
500Bad Request
401Unauthorize

Warehouse List

แสดงข้อมูลคลังสินค้าทั้งหมด

EndPoint

GET /SMLJavaRESTService/warehouse/v4

Query Request

FieldDescription
pagenumber of page
sizepage size

Example:

GET localhost:8084/SMLJavaRESTService/warehouse/v4?page=1&size=10

Response Success

json
{
    "success": true,
    "pages": {
        "pageNo": 1,
        "pageSize": 10,
        "recordCount": 3,
        "pageCount": 1
    },
    "data": [
        {
            "code": "CENTER",
            "name_1": "คลังกลาง",
            "name_2": "Center Warehouse",
            "address": "123 ถนนสุขุมวิท",
            "telephone": "02-000-0000",
            "fax": null,
            "user_group": null,
            "wh_manager": null,
            "status": 1,
            "guid_code": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "branch_code": "001",
            "branch_use": null,
            "latitude": null,
            "longitude": null,
            "shelf": null
        }
    ]
}

Response Error

json
{
    "error": true,
    "code": "99",
    "message": "error message"
}

Warehouse Information

ดึงข้อมูลคลังสินค้าทีละ 1 คลัง พร้อมรายการพื้นที่เก็บสินค้า (shelf) ที่อยู่ในคลังนั้น

EndPoint

GET /SMLJavaRESTService/warehouse/v4/{code}

Path Parameter:

NameDescriptionExample
codeรหัสคลังสินค้าCENTER

Example:

GET localhost:8084/SMLJavaRESTService/warehouse/v4/CENTER

Response Success

json
{
    "success": true,
    "pages": null,
    "data": {
        "code": "CENTER",
        "name_1": "คลังกลาง",
        "name_2": "Center Warehouse",
        "address": "123 ถนนสุขุมวิท",
        "telephone": "02-000-0000",
        "fax": null,
        "user_group": null,
        "wh_manager": null,
        "status": 1,
        "guid_code": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "branch_code": "001",
        "branch_use": null,
        "latitude": null,
        "longitude": null,
        "shelf": [
            {
                "code": "CENTER",
                "name_1": "พื้นที่กลาง",
                "name_2": null,
                "whcode": "CENTER",
                "width": null,
                "weight": null,
                "height": null,
                "depth": null,
                "status": 1,
                "guid_code": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                "stock_control": 0,
                "remark": null
            }
        ]
    }
}

Response Error (Not Found)

json
{
    "error": true,
    "code": "404",
    "message": "Warehouse not found: CENTER"
}

Response Error

json
{
    "error": true,
    "code": "99",
    "message": "error message"
}

Warehouse Attribute

Warehouse

Field NameField TypeLengthDescription
codeString25รหัสคลังสินค้า
name_1String100ชื่อคลังสินค้า
name_2String100ชื่อคลัง (ภาษาอังกฤษ)
addressString255ที่อยู่
telephoneString50หมายเลขโทรศัพท์
faxString50หมายเลขโทรสาร
user_groupString10กลุ่มผู้ใช้งาน
wh_managerString25ผู้จัดการคลัง
statusInteger0สถานะ
guid_codeString35GUID
branch_codeString25สาขา
branch_useString500สาขาที่ใช้งาน
latitudeFloat0ละติจูด
longitudeFloat0ลองจิจูด
shelfArrayObjectรายการพื้นที่เก็บสินค้า

Shelf

Field NameField TypeLengthDescription
codeString25รหัสพื้นที่เก็บสินค้า
name_1String100ชื่อพื้นที่เก็บสินค้า
name_2String100ชื่อพื้นที่ (ภาษาอังกฤษ)
whcodeString10รหัสคลังสินค้า (FK)
widthString10กว้าง
weightString10น้ำหนัก (กก.)
heightString10สูง
depthString10ลึก
statusInteger0สถานะ
guid_codeString35GUID
stock_controlInteger0อนุญาตให้ติดลบได้
remarkString255หมายเหตุ