public Respbase <ChargeUserInfoDto> GetYGPCNUEUserInfo(ReqExchangeUserInfo req)
        {
            ExchangeFacade    exchange = new ExchangeFacade();
            ChargeUserInfoDto data     = null;
            int resultcode             = 0;

            switch (req.typeId)
            {
            case 0:
                data = exchange.GetUeInfo(req.Nodeid, 1, out resultcode);
                break;

            case 4:
                data = exchange.GetPCNUserInfo(req.nodeCode, req.Nodeid);
                break;

            case 5:
                data = exchange.GetYGUserInfo(req.nodeCode);
                break;

            default:
                exchange.Alert("typeid不正确");
                break;
            }
            if (data == null)
            {
                var isue = req.typeId == 0;
                return(new Respbase <ChargeUserInfoDto> {
                    Result = isue ? resultcode : 0, Message = exchange.PromptInfo.Message
                });
            }
            return(new Respbase <ChargeUserInfoDto> {
                Result = 1, Data = data
            });
        }
Exemple #2
0
        /// <summary>
        /// 支付检查
        /// </summary>
        /// <param name="nodeid"></param>
        /// <param name="payPwd"></param>
        /// <param name="sumNum">总数量</param>
        /// <param name="amount">总价(数量*价格)</param>
        /// <returns></returns>
        private (bool, TpxinPaiConfig, TpxinUserinfo) PayCheck(int nodeid, string payPwd, int sumNum, decimal amount)
        {
            ExchangeFacade facade = new ExchangeFacade();
            TnetReginfo    user   = new TnetReginfo();

            if (!facade.CheckPwd(nodeid, payPwd, ref user))
            {
                Alert(facade.PromptInfo.Message);
                return(false, null, null);
            }
            var now      = DateTime.Now;
            int monthDay = DateTime.DaysInMonth(now.Year, now.Month);
            var next     = new DateTime(now.Year, now.Month, monthDay).AddHours(12);

            if (next <= now)
            {
                Alert("已超过截止日期,不能竞拍");
                return(false, null, null);
            }
            var config = GetConfig();

            if (config == null)
            {
                Alert("本月没有竞拍");
                return(false, null, null);
            }
            if (sumNum > config.Num)
            {
                Alert("竞拍数量大于总数量");
                return(false, null, null);
            }
            var pxinUser = db.TpxinUserinfoSet.Where(w => w.Nodeid == nodeid).FirstOrDefault();

            if (pxinUser == null)
            {
                Alert("不是相信app用户");
                return(false, null, null);
            }
            //if (pxinUser.P < amount)
            //{
            //    Alert("p点余额不足");
            //    return (false, null, null);
            //}
            return(true, config, pxinUser);
        }
        private bool PaySuccessNotice(PayHisDto apiueHis)
        {
            PXinContext ctx = HttpContext.GetDbContext <PXinContext>();

            //付款成功状态
            int          oid      = Convert.ToInt32(apiueHis.Orderno);
            TnetUepayhis uePayHis = ctx.TnetUepayhisSet.FirstOrDefault(c => c.Id == oid);

            if (uePayHis == null)
            {
                log.Info("orderid:" + apiueHis.Orderno + "不存在");
                Response.Write("fail");
                return(false);
            }
            if (uePayHis.Status != 0)
            {
                log.Info("orderid:" + apiueHis.Orderno + "已处理");
                return(false);
            }
            uePayHis.Ordernoue = apiueHis.OrdernoUE;
            //uePayHis.Status = 1;
            //if (ctx.SaveChanges() <= 0)
            //{
            //    log.Info("orderid=" + uePayHis.Id + ",更新订单状态失败");
            //    Response.Write("fail");
            //    return false;
            //}
            if (uePayHis.Typeid == 20001)
            {
                //13-充值V点
                FriFacade facade = new FriFacade();
                bool      result = facade.ChargeVDian_Notice(uePayHis);
                if (!result)
                {
                    log.Info("充值V点失败,原因" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20002)
            {
                //5-充值商新增代理人
                FbApFacade facade = new FbApFacade();
                bool       result = facade.AddUserJxs_Notice(uePayHis).Result;
                if (!result)
                {
                    log.Info("充值商新增代理人失败,原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20003 || uePayHis.Typeid == 20007)
            {
                //1-兑换充值码(进货)
                FbApFacade facade = new FbApFacade();
                bool       result = facade.ExChangeRechargeCode_Notice(uePayHis).Result;
                if (!result)
                {
                    log.Info("兑换充值码失败,原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20004)
            {
                //开通专属账号
                var facade = new ExchangeFacade();
                var result = facade.OpenInfo_Notice(uePayHis);
                if (!result)
                {
                    log.Info("开通专属账号失败原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20005)
            {
                //18-充值商续费
                FbApFacade facade = new FbApFacade();
                bool       result = facade.Renew_Notice(uePayHis).Result;
                if (!result)
                {
                    log.Info("充值商续费失败,原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20006)
            {
                //ue转账到相信
                var facade = new ExchangeFacade();
                var result = facade.UeTransferInDos_Notice(uePayHis);
                if (!result)
                {
                    log.Info("ue转账到相信失败原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20008)
            {
                //十月送手机活动
                var facade = new ActivityFacade();
                var result = facade.OctoberActivityDosUEPay_Notice(uePayHis);
                if (!result)
                {
                    log.Info("十月送手机活动支付服务费失败原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else if (uePayHis.Typeid == 20010)
            {
                //代开充值商
                var facade = new FbApFacade();
                var result = facade.OpenCzs_Notice(uePayHis).Result;
                if (!result)
                {
                    log.Info("代开充值商支付服务费失败,原因:" + facade.PromptInfo.Message);
                }
                return(result);
            }
            else
            {
                //未知业务类型
                log.Info("未知业务类型:" + JsonConvert.SerializeObject(apiueHis));
                return(false);
            }
        }