/// <summary>
        /// 获取表头信息
        /// </summary>
        private List <AkServerReportModel> getHeaderData()
        {
            List <AkServerReportModel> lt_headers = new List <AkServerReportModel>();

            AkServerReportModel model1 = new AkServerReportModel();
            AkServerReportModel model2 = new AkServerReportModel();
            AkServerReportModel model3 = new AkServerReportModel();


            model1.TimeInterval = AkConfig.StartDate.Replace("-", "") + "—" + AkConfig.EndDate.Replace("-", "") + "  BK-SOS-Report 服务区";
            //model1.HourTime = "BK-SOS-Report";
            //model1.OrderModeName = "BK-SOS-Report";
            //model1.TerminalName = "BK-SOS-Report";
            //model1.SalesTurnover = "BK-SOS-Report";
            //model1.OrderNum = "BK-SOS-Report";
            model1.Item1 = "服务速度报表";
            //model1.AvgProduct = AkDaoHelper.Instance_SystemParam.GetStoreNO();
            //model1.Item2 = "服务区样表";
            //model1.Item3 = "服务区样表";
            //model1.Item4 = "服务区样表";
            //model1.Item5 = "服务区样表";
            //model1.Item6 = "服务区样表";
            //model1.Item7 = "服务区样表";
            lt_headers.Add(model1);

            model2.TimeInterval  = "时段";
            model2.HourTime      = "小时";
            model2.SalesTurnover = "营业额";
            model2.OrderNum      = "订单数量";
            model2.AvgProduct    = "产品平均数";
            model2.Item1         = "系统点餐时间";
            model2.Item2         = "收银时间";
            model2.Item3         = "备餐时间";
            model2.Item4         = "汇餐时间";
            model2.Item5         = "整体时间";
            model2.Item6         = "超时订单率";

            model2.Item11 = "柜台";
            model2.Item21 = "自助点餐(含手机点餐&大屏点餐)";
            model2.Item31 = "外送";
            lt_headers.Add(model2);

            model3.Item11 = "柜台订单数量";
            model3.Item12 = "系统点餐时间";
            model3.Item13 = "收银时间";
            model3.Item14 = "备餐时间";
            model3.Item15 = "汇餐时间";
            model3.Item16 = "整体时间";

            model3.Item21 = "自助点餐订单数量";
            model3.Item22 = "备餐时间";
            model3.Item23 = "汇餐时间";

            model3.Item31 = "外送订单数量";
            model3.Item32 = "备餐时间";
            lt_headers.Add(model3);
            return(lt_headers);
        }
示例#2
0
        /// <summary>
        /// 添加数据记录
        /// </summary>
        /// <param name="repastName"></param>
        /// <param name="orderMode"></param>
        /// <param name="terminalType"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="ltResult"></param>
        private void AddRecode(string repastName, string startTime, string endTime, List <AkServerReportModel> ltResult, int type = 0)
        {
            AkServerReportModel model = new AkServerReportModel();

            if (type == 0)
            {
                model.TimeInterval = repastName;
                model.HourTime     = startTime + "-" + endTime;
            }
            else if (type == 1)
            {
                model.TimeInterval = repastName + "合计";
                model.HourTime     = startTime + "-" + endTime;
            }
            else if (type == 2)
            {
                model.TimeInterval = repastName + "合计";
                model.HourTime     = startTime + "-" + endTime;
            }

            model.SalesTurnover = this.DefaultValue;
            model.OrderNum      = this.DefaultValue;
            model.AvgProduct    = this.DefaultValue;
            model.Item1         = this.DefaultValue;
            model.Item2         = this.DefaultValue;
            model.Item3         = this.DefaultValue;
            model.Item4         = this.DefaultValue;
            model.Item5         = this.DefaultValue;
            model.Item6         = this.DefaultValue;

            model.Item11 = this.DefaultValue;
            model.Item12 = this.DefaultValue;
            model.Item13 = this.DefaultValue;
            model.Item14 = this.DefaultValue;
            model.Item15 = this.DefaultValue;
            model.Item16 = this.DefaultValue;

            model.Item21 = this.DefaultValue;
            model.Item22 = this.DefaultValue;
            model.Item23 = this.DefaultValue;

            model.Item31   = this.DefaultValue;
            model.Item32   = this.DefaultValue;
            model.RowIndex = rowIndex++;
            ltResult.Add(model);
        }
示例#3
0
        private void setTotalServerData(string startTime, string endTime, AkServerReportModel model)
        {
            startTime = startTime + ":00";
            endTime   = endTime + ":00";

            if (model != null)
            {
                //@1.设置营业额
                int salesTurnover = AkDaoHelper.Instance_Server.GetSalesTurnover(startTime, endTime);
                if (salesTurnover > 0)
                {
                    model.SalesTurnover = salesTurnover.ToString();
                }

                //@2.订单数量
                Dictionary <string, decimal> orderNum = AkDaoHelper.Instance_Server.GetOrderNumber(startTime, endTime);
                if (orderNum != null && orderNum.Count > 0)
                {
                    model.OrderNum = orderNum["all"].ConvertDigits(0);
                    model.Item11   = orderNum["guit"].ConvertDigits(0);
                    model.Item21   = orderNum["auto"].ConvertDigits(0);
                    model.Item31   = orderNum["wais"].ConvertDigits(0);
                }

                //@3.点餐时间
                Dictionary <string, decimal> orderTime = AkDaoHelper.Instance_Server.GetOrderTime(orderNum, startTime, endTime);
                if (orderTime != null && orderTime.Count > 0)
                {
                    model.Item1  = orderTime["all"].ConvertDigits(0);
                    model.Item12 = orderTime["guit"].ConvertDigits(0);
                }

                //@4.收银时间
                Dictionary <string, decimal> cashTime = AkDaoHelper.Instance_Server.GetCashTime(orderNum, startTime, endTime);
                if (cashTime != null && cashTime.Count > 0)
                {
                    model.Item2  = cashTime["all"].ConvertDigits(0);
                    model.Item13 = cashTime["guit"].ConvertDigits(0);
                }

                //@5.备餐时间
                Dictionary <string, decimal> prepareTime = AkDaoHelper.Instance_Server.GetPrepareTime(orderNum, startTime, endTime);
                if (prepareTime != null && prepareTime.Count > 0)
                {
                    model.Item3  = prepareTime["all"].ConvertDigits(0);
                    model.Item14 = prepareTime["guit"].ConvertDigits(0);
                    model.Item22 = prepareTime["auto"].ConvertDigits(0);
                    model.Item32 = prepareTime["wais"].ConvertDigits(0);
                }

                //@6.汇餐时间
                Dictionary <string, decimal> remitTime = AkDaoHelper.Instance_Server.GetRemitTime(orderNum, startTime, endTime);
                if (remitTime != null && remitTime.Count > 0)
                {
                    model.Item4  = remitTime["all"].ConvertDigits(0);
                    model.Item15 = remitTime["guit"].ConvertDigits(0);
                    model.Item23 = remitTime["auto"].ConvertDigits(0);
                }

                //@7.整体时间
                Dictionary <string, decimal> wholeTime = AkDaoHelper.Instance_Server.GetWholeTime(orderNum, startTime, endTime);
                if (wholeTime != null && wholeTime.Count > 0)
                {
                    model.Item5  = wholeTime["all"].ConvertDigits(0);
                    model.Item16 = wholeTime["guit"].ConvertDigits(0);
                }

                //@8.超时订单%
                model.Item6 = AkDaoHelper.Instance_Server.GetTimeOut(orderNum, startTime, endTime);

                //产品平均数
                int avg = AkDaoHelper.Instance_Server.GetAvgProduct(orderNum, startTime, endTime);
                if (orderNum != null && orderNum.ContainsKey("all"))
                {
                    model.AvgProduct = orderNum["all"] > 0 ? (avg / orderNum["all"]).ConvertDigits(1) : string.Empty;
                }
            }
        }
        /// <summary>
        /// Excel添加行数据
        /// </summary>
        /// <param name="sheet"></param>
        /// <param name="model"></param>
        private void AddRow(ISheet sheet, AkServerReportModel model, List <int> ltStyle)
        {
            IRow dataRow = sheet.CreateRow(rowIndex);
            int  column  = 0;

            dataRow.Height = 18 * 20;

            ICell newCel0  = dataRow.CreateCell(column++);
            ICell newCel1  = dataRow.CreateCell(column++);
            ICell newCel2  = dataRow.CreateCell(column++);
            ICell newCel3  = dataRow.CreateCell(column++);
            ICell newCel4  = dataRow.CreateCell(column++);
            ICell newCel5  = dataRow.CreateCell(column++);
            ICell newCel6  = dataRow.CreateCell(column++);
            ICell newCel7  = dataRow.CreateCell(column++);
            ICell newCel8  = dataRow.CreateCell(column++);
            ICell newCel9  = dataRow.CreateCell(column++);
            ICell newCel10 = dataRow.CreateCell(column++);
            ICell newCel11 = dataRow.CreateCell(column++);
            ICell newCel12 = dataRow.CreateCell(column++);
            ICell newCel13 = dataRow.CreateCell(column++);
            ICell newCel14 = dataRow.CreateCell(column++);
            ICell newCel15 = dataRow.CreateCell(column++);
            ICell newCel16 = dataRow.CreateCell(column++);
            ICell newCel17 = dataRow.CreateCell(column++);
            ICell newCel18 = dataRow.CreateCell(column++);
            ICell newCel19 = dataRow.CreateCell(column++);
            ICell newCel20 = dataRow.CreateCell(column++);
            ICell newCel21 = dataRow.CreateCell(column++);

            newCel0.SetCellValue(model.TimeInterval);
            newCel1.SetCellValue(model.HourTime);
            newCel2.SetCellValue(model.SalesTurnover);
            newCel3.SetCellValue(model.OrderNum);
            newCel4.SetCellValue(model.AvgProduct);
            newCel5.SetCellValue(model.Item1);
            newCel6.SetCellValue(model.Item2);
            newCel7.SetCellValue(model.Item3);
            newCel8.SetCellValue(model.Item4);
            newCel9.SetCellValue(model.Item5);
            newCel10.SetCellValue(model.Item6);

            newCel11.SetCellValue(model.Item11);
            newCel12.SetCellValue(model.Item12);
            newCel13.SetCellValue(model.Item13);
            newCel14.SetCellValue(model.Item14);
            newCel15.SetCellValue(model.Item15);
            newCel16.SetCellValue(model.Item16);

            newCel17.SetCellValue(model.Item21);
            newCel18.SetCellValue(model.Item22);
            newCel19.SetCellValue(model.Item23);

            newCel20.SetCellValue(model.Item31);
            newCel21.SetCellValue(model.Item32);

            if (ltStyle != null && ltStyle.Contains(rowIndex))
            {
                newCel0.CellStyle  = this.StyleForegroundThin;
                newCel1.CellStyle  = this.StyleForegroundThin;
                newCel2.CellStyle  = this.StyleForegroundThin;
                newCel3.CellStyle  = this.StyleForegroundThin;
                newCel4.CellStyle  = this.StyleForegroundThin;
                newCel5.CellStyle  = this.StyleForegroundThin;
                newCel6.CellStyle  = this.StyleForegroundThin;
                newCel7.CellStyle  = this.StyleForegroundThin;
                newCel8.CellStyle  = this.StyleForegroundThin;
                newCel9.CellStyle  = this.StyleForegroundThin;
                newCel10.CellStyle = this.StyleForegroundThin;
                newCel11.CellStyle = this.StyleForegroundThin;
                newCel12.CellStyle = this.StyleForegroundThin;
                newCel13.CellStyle = this.StyleForegroundThin;
                newCel14.CellStyle = this.StyleForegroundThin;
                newCel15.CellStyle = this.StyleForegroundThin;
                newCel16.CellStyle = this.StyleForegroundThin;
                newCel17.CellStyle = this.StyleForegroundThin;
                newCel18.CellStyle = this.StyleForegroundThin;
                newCel19.CellStyle = this.StyleForegroundThin;
                newCel20.CellStyle = this.StyleForegroundThin;
                newCel21.CellStyle = this.StyleForegroundThin;
            }
            else
            {
                newCel0.CellStyle  = this.StyleThin;
                newCel1.CellStyle  = this.StyleThin;
                newCel2.CellStyle  = this.StyleThin;
                newCel3.CellStyle  = this.StyleThin;
                newCel4.CellStyle  = this.StyleThin;
                newCel5.CellStyle  = this.StyleThin;
                newCel6.CellStyle  = this.StyleThin;
                newCel7.CellStyle  = this.StyleThin;
                newCel8.CellStyle  = this.StyleThin;
                newCel9.CellStyle  = this.StyleThin;
                newCel10.CellStyle = this.StyleThin;
                newCel11.CellStyle = this.StyleThin;
                newCel12.CellStyle = this.StyleThin;
                newCel13.CellStyle = this.StyleThin;
                newCel14.CellStyle = this.StyleThin;
                newCel15.CellStyle = this.StyleThin;
                newCel16.CellStyle = this.StyleThin;
                newCel17.CellStyle = this.StyleThin;
                newCel18.CellStyle = this.StyleThin;
                newCel19.CellStyle = this.StyleThin;
                newCel20.CellStyle = this.StyleThin;
                newCel21.CellStyle = this.StyleThin;
            }

            rowIndex++;
        }