Ejemplo n.º 1
0
        /// <summary>
        /// 根据时间获取Pay的数据
        /// </summary>
        /// <param name="BillDate"></param>
        /// <returns></returns>
        public async Task <List <DetailedList> > DetailedListInPayOrder(string[] BillDate)
        {
            var datas = new List <DetailedList>();

            for (var i = 0; i < BillDate.Length; i++)
            {
                var PayModel = await _ipayTableServices.Query(obj => obj.orderDate == BillDate[i]);

                if (PayModel.Count == 0)
                {  //查询时间数组中 那天的数据 空表示没有数据 进行时间数组中下一天的查询
                    myLogger.LogWarning($"{BillDate[i]} 无数据");
                    continue;
                }
                decimal returnMoney = 0;
                decimal moneys      = 0;
                int     count       = 0;
                myLogger.LogDebug($"{BillDate[i]} 有数据");
                foreach (var pay in PayModel) //查询时间数组中 那天的数据 如果有数据
                {
                    if ("YES".Equals(pay.isRefund))
                    {
                        returnMoney += Convert.ToDecimal(pay.orderAmount);
                    }
                    moneys += Convert.ToDecimal(pay.orderAmount); //类型不相同需要强转
                    count++;
                }
                if (count == 0)
                {
                    return(datas);
                }
                var dt = new DetailedList
                {
                    Count    = count,
                    BillDate = BillDate[i],
                    Money    = Convert.ToDouble(moneys - returnMoney),
                    DataName = "Pay"
                };
                datas.Add(dt);
            }
            return(datas);
        }
Ejemplo n.º 2
0
 public async Task <List <PayTable> > GetOneyDay(string Billdate)
 {
     return(await _IPayTableServices.Query(obj => obj.orderDate == Billdate));
 }