Exemplo n.º 1
0
        public accountInfoDto receive([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] accountInfoDto arg0)
        {
            object[] results = this.Invoke("receive", new object[] {
                arg0
            });

            return((accountInfoDto)(results[0]));
        }
Exemplo n.º 2
0
 /// <remarks/>
 public void receiveAsync(accountInfoDto arg0, object userState)
 {
     if ((this.receiveOperationCompleted == null))
     {
         this.receiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreceiveOperationCompleted);
     }
     this.InvokeAsync("receive", new object[] {
         arg0
     }, this.receiveOperationCompleted, userState);
 }
Exemplo n.º 3
0
        // 打款接口
        /// <summary>
        /// 打款接口
        /// </summary>
        /// <param name="service"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static accountInfoDto Do(this SI04ImplService service, accountInfoDto param)
        {
            service.Url = PubHelper.GetAddress(service.Url);

            string entityName = "打款接口";
            long svID = -1;
            if (IsLog)
            {
                svID = ProxyLogger.CreateTransferSV(entityName
                    //, EntitySerialization.EntitySerial(bpObj)
                    , Newtonsoft.Json.JsonConvert.SerializeObject(param)
                    , service.GetType().FullName,Newtonsoft.Json.JsonConvert.SerializeObject(service));
            }

            try
            {
                var result = service.receive(param);

                if (svID > 0)
                {
                    if (result != null
                        )
                    {
                        //string resultXml = EntitySerialization.EntitySerial(result);
                        string resultXml = Newtonsoft.Json.JsonConvert.SerializeObject(result);

                        ProxyLogger.UpdateTransferSV(svID, resultXml, result.flag == 1, result.errMsg, string.Empty, string.Empty);
                    }
                    else
                    {
                        ProxyLogger.UpdateTransferSV(svID, string.Empty, false, Const_ResultNullMessage, string.Empty, string.Empty);
                    }
                }
                return result;
            }
            catch (Exception ex)
            {
                if (svID > 0)
                {
                    ProxyLogger.UpdateTransferSV(svID, string.Empty, false, ex.Message, string.Empty, ex.StackTrace);
                }

                throw ex;
            }

            return null;
        }
Exemplo n.º 4
0
 /// <remarks/>
 public void receiveAsync(accountInfoDto arg0)
 {
     this.receiveAsync(arg0, null);
 }
Exemplo n.º 5
0
 /// <remarks/>
 public void receiveAsync(accountInfoDto arg0, object userState) {
     if ((this.receiveOperationCompleted == null)) {
         this.receiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreceiveOperationCompleted);
     }
     this.InvokeAsync("receive", new object[] {
                 arg0}, this.receiveOperationCompleted, userState);
 }
Exemplo n.º 6
0
 /// <remarks/>
 public void receiveAsync(accountInfoDto arg0) {
     this.receiveAsync(arg0, null);
 }
