예제 #1
0
        public DataTable CreateMainTable(List <BaseDataInfo> dataInfos)
        {
            List <BaseDataInfo> infos        = GetGroupStatsicLine(dataInfos);
            List <BaseDataInfo> statsicInfos = GetStatsicLines(dataInfos);

            infos.AddRange(statsicInfos);
            DataProcess.Compute(infos);
            return(DataProcess.T6(infos));
        }
예제 #2
0
        public JsonResult Refresh(RefreshParam info)
        {
            Common.ResultInfo rInfo = new Common.ResultInfo();
            if (info == null)
            {
                rInfo.Message = "参数不正确";
                return(Json(rInfo));
            }

            try
            {
                string[] lines    = info.Datas.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
                string   dataPath = GetDataPath(info.Id.ToString());
                List <StatsisLib.BaseDataInfo> infos = null;
                infos = infos.Deserialize(dataPath);
                var lineInfos = lines.Select(x => new { GroupName = x.Split('|')[0], PName = x.Split('|')[1], PValue = x.Split('|')[2] }).GroupBy(x => x.GroupName).ToDictionary(x => x.Key, x => x.ToList());

                foreach (var line in lineInfos)
                {
                    var lineInfo = infos.FirstOrDefault(x => x.技能组 == line.Key);
                    if (lineInfo == null)
                    {
                        continue;
                    }
                    foreach (var item in line.Value)
                    {
                        int intValue = 0;
                        if (int.TryParse(item.PValue, out intValue))
                        {
                            var pInfo = lineInfo.GetType().GetProperty(item.PName);
                            if (pInfo != null)
                            {
                                pInfo.SetValue(lineInfo, intValue, null);
                            }
                        }
                    }
                }

                // DataProcess.ComputeV2(infos);
                DataProcess.Compute(infos);
                infos = infos.OrderByDescending(x => x.通过率).ThenByDescending(x => x.净满意度).ToList();

                infos.Serialize(dataPath);

                rInfo.IsSuccess = true;
            }
            catch (Exception ex)
            {
                rInfo.Message = ex.Message;
            }

            return(Json(rInfo));
        }
예제 #3
0
        /// <summary>
        /// 提供组信息自定义
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public List <BaseDataInfo> GetSumLineTable(string path, Dictionary <string, object> dict)
        {
            var dt = NPOIHelper.ImportExceltoDt(path, 0, 1);

            SrcInfos = StatsisLib.Common.DTToList <BaseDataInfo>(dt);
            var DestInfos = WatshUnJoinGroupData(SrcInfos);//洗

            DestInfos = AjustData(dict, DestInfos);
            var sumLines = DataProcess.SumLine(DestInfos);

            DataProcess.Compute(sumLines);
            var resultData = sumLines.OrderByDescending(x => x.通过率).ThenByDescending(x => x.净满意度).ToList();

            return(resultData);
        }