Ejemplo n.º 1
0
        private void UnFreezeSuccess(OrderPaidUnFreeze orderPaidUnFreeze)
        {
            var iOrderPaidUnFreezeService = DIFactory.GetContainer().Resolve <IOrderPaidUnFreezeService>();
            var iMemberService            = DIFactory.GetContainer().Resolve <IMemberService>();

            orderPaidUnFreeze.OrderPaid.Status = OrderPaidStatusOption.UnFrozenSuccess.ToInt();
            Save(orderPaidUnFreeze.OrderPaid);

            orderPaidUnFreeze.Status    = OrderPaidUnFreezeStatusOption.Success.ToInt();
            orderPaidUnFreeze.TransTime = DateTime.Now;
            iOrderPaidUnFreezeService.Save(orderPaidUnFreeze);

            iMemberService.BalanceChange(orderPaidUnFreeze.OrderPaid.Member, orderPaidUnFreeze.Amount, MemberBalanceHistoryTypeOption.UnFreeze, (AccountBankOption)orderPaidUnFreeze.OrderPaid.Merchant.AccountBank, orderPaidUnFreeze.Amount * -1, remark: orderPaidUnFreeze.SerialNumber);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 解冻
        /// </summary>
        /// <returns></returns>
        public UnfrozenFixedDepositResponse Unfreeze(OrderPaidUnFreeze orderPaidUnFreeze)
        {
            UnfrozenFixedDepositRequest request = new UnfrozenFixedDepositRequest();

            request.Head.ReqJnlNo = GuidHelper.GenUniqueId();

            request.Body.TrsDate        = orderPaidUnFreeze.OrderPaid.FreezeDate.ToDateTime().ToString("yyyyMMdd");
            request.Body.CoPatrnerJnlNo = orderPaidUnFreeze.OrderPaid.FreezeSerialNumber;
            request.Body.ManageFlag     = "5";
            request.Body.Currency       = "CNY";

            var result = guangDaExec.Exec(request) as UnfrozenFixedDepositResponse;

            return(result);
        }
Ejemplo n.º 3
0
        private void UnFreeze(OrderPaid orderPaid)
        {
            //var iOrderPaidService = DIFactory.GetContainer().Resolve<IOrderPaidService>();
            var iOrderPaidUnFreezeService = DIFactory.GetContainer().Resolve <IOrderPaidUnFreezeService>();
            var iGuangDaAPIService        = DIFactory.GetContainer().Resolve <IGuangDaAPIService>();

            OrderPaidUnFreeze orderPaidUnFreeze = new OrderPaidUnFreeze();

            orderPaidUnFreeze.OrderPaid = orderPaid;
            orderPaidUnFreeze.Amount    = orderPaid.TransactionAmount;

            iOrderPaidUnFreezeService.Save(orderPaidUnFreeze);
            iOrderPaidUnFreezeService.Commit();

            var unFreezeResponse = iGuangDaAPIService.Unfreeze(orderPaidUnFreeze);

            orderPaidUnFreeze.ResponseCode    = unFreezeResponse.Head.ResCode;
            orderPaidUnFreeze.ResponseMessage = unFreezeResponse.Head.ResMsg;

            if (unFreezeResponse.IsOK)
            {
                UnFreezeSuccess(orderPaidUnFreeze);

                Commit();
            }
            //else if (unFreezeResponse.IsWait)
            //{
            //    orderPaid.Status = OrderPaidStatusOption.UnFrozenWait.ToInt();
            //    Save(orderPaid);

            //    orderPaidUnFreeze.Status = OrderPaidUnFreezeStatusOption.Wait.ToInt();
            //    iOrderPaidUnFreezeService.Save(orderPaidUnFreeze);

            //    Commit();

            //    throw new APIException("解冻中,请查询确认(" + unFreezeResponse.Head.ResMsg + ")");
            //}
            else if (unFreezeResponse.IsFail)
            {
                orderPaidUnFreeze.Status = OrderPaidUnFreezeStatusOption.Fail.ToInt();
                iOrderPaidUnFreezeService.Save(orderPaidUnFreeze);

                Commit();

                throw new APIException("解冻失败:" + unFreezeResponse.Head.ResMsg);
            }
        }