转单接口–转入来源制令单生成【成品缴库单】MO->MM

概述

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

参数说明

1.请求方式

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

2.header参数

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

3.请求参数

请求JSON示例

{
  "REF_NO": "HYPMM2301050001",        //第三方单号,必填
  "PGM": "MRPAFC",            //程序代号,必填
  "MF_MM0": [          //请求生成单据的表头参数信息
    {
      "MM_ID":"MM",        //生成单据别,必填
      "MM_NO":"",         //ERP为自动编号,则取ERP系统编码;为手工编码,则与REF_NO必须相同
      "TRAN_BIL_ID":"MO",       //来源单据别,必填
      "USR":"ADMIN"         //制单人,必填
    }
  ],
  "TF_MM0": [            //请求生成单据的表身参数信息,变更表身资料
    {
      "MM_ID":"MM",
      "MM_NO":"",
      "ITM":1,           //表身项次,必填
      "TRAN_BIL_ID":"MO",            //来源单据别,必填
      "TRAN_BIL_NO":"MO2301050001",      //来源单号,必填
      "QTY":10
    },
    {
      "MM_ID":"MM",
      "MM_NO":"",
      "ITM":2,
      "TRAN_BIL_ID":"MO",
      "TRAN_BIL_NO":"MO2301050002",
      "QTY":20          //数量,必填
    }
  ],
    "PROP":{           //属性,不传属性参数时,缺省取默认值,非必填;
      "WHQTYMINUSNOTPAST":"T",//【倒冲领料不允许仓库出现负数】,T不允许,F允许,默认T;
      "WhMl":"0",//【领料仓库取值(倒冲领料)】,0:制令单仓库,1:生产部门仓库,2:指定仓库,默认0;
      "SelMlWh":"YH001", //【领料指定仓库(倒冲领料)】,此属性结合领料仓库取值为“2:指定仓库”时使用
      "THINKBATQTY":"1", //【产生领料单考虑批号库存(倒冲领料)】,0:依生产单号,1:依批号库存自动取值,2:依缴库单批号,3:依批号库存自动取值(允许负库存),默认0;
      "THINKQTYRTN":"0", //【缴库倒扣时应考虑制令单的实发量】,0:不考虑,1:考虑实发量,2:考虑已审/未审实发量,3:依缴库应领量考虑实发量,4:依缴库/制令应领量考虑实发量,默认0;
      "QTY_BASE":"1" , //【材料标准用量计算基准】,0:依应发量,1:依应发+损耗量,默认1;
      "CHKPRDECN":"T"//【倒冲领料考虑旧货品库存】,T考虑,F不考虑,默认F;
 }
}

返回结果示例

{
    "code": 0,                 //为0表示执行成功,其他表示错误
    "message": "新增成功",
    "data": {
        "MF_MM0": [            //生成成品缴库单表头内容
            {
                "MM_ID": "MM",
                "MM_NO": "MM2302070001",
                "MM_DD": "2023-02-07 00:00:00",
                "DEP": "965",
                "MO_NO": "MO2301050001-2",
                "USR": "ADMIN",
                "USR_NO": "",
                "CHK_MAN": "ADMIN",
                "SYS_DATE": "2023-02-07 19:56:43",
                "CLS_DATE": "2023-02-07 19:56:43",
                "PRT_SW": "N",
                "REM": "",
                "TRAN_BIL_ID": "MO"
            }
        ],
        "TF_MM0": [               //生成成品缴库单表身内容
            {
                "MM_ID": "MM",
                "MM_NO": "MM2302070001",
                "ITM": 1,
                "MM_DD": "2023-02-07 00:00:00",
                "MO_NO": "MO2301050001",
                "DEP": "965",
                "PRD_NO": "WDP001",
                "ID_NO": "WDP001->",
                "PRD_MARK": "",
                "PRD_NAME": "打印机",
                "UNIT": "1",
                "WH": "YH001",
                "VALID_DD": "2023-03-08 00:00:00",
                "PRE_ITM": 1,
                "QTY": 10.0,
                "QTY1": 20.0,
                "CST_MAKE": 0.0,
                "CST_PRD": 0.0,
                "CST_OUT": 0.0,
                "CST_MAN": 0.0,
                "CST": 100.0,
                "USED_TIME": 0.0,
                "TIME_CNT": 0.0,
                "CST_SMAKE": 0.0,
                "CST_SPRD": 0.0,
                "CST_SOUT": 0.0,
                "CST_SMAN": 0.0,
                "CST_STD": 100.0,
                "REM": "",
                "ML_NO": "ML2302070001",
                "UP_STD": 100.0,
                "QTY_MO": 10.0,
                "QTY_PRC": 10.0,
                "ML_BY_MM": "T",
                "STA_DD": "2023-01-05 12:18:09",
                "END_DD": "2023-01-06 12:18:10",
                "CST_STD_ORI": 100.0,
                "CST_TOTAL": 100.0,
                "TRAN_BIL_ID": "MO",
                "TRAN_BIL_NO": "MO2301050001"
            },
            {
                "MM_ID": "MM",
                "MM_NO": "MM2302070001",
                "ITM": 2,
                "MM_DD": "2023-02-07 00:00:00",
                "MO_NO": "MO2301050002",
                "DEP": "965",
                "PRD_NO": "WDP001",
                "ID_NO": "WDP001->",
                "PRD_MARK": "",
                "PRD_NAME": "打印机",
                "UNIT": "1",
                "WH": "YH001",
                "VALID_DD": "2023-03-08 00:00:00",
                "PRE_ITM": 2,
                "QTY": 20.0,
                "QTY1": 40.0,
                "CST_MAKE": 0.0,
                "CST_PRD": 0.0,
                "CST_OUT": 0.0,
                "CST_MAN": 0.0,
                "CST": 200.0,
                "USED_TIME": 0.0,
                "TIME_CNT": 0.0,
                "CST_SMAKE": 0.0,
                "CST_SPRD": 0.0,
                "CST_SOUT": 0.0,
                "CST_SMAN": 0.0,
                "CST_STD": 200.0,
                "REM": "",
                "ML_NO": "ML2302070002",
                "UP_STD": 100.0,
                "QTY_MO": 20.0,
                "QTY_PRC": 20.0,
                "ML_BY_MM": "T",
                "STA_DD": "2023-01-05 12:18:42",
                "END_DD": "2023-01-06 12:18:44",
                "CST_STD_ORI": 200.0,
                "CST_TOTAL": 200.0,
                "TRAN_BIL_ID": "MO",
                "TRAN_BIL_NO": "MO2301050002"
            }
        ],
        "BILL_STATE": {
            "READONLY": false,
            "READONLY_REM": []
        }
    }
}