批量查询【生产退料单】接口

概述

该接口主要用于第三方平台或自主研发者,需要通过日期、单号、部门批量查询ERP系统的单据时,则可调用该单据的批量查询接口,将Sunlike ERP或Online ERP系统中的批量单据信息查询到第三方平台中。

参数说明

1.请求方式

请求方式 POST
接口地址 http://ERPAPI站点/MRPAG/BATCHDATA
格式 JSON
编码类型 UTF-8

2.header参数

Content-Type application/json
Authorization token 授权接口所获取的值

3.请求参数

字段名称 字段代号 类型 长度 必填 固定值 备注
程序代号 PGM     MRPAGI  
单据别 MLID String 2 M2  
单据号码 ML_NO String 38     ERP的单号,可传多张单号,加中括号[],单号之间用豆号隔开,如”ML_NO”:[“PR11110001″,”PR11110002”]
日期类型 DATE_TYPE String 1   0表示单据日期,1表示制单日期,2表示终审日期,3修改日期
开始日期 START_DATE datetime       从开始日期开始查询单据,当单号为空时,日期必填
结束日期 END_DATE datetime       查询以结束日期截止的单据,当单号为空时,日期必填
单据部门 QT_DEP string 8     多个部门,用中括号[]包住多个部门,以豆号隔开,不含下属部门,如”DEP”:[“01″,”02”];单个部门,不用中括号,有含下属
排序 ORDER_BY         例如:“ORDER BY”:{“ML_NO”:”DESC”}

请求JSON示例

{
    "PGM":"MRPAGI",       //程序代号
    "MLID":"M2",      //单据别
    "ML_NO":"",       //生产领料单号
    "DATE_TYPE":0,        //0表示单据日期,1表示制单日期,2表示终审日期,3修改日期
     "START_DATE":"2021-03-08",  //查询的开始日期
     "END_DATE":"2021-03-08",   //查询的结束日期
     "DEP":"00000000",      //有[]表示多选,不含下属部门;没有[]表示单选且含下属
     "ORDER_BY":{        //排序规则
      "ML_NO":"DESC"   //DESC表示降序排序
     }
}

返回结果示例

{
    "code": 0,    //0表示执行成功
    "message": "查询成功",
    "data": {
        "UP_DD": "2021-03-08 11:03:26",
        "TOTAL_NUM": 1,
        "BILL_LIST": [       //批量查询返回的单据明细
            {
                "MF_ML": [
                    {
                        "MLID": "M2",
                        "ML_NO": "M213080001",
                        "ML_ID": "2",
                        "ML_DD": "2021-03-08 00:00:00",
                        "FIX_CST1": "1",
                        "MO_NO": "MO13080001",
                        "VOH_ID": "",
                        "DEP": "00000000",
                        "CHK_MAN": "ADMIN",
                        "USR": "ADMIN",
                        "PRT_SW": "N",
                        "CLS_DATE": "2021-03-08 00:00:00",
                        "SYS_DATE": "2021-03-08 11:03:26",
                        "YL_ID": "F"
                    }
                ],
                "TF_ML": [
                    {
                        "MLID": "M2",
                        "ML_NO": "M213080001",
                        "ML_ID": "2",
                        "ITM": 1,
                        "PRD_NO": "A4001",
                        "PRD_NO_NO": "A4001",
                        "PRD_NAME": "A4001原料",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 4.00000000,
                        "CST": 0.00000000,
                        "REM": "",
                        "CST_STD": 0.00000000,
                        "PRD_NO_CHG": "",
                        "ID_NO": "",
                        "PRE_ITM": 1,
                        "EST_ITM": 1,
                        "LOS_RTO": 0.00000000,
                        "QTY_STD": 2.00000000,
                        "PRD_MARK": "",
                        "CHG_RTO": "",
                        "USEIN_NO": "",
                        "ML_DD": "2021-03-08 00:00:00",
                        "MO_NO": "MO13080001",
                        "TZ_NO": "",
                        "QTY_ML": 2.00000000,
                        "QL_NO": "",
                        "QL_ID": "",
                        "UNIT_H": "1",
                        "QTY_WH": -10.00000000,
                        "ZC_NO": "",
                        "QTY_RSV": 2.00000000,
                        "QTY_LOST": 0.00000000,
                        "QTY_RTN": 4.00000000,
                        "FIX_CST1": "1",
                        "UP_STD": 0.00000000,
                        "QTY_WL": -4.00
                    },
                    {
                        "MLID": "M2",
                        "ML_NO": "M213080001",
                        "ML_ID": "2",
                        "ITM": 2,
                        "PRD_NO": "A4002",
                        "PRD_NO_NO": "A4002",
                        "PRD_NAME": "A4002原料",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 4.00000000,
                        "CST": 0.00000000,
                        "REM": "",
                        "CST_STD": 0.00000000,
                        "PRD_NO_CHG": "",
                        "ID_NO": "",
                        "PRE_ITM": 2,
                        "EST_ITM": 2,
                        "LOS_RTO": 0.00000000,
                        "QTY_STD": 2.00000000,
                        "PRD_MARK": "",
                        "CHG_RTO": "",
                        "USEIN_NO": "",
                        "ML_DD": "2021-03-08 00:00:00",
                        "MO_NO": "MO13080001",
                        "TZ_NO": "",
                        "QTY_ML": 2.00000000,
                        "QL_NO": "",
                        "QL_ID": "",
                        "UNIT_H": "1",
                        "QTY_WH": -10.00000000,
                        "ZC_NO": "",
                        "QTY_RSV": 2.00000000,
                        "QTY_LOST": 0.00000000,
                        "QTY_RTN": 4.00000000,
                        "FIX_CST1": "1",
                        "UP_STD": 0.00000000,
                        "QTY_WL": -4.00
                    },
                    {
                        "MLID": "M2",
                        "ML_NO": "M213080001",
                        "ML_ID": "2",
                        "ITM": 3,
                        "PRD_NO": "A5001",
                        "PRD_NO_NO": "A5001",
                        "PRD_NAME": "A5001物料",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 2.00000000,
                        "CST": 0.00000000,
                        "REM": "",
                        "CST_STD": 0.00000000,
                        "PRD_NO_CHG": "",
                        "ID_NO": "",
                        "PRE_ITM": 3,
                        "EST_ITM": 3,
                        "LOS_RTO": 0.00000000,
                        "QTY_STD": 1.00000000,
                        "PRD_MARK": "",
                        "CHG_RTO": "",
                        "USEIN_NO": "",
                        "ML_DD": "2021-03-08 00:00:00",
                        "MO_NO": "MO13080001",
                        "TZ_NO": "",
                        "QTY_ML": 2.00000000,
                        "QL_NO": "",
                        "QL_ID": "",
                        "UNIT_H": "1",
                        "QTY_WH": -5.00000000,
                        "ZC_NO": "",
                        "QTY_RSV": 1.00000000,
                        "QTY_LOST": 0.00000000,
                        "QTY_RTN": 2.00000000,
                        "FIX_CST1": "1",
                        "UP_STD": 0.00000000,
                        "QTY_WL": -2.00
                    }
                ],
                "BILL_STATE": {
                    "READONLY": false,
                    "READONLY_REM": []
                }
            }
        ]
    }
}