public IHttpActionResult Get(int CurrentPage, int PageSize, long feeNo, DateTime startDate, DateTime endDate, string mark)
        {
            BaseResponse <object> response = new BaseResponse <object>();

            switch (mark)
            {
            case "FeeList":
                var sDate = dictManageService.GetFeeIntervalByDate(startDate).Month;
                var eDate = dictManageService.GetFeeIntervalByDate(endDate).Month;
                var nsno  = service.GetNsno();
                var res   = service.QueryBillV2FeeList(feeNo, startDate, endDate);
                response.RecordsCount = res.RecordsCount;
                response.PagesCount   = res.PagesCount;

                object obj = new
                {
                    regInformation = res.Data.regInformation,
                    feeRecordList  = res.Data.feeRecordList.GroupBy(
                        x => new
                    {
                        x.ProjectName,
                        x.UnitPrice,
                        x.Units
                    })
                                     .Select(g => new
                    {
                        ProjectName = g.Key.ProjectName,
                        UnitPrice   = g.Key.UnitPrice,
                        Units       = g.Key.Units,
                        Count       = g.Sum(a => a.Count),
                        Cost        = g.Sum(a => a.Cost)
                    }).OrderByDescending(x => x.ProjectName)
                                     .ToList(),
                    totalCount = res.Data.feeRecordList.Sum(s => s.Count),
                    totalCost  = res.Data.feeRecordList.Sum(s => s.Cost)
                };
                response.Data = obj;
                break;
            }
            return(Ok(response));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetFeeIntervalByDateStr(string date)
        {
            var response = _service.GetFeeIntervalByDate(date);

            return(Ok(response));
        }