菜单

保存

基本信息

  • 用途说明:生产入库单保存(单据标识:wg_new_inv_product_bill)
  • 请求方式:POST
  • 请求地址:https://api.kingdee.com/weigusoft/wg_prd/wg_productionManagementCommonApi?access_token=

请求参数

headers参数

  • 所有的接口必须携带header参数
参数名称 参数示例 是否必填 参数说明
Content-Type application/json true 固定传:application/json
groupName ns-v7g6 true 分组名称,获取授权信息时返回的groupName
accountId 16xxxxxxxxxxxx true 账套ID,获取授权信息时返回的accountId
X-GW-Router-Addr https://tf.jdy.com true IDC域名,获取授权信息时返回的domain

body参数

参数名称 必选 类型 说明
api_name true String 默认-PRD_INSTOCK
api_method_name true String 默认-MODIFY
id true String 编辑时需要传单据id,新增不用
wg_returnstatus true String 退库状态-A:未退库 Z:部分退库 C:全部退库
billno true String 单据编码
billdate true String 单据日期
deptid false String 部门
empid true String 交货人id
cgyid false String 仓管员
entitys false Array[String] 商品分录
exchangerate true String 汇率-默认:1
billsource true String 来源
backflushed true Boolean 是否存在倒冲
customfield false Array

表头自定义字段:customfield:[
    {
        "k": "custom_field__1__46x0ymvc5zmxie",
        "v": "测试自定义"
    },
    {
        "k": "custom_field__4__4zun4z79jiasrh",
        "v": "2221201684464471040"
    },
]

说明:

k:自定义字段属性名称

v:字段值(日期类型传时间戳,基础资料类型传对应基础资料id)

entitys的数据结构:

参数名称 类型 必选 说明
Seq String false 顺序
materialid String true 商品id
barcode String false 条形码
stockid String false 仓库id
spid String false 仓位id
baseunit String true 基本单位
unit_id String true 单位
qty Number true 数量
comment String false 备注
auxunitid String false 辅助单位id
auxqty Number false 辅助数量
srcinterid String false 源单id
srcbillno String false 源单单号
srcentryid String false 源单分录内码
src_billdate String false 源单日期
wg_srcorderbillno String false 销售订单号
wg_srcorderinterid String false 订单内码
wg_srcorderentryid String false 订单分录内码
materialunitcost String false 单位直接材料成本
materialcost String false 直接材料成本
entrytranstype String false 业务类型  C普通 R返修
unitcost String false 基本单位成本本位币
recvbaseqty String false 基本单位应收数量
inputcoefficient String false 换算率
coefficient String false 主单位换算率
auxcoefficient String false 辅助单位换算率
wg_returnqty Number false 退料数量
wg_returnbaseqty Number false 基本单位退料数量
wg_project String false 项目
material_customer String false 客户
recvqty Number false 应收数量
baseqty Number false 基本数量
unittype String false 单位类型
auxunittype String false 辅助单位类型
wg_pickqty Number false 应领数量
wg_pickbaseqty Number false 基本应领数量
wg_moproductentryid String false 商品分录内码 领料时需要传
wg_isconsumable Boolean false 选商品时直接领料共耗材料默认勾选
material_entity_lk Array[String] false 联查信息
wg_weight_device String false 设备信息

请求示例

{
    "api_name": "PRD_INSTOCK",
    "api_method_name": "MODIFY",
    "id": "2146139740997447680",//编辑时需要传单据id,新增不用
    "billno": "SCRKN-WG-20250209-000002",//单据编码
    "wg_returnstatus": "A",//退库状态
    "billdate": "2025-02-09",//单据日期
    "deptid": "1697221606960547840",//部门
    "empid": "1697012657288137728",//交货人
    "cgyid": "1697012657288137728",//仓管员
    "entitys": [//商品分录
        {
            "Seq": "1",
            "id": "2146139740997448704",
            "barcode": "",//条形码
            "materialid": "2034034294178978816",//商品id
            "stockid": "1999983187119348736",//仓库
            "spid": "",//仓位
            "baseunit": "1",//基本单位
            "unit_id": "1",//单位
            "qty": 2,//数量
            "auxunitid": "",//辅助单位
            "auxqty": "0",//辅助数量
            "srcinterid": "2144408782699091968",//源单id
            "srcbillno": "SCJG-WG-20250206-00004", //源单单号
            "srcbilltypeid": "wg_production_process",//源单类型
            "srcentryid": "2144408904786866176",//源单分录内码
            "src_billdate": "2025-02-06 00:00:00.0", //源单日期
            "wg_srcorderbillno": "",
            "wg_srcorderinterid": "2144408722628153344",
            "wg_srcorderentryid": "2144408722628154369",
            "materialunitcost": "0",
            "materialcost": "0",
            "entrytranstype": "",
            "unitcost": "0",
            "recvbaseqty": "1",//基本单位应收数量
            "inputcoefficient": "0", //换算率
            "coefficient": "1",//主单位换算率 
            "auxcoefficient": "0.0000000000",//辅助单位换算率
            "returnqty": "0",//已退库数量
            "returnbaseqty": "0", //基本单位已退库数量
            "wg_project": "",//项目
            "material_customer": "",//客户
            "recvqty": "",//应收数量
            "baseqty": "1.0000000000",//基本数量
            "unittype": "0", //单位类型
            "auxunittype": "0",//辅助单位类型
            "material_entity_lk": [
                {
                    "material_entity_lk_auxqty_old": "0",
                    "material_entity_lk_deffloatqty": "0",
                    "material_entity_lk_auxqty": "0",
                    "material_entity_lk_qty": "1",
                    "material_entity_lk_baseqty_old": "0",
                    "material_entity_lk_sid": "2144408904786866176",
                    "material_entity_lk_baseqty": "1",
                    "material_entity_lk_sbillid": "2144408782699091968",
                    "material_entity_lk_qty_old": "0",
                    "id": "2146139740997447681",
                    "material_entity_lk_stableid": "4662422202496777098",
                    "seq": "1",
                    "material_entity_lk_deffloatqty_old": "0"
                }
            ],
            "wg_weight_device": ""//设备信息
        }
    ],
    "exchangerate": "1",
    "billsource": "APP",//来源
    "backflushed": false,//是否存在倒冲

    customfield:[//自定义字段
    {
        "k": "custom_field__1__46x0ymvc5zmxie",
        "v": ""
    },
    {
        "k": "custom_field__1__4dxzvxie6muk5y",
        "v": ""
    },
    {
        "k": "custom_field__1__4kepqzvn0u5w",
        "v": "1111"
    },
    {
        "k": "custom_field__1__4oct299h528s",
        "v": ""
    },
    {
        "k": "custom_field__4__4zun22carw7i",
        "v": "0"
    },
    {
        "k": "custom_field__4__4zun3rvxkt2s",
        "v": "2221897456122137600"
    },
    {
        "k": "custom_field__4__4zun4z79jiasrh",
        "v": "2221201393866294272"
    },
    {
        "k": "custom_field__4__4zun6hp4xieleg",
        "v": "2221202033388620800"
    },
    {
        "k": "custom_field__4__4zuo5v7kfgxiea",
        "v": "0"
    },
    {
        "k": "custom_field__4__4zuqe0sjiavcfs",
        "v": "0"
    }
]
}

响应示例

{
    "data": {
        "id": "2146139740997447680"//单据id
    },
    "errorCode": "success",
    "status": true,
    "success": true
}

分享文章
最近修改: 2025-06-25