Esempio n. 1
0
        private static bool VerifyExistRansomCallBack(string content)
        {
            bool exist = false;

            SendRansomMessage model  = GetRansomModelResponse(content);
            Hashtable         htComm = GetCommonreturn(model.Commonreturn);

            string customerId = htComm["CustomerID"].ToString();
            string userId     = htComm["UserID"].ToString();
            string seqNo      = htComm["SeqNO"].ToString();

            var loggingSessionInfo = Default.GetBSLoggingSession(customerId, userId);
            var redeemBll          = new WXHouseReservationRedeemBLL(loggingSessionInfo);
            var reddemList         = redeemBll.Query(new IWhereCondition[]
            {
                new EqualsCondition {
                    DateTimeAccuracy = null, FieldName = "CustomerID", Value = customerId
                },
                new EqualsCondition {
                    DateTimeAccuracy = null, FieldName = "IsDelete", Value = "0"
                },
                new EqualsCondition {
                    DateTimeAccuracy = null, FieldName = "SeqNO", Value = seqNo
                }
            }, null);

            if (reddemList != null && reddemList.Length > 0)
            {
                exist = true;
            }
            return(exist);
        }
Esempio n. 2
0
        /// <summary>
        /// 基金赎回。
        /// </summary>
        /// <param name="message"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        public static void RansomCallBack(string content)
        {
            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "赎回  content" + content
            });

            SendRansomMessage model  = GetRansomModelResponse(content);
            Hashtable         htComm = GetCommonreturn(model.Commonreturn);

            string customerId    = htComm["CustomerID"].ToString();
            string userId        = htComm["UserID"].ToString();
            string prePaymentId  = htComm["PrePaymentID"].ToString();
            string seqNo         = htComm["SeqNO"].ToString();
            string merchantdate  = htComm["Merchantdate"].ToString();
            string resultPageUrl = htComm["ToPageURL"].ToString();

            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "赎回  ToPageURL" + resultPageUrl
            });

            string retMsg;
            int    fundState;

            //判断华安赎回返回Retcode状态
            if (model.Retcode == "0000")
            {
                fundState = (int)FundStateEnum.Order;
                retMsg    = "委托已受理";
            }
            else
            {
                fundState = (int)FundStateEnum.Error;
                retMsg    = "委托失败";
            }

            var loggingSessionInfo = Default.GetBSLoggingSession(customerId, userId);

            #region  添加赎回记录
            try
            {
                var redeemBll = new WXHouseReservationRedeemBLL(loggingSessionInfo);
                var entity    = redeemBll.GetByPrePaymentID(customerId, prePaymentId);
                if (entity != null)
                {
                    entity.FundState = fundState;
                    redeemBll.Update(entity);
                }
                else
                {
                    entity = new WXHouseReservationRedeemEntity
                    {
                        RedeemID     = Guid.NewGuid(),
                        PrePaymentID = new Guid(prePaymentId),
                        Fundtype     = (int)FundtypeeEnum.ReservationRedeem,
                        FundState    = fundState,
                        Merchantdate = merchantdate,
                        SeqNO        = seqNo,
                        Retmsg       = model.Retmsg,
                        Retcode      = model.Retcode,
                        CustomerID   = customerId
                    };

                    redeemBll.Create(entity);
                }
            }
            catch (Exception ex)
            {
                Loggers.DEFAULT.Exception(new ExceptionLogInfo(ex));
                // throw new APIException(string.Format("操作赎回记录失败,原因:{0}", ex.Message)) { ErrorCode = 201 };
            }
            #endregion

            string toPageUrl = resultPageUrl + "&type=2&retStatus=" + fundState + "&retMsg=" + retMsg + "&Retcode=" + model.Retcode;
            RedirectUrl(toPageUrl);
        }