转单接口–转入来源制成品送检生成【生产缴库验收单】T6->TP

概述

该接口主要用于第三方平台或自主研发者,通过调用【生产缴库验收单】的转单接口,将第三方系统的生产制成品缴库验收的信息推送到Sunlike ERP或Online ERP系统中,从而生成Sunlike ERP或Online ERP系统的【生产缴库验收单】。

参数说明

1.请求方式

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

2.header参数

Content-Type application/json
Authorization token 获取每次登录的值

3.请求参数

请求JSON示例

{
  "REF_NO": "HYPTP2302020003",        //第三方单号,必填
  "PGM": "MRPBN",            //程序代号,必填
  "MF_TY": [          //请求生成单据的表头参数信息
    {
      "TY_ID": "TP",        //生成单据别,必填
      "TY_NO": "",         //ERP为自动编号,则取ERP系统编码;为手工编码,则与REF_NO必须相同
      "TRAN_BIL_ID":"T6",       //来源单据别,必填
      "USR":"ADMIN"         //制单人,必填
    }
  ],
  "TF_TY": [            //请求生成单据的表身参数信息,变更表身资料
    {
      "TY_ID": "TP",
      "TY_NO": "",
      "ITM": 1,           //表身项次,必填
      "TRAN_BIL_ID":"T6",             //来源单据别,必填
      "TRAN_BIL_NO":"T62302020005",      //来源单号,必填
      "TRAN_BIL_ITM":1,      //转单项次,可通过查询接口查来源单表身TRAN_BIL_ITM的值,必填
      "QTY_CHK": 10,          //验货数量,必填
      "QTY_OK": 10          //合格数量,必填
    },
    {
      "TY_ID": "TP",
      "TY_NO": "",
      "ITM": 2,
      "TRAN_BIL_ID":"T6",
      "TRAN_BIL_NO":"T62302020006",
      "TRAN_BIL_ITM":1,
      "QTY_CHK": 20,
      "QTY_OK": 20
    }
  ]
}

返回结果示例

{
    "code": 0,                  //为0表示执行成功,其他表示错误
    "message": "新增成功",
    "data": {
        "MF_TY": [                  //生成生产缴库验收单表头内容
            {
                "TY_ID": "TP",
                "TY_NO": "TP2302070001",
                "TY_DD": "2023-02-07 00:00:00",
                "SAL_NO": "001",
                "CUS_NO": "",
                "TI_NO": "T62302020005",
                "REM": "",
                "USR": "ADMIN",
                "CHK_MAN": "ADMIN",
                "PRT_SW": "N",
                "BIL_NO": "MO2302020005",
                "BIL_ID": "MO",
                "CLS_DATE": "2023-02-07 20:14:17",
                "BIL_TYPE": "",
                "DEP": "965",
                "CUS_OS_NO": "",
                "SYS_DATE": "2023-02-07 20:14:17",
                "TRAN_BIL_ID": "T6"
            }
        ],
        "TF_TY": [                  //生成生产缴库验收单表身内容
            {
                "TY_ID": "TP",
                "TY_NO": "TP2302070001",
                "ITM": 1,
                "PRD_NO": "WDP001",
                "PRD_NAME": "打印机",
                "PRD_MARK": "",
                "WH": "YH001",
                "UNIT": "1",
                "QTY_CHK": 10.0,
                "QTY_OK": 10.0,
                "REM": "",
                "BIL_NO": "MO2302020005",
                "TI_NO": "T62302020005",
                "BAT_NO": "",
                "MO_NO": "MO2302020005",
                "EST_ITM": 1,
                "PRE_ITM": 1,
                "ID_NO": "WDP001->",
                "FREE_ID": "",
                "TI_ITM": 1,
                "CAS_NO": "",
                "CUS_OS_NO": "",
                "RK_DD": "2023-02-02 00:00:00",
                "TRAN_BIL_ITM": 1,
                "TRAN_BIL_ID": "T6",
                "TRAN_BIL_NO": "T62302020005"
            },
            {
                "TY_ID": "TP",
                "TY_NO": "TP2302070001",
                "ITM": 2,
                "PRD_NO": "WDP001",
                "PRD_NAME": "打印机",
                "PRD_MARK": "",
                "WH": "YH001",
                "UNIT": "1",
                "QTY_CHK": 20.0,
                "QTY_OK": 20.0,
                "REM": "",
                "BIL_NO": "MO2302020006",
                "TI_NO": "T62302020006",
                "BAT_NO": "",
                "MO_NO": "MO2302020006",
                "EST_ITM": 1,
                "PRE_ITM": 2,
                "ID_NO": "WDP001->",
                "FREE_ID": "",
                "TI_ITM": 1,
                "CAS_NO": "",
                "CUS_OS_NO": "",
                "RK_DD": "2023-02-02 00:00:00",
                "TRAN_BIL_ITM": 1,
                "TRAN_BIL_ID": "T6",
                "TRAN_BIL_NO": "T62302020006"
            }
        ],
        "BILL_STATE": {
            "READONLY": false,
            "READONLY_REM": []
        }
    }
}