11.SRM系统访问金蝶云星空(webapi):写入工序委外入库单

返回根目录 SRM系统访问金蝶云星空(ERP)的接口定义及示例

需求描述

集成逻辑:
1、MES传入工序委外单到ERP,ERP生成工序委外单并关联生产订单(生产订单下查可寻,工序委外单上查可寻);
2、ERP根据工序委外单自动下推工序委外出库单并审核;
3、SRM 从ERP中读取工序委外单信息

  1. SRM 传入工序委外入库单到ERP,ERP生成工序委外入库单,关联工序委外入库单(上查下查可关联);

接口定义

工序委外入库单保存接口(自定义webapi接口)的定义如下:

//其中BLN.CY.ApiClient.K3Cloud.Stub是命名空间,PrdInStockService是类名
BLN.CY.ApiClient.K3Cloud.Stub.ProcessSubService.ProcessSubInstockStock(string param)

请求参数

[{
        "MoId": "100122",      
        "MoEntryId": "100148",      
        "MESLot": "20200315",      
        "MaterialNumber": "000006",
        "Qty": 1.0,
        "Bak": "abc",
        "InStockPosition": "AAAA",
        "StockNumber": "01",
        "DeliveryBillNumber": "送货单001",//送货单单号
        "DeliveryBillIndex":"1",  //送货单行号
        "FromSource":"SRM",  //来源
        "ThirdSysUser": "李明",//第三方系统操作人"
}]

返回结果

{
    "IsSuccess": true,
    "Message": "操作成功!",
    "ErrorStackTrace": null
}

代码示例

无引用组件示例(不引用金蝶的组件):
http://ServerIp/K3Cloud/接口命名空间.接口实现类名.方法,组件名.common.kdsvc

  if (LoginByAppSecret())
            {
                HttpClient httpClient = new HttpClient();
                httpClient.Url = "http://localhost/k3cloud/BLN.CY.ApiClient.K3Cloud.Stub.ProcessSubService.ProcessSubInstockStock,BLN.CY.ApiClient.K3Cloud.Stub.common.kdsvc";
             List processSubOrderParameters = new List();
               processSubOrderParameters.Add(new ProcessSubInstockParameter()
                {
                    Bak = "abc",                       //分录备注
                    MoId = 100332,                         //生产订单内码
                    MoEntryId = 139972,                    //生产订单分录内码
                    MESLot = "20200428",                         //批次号
                    MaterialNumber = "6.01.HTSP4-040-001/RF-01A",            //物料编码
                    Qty = 1,                          //数量
                    StockNumber = "01",                  //仓库编码
                    InStockPosition = "AAAA",           //入库位置
                   DeliveryBillNumber="F00001",//送货单单号
                    DeliveryBillIndex="1"//送货行号
                });
                List parameters = new List();
                parameters.Add(processSubOrderParameters);
                httpClient.Content = JsonConvert.SerializeObject(parameters);
                var result = httpClient.AsyncRequest();
            }
 
 

入库参数实体定义

 [Serializable]
    public class ProcessSubInstockParameter
    {
        /// 
        /// 生产订单内码
        /// 
        public long MoId { get; set; }
        /// 
        /// 生产订单分录内码
        /// 
        public long MoEntryId { get; set; }
        /// 
        /// MES批次号
        /// 
        public string MESLot { get; set; }

        public string MaterialNumber { get; set; }

        public decimal Qty { get; set; }

        public string Bak { get; set; }

        /// 
        /// 入库位置
        /// 
        public string InStockPosition { get; set; }

        public string StockNumber { get; set; }

 /// 
        /// 送货单编号
        /// 
        public string DeliveryBillNumber { get; set; }
        /// 
        /// 送货行号
        /// 
        public string DeliveryBillIndex { get; set; }
    }

返回根目录 SRM系统访问金蝶云星空(ERP)的接口定义及示例

你可能感兴趣的:(11.SRM系统访问金蝶云星空(webapi):写入工序委外入库单)