08 MES系统访问金蝶云星空(ERP): MES传入工序委外单到ERP

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

需求描述

MES传入工序委外单到ERP,ERP生成工序委外单并关联生产订单(生产订单下查可寻,工序委外单上查可寻);

接口定义

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

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

请求参数

[{
    "MoId": "100122",      
    "MoEntryId": "100148",      
    "MESLot": "20200315",      
    "MaterialNumber": "000006",
    "SupplierNumber": "1.31.02",
    "Qty": 10.0,
    "Bak": "abc",
    "DeliveryDate": "\/Date(1584103959703+0800)\/",
    "SuProcess": "123"
}]

返回结果

{
    "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.ProcessSubOrder,BLN.CY.ApiClient.K3Cloud.Stub.common.kdsvc";
          List processSubOrderParameters = new List();
                processSubOrderParameters.Add(new ProcessSubOrderParameter()
                {
                    Bak = "abc",                       //分录备注
                    MoId = 100122,                     //生产订单内码
                    MoEntryId = 100148,                //生产订单分录内码
                    MaterialNumber = "000006",            //物料编码
                    Qty = 2,                          //数量
                    DeliveryDate = DateTime.Now,       //交货日期
                    SupplierNumber = "1.31.02",        //供应商编码
                    SuProcess = "123"   ,               //委外工序
                    MESLot="20200315"                  //mes批次号
                });
                List parameters = new List();
                parameters.Add(processSubOrderParameters);
                httpClient.Content = JsonConvert.SerializeObject(parameters);

                var result = httpClient.AsyncRequest();
            }
 
 

请求参数实体

 [Serializable]
    public class ProcessSubOrderParameter
    {
        public long MoId { get; set; }
        public long MoEntryId { get; set; }

        public string MESLot { get; set; }

        public string MaterialNumber { get; set; }
        public string SupplierNumber { get; set; }

        public decimal Qty { get; set; }

        public string Bak { get; set; }

        public DateTime DeliveryDate { get; set; }

        public string SuProcess { get; set; }

    }

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

你可能感兴趣的:(08 MES系统访问金蝶云星空(ERP): MES传入工序委外单到ERP)