123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- using PMS.DBService.Problems;
- using PMS.Interface.Problems;
- using QWPlatform.IService;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using PMS.BusinessModels.Problem;
- using System.Data;
- using QWPlatform.SystemLibrary;
- using QWPlatform.SystemLibrary.Utils;
- using PMS.BusinessModels.Account;
- namespace PMS.BusinessService.Problems
- {
- public class ReportBLL : IReport
- {
- private ReportService ReportService = DataServiceBase.Instance<ReportService>();
- public string GetAfterSale(AfterSaleModel model)
- {
- var total = 0;
- var dt= ReportService.GetAfterSale(model , out total);
- float TotalScore = 0;
- if (dt != null && dt.Rows.Count > 0)
- {
- foreach( DataRow row in dt.Rows)
- {
- var core = row.GetValueByName<float>("问题分值");
- TotalScore += core;
- }
- }
- var footer = new List<AfterSaleFooter>();
- footer.Add(new AfterSaleFooter { 编号 = "合计", 问题分值 = TotalScore });
- var ReportObject = new
- {
- total = total,
- rows = dt,
- footer= footer
- };
- return Strings.ObjectToJson(ReportObject);
- }
- public string GetChannel()
- {
- return ReportService.GetChannel().ToJson();
- }
- public string GetRing()
- {
- return ReportService.GetRing().ToJson();
- }
- /// <summary>
- /// 获取监控数据表格
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GetMonitoring(MonitoringModel model)
- {
- var total = 0;
- var dt = ReportService.GetMonitoring(model,out total);
- var ReportObject = new
- {
- total = total,
- rows = dt
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 渠道服务问题统计
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GetChannelStatistics(MonitoringModel model)
- {
- var total = 0;
- DataTable dt = ReportService.GetChannelStatistics(model, out total);
- var TotalScore = 0;
- if (dt != null && dt.Rows.Count > 0)
- {
- foreach (DataRow row in dt.Rows)
- {
- var core = row.GetValueByName<int>("服务数量");
- TotalScore += core;
- }
- }
- var footer = new List<AfterSaleFooter>();
- footer.Add(new AfterSaleFooter { 名称 = "合计", 服务数量 = TotalScore });
- var ReportObject = new
- {
- footer = footer,
- total = total,
- rows = dt
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 反馈人服务问题统计
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GetFeedbackStatistics(MonitoringModel model)
- {
- var total = 0;
- DataTable dt = ReportService.GetFeedbackStatistics(model, out total);
- var TotalScore = 0;
- if (dt != null && dt.Rows.Count > 0)
- {
- foreach (DataRow row in dt.Rows)
- {
- var core = row.GetValueByName<int>("服务数量");
- TotalScore += core;
- }
- }
- var footer = new List<AfterSaleFooter>();
- footer.Add(new AfterSaleFooter { 姓名 = "合计", 服务数量 = TotalScore });
- var ReportObject = new
- {
- footer = footer,
- total = total,
- rows = dt
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 未完成问题统计
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GetNotYetStatistics(MonitoringModel model)
- {
- var total = 0;
- DataTable dt = ReportService.GetNotYetStatistics(model, out total);
- var TotalScore = 0;
- if (dt != null && dt.Rows.Count > 0)
- {
- foreach (DataRow row in dt.Rows)
- {
- var core = row.GetValueByName<int>("服务数量");
- TotalScore += core;
- }
- }
- var ReportObject = new
- {
- total = total,
- rows = dt,
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 获取统计报表
- /// </summary>
- /// <returns></returns>
- public string GetList(UserInfo user)
- {
- DataTable dt= ReportService.GetList(user.PersonProperty);
- var json = "[{";
- foreach (DataRow row in dt.Rows)
- {
- if (row.GetValueByName<int>("上级ID") == 0)
- {
- json += "'渠道id':'"+user.CompanyID+"','id':" + row.GetValueByName<int>("ID") + ",'text':'" + row.GetValueByName<string>("报表名称") + "','children': [";
- foreach (DataRow r in dt.Rows)
- {
- if (r.GetValueByName<int>("上级ID") == row.GetValueByName<int>("ID"))
- {
- json += "{ 'text': '" + r.GetValueByName<string>("报表名称") + "','url':'" + r.GetValueByName<string>("报表地址") + "','file':'" + r.GetValueByName<string>("文件名称") + "'},";
- }
- }
- json += "],";
- }
- }
- json += "}]";
-
- return json;
- }
- /// <summary>
- /// 技术中心问题统计
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GetSupportStatistics(MonitoringModel model)
- {
- var total = 0;
- DataTable dt = ReportService.GetSupportStatistics(model, out total);
- var ReportObject = new
- {
- total = total,
- rows = dt,
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 研发问题统计
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GetDevelopStatistics(MonitoringModel model)
- {
- var total = 0;
- DataTable dt = ReportService.GetDevelopStatistics(model, out total);
- var ReportObject = new
- {
- total = total,
- rows = dt,
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 超时处理(30分钟)
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string TimeoutStatistics(MonitoringModel model)
- {
- var total = 0;
- DataTable dt = ReportService.TimeoutStatistics(model, out total);
- var footer = new List<AfterSaleFooter>();
- footer.Add(new AfterSaleFooter { 编号 = "合计", 问题标题 = total });
- var ReportObject = new
- {
- footer = footer,
- total = total,
- rows = dt
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 贵阳售后统计问题积分
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GuiyangProblems(AfterSaleModel model)
- {
- var total = 0;
- var dt = ReportService.GuiyangProblems(model, out total);
- float TotalScore = 0;
- if (dt != null && dt.Rows.Count > 0)
- {
- foreach (DataRow row in dt.Rows)
- {
- var core1 = row.GetValueByName<float>("陈勇");
- var core2 = row.GetValueByName<float>("池显");
- var core3 = row.GetValueByName<float>("兰忠胜");
- var core4 = row.GetValueByName<float>("陈运良");
- row["问题分值"]= (core1 + core2 + core3 + core4);
- TotalScore += (core1+ core2+ core3+ core4);
- }
- }
- var footer = new List<AfterSaleFooter>();
- footer.Add(new AfterSaleFooter { 名称 = "合计", 问题分值 = TotalScore });
- var ReportObject = new
- {
- total = total,
- rows = dt,
- footer = footer
- };
- return Strings.ObjectToJson(ReportObject);
- }
- /// <summary>
- /// 获取渠道脱保数
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string GeMaintenanceInquiry(MaintenanceModel model)
- {
- var total = 0;
- var dt = ReportService.GeMaintenanceInquiry(model, out total);
- float TotalScore = 0;
-
- var ReportObject = new
- {
- total = total,
- rows = dt
-
- };
- return Strings.ObjectToJson(ReportObject);
- }
- }
- }
|