批量查询【托工缴回单】接口
概述
该接口主要用于第三方平台或自主研发者,需要通过日期、单号、部门批量查询ERP系统的单据时,则可调用该单据的批量查询接口,将Sunlike ERP或Online ERP系统中的批量单据信息查询到第三方平台中。
参数说明
请求方式
请求方式 | POST | |||||
接口地址 | http://ERPAPI站点/MRPBF/BATCHDATA | |||||
格式 | JSON | |||||
编码类型 | UTF-8 |
header参数
Content-Type | application/json | |||||
Authorization | token | 授权接口所获取的值 |
请求参数
字段名称 | 字段代号 | 类型 | 长度 | 必填 | 固定值 | 备注 |
程序代号 | PGM | 是 |
MRPBF
|
|||
单据号码 |
TB_NO
|
String | 20 | ERP的单据号码,可多张单号,加中括号[],单号之间用逗号隔开,如”TB_NO”:”[TB2111050001],[TB2111050002]” | ||
单据日期类型 | DATE_TYPE | String | 1 | 是 | 0表示单据日期,1表示制单日期,2表示终审日期,3修改日期 | |
开始日期 | START_DATE | datetime | 从开始日期开始查询单据,当单号为空时,日期必填 | |||
结束日期 | END_DATE | datetime | 查询以结束日期截止的单据,当单号为空时,日期必填 | |||
单据部门 | DEP | string | 8 | 多个部门,加中括号[],以逗号隔开,不含下属部门,如”DEP”:”[01],[02]”;单个部门,不用中括号,有含下属 | ||
排序 | ORDER_BY | 例如: “ORDER BY”:{“TB_NO”:”DESC”, “CUS_NO”:”ASC”} |
请求JSON示例
{ "PGM":"MRPBF", //程序代号 "TB_NO":"", //按单号查询,可多张单号,加中括号[],单号之间用豆号隔开 "DATE_TYPE":0, //0表示单据日期,1表示制单日期,2表示终审日期,3修改日期 "START_DATE":"2021-01-01", //查询的开始日期 "END_DATE":"2021-12-31", //查询的结束日期 "DEP":"00000000", //有[]表示多选,不含下属部门;没有[]表示单选且含下属 "ORDER_BY":{ //排序规则 "TB_NO":"DESC", //DESC表示降序排序 "CUS_NO":"ASC" //ASC表示升序排序 } }
返回结果示例
{ "code": 0, //0值表示执行成功,其他值则表示失败 "message": "查询成功", "data": { "UP_DD": "2022-05-05 14:05:59", "TOTAL_NUM": 1, "BILL_LIST": [ //请求批量查询返回的单据明细信息 { "MF_TB": [ { "TB_NO": "TB2201250001", "TB_DD": "2022-01-25 00:00:00", "PAY_DD": "2022-01-25 00:00:00", "CHK_DD": "2022-01-25 00:00:00", "BAT_NO": "", "CUS_NO": "CU0301", "VOH_ID": "", "DEP": "965", "TAX_ID": "2", "TW_NO": "TW2201250001", "SEND_WH": "", "RP_NO": "", "ZHANG_ID": "1", "CUR_ID": "", "EXC_RTO": 1.00000000, "SAL_NO": "001", "PAY_MTH": "1", "PAY_DAYS": 1, "CHK_DAYS": 30, "INT_DAYS": 30, "PAY_REM": "结帐期:2022-01-25; 票据到期日:2022-01-25", "CLOSE_ID": "F", "REM": "托外缴回", "CLS_REM": "票据到期日:97-02-15结帐期:97-0", "USR": "ADMIN", "CHK_MAN": "ADMIN", "PRT_SW": "N", "CLS_DATE": "2022-05-05 14:05:59", "MMVOH_ID": "", "BIL_TYPE": "", "KP_ID": "F", "MOB_ID": "", "SYS_DATE": "2022-05-05 14:05:59", "CAS_NO": "", "TW_ID": "TW", "CUS_OS_NO": "", "PRT_USR": "", "AMTN_RCV": 0.00000000, "AMTN_TAX_IRP": 0.00000000, "AMT_TAX_IRP": 0.00000000 } ], "TF_TB": [ { "TB_NO": "TB2201250001", "ITM": 1, "PRD_NO": "WDP001", "PRD_NO_NO": "WDP001", "PRD_NAME": "打印机", "PRD_MARK": "", "WH": "YH001", "UNIT": "1", "QTY": 1.00000000, "QTY1": 2.00000000, "UP": 0.00000000, "UP_QTY1": 0.00000000, "UP_LOST": 0.00000000, "UP_QTY1_LOST": 0.00000000, "AMTN_NET": 0.00000000, "TAX": 0.00000000, "AMT": 0.00000000, "BAT_NO": "", "TW_NO": "TW2201250001", "ML_NO": "M42201250001", "MM_NO": "MM2201250001", "MO_NO": "", "EST_ITM": 1, "ID_NO": "WDP001->", "RTO_TAX": 5.00000000, "PRE_ITM": 1, "TW_ID": "TW", "CUS_OS_NO": "", "UP_STD": 0.00000000, "CST_STD": 0.00000000, "SPC": "H&P" } ], "BILL_STATE": { "READONLY": false, "READONLY_REM": [] } } ] } }