Exemplo n.º 7
0
        public void Notify(params object[] args)
        {
            if (args != null && args.Length != 0 && args[0] is EntityEvent)
            {
                BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey;
                if (!(key == null))
                {
                    Voucher voucher = key.GetEntity() as Voucher;
                    //if (voucher.Org.Code == "20")
                    if (PubHelper.IsOrg_Finance2DMS())
                    {
                        bool flag = PubHelper.IsUsedDMSAPI();
                        if (flag)
                        {
                            if (voucher.OriginalData.VoucherStatus == VoucherStatus.Approving && voucher.VoucherStatus == VoucherStatus.Approved)
                            {
                                SI04ImplService service = new SI04ImplService();
                                // service.Url = PubHelper.GetAddress(service.Url);
                                foreach (Entry entry in voucher.Entries)
                                {
                                    //if(entry.AccountKey != null && (entry.Account.Segment1.StartsWith("22410401") || entry.Account.Segment1.StartsWith("1122010303") || entry.Account.Segment1.StartsWith("1122010101") || entry.Account.Segment1.StartsWith("1122010301") || entry.Account.Segment1.StartsWith("2241030801") || entry.Account.Segment1 == "2241030803" || entry.Account.Segment1 == "1122010302" || entry.Account.Segment1 == "2241030901"))

                                    // 这里只处理打款(回款) 业务(即,账号增加;减少 在应收应付里做)

                                    // operaTionType账户类型;现金、三包
                                    // 现金,DJ(定金);三包,CBXY(三包信用)
                                    string dmsOperationType = GetDMSOperationType(entry);

                                    //if (IsUpdateDMS(entry))
                                    if(dmsOperationType.IsNotNullOrWhiteSpace())
                                    {
                                        //if (entry.AccountedCr != 0)
                                        // Cr贷、Dr借
                                        if (entry.AccountedCr != 0
                                            // || entry.AccountedDr != 0
                                            )
                                        {
                                            Customer cust = Customer.Finder.Find(string.Format("Org={0} and Code='{1}'", Context.LoginOrg.ID.ToString(), entry.Account.Segment3), new OqlParam[0]);

                                            if (PubHelper.IsUpdateDMS(cust))
                                            {
                                                try
                                                {
                                                    accountInfoDto dto = new accountInfoDto();
                                                    dto.dealerCode = entry.Account.Segment3;
                                                    dto.creadNo = voucher.VoucherDisplayCode;
                                                    dto.invokeTime = System.DateTime.Now;
                                                    dto.UNineCreateUser = voucher.CreatedBy;
                                                    dto.remark = entry.Abstracts;
                                                    dto.changeType = ((entry.AccountedCr > 0) ? 1 : 0);
                                                    // operaTionType账户类型;现金、三包
                                                    // 现金,DJ(定金);三包,SBXY(三包信用)
                                                    //if (entry.Account.Segment1.StartsWith("22410401") || entry.Account.Segment1 == "1122010302")
                                                    //{
                                                    //    dto.operaTionType = "DJ";
                                                    //}
                                                    //else if (entry.Account.Segment1.StartsWith("1122010101"))
                                                    //{
                                                    //    dto.operaTionType = "FCK";
                                                    //}
                                                    //else if (entry.Account.Segment1 == "1122010301")
                                                    //{
                                                    //    dto.operaTionType = "CBXY";
                                                    //}
                                                    //else if (entry.Account.Segment1 == "2241030801" || entry.Account.Segment1 == "2241030803")
                                                    //{
                                                    //    dto.operaTionType = "BZJ";
                                                    //}
                                                    //else if (entry.Account.Segment1 == "12210203")
                                                    //{
                                                    //    dto.operaTionType = "SBXY";
                                                    //}
                                                    //else
                                                    //{
                                                    //    dto.operaTionType = "FL";
                                                    //}
                                                    dto.operaTionType = dmsOperationType;

                                                    dto.amount = double.Parse(System.Math.Abs(entry.AccountedCr).ToString());

                                                    if (Context.LoginOrg.Code == PubHelper.Const_OrgCode_Electric)
                                                    {
                                                        // 电动车只有服务站
                                                        dto.customerType = "101006";
                                                    }
                                                    else
                                                    {
                                                        if (cust != null && cust.CustomerCategoryKey != null)
                                                        {
                                                            dto.customerType = cust.CustomerCategory.Code;
                                                        }
                                                    }
                                                    ILogger logger = LoggerManager.GetLogger(typeof(Voucher));
                                                    logger.Info(string.Format("审核 dealerCode={0},creadNo={1},invokeTime={2},UNineCreateUser={3},remark={4},changeType={5},operaTionType={6},amount={7},customerType={8}", new object[]
                                                {
                                                    dto.dealerCode,
                                                    dto.creadNo,
                                                    dto.invokeTime,
                                                    dto.UNineCreateUser,
                                                    dto.remark,
                                                    dto.changeType,
                                                    dto.operaTionType,
                                                    dto.amount.ToString(),
                                                    dto.customerType
                                                }), new object[0]);
                                                    accountInfoDto c = service.Do(dto);
                                                    if (c != null && c.flag == 0)
                                                    {
                                                        throw new System.ApplicationException(c.errMsg);
                                                    }
                                                }
                                                catch (System.Exception e)
                                                {
                                                    throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            else if (voucher.OriginalData.VoucherStatus == VoucherStatus.Approved && voucher.VoucherStatus == VoucherStatus.Approving)
                            {
                                SI04ImplService service = new SI04ImplService();
                                // service.Url = PubHelper.GetAddress(service.Url);
                                foreach (Entry entry in voucher.Entries)
                                {
                                    //if (entry.AccountKey != null && (entry.Account.Segment1.StartsWith("22410401") || entry.Account.Segment1.StartsWith("1122010303") || entry.Account.Segment1.StartsWith("1122010101") || entry.Account.Segment1.StartsWith("1122010301") || entry.Account.Segment1.StartsWith("2241030801") || entry.Account.Segment1 == "2241030803" || entry.Account.Segment1 == "1122010302" || entry.Account.Segment1 == "2241030901"))

                                    // 这里只处理打款(回款) 业务(即,账号增加;减少 在应收应付里做)

                                    // operaTionType账户类型;现金、三包
                                    // 现金,DJ(定金);三包,CBXY(三包信用)
                                    string dmsOperationType = GetDMSOperationType(entry);

                                    //if (IsUpdateDMS(entry))
                                    if (dmsOperationType.IsNotNullOrWhiteSpace())
                                    {
                                        if (entry.AccountedCr != 0)
                                        {
                                            Customer cust = Customer.Finder.Find(string.Format("Org={0} and Code='{1}'", Context.LoginOrg.ID.ToString(), entry.Account.Segment3), new OqlParam[0]);

                                            if (PubHelper.IsUpdateDMS(cust))
                                            {
                                                try
                                                {
                                                    accountInfoDto dto = new accountInfoDto();
                                                    dto.dealerCode = entry.Account.Segment3;
                                                    dto.creadNo = voucher.VoucherDisplayCode;
                                                    dto.invokeTime = System.DateTime.Now;
                                                    dto.UNineCreateUser = voucher.CreatedBy;
                                                    dto.remark = entry.Abstracts;
                                                    dto.changeType = ((entry.AccountedCr > 0) ? 0 : 1);
                                                    //if (entry.Account.Segment1.StartsWith("22410401") || entry.Account.Segment1 == "1122010302")
                                                    //{
                                                    //    dto.operaTionType = "DJ";
                                                    //}
                                                    //else if (entry.Account.Segment1.StartsWith("1122010101"))
                                                    //{
                                                    //    dto.operaTionType = "FCK";
                                                    //}
                                                    //else if (entry.Account.Segment1 == "1122010301")
                                                    //{
                                                    //    dto.operaTionType = "CBXY";
                                                    //}
                                                    //else if (entry.Account.Segment1 == "2241030801" || entry.Account.Segment1 == "2241030803")
                                                    //{
                                                    //    dto.operaTionType = "BZJ";
                                                    //}
                                                    //else if (entry.Account.Segment1 == "12210203")
                                                    //{
                                                    //    dto.operaTionType = "SBXY";
                                                    //}
                                                    //else
                                                    //{
                                                    //    dto.operaTionType = "FL";
                                                    //}
                                                    dto.operaTionType = dmsOperationType;
                                                    dto.amount = double.Parse(System.Math.Abs(entry.AccountedCr).ToString());
                                                    //Customer cust = Customer.Finder.Find(string.Format("Org={0} and Code='{1}'", Context.LoginOrg.ID.ToString(), entry.Account.Segment3), new OqlParam[0]);
                                                    //if (cust != null && cust.CustomerCategoryKey != null)
                                                    //{
                                                    //    dto.customerType = cust.CustomerCategory.Code;
                                                    //}

                                                    if (Context.LoginOrg.Code == PubHelper.Const_OrgCode_Electric)
                                                    {
                                                        // 电动车只有服务站
                                                        dto.customerType = "101006";
                                                    }
                                                    else
                                                    {
                                                        if (cust != null && cust.CustomerCategoryKey != null)
                                                        {
                                                            dto.customerType = cust.CustomerCategory.Code;
                                                        }
                                                    }
                                                    ILogger logger = LoggerManager.GetLogger(typeof(Voucher));
                                                    logger.Info(string.Format("弃审 dealerCode={0},creadNo={1},invokeTime={2},UNineCreateUser={3},remark={4},changeType={5},operaTionType={6},amount={7},customerType={8}", new object[]
                                                {
                                                    dto.dealerCode,
                                                    dto.creadNo,
                                                    dto.invokeTime,
                                                    dto.UNineCreateUser,
                                                    dto.remark,
                                                    dto.changeType,
                                                    dto.operaTionType,
                                                    dto.amount.ToString(),
                                                    dto.customerType
                                                }), new object[0]);
                                                    accountInfoDto c = service.Do(dto);
                                                    if (c != null && c.flag == 0)
                                                    {
                                                        throw new System.ApplicationException(c.errMsg);
                                                    }
                                                }
                                                catch (System.Exception e)
                                                {
                                                    throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 8
0
        public void Notify(params object[] args)
        {
            if (args != null && args.Length != 0 && args[0] is EntityEvent)
            {
                BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey;
                if (!(key == null))
                {
                    Voucher voucher = key.GetEntity() as Voucher;
                    //if (voucher.Org.Code == "20")
                    if (PubHelper.IsOrg_Finance2DMS())
                    {
                        bool flag = PubHelper.IsUsedDMSAPI();
                        if (flag)
                        {
                            // 不审核的,都不更新DMS,删除时肯定也不应该修改;
                            if (voucher.VoucherStatus == VoucherStatus.Approved)
                            {
                                SI04ImplService service = new SI04ImplService();
                                // service.Url = PubHelper.GetAddress(service.Url);
                                using (System.Collections.Generic.IEnumerator<IPersistableObject> enumerator = voucher.Entries.DelLists.GetEnumerator())
                                {
                                    while (enumerator.MoveNext())
                                    {
                                        Entry entry = (Entry)enumerator.Current;
                                        if (entry.AccountKey != null && (entry.Account.Segment1.StartsWith("22410401") || entry.Account.Segment1.StartsWith("1122010303") || entry.Account.Segment1.StartsWith("1122010101") || entry.Account.Segment1.StartsWith("1122010301") || entry.Account.Segment1.StartsWith("2241030801") || entry.Account.Segment1 == "2241030803" || entry.Account.Segment1 == "1122010302" || entry.Account.Segment1 == "2241030901"))
                                        {
                                            if (entry.AccountedCr != 0)
                                            {
                                                Customer cust = Customer.Finder.Find(string.Format("Org={0} and Code='{1}'", Context.LoginOrg.ID.ToString(), entry.Account.Segment3), new OqlParam[0]);

                                                if (PubHelper.IsUpdateDMS(cust))
                                                {
                                                    try
                                                    {
                                                        accountInfoDto dto = new accountInfoDto();
                                                        dto.dealerCode = entry.Account.Segment3;
                                                        dto.creadNo = voucher.VoucherDisplayCode;
                                                        dto.invokeTime = System.DateTime.Now;
                                                        dto.UNineCreateUser = voucher.CreatedBy;
                                                        dto.remark = entry.Abstracts;
                                                        dto.changeType = ((entry.AccountedCr > 0) ? 0 : 1);
                                                        if (entry.Account.Segment1.StartsWith("22410401") || entry.Account.Segment1 == "1122010302")
                                                        {
                                                            dto.operaTionType = "DJ";
                                                        }
                                                        else if (entry.Account.Segment1.StartsWith("1122010101"))
                                                        {
                                                            dto.operaTionType = "FCK";
                                                        }
                                                        else if (entry.Account.Segment1 == "1122010301")
                                                        {
                                                            dto.operaTionType = "CBXY";
                                                        }
                                                        else if (entry.Account.Segment1 == "2241030801" || entry.Account.Segment1 == "2241030803")
                                                        {
                                                            dto.operaTionType = "BZJ";
                                                        }
                                                        else if (entry.Account.Segment1 == "12210203")
                                                        {
                                                            dto.operaTionType = "SBXY";
                                                        }
                                                        else
                                                        {
                                                            dto.operaTionType = "FL";
                                                        }
                                                        dto.amount = double.Parse(System.Math.Abs(entry.AccountedCr).ToString());
                                                        //Customer cust = Customer.Finder.Find(string.Format("Org={0} and Code='{1}'", Context.LoginOrg.ID.ToString(), entry.Account.Segment3), new OqlParam[0]);

                                                        if (Context.LoginOrg.Code == PubHelper.Const_OrgCode_Electric)
                                                        {
                                                            // 电动车只有服务站
                                                            dto.customerType = "101006";
                                                        }
                                                        else
                                                        {
                                                            if (cust != null && cust.CustomerCategoryKey != null)
                                                            {
                                                                dto.customerType = cust.CustomerCategory.Code;
                                                            }
                                                        }
                                                        ILogger logger = LoggerManager.GetLogger(typeof(Voucher));
                                                        logger.Info(string.Format("删除 dealerCode={0},creadNo={1},invokeTime={2},UNineCreateUser={3},remark={4},changeType={5},operaTionType={6},amount={7},customerType={8}", new object[]
                                                {
                                                    dto.dealerCode,
                                                    dto.creadNo,
                                                    dto.invokeTime,
                                                    dto.UNineCreateUser,
                                                    dto.remark,
                                                    dto.changeType,
                                                    dto.operaTionType,
                                                    dto.amount.ToString(),
                                                    dto.customerType
                                                }), new object[0]);
                                                        accountInfoDto c = service.Do(dto);
                                                        if (c != null && c.flag == 0)
                                                        {
                                                            throw new System.ApplicationException(c.errMsg);
                                                        }
                                                    }
                                                    catch (System.Exception e)
                                                    {
                                                        throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }