批量查询【异常强制缴库】接口

概述

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

参数说明

请求方式

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

header参数

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

请求参数

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

请求JSON示例

{
    "PGM": "MRPAFC",   //程序代号,必填
    "MM_ID":"MM",           //单据识别代号
    "MM_NO":"",   //按单号查询,可多张单号,加中括号[],单号之间用豆号隔开
    "DATE_TYPE":0,        //0表示单据日期,1表示制单日期,2表示终审日期,3修改日期
    "START_DATE":"2022-05-1",   //查询的开始日期,必填
    "END_DATE":"2022-05-31",   //查询的结束日期,必填
    "DEP":"",      //有[]表示多选,不含下属部门;没有[]表示单选且含下属
    "ORDER_BY":{        //排序规则
      "MM_NO":"DESC",   //DESC表示降序排序
      "DEP":"ASC"    //ASC表示升序排序
  }
}

返回结果示例

{
    "code": 0,                //0值表示执行成功,其他值则表示失败
    "message": "查询成功",
    "data": {
        "UP_DD": "2022-05-26 10:34:06",
        "TOTAL_NUM": 1,
        "BILL_LIST": [                  //请求批量查询返回的单据明细信息
            {
                "MF_MM0": [
                    {
                        "MM_ID": "MM",
                        "MM_NO": "MM2205120001",
                        "MM_DD": "2022-05-12 00:00:00",
                        "DEP": "965",
                        "BIL_ID": "TR",
                        "BIL_NO": "TR2205120001",
                        "VOH_ID": "",
                        "USR": "ADMIN",
                        "USR_NO": "001",
                        "CHK_MAN": "ADMIN",
                        "SYS_DATE": "2022-05-26 10:34:06",
                        "CLS_DATE": "2022-05-26 10:34:06",
                        "PRT_SW": "N",
                        "REM": ""
                    }
                ],
                "TF_MM0": [
                    {
                        "MM_ID": "MM",
                        "MM_NO": "MM2205120001",
                        "ITM": 1,
                        "MM_DD": "2022-05-12 00:00:00",
                        "MO_NO": "MO2205120001",
                        "DEP": "965",
                        "PRD_NO": "WDP001",
                        "PRD_NO_NO": "WDP001",
                        "ID_NO": "WDP001->",
                        "PRD_MARK": "",
                        "PRD_NAME": "打印机",
                        "UNIT": "1",
                        "WH": "YH001",
                        "VALID_DD": "2022-06-10 00:00:00",
                        "PRE_ITM": 1,
                        "QTY": 1.00000000,
                        "QTY1": 2.00000000,
                        "CST_MAKE": 0.00000000,
                        "CST_PRD": 0.00000000,
                        "CST_OUT": 0.00000000,
                        "CST_MAN": 0.00000000,
                        "CST": 10.00000000,
                        "USED_TIME": 0.00000000,
                        "TIME_CNT": 0.00000000,
                        "CST_SMAKE": 0.00000000,
                        "CST_SPRD": 0.00000000,
                        "CST_SOUT": 0.00000000,
                        "CST_SMAN": 0.00000000,
                        "CST_STD": 10.00000000,
                        "REM": "",
                        "ML_NO": "ML2205120001",
                        "BIL_ID": "TR",
                        "BIL_NO": "TR2205120001",
                        "UP_STD": 0.00000000,
                        "QTY_MO": 1.00000000,
                        "QTY_PRC": 0.00000000,
                        "ML_BY_MM": "T",
                        "STA_DD": "2022-05-12 00:00:00",
                        "OPN_DD": "2022-05-12 00:00:00",
                        "END_DD": "2022-05-12 00:00:00",
                        "SPC": "H&P",
                        "UT1": "套",
                        "NAME_ENG": "DAYING",
                        "SC_DD": "2022-05-12 00:00:00",
                        "CST_TOTAL": 10.00000000
                    }
                ],
                "BILL_STATE": {
                    "READONLY": false,
                    "READONLY_REM": []
                }
            }
        ]
    }
}