Beispiel #1
0
        /// <summary>
        /// 担保交易(金币)支付,生成结算单
        /// </summary>
        public static SettleAccounts CreateSettleAccount(ContextSession contextSession, CommodityOrder commodityOrder)
        {
            // 未加入场馆的不生成结算单
            if (!commodityOrder.EsAppId.HasValue)
            {
                return(null);
            }

            if (!CheckPayType(commodityOrder))
            {
                return(null);
            }

            var parSources = PaySource.GetPaymentByTradeType(0);

            if (commodityOrder.Payment != 0)
            {
                LogHelper.Warn("担保交易(金币)支付,生成结算单失败,该订单:[" + commodityOrder.Id + "]非金币支付。");
                return(null);
            }

            // 查询场馆信息
            var mall = MallApply.ObjectSet().Where(m => m.AppId == commodityOrder.AppId && m.EsAppId == commodityOrder.EsAppId && (m.State.Value == 2 || m.State.Value == 4)).FirstOrDefault();

            if (mall == null)
            {
                LogHelper.Info("生成结算项失败,商城中未找到该APP,订单ID:" + commodityOrder.Id);
                return(null);
            }
            return(CreateSettleAccount(contextSession, commodityOrder, mall));
        }
Beispiel #2
0
        public static bool CheckPayType(CommodityOrder commodityOrder)
        {
            var paySources = PaySource.GetPaymentByTradeType(0);

            if (paySources.Contains(commodityOrder.Payment))
            {
                return(true);
            }
            LogHelper.Warn("担保交易(金币)支付,生成结算单失败,该订单:[" + commodityOrder.Id + "]非担保交易。");
            return(false);
        }