Ejemplo n.º 1
0
        private string BuildSendMessageXml(SSBMessageHeader ssbHeader, IPPRequestRegisterStatusChangeSSBEntity ssbBody)
        {
            string bodyStr = ssbBody.ToXmlString();

            bodyStr = RemoveNameSpace(bodyStr);
            string headerStr = ssbHeader.ToXmlString();

            headerStr = RemoveNameSpace(headerStr);
            //this.BuildMessageHeaderXml();
            //this.BuildMessageBodyXml();
            return(string.Format("<RequestRoot>{0}</RequestRoot>", (headerStr + string.Format("<Body>{0}</Body>", bodyStr))));
        }
Ejemplo n.º 2
0
        public virtual RMARegisterInfo CloseCase(int sysNo)
        {
            //#warning Send SSB To SellerPortal

            //return ObjectFactory<RegisterProcessor>.Instance.Close(sysNo);
            var result = ObjectFactory <RegisterProcessor> .Instance.Close(sysNo);

            RMARequestInfo request = ObjectFactory <RequestProcessor> .Instance.LoadByRegisterSysNo(sysNo);

            if (request != null)
            {
                IPPRequestRegisterStatusChangeSSBEntity ssbBody = new IPPRequestRegisterStatusChangeSSBEntity();
                ssbBody.RequestSysNo     = request.SysNo.Value;
                ssbBody.Status           = "CMP";
                ssbBody.RegisterInfoList = new List <RegisterInfo>();
                ssbBody.RegisterInfoList.Add(new RegisterInfo()
                {
                    RegisterSysNo = sysNo
                });

                SSBMessageHeader ssbHeader = new SSBMessageHeader()
                {
                    Language     = "CH",
                    Sender       = "VendorPortal",
                    CompanyCode  = "8601",
                    Action       = "Update",
                    Version      = "1.0",
                    Type         = "IPPRequestRegisterStatusChange",
                    OriginalGUID = Guid.NewGuid().ToString()
                };

                SSBSender.SendV3(
                    FROMSERVICE
                    , TOSERVICELIST
                    , ArticleCategory
                    , ArticleType1
                    , ArticleType2
                    , this.BuildSendMessageXml(ssbHeader, ssbBody)
                    , "NCService"

                    );
            }
            return(result);
        }
Ejemplo n.º 3
0
        public virtual RefundInfo Refund(int sysNo)
        {
            RefundInfo entity = ObjectFactory <RefundProcessor> .Instance.Refund(sysNo);

            ///获取退款单对应的单件信息
            List <RegisterForRefund> list = null;

            if (entity != null && entity.SysNo.HasValue)
            {
                list = ObjectFactory <RefundProcessor> .Instance.GetRegistersForRefund(entity.SysNo.Value);

                if (list != null && list.Count > 0)
                {
                    #region SSB
                    if (list != null)
                    {
                        // 获取申请单信息
                        int?           registerSysNo = list[0].RegisterSysNo;
                        RMARequestInfo requestEntity = ObjectFactory <RequestProcessor> .Instance.LoadByRegisterSysNo(registerSysNo.Value);

                        if (requestEntity != null)
                        {
                            if (requestEntity.ShippingType != null && requestEntity.StockType != null && requestEntity.InvoiceType != null)
                            {
                                //退款完成后2,3,5,6,向VP发送已完成的SSB;
                                if (
                                    (requestEntity.InvoiceType == InvoiceType.SELF && requestEntity.StockType == StockType.MET && requestEntity.ShippingType == DeliveryType.SELF)
                                    ||
                                    (requestEntity.InvoiceType == InvoiceType.SELF && requestEntity.StockType == StockType.MET && requestEntity.ShippingType == DeliveryType.MET)
                                    ||
                                    (requestEntity.InvoiceType == InvoiceType.MET && requestEntity.StockType == StockType.MET && requestEntity.ShippingType == DeliveryType.SELF)
                                    ||
                                    (requestEntity.InvoiceType == InvoiceType.MET && requestEntity.StockType == StockType.MET && requestEntity.ShippingType == DeliveryType.MET)
                                    )
                                {
                                    IPPRequestRegisterStatusChangeSSBEntity ssb = new IPPRequestRegisterStatusChangeSSBEntity();
                                    ssb.RequestSysNo     = requestEntity.SysNo.Value;
                                    ssb.Status           = "CMP";
                                    ssb.RegisterInfoList = new List <RegisterInfo>();
                                    foreach (var item in list)
                                    {
                                        ssb.RegisterInfoList.Add(new RegisterInfo()
                                        {
                                            RegisterSysNo = item.RegisterSysNo.Value
                                        });
                                    }

                                    SSBMessageHeader ssbHeader = new SSBMessageHeader()
                                    {
                                        Language     = "CH",
                                        Sender       = "VendorPortal",
                                        CompanyCode  = "8601",
                                        Action       = "Update",
                                        Version      = "1.0",
                                        Type         = "IPPRequestRegisterStatusChange",
                                        OriginalGUID = Guid.NewGuid().ToString()
                                    };

                                    SSBSender.SendV3(
                                        FROMSERVICE,
                                        TOSERVICELIST,
                                        ArticleCategory,
                                        ArticleType1,
                                        ArticleType2,
                                        this.BuildSendMessageXml(ssbHeader, ssb),
                                        "NCService");
                                }
                            }
                        }
                    }
                    #endregion
                }
            }
            return(entity);
        }