批量查询【托工单】接口

概述

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

参数说明

1.请求方式

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

2.header参数

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

3.请求参数

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

请求JSON示例

{
  "PGM":"MRPBE",   //单据别
  "TW_NO":"",   //按单号查询,可多张单号,用豆号隔开
  "DATE_TYPE":0,        //0表示单据日期,1表示制单日期,2表示终审日期,3修改日期
  "START_DATE":"2021-01-13",  //查询的开始日期
  "END_DATE":"2021-01-13",   //查询的结束日期
  "DEP":"00000000",      //有[]表示多选,不含下属部门;没有[]表示单选且含下属
  "ORDER_BY":
  {"TW_NO":"DESC"
  }
}

返回结果示例

{
    "code": 0,      //0表示执行成功
    "message": "查询成功",
    "data": {
        "UP_DD": "2021-01-13 12:23:48",
        "TOTAL_NUM": 1,
        "BILL_LIST": [          //批量查询返回的单据明细
            {
                "MF_TW": [
                    {
                        "TW_NO": "TW11130001",
                        "TW_DD": "2021-01-13 00:00:00",
                        "SEND_MTH": "1",
                        "EST_DD": "2021-01-13 00:00:00",
                        "CUS_NO": "1001",
                        "SAL_NO": "10001",
                        "DEP": "0101",
                        "CUR_ID": "",
                        "EXC_RTO": 1.00000000,
                        "CLOSE_ID": "F",
                        "TAX_ID": "2",
                        "AMTN_NET": 0.00000000,
                        "TAX": 0.00000000,
                        "AMT": 0.00000000,
                        "MRP_NO": "A2001",
                        "PRD_MARK": "",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 3.00000000,
                        "UP": 0.00000000,
                        "QTY_RTN": 2.00000000,
                        "QTY_ML": 3.00000000,
                        "QTY_ML_UNSH": 0.00000000,
                        "USR": "ADMIN",
                        "CHK_MAN": "ADMIN",
                        "PRT_SW": "N",
                        "FIN_DD": "1899-12-31 00:00:00",
                        "QTY_MV": 3.00000000,
                        "CLS_DATE": "2021-01-13 00:00:00",
                        "ID_NO": "A2001->",
                        "CST": 0.00000000,
                        "MM_CURML": "F",
                        "QTY_TC": 1.00000000,
                        "RTO_TAX": 5.00000000,
                        "UP1": 0.00000000,
                        "SYS_DATE": "2021-01-13 12:23:48",
                        "PRT_USR": "",
                        "QL_ID": "F",
                        "Q2_ID": "F",
                        "Q3_ID": "F",
                        "ML_BY_MM": "F",
                        "CONTROL": "F",
                        "PAY_DD": "2021-02-01 00:00:00",
                        "CHK_DD": "2021-03-01 00:00:00",
                        "PAY_MTH": "1",
                        "PAY_DAYS": 1,
                        "CHK_DAYS": 30,
                        "INT_DAYS": 30,
                        "PAY_REM": "结帐期:2021-02-01;票据到期日:2021-03-01",
                        "CF_ID": "T",
                        "ZT_ID": "F",
                        "STA_DD": "2021-01-13 00:00:00",
                        "MRP_NAME": "A2001制成品"
                    }
                ],
                "TF_TW": [
                    {
                        "TW_NO": "TW11130001",
                        "ITM": 1,
                        "PRD_NO": "A4001",
                        "PRD_NO_NO": "A4001",
                        "PRD_NAME": "A4001原料",
                        "PRD_MARK": "",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 6.00000000,
                        "QTY_RTN": 6.00000000,
                        "USEIN_NO": "",
                        "REM": "",
                        "PRD_NO_CHG": "",
                        "QTY1": 0.00000000,
                        "ID_NO": "",
                        "CST": 0.00000000,
                        "TS_ITM": 4,
                        "EST_ITM": 4,
                        "PRE_ITM": 4,
                        "LOS_RTO": 0.00000000,
                        "QTY_STD": 2.00000000,
                        "QTY_RSV": 6.00000000,
                        "QTY_LOST": 0.00000000,
                        "CHG_RTO": "",
                        "CST_STD": 0.00000000,
                        "IDX1": "03"
                    },
                    {
                        "TW_NO": "TW11130001",
                        "ITM": 2,
                        "PRD_NO": "A4002",
                        "PRD_NO_NO": "A4002",
                        "PRD_NAME": "A4002原料",
                        "PRD_MARK": "",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 6.00000000,
                        "QTY_RTN": 6.00000000,
                        "USEIN_NO": "",
                        "REM": "",
                        "PRD_NO_CHG": "",
                        "QTY1": 0.00000000,
                        "ID_NO": "",
                        "CST": 0.00000000,
                        "TS_ITM": 5,
                        "EST_ITM": 5,
                        "PRE_ITM": 5,
                        "LOS_RTO": 0.00000000,
                        "QTY_STD": 2.00000000,
                        "QTY_RSV": 6.00000000,
                        "QTY_LOST": 0.00000000,
                        "CHG_RTO": "",
                        "CST_STD": 0.00000000,
                        "IDX1": "03"
                    },
                    {
                        "TW_NO": "TW11130001",
                        "ITM": 3,
                        "PRD_NO": "A5001",
                        "PRD_NO_NO": "A5001",
                        "PRD_NAME": "A5001物料",
                        "PRD_MARK": "",
                        "WH": "A000",
                        "UNIT": "1",
                        "QTY": 3.00000000,
                        "QTY_RTN": 3.00000000,
                        "USEIN_NO": "",
                        "REM": "",
                        "PRD_NO_CHG": "",
                        "QTY1": 0.00000000,
                        "ID_NO": "",
                        "CST": 0.00000000,
                        "TS_ITM": 6,
                        "EST_ITM": 6,
                        "PRE_ITM": 6,
                        "LOS_RTO": 0.00000000,
                        "QTY_STD": 1.00000000,
                        "QTY_RSV": 3.00000000,
                        "QTY_LOST": 0.00000000,
                        "CHG_RTO": "",
                        "CST_STD": 0.00000000,
                        "IDX1": "03"
                    }
                ],
                "BILL_STATE": {
                    "READONLY": true,    //flase表示允许删除此单,true表示不允许删除,且提供不允许删除的理由说明
                    "READONLY_REM": [
                        "此单下过领料单不能修改和删除"
                    ]
                }
            }
        ]
    }
}