查询条码接口

一、说明

  • 该接口主要查询AI-WMS PLUS条码库的条码信息;
  • 除了可根据条码主表的栏位作为过滤查询外,还可根据自定义栏位作为过滤条件查询;
  • 执行此接口,可通过AI-WMS PLUS系统的【第三方调用历史表】查看接口记录。

二、参数说明

1、请求方式

请求方式 POST
接口地址 http://服务器IP或机器名或域名/WMS/API/SYS/QueryBarcodes
格式 JSON
编码类型 UTF-8

2、header参数

KEY VALUE
Content-Type application/json
Authorization token值 说明:授权接口所获取的值

3、请求参数

字段 字段名 字段类型 长度 必填 说明
ref_id 第三方系统标识 String 20 第三方系统标识
oth_task_id 第三方任务单号 String 100 第三方任务单号
owner_code 货主编码 String 20 不启用货主功能时,默认为OWNER,启用货主后,根据实际的货主编码
type_id 条码类型 String 100 @BB为箱条码、@BC为货品条码、@BR为序列号
start_print_date 开始日期 DateTime      [开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值
end_print_date 截止日期 DateTime     [开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值
barcode 条码 String 200   可带前缀,也可不带;[开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值
item_code 货品代号 String 50   [开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值
sku_property 货品特征 String 255    
inspection_status 列示检验状态 String 1 0则视为全部;1只列示合格;2只列示不合格;3只列示待检
source_order_code 来源单号 String 100    
cus_code 客户代号 String 30    
inventory_date 盘点日期 DateTime      
inventory_date_flag 盘点日期为空是否列示 String 1   T为列示,不传或F为不列示
unboxed_flag 列示装外箱的箱码 String 1   T为列示,不传或为空视为T,F为不列示
warehouse_code 仓库代号 String 30    
page_number 查询第几页 int   查询第几页
operator_code 打印人 String 30    
limit 每页列示笔数 int   每页列示笔数
custom_filter:[{自定义条件组1},{自定义条件组2},…]
field 自定义栏位代号 String     值为自定义栏位代号
filter_type 查询条件 String     跟VUE查询条件一样,常见有range:起止;contain:类似;in:在…中;equal:等于;large_than:大于;large_equal_than:大于等于;less_than:小于;less_equal_than:小于等于;not_equal:不等于
field_type 类型 String     目前有date:日期;string:字符;number:数字
value 自定义栏位值 String      

4、返回参数

  字段 字段名 字段类型 长度 说明
code 成功标识 string 10 返回0则表示成功,其他则为失败
message 返回信息 string 200  
page_number 当前页数 int 100  
limit 每页列示笔数 int    
total_page 总页数 int    
total 总笔数 int    
details 返回入库通知单明细 string    

三、请求JSON范例

{
    "ref_id": "MES", //必填,第三方系统标识
    "oth_task_id": "{{$guid}}", //必填,第三方任务单号
    "owner_code": "OWNER", //货主编码,未启用货主编码时,默认传OWNER;启用多货主编码时,则必填,需传货主编码;
    "type_id": "@BB", //条码类型,必填,@BB为箱条码、@BC为货品条码、@BR为序列号
    "start_print_date": "2025-11-10", //开始日期,[开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值;
    "end_print_date": "2026-03-10", //截止日期,[开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值;
    "barcode": "", //条码,可带前缀,也可不带;[开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值;
    "item_code": "C1001", //货品代号,[开始日期&截止日期]与[条码]、[货品代号],三种参数条件任意条件必须有值;
    "sku_property": "", //货品特征
    "inspection_status": "0", //列示检验状态,0则视为全部;1只列示合格;2只列示不合格;3只列示待检;
    "source_order_code": "", //来源单号
    "cus_code": "", //客户代号
    "inventory_date": "", //盘点日期
    "inventory_date_flag": "T", //盘点日期为空是否列示,T为列示,不传或F为不列示
    "unboxed_flag": "T", //列示装外箱的箱码,T列示,不传或为空视为T,F为不列示;
    "warehouse_code": "", //仓库代号
    "operator_code": "", //打印人
    "page_number": "1", //查询第几页
    "limit": "100", //每页列示笔数
    "custom_filter": [
        {
            "field": "D004_BB_WB1", //字段名必须大写,该字段必须在单据表头或单据表头自定义字段表中存在;
            "filter_type": "contain", //与vue查询条件的范围值一样
            "field_type": "string", //date:日期;string:字符;number:数字
            "value": "三" //条件值
        },
        {
            "field": "D004_BB_INT", //字段名必须大写,该字段必须在单据表头或单据表头自定义字段表中存在;
            "filter_type": "large_equal_than", //与vue查询条件的范围值一样
            "field_type": "number", //date:日期;string:字符;number:数字
            "value": "5" //条件值
        },
        {
            "field": "D004_BB_DD", //字段名必须大写,该字段必须在单据表头或单据表头自定义字段表中存在;
            "filter_type": "range", //与vue查询条件的范围值一样
            "field_type": "date", //date:日期;string:字符;number:数字
            "value": [
                "2026-03-01",
                "2026-04-28"
            ] //条件值
        },
        {
            "field": "D004_BB_SF", //字段名必须大写,该字段必须在单据表头或单据表头自定义字段表中存在;
            "filter_type": "IN", //与vue查询条件的范围值一样
            "field_type": "string", //date:日期;string:字符;number:数字
            "value": "" //条件值
        }
    ]
}

四、返回JSON范例

{
    "code": 0,
    "message": "查询成功",
    "page_number": 1,
    "limit": 100,
    "total_page": 1,
    "total": 7,
    "datas": [
        {
            "owner_code": "OWNER",
            "type_id": "@BB",
            "barcode": "C100126031000500001",
            "warehouse_code": "",
            "storage_code": "",
            "item_code": "C1001",
            "sku_property": "",
            "batch_code": "260310005",
            "qty": "1.00000000",
            "qty1": "0.00000000",
            "container_code": "",
            "outer_box_code": "",
            "original_box_code": "",
            "stop_flag": "",
            "inspection_flag": "",
            "picking_flag": "",
            "remark": "",
            "last_inventory_date": "",
            "box_flag": "T",
            "inspection_status": "",
            "source_order_id": "",
            "source_order_code": "",
            "cus_code": "",
            "cus_name": "",
            "create_date": "2026/3/10 0:00:00",
            "valid_date": "",
            "custom_field": {
                "D004_BB_WB1": "一二三",
                "D004_BB_INT": "5",
                "D004_BB_SF": "",
                "D004_BB_DD": "2026/3/31 0:00:00",
                "D004_BB_WB2": ""
            }
        }
    ]
}