예제 #1
0
        public IActionResult LoadGainChartOfNetWebFinace(int?stationId, int?supplierId, string timeRange = "Last3Days")
        {
            DateTime dt = DateTime.Now;
            DateTime?sTime = null, eTime = null;

            base.initialData_TimeRange(ref sTime, ref eTime, timeRange: timeRange); //时间初始化
            if (!stationId.HasValue)
            {
                stationId = UserSelf.StationId;
            }
            if (!supplierId.HasValue)
            {
                supplierId = MPS.DefaultSupplierId;
            }

            var             model    = new StatisticsCBL(this).GainOfWebNetSended(stationId.Value, supplierId.Value, sTime.Value, eTime.Value);
            List <TitleVal> partList = new List <TitleVal>()
            {
                new TitleVal {
                    Title = "快递费", Val = model.Sum(m => m.TransFeeAmount)
                },
                new TitleVal {
                    Title = "药品费", Val = model.Sum(m => m.TotalAmount) - model.Sum(m => m.TransFeeAmount)
                }
            };

            //ViewBag.Total = new TitleVal { Title = "总计", Val = model.Sum(m => m.TotalVal) };
            //ViewBag.PartList = partList;
            //return PartialView("_pvLoadFinaceChart_Gain", model);

            return(TryCatchFunc(d =>
            {
                d.total = new TitleVal {
                    Title = "总计", Val = model.Sum(m => m.TotalAmount)
                };
                d.partList = partList;
                d.items = model;
                return null;
            }));
        }
예제 #2
0
        public IActionResult LoadFinaceChart_Gain(int?stationId, string timeRange = "Last3Days")
        {
            DateTime dt = DateTime.Now;
            DateTime?sTime = null, eTime = null;

            base.initialData_TimeRange(ref sTime, ref eTime, timeRange: timeRange); //时间初始化
            if (!stationId.HasValue)
            {
                stationId = UserSelf.StationId;
            }
            var             model    = new StatisticsCBL(this).GainChartCBL(sTime.Value, eTime.Value, stationId.Value);
            List <TitleVal> partList = new List <TitleVal>()
            {
                new TitleVal {
                    Title = "中药", Val = model.Sum(m => m.HerbVal)
                },
                new TitleVal {
                    Title = "成药", Val = model.Sum(m => m.FormedVal)
                },
                new TitleVal {
                    Title = "诊金", Val = model.Sum(m => m.ConsultationVal)
                },
                new TitleVal {
                    Title = "快递", Val = model.Sum(m => m.ShippingVal)
                },
                new TitleVal {
                    Title = "其他", Val = model.Sum(m => m.OtherFeeVal)
                },
            };

            //ViewBag.Total = new TitleVal { Title = "总计", Val = model.Sum(m => m.TotalVal) };
            //ViewBag.PartList = partList;
            //return PartialView("_pvLoadFinaceChart_Gain", model);

            return(TryCatchFunc(d =>
            {
                d.total = new TitleVal {
                    Title = "总计", Val = model.Sum(m => m.TotalVal)
                };
                d.partList = partList;
                d.items = model;
                return null;
            }));
        }