コード例 #1
0
        /// <summary>
        /// 基金赎回。
        /// </summary>
        /// <param name="rRequest"></param>
        /// <returns></returns>
        private void FundRansom()
        {
            string seqNO = HuaAnFactory.GenerateSeqNO();
            var    loggingSessionInfo = Default.GetBSLoggingSession(m_customerID, m_userID);

            //处理调用华安请求From表单对象
            DateTime             dt     = DateTime.Now;
            ReceiveRansomMessage pEnity = AssertRanson(loggingSessionInfo, m_customerID, m_userID, m_detailID, dt);
            string strContent           = Utility.GetRequsetXml(pEnity);

            //HanAnRequestMessage rMessage = new HuaAnFactory().FormRequestContent(dt, strContent, HuaAnConst.Redemption, seqNO);

            Model = new HuaAnFactory().FormRequestContent(dt, Utility.GetRequsetXml(pEnity), HuaAnConfigurationAppSitting.Redemption, seqNO);
        }
コード例 #2
0
        /// <summary>
        /// 获取华安接口中:每万份收益、年化收益率(5002)
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        private void GetProfit()
        {
            DateTime dt = DateTime.Now;

            string seqNO = HuaAnFactory.GenerateSeqNO();

            //处理调用华安请求From表单对象
            //ReceiveProfitSelectMessage entity = AssignmentProfit(dt);  //查询年化收益率
            // ReceivePaySingleQueryMessage entity = AssignmentSingleQuery(dt);  //3001
            ReceiveFundProfitMessage entity = Assignment5000(dt);   //500
            string strContent            = Utility.GetRequsetXml(entity);
            HanAnRequestMessage rMessage = new HuaAnFactory().FormRequestContent(dt, strContent, 5001, seqNO);

            IDictionary <string, string> dic = HuaAnFactory.SetFormPara(rMessage);
            HttpWebResponse webResponse      = HttpHelper.CreatePostHttpResponse(HuaAnConfigurationAppSitting.ReservationServletUrl, dic, null, null, Encoding.UTF8, null);
            string          content          = HttpHelper.GetResponseString(webResponse);

            Hashtable    htComm = GetCommonreturn(content);
            HanAnMessage msg    = new HanAnMessage
            {
                verNum  = htComm["verNum"].ToString(),
                sysdate = htComm["sysdate"].ToString(),
                systime = htComm["systime"].ToString(),
                txcode  = htComm["txcode"].ToString(),
                seqNO   = htComm["seqNO"].ToString(),
                maccode = htComm["maccode"].ToString(),
                content = htComm["content"].ToString()
            };


            if (msg != null)
            {
                string decrypt = Utility.AESDecrypt(msg.content, HuaAnConfigurationAppSitting.AesKey);
                SendFundProfitMessage profitMsg = GetProfitMsg(decrypt);
                string[] profitN = profitMsg.Content.Split('\n');
                foreach (var item in profitN)
                {
                    string   profit      = item;
                    string[] profitArray = profit.Split('|');
                }
                //   string[] profit = profitMsg.Content.Split('|');
            }

            Model = rMessage;
        }
コード例 #3
0
        /// <summary>
        /// 基金购买
        /// </summary>
        /// <param name="reqContent"></param>
        /// <returns></returns>
        public void BuyFund()
        {
            DateTime dt                 = DateTime.Now;
            string   orderNO            = HuaAnFactory.GenerateSeqNO();
            var      loggingSessionInfo = Default.GetBSLoggingSession(m_customerID, m_userID);

            WXHouseDetailBLL    wxhdbll = new WXHouseDetailBLL(loggingSessionInfo);
            WXHouseDetailEntity wxhde   = wxhdbll.GetDetailByID(m_customerID, m_detailID);

            if (wxhde == null)
            {
                throw new Exception("没有找到该楼盘信息。");
            }

            string realPay = wxhde.RealPay.ToString();

            //产生订单号
            TUnitExpandBLL TUeBll = new TUnitExpandBLL(loggingSessionInfo);
            // string seqNO = TUeBll.GetUnitOrderNo(loggingSessionInfo, "ed7d227564b54778a4cffb7335a8b078");

            string seqNO = HuaAnFactory.GenerateSeqNO();
            //1判断会员楼盘明细映射是否存在记录
            WXHouseVipMappingBLL bll = new WXHouseVipMappingBLL(loggingSessionInfo);
            DataSet ds        = bll.VerifWXHouseVipMapping(m_userID, m_detailID, m_customerID);
            Guid    mappingID = Guid.NewGuid();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                //1.1存在
                mappingID = new Guid(ds.Tables[0].Rows[0]["MappingID"].ToString());
            }
            else
            {
                //1.2不存在
                //插入会员楼盘明细映射表
                WXHouseVipMappingEntity WXHvmEntity = new WXHouseVipMappingEntity();
                WXHvmEntity.MappingID  = mappingID;
                WXHvmEntity.DetailID   = new Guid(m_detailID);
                WXHvmEntity.CustomerID = m_customerID;
                WXHvmEntity.VIPID      = m_userID;
                //WXHvmEntity.HouseSaleNo = "";//预售号码
                WXHvmEntity.ReserveNo = orderNO;
                //WXHvmEntity.HoseMessage = "";//房子描述信息
                WXHvmEntity.HoseState = 0;
                WXHvmEntity.IsBuyHose = (int)PayHouseStateEnum.Unknown;
                WXHvmEntity.IsBuyFund = 1;
                WXHvmEntity.IsRedeem  = (int)FundStateEnum.Unknown;
                bll.Create(WXHvmEntity);
            }
            //1.3插入交易手续费表
            Guid feeID = Guid.NewGuid();
            WXHouseTradeFeeEntity WXHtfEntity = new WXHouseTradeFeeEntity();

            WXHtfEntity.FeeID      = feeID;
            WXHtfEntity.TradeType  = 0;
            WXHtfEntity.FeeType    = 0;
            WXHtfEntity.Fee        = 0;
            WXHtfEntity.CustomerID = m_customerID;
            WXHouseTradeFeeBLL WXHtfBll = new WXHouseTradeFeeBLL(loggingSessionInfo);

            WXHtfBll.Create(WXHtfEntity);
            ////1.4插入预付款订单
            //WXHousePrePaymentEntity WXHppEntity = new WXHousePrePaymentEntity();
            //Guid prePaymentID = Guid.NewGuid();
            //WXHppEntity.PrePaymentID = prePaymentID;
            //WXHppEntity.FeeID = feeID;
            //WXHppEntity.MappingID = mappingID;
            //WXHppEntity.OrderNo = orderNO;
            //WXHppEntity.RealPay = Convert.ToDecimal(realPay);
            //WXHppEntity.OrderDate = dt.ToString();
            //WXHppEntity.CustomerID = m_customerID;
            //WXHousePrePaymentBLL WXHppBll = new WXHousePrePaymentBLL(loggingSessionInfo);
            //WXHppBll.Create(WXHppEntity);

            //创建会员客户协议号映射
            //CreateClientAgreementNO(rp, loggingSessionInfo);

            //处理调用华安请求From表单对象
            Receive.ReceiveBuyMessage pEnity = new Receive.ReceiveBuyMessage();
            pEnity.MerchantID   = HuaAnConfigurationAppSitting.MerchantID;
            pEnity.Merchantdate = dt.ToString("yyyyMMdd");
            pEnity.Totalamt     = Convert.ToDecimal(realPay);
            VipBLL    vbll = new VipBLL(loggingSessionInfo);
            VipEntity ve   = vbll.GetVipDetailByVipID(m_userID);

            pEnity.Assignbuyer    = ve.VipCode;
            pEnity.Assbuyername   = ve.VipName;
            pEnity.Assbuyermobile = ve.Phone;
            pEnity.Fee            = "0";
            //用于回调更新
            string strCommon = "CustomerID=" + m_customerID;

            strCommon += "|UserID=" + m_userID;
            strCommon += "|HouseDetailID=" + m_detailID;
            strCommon += "|MappingID=" + mappingID.ToString();
            //  strCommon += "|PrePaymentID=" + prePaymentID.ToString();
            strCommon          += "|ToPageURL=http://o2oapi.aladingyidong.com/ApplicationInterface/Project/HuaAn/HuaAnCallBack.aspx?action=BuyCallBack";
            pEnity.Commonreturn = strCommon;
            //回调url
            pEnity.RetURL  = "";
            pEnity.PageURL = string.Format(HuaAnConfigurationAppSitting.CallBackPageUrl, "BuyCallBack");
            //pEnity.PageURL = "http://o2oapi.aladingyidong.com/ApplicationInterface/Project/HuaAn/HuaAnCallBack.aspx?action=BuyCallBack";
            pEnity.Memo = "";
            //请求表单对象
            var fromList = new HuaAnFactory().FormRequestContent(dt, Utility.GetRequsetXml(pEnity), HuaAnConfigurationAppSitting.Buy, orderNO);
            var rdData   = new PayEntityRD();

            rdData.FormData = fromList;
            //华安url
            rdData.Url = HuaAnConfigurationAppSitting.ReservationPurchaseUrl;
            //请求表单对象
            Model = new HuaAnFactory().FormRequestContent(dt, Utility.GetRequsetXml(pEnity), HuaAnConfigurationAppSitting.Buy, seqNO);
        }