美文网首页
15. SRM系统访问金蝶云星空(webapi):回写询价结果

15. SRM系统访问金蝶云星空(webapi):回写询价结果

作者: Steve_Hu | 来源:发表于2020-09-20 23:08 被阅读0次

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

需求描述

SRM走询比价流程,返回选定供应商、价格、询价完成标识到ERP询价单

自定义接口定义:

//其中BLN.CY.ApiClient.K3Cloud.Stub是命名空间,InquiryBilService是类名
BLN.CY.ApiClient.K3Cloud.Stub.InquiryBilService.UpdateInquiryState(data)

请求参数

 [{
        "EntryId": 100089,//询价单分录内码
        "SupplierNumber": "VEN00005",//供应商编码
        "IsFinish": true,//询价完成标识
        "Price": 20.0,//含税单价
        "QuotationDate": "2020-10-01",//已报价日期
        "DeliveryDays": "2",//货期
        "IsOneTimePrice": "0",//一次性价格 0否,1是
    }, {
        "EntryId": 100090,
        "SupplierNumber": "VEN00005",
        "IsFinish": true,
        "Price": 30.0,
        "QuotationDate": "2020-10-01",
        "DeliveryDays": "2",
        "IsOneTimePrice": "0",//一次性价格 0否,1是
    }]

返回结果

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

代码示例

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

if (LoginByAppSecret())
            {
                HttpClient httpClient = new HttpClient();
                httpClient.Url = "http://localhost/k3cloud/BLN.CY.ApiClient.K3Cloud.Stub.InquiryBilService.UpdateInquiryState,BLN.CY.ApiClient.K3Cloud.Stub.common.kdsvc";

               var Entry=new List<InquiryBillEntry>();
               Entry.Add(new InquiryBillEntry() {
                    EntryId= 100089,//询价单分录内码
                    SupplierNumber= "VEN00005",//供应商编码
                    Price=20,//含税单价
                    IsFinish=true,//询价完成标识
                    QuotationDate="2020-10-01",//已报价日期
                    DeliveryDays="2",//货期
                    IsOneTimePrice="0"//一次性价格
                });
               Entry.Add(new InquiryBillEntry()
                {
                    EntryId = 100090,
                    SupplierNumber = "VEN00005",
                    Price = 30,
                    IsFinish = true,
                    QuotationDate="2020-10-01",//已报价日期
                    DeliveryDays="2",//货期
                    IsOneTimePrice="0"//一次性价格
                });
              List<object> parameters = new List<object>();
                parameters.Add(Entry);
                var data = JsonConvert.SerializeObject(parameters);
                httpClient.Content = data;

                var result = httpClient.AsyncRequest();

                return result;
            }
            else
            {
                return "登录失败!";
            }

    [Serializable]
    public class InquiryBillEntry
    {
        public long EntryId { get; set; }//询价单分录内码

        public string SupplierNumber { get; set; }//供应商编码

        public bool IsFinish { get; set; }//询价完成标识

        public decimal Price { get; set; }//含税单价

        public string QuotationDate{ get; set; }//已报价日期

        public string DeliveryDays{ get; set; }//货期

        public string IsOneTimePrice{ get; set; }//一次性价格 0否,1是
    }

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

相关文章

网友评论

      本文标题:15. SRM系统访问金蝶云星空(webapi):回写询价结果

      本文链接:https://www.haomeiwen.com/subject/kacmyktx.html