Himall商城BillingApplication获取营销服务费用明细、获取平台的收支明细

目录

1 Himall商城BillingApplication

1.1 获取营销服务费用明细(需移至营销服务BLL但目前没有此BLL)

1.2 分页获取平台的收支明细

1.3 非分页获取平台的收支明细

  1. Himall商城BillingApplication
    1.  获取营销服务费用明细(需移至营销服务BLL但目前没有此BLL)

         /// <summary>

        /// 获取营销服务费用明细(需移至营销服务BLL但目前没有此BLL)

        /// </summary>

        /// <param name="query">营销费用购买Id</param>

        /// <returns></returns>

        public static MarketServicesRecord GetMarketServiceRecord(long Id, long? shopId = null)

        {

            var model = MarketApplication.GetShopMarketServiceRecordInfo(Id);

            if (shopId.HasValue && shopId.Value != model.ActiveMarketServiceInfo.ShopId)

            {

                throw new Core.HimallException("找不到店铺的购买明细");

            }

            var record = ConvertToMarketServicesRecord(model);

            return record;

        }

        private static MarketServicesRecord ConvertToMarketServicesRecord(MarketServiceRecordInfo info)

        {

            MarketServicesRecord record = null;

            if (info != null)

            {

                record = new MarketServicesRecord();

                record.BuyTime = info.BuyTime.ToString("yyyy-MM-dd HH:mm:ss");

                record.BuyingCycle = info.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "至" + info.EndTime.ToString("yyyy-MM-dd HH:mm:ss");

                record.MarketType = (info.ActiveMarketServiceInfo.TypeId).ToDescription();

                record.Price = info.Price;

                record.ShopId = info.ActiveMarketServiceInfo.ShopId;

                record.ShopName = info.ActiveMarketServiceInfo.ShopName;

            }

            return record;

        }

    1. 分页获取平台的收支明细

      /// <summary>

        /// 分页获取平台的收支明细

        /// </summary>

        /// <param name="query">查询实体</param> 

        /// <returns></returns>

        public static QueryPageModel<PlatAccountItem> GetPlatAccountItem(PlatAccountItemQuery query)

        {

            var model = _iBillingService.GetPlatAccountItem(query);

            QueryPageModel<PlatAccountItem> item = new QueryPageModel<PlatAccountItem>();

            item.Total = model.Total;

            List<PlatAccountItem> items = new List<PlatAccountItem>();

            foreach (var m in model.Models)

            {

                PlatAccountItem PlatAccountItem = new PlatAccountItem();

                PlatAccountItem.AccountNo = m.AccountNo;

                PlatAccountItem.Balance = m.Balance.ToString();

                PlatAccountItem.CreateTime = m.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");

                PlatAccountItem.DetailId = m.DetailId;

                PlatAccountItem.PlatAccountType = m.TradeType;

                if (m.IsIncome)

                {

                    PlatAccountItem.Income = m.Amount.ToString();

                }

                else

                {

                    PlatAccountItem.Expenditure = m.Amount.ToString();

                }

                PlatAccountItem.Id = m.Id;

                items.Add(PlatAccountItem);

            }

            item.Models = items;

            return item;

        }

    1. 分页获取平台的收支明细

  /// <summary>

        /// 分页获取平台的收支明细

        /// </summary>

        /// <param name="query">查询实体</param> 

        /// <returns></returns>

        public static List<PlatAccountItem> GetPlatAccountItemNoPage(PlatAccountItemQuery query)

        {

            var models = _iBillingService.GetPlatAccountItemNoPage(query);

            List<PlatAccountItem> items = new List<PlatAccountItem>();

            foreach (var m in models)

            {

                PlatAccountItem PlatAccountItem = new PlatAccountItem();

                PlatAccountItem.AccountNo = m.AccountNo;

                PlatAccountItem.Balance = m.Balance.ToString();

                PlatAccountItem.CreateTime = m.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");

                PlatAccountItem.DetailId = m.DetailId;

                PlatAccountItem.PlatAccountType = m.TradeType;

                if (m.IsIncome)

                {

                    PlatAccountItem.Income = m.Amount.ToString();

                }

                else

                {

                    PlatAccountItem.Expenditure = m.Amount.ToString();

                }

                PlatAccountItem.Id = m.Id;

                items.Add(PlatAccountItem);

            }

            return items;

        }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GZM888888

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值