Ejemplo n.º 1
0
        /// <summary>
        /// 获取分销商佣金入账信息
        /// </summary>
        /// <param name="distributeMoneySearch"></param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.DistributorMoneyResultDTO GetDistributorMoneyInfo(Jinher.AMP.BTP.Deploy.CustomDTO.DistributeMoneySearch distributeMoneySearch)
        {
            //定义返回值
            Jinher.AMP.BTP.Deploy.CustomDTO.DistributorMoneyResultDTO result;

            try
            {
                //调用代理方法
                result = base.Channel.GetDistributorMoneyInfo(distributeMoneySearch);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取分销商佣金入账信息
        /// </summary>
        /// <param name="distributeMoneySearch"></param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.DistributorMoneyResultDTO GetDistributorMoneyInfo(Jinher.AMP.BTP.Deploy.CustomDTO.DistributeMoneySearch distributeMoneySearch)
        {
            base.Do(false);
            Stopwatch timer = new Stopwatch();

            timer.Start();
            var result = this.GetDistributorMoneyInfoExt(distributeMoneySearch);

            timer.Stop();
            LogHelper.Debug(string.Format("DistributorSV.GetDistributorMoneyInfo:耗时:{0}。入参:distributeMoneySearch:{1},\r\n出参:{2}", timer.ElapsedMilliseconds, JsonHelper.JsonSerializer(distributeMoneySearch), JsonHelper.JsonSerializer(result)));
            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取分销商佣金入账信息
        /// </summary>
        /// <param name="distributeMoneySearch"></param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.DistributorMoneyResultDTO GetDistributorMoneyInfoExt(Jinher.AMP.BTP.Deploy.CustomDTO.DistributeMoneySearch distributeMoneySearch)
        {
            Jinher.AMP.BTP.Deploy.CustomDTO.DistributorMoneyResultDTO result = new DistributorMoneyResultDTO();

            if (distributeMoneySearch == null || distributeMoneySearch.DistributorId == Guid.Empty || distributeMoneySearch.PageIndex < 0 || distributeMoneySearch.PageSize < 1)
            {
                return(result);
            }
            var payeeType = new List <int>()
            {
                9, 10, 11
            };
            var orderStates = new List <int>()
            {
                1, 2, 8, 9, 10, 12, 13, 14
            };
            var orderAfterStates = new List <int>()
            {
                3, 5, 10, 12, 13
            };

            var distributorId = distributeMoneySearch.DistributorId.ToString();

            //佣金累计 查已收益佣金
            if (distributeMoneySearch.SearchType == 1)
            {
                var query = from os in OrderShare.ObjectSet()
                            join orderService in CommodityOrderService.ObjectSet()
                            on os.OrderId equals orderService.Id
                            where
                            payeeType.Contains(os.PayeeType) &&
                            os.ShareKey == distributorId && os.Commission > 0 &&
                            orderService.State == 15
                            select new DistributorMoneyDTO
                {
                    DistributorId = distributeMoneySearch.DistributorId,
                    SortTime      = orderService.EndTime.Value,
                    Money         = os.Commission,
                    State         = 0
                };
                result.Count = query.Count();
                result.DistributorMoneyList = query.OrderByDescending(n => n.SortTime).Skip((distributeMoneySearch.PageIndex - 1) * distributeMoneySearch.PageSize).Take(distributeMoneySearch.PageSize).ToList();
            }
            //待收益
            else if (distributeMoneySearch.SearchType == 2)
            {
                var query = from os in OrderShare.ObjectSet()
                            join order in CommodityOrder.ObjectSet()
                            on os.OrderId equals order.Id
                            join dataS in CommodityOrderService.ObjectSet()
                            on os.OrderId equals dataS.Id
                            into tempS
                            from orderService in tempS.DefaultIfEmpty()
                            where
                            payeeType.Contains(os.PayeeType) &&
                            os.ShareKey == distributorId && os.Commission > 0 &&
                            (orderStates.Contains(order.State) ||
                             (order.State == 3 && orderService.State != null && orderAfterStates.Contains(orderService.State)))
                            select new DistributorMoneyDTO
                {
                    DistributorId = distributeMoneySearch.DistributorId,
                    SortTime      = order.PaymentTime.Value,
                    Money         = os.Commission,
                    State         = 1
                };
                result.Count = query.Count();
                result.DistributorMoneyList = query.OrderByDescending(n => n.SortTime).Skip((distributeMoneySearch.PageIndex - 1) * distributeMoneySearch.PageSize).Take(distributeMoneySearch.PageSize).ToList();
            }
            else
            {
                //
            }
            return(result);
        }