@@ -1,5 +1,6 @@ | |||||
using Learun.Application.OA; | using Learun.Application.OA; | ||||
using Learun.Application.OA.File.FileInfo; | using Learun.Application.OA.File.FileInfo; | ||||
using Learun.Application.TwoDevelopment.AssetManagementSystem; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | using Learun.Application.TwoDevelopment.EducationalAdministration; | ||||
using Learun.Application.WorkFlow; | using Learun.Application.WorkFlow; | ||||
using Learun.Util; | using Learun.Util; | ||||
@@ -19,6 +20,9 @@ namespace Learun.Application.WebApi.Modules.Echarts | |||||
private FileInfoIBLL fileInfoBLL = new FileInfoBLL(); | private FileInfoIBLL fileInfoBLL = new FileInfoBLL(); | ||||
private NWFSchemeIBLL nWFSchemeIBLL = new NWFSchemeBLL(); | private NWFSchemeIBLL nWFSchemeIBLL = new NWFSchemeBLL(); | ||||
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL(); | private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL(); | ||||
private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL(); | |||||
private FundsApplyIBLL fundsApplyIBLL = new FundsApplyBLL(); | |||||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||||
public EchartsApi() : base("/api/echarts/") | public EchartsApi() : base("/api/echarts/") | ||||
@@ -34,7 +38,16 @@ namespace Learun.Application.WebApi.Modules.Echarts | |||||
Get["/SchemeInfoCount"] = SchemeInfoCount; | Get["/SchemeInfoCount"] = SchemeInfoCount; | ||||
Get["/ProcessNotFinishCount"] = ProcessNotFinishCount; | Get["/ProcessNotFinishCount"] = ProcessNotFinishCount; | ||||
Get["/ProcessCount"] = ProcessCount; | Get["/ProcessCount"] = ProcessCount; | ||||
Get["/teacher/sum"] = TeacherSum; | |||||
Get["/teacher/gendersum"] = TeacherGenderSum; | |||||
Get["/teacher/jsgwsum"] = TeacherTitSum; | |||||
Get["/foundapply/monthsum"] = FundsApplyMonthSum; | |||||
Get["/wf/sumuse"] = WfUseSumCount; | |||||
Get["/wf/use1"] = WfUseFive; | |||||
Get["/wf/use2"] = WfUseSix; | |||||
Get["/stu/sum"] = StuSum; | |||||
Get["/stu/gendersum"] = StuGenderSum; | |||||
Get["/stu/deptsum"] = StuDeptSum; | |||||
} | } | ||||
@@ -111,7 +124,7 @@ namespace Learun.Application.WebApi.Modules.Echarts | |||||
data.Add(dic[i]); | data.Add(dic[i]); | ||||
} | } | ||||
var res = new { categories = cate, series = new List<object> { new { name = "公告", data = data } } }; | |||||
var res = new { categories = cate, series = new List<object> { new { name = "邮件", data = data } } }; | |||||
return Res(res); | return Res(res); | ||||
} | } | ||||
@@ -148,7 +161,7 @@ namespace Learun.Application.WebApi.Modules.Echarts | |||||
data.Add(dic[i]); | data.Add(dic[i]); | ||||
} | } | ||||
var res = new { categories = cate, series = new List<object> { new { name = "公告", data = data } } }; | |||||
var res = new { categories = cate, series = new List<object> { new { name = "公文", data = data } } }; | |||||
return Res(res); | return Res(res); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -188,9 +201,63 @@ namespace Learun.Application.WebApi.Modules.Echarts | |||||
return Res(res); | return Res(res); | ||||
} | } | ||||
/// <summary> | |||||
/// 流程使用和数量雷达图 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response WfUseSumCount(dynamic _) | |||||
{ | |||||
var data = nWFSchemeIBLL.GetWfUseSum(); | |||||
var nm = data.Select(x => new { name = x.Item1, max = (x.Item2 + x.Item3) == 0 ? 50 : (x.Item2 + x.Item3) * 2 }).ToList(); | |||||
var sumValue = data.Select(x => x.Item2).ToList(); | |||||
var useValue = data.Select(x => x.Item3).ToList(); | |||||
var values = new List<object>(); | |||||
values.Add(new { name = "流程数量", value = sumValue }); | |||||
values.Add(new { name = "流程使用次数", value = useValue }); | |||||
var rs = new { indicator = nm, series = new List<object> { new { data = values } } }; | |||||
return Res(rs); | |||||
} | |||||
/// <summary> | |||||
/// 使用1-5 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response WfUseFive(dynamic _) | |||||
{ | |||||
var data = nWFSchemeIBLL.GetUseCount().OrderByDescending(x => x.Value).Take(5); | |||||
var value = data.Select(x => x.Value).ToList(); | |||||
var nm = new List<string> { "No.1", "No.2", "No.3", "No.4", "No.5" }; | |||||
var res = new { categories = nm, series = new List<object> { new { name = "", data = value } } }; | |||||
return Res(res); | |||||
} | |||||
/// <summary> | |||||
/// 使用6- | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response WfUseSix(dynamic _) | |||||
{ | |||||
var data = nWFSchemeIBLL.GetUseCount().OrderByDescending(x => x.Value).Skip(5).Take(5); | |||||
var value = data.Select(x => x.Value).ToList(); | |||||
if(value.Count!=5) | |||||
{ | |||||
for (int i = 0; i < 5-value.Count; i++) | |||||
{ | |||||
value.Add(0); | |||||
} | |||||
} | |||||
var nm = new List<string> { "No.5", "No.7", "No.8", "No.9", "No.10" }; | |||||
var res = new { categories = nm, series = new List<object> { new { name = "", data = value } } }; | |||||
return Res(res); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 云盘 | /// 云盘 | ||||
/// </summary> | /// </summary> | ||||
@@ -224,7 +291,92 @@ namespace Learun.Application.WebApi.Modules.Echarts | |||||
data.Add(dic[i]); | data.Add(dic[i]); | ||||
} | } | ||||
var res = new { categories = cate, series = new List<object> { new { name = "公告", data = data } } }; | |||||
var res = new { categories = cate, series = new List<object> { new { name = "云盘", data = data } } }; | |||||
return Res(res); | |||||
} | |||||
/// <summary> | |||||
/// 教师总数量 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response TeacherSum(dynamic _) | |||||
{ | |||||
var sum = empInfoIBLL.GetCount(); | |||||
var res = new { value = sum }; | |||||
return Res(res); | |||||
} | |||||
public Response TeacherGenderSum(dynamic _) | |||||
{ | |||||
var dic = empInfoIBLL.GetGenderCount(); | |||||
var res = dic.Select(x => new { name = x.Key, value = x.Value, url = string.Empty }); | |||||
return Res(res); | |||||
} | |||||
public Response TeacherTitSum(dynamic _) | |||||
{ | |||||
var dic = empInfoIBLL.GetTitCount(); | |||||
var res = dic.Select(x => new { name = x.Key, value = x.Value, url = string.Empty }); | |||||
return Res(res); | |||||
} | |||||
/// <summary> | |||||
/// 申报经费按月 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response FundsApplyMonthSum(dynamic _) | |||||
{ | |||||
var dic = fundsApplyIBLL.GetMonthCount(); | |||||
var m = 0; | |||||
while (m < 13) | |||||
{ | |||||
m++; | |||||
if (!dic.ContainsKey(m)) | |||||
{ | |||||
dic.Add(m, 0); | |||||
} | |||||
} | |||||
var cate = new List<string>(); | |||||
var data = new List<decimal>(); | |||||
for (int i = 1; i < 13; i++) | |||||
{ | |||||
cate.Add($"{i}月"); | |||||
data.Add(dic[i]); | |||||
} | |||||
var res = new { categories = cate, series = new List<object> { new { name = "云盘", data = data } } }; | |||||
return Res(res); | |||||
} | |||||
/// <summary> | |||||
/// 学生总数量 | |||||
/// </summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response StuSum(dynamic _) | |||||
{ | |||||
var sum = stuInfoBasicIBLL.GetCount(); | |||||
var res = new { value = sum }; | |||||
return Res(res); | |||||
} | |||||
public Response StuGenderSum(dynamic _) | |||||
{ | |||||
var dic = stuInfoBasicIBLL.GetGenderCount(); | |||||
var res = dic.Select(x => new { name = x.Key, value = x.Value, url = string.Empty }); | |||||
return Res(res); | |||||
} | |||||
public Response StuDeptSum(dynamic _) | |||||
{ | |||||
var dic = stuInfoBasicIBLL.GetDeptCount(); | |||||
var res = dic.Select(x => new { name = x.Key, value = x.Value, url = string.Empty }); | |||||
return Res(res); | return Res(res); | ||||
} | } | ||||
} | } |
@@ -244,7 +244,28 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endregion | #endregion | ||||
public Dictionary<int, decimal> GetMonthCount() | |||||
{ | |||||
try | |||||
{ | |||||
return fundsApplyService.GetMonthCount(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -72,5 +72,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
void ChangeStatusByProcessId(string processId, int status); | void ChangeStatusByProcessId(string processId, int status); | ||||
#endregion | #endregion | ||||
Dictionary<int, decimal> GetMonthCount(); | |||||
} | } | ||||
} | } |
@@ -387,5 +387,27 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
#endregion | #endregion | ||||
public Dictionary<int, decimal> GetMonthCount() | |||||
{ | |||||
try | |||||
{ | |||||
var dt = new DateTime(DateTime.Now.Year, 1, 1); | |||||
var query = this.BaseRepository("CollegeMIS").FindList<FundsApplyEntity>(x => x.ApplyTime >= dt).Join(this.BaseRepository("CollegeMIS").FindList<FundsApplyDetailEntity>(), a => a.Id, b => b.ApplyId, (a, b) => new { a.ApplyTime.Value.Month, b.Amount }).ToList(); | |||||
var rs=query.GroupBy(x => x.Month).ToDictionary(x => x.Key, a => a.Sum(b => b.Amount ?? 0)); | |||||
return rs; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -482,7 +482,65 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
#endregion | #endregion | ||||
public int GetCount() | |||||
{ | |||||
try | |||||
{ | |||||
return empInfoService.GetCount(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public Dictionary<string, int> GetGenderCount() | |||||
{ | |||||
try | |||||
{ | |||||
return empInfoService.GetDicCount(1); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public Dictionary<string, int> GetTitCount() | |||||
{ | |||||
try | |||||
{ | |||||
return empInfoService.GetDicCount(2); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -85,5 +85,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <returns></returns> | /// <returns></returns> | ||||
void SaveEditEntity(string keyValue, EmpInfoEntity entity); | void SaveEditEntity(string keyValue, EmpInfoEntity entity); | ||||
EmpInfoEntity GetEmpInfoEntityByIdCardNo(string account); | EmpInfoEntity GetEmpInfoEntityByIdCardNo(string account); | ||||
int GetCount(); | |||||
Dictionary<string, int> GetGenderCount(); | |||||
Dictionary<string, int> GetTitCount(); | |||||
} | } | ||||
} | } |
@@ -876,5 +876,85 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi | |||||
#endregion | #endregion | ||||
public int GetCount() | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>().Count(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="type">1按性别,2按岗位类别</param> | |||||
/// <returns></returns> | |||||
public Dictionary<string,int> GetDicCount(int type) | |||||
{ | |||||
try | |||||
{ | |||||
var rs = new Dictionary<string, int>(); | |||||
var query = this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>(); | |||||
switch (type) | |||||
{ | |||||
case 2: | |||||
var data = query.GroupBy(x => x.EmpSortNo).Select(x=>new Tuple<string, int>(x.Key,x.Count())).ToList(); | |||||
ConvertName(data, rs); | |||||
break; | |||||
default: | |||||
rs = query.GroupBy(x => x.GenderNo ?? false).ToDictionary(x => x.Key ? "男" : "女", a => a.Count()); | |||||
break; | |||||
} | |||||
return rs; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
private void ConvertName(List<Tuple<string, int>> data, Dictionary<string, int> rs) | |||||
{ | |||||
if(data.Any()) | |||||
{ | |||||
var detailList = this.BaseRepository().FindList<DataItemDetailEntity>(@"SELECT t.*,t2.F_ItemCode FROM LR_Base_DataItemDetail t | |||||
INNER JOIN LR_Base_DataItem t2 ON t.F_ItemId = t2.F_ItemId | |||||
WHERE t.F_DeleteMark = 0 and t2.f_itemcode='jsgw'"); | |||||
foreach (var item in data) | |||||
{ | |||||
var dl = detailList.FirstOrDefault(x => x.F_ItemValue == item.Item1); | |||||
if(dl!=null) | |||||
{ | |||||
if(!rs.ContainsKey(dl.F_ItemName)) | |||||
{ | |||||
rs.Add(dl.F_ItemName, item.Item2); | |||||
} | |||||
else | |||||
{ | |||||
rs[dl.F_ItemName] = rs[dl.F_ItemName] + item.Item2; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -749,6 +749,63 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public int GetCount() | |||||
{ | |||||
try | |||||
{ | |||||
return stuInfoBasicService.GetCount(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public Dictionary<string, int> GetGenderCount() | |||||
{ | |||||
try | |||||
{ | |||||
return stuInfoBasicService.GetDicCount(1); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public Dictionary<string, int> GetDeptCount() | |||||
{ | |||||
try | |||||
{ | |||||
return stuInfoBasicService.GetDicCount(2); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -119,5 +119,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
IEnumerable<StuInfoBasicEntity> GetStuInfoByClassNo(string classNo); | IEnumerable<StuInfoBasicEntity> GetStuInfoByClassNo(string classNo); | ||||
string StuInfoBasicImport(DataTable dt, string fileId); | string StuInfoBasicImport(DataTable dt, string fileId); | ||||
int GetCount(); | |||||
Dictionary<string, int> GetGenderCount(); | |||||
Dictionary<string, int> GetDeptCount(); | |||||
} | } | ||||
} | } |
@@ -1782,5 +1782,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public int GetCount() | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>().Count(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// | |||||
/// </summary> | |||||
/// <param name="type">1按性别,2按岗位类别</param> | |||||
/// <returns></returns> | |||||
public Dictionary<string, int> GetDicCount(int type) | |||||
{ | |||||
try | |||||
{ | |||||
var rs = new Dictionary<string, int>(); | |||||
var query = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(); | |||||
switch (type) | |||||
{ | |||||
case 2: | |||||
rs = query.Join(this.BaseRepository("CollegeMIS").FindList<CdDeptEntity>(),a=>a.DeptNo,b=>b.DeptNo,(a,b)=>new { b.DeptName}).GroupBy(x => x.DeptName).ToDictionary(x=>x.Key,a=>a.Count()); | |||||
break; | |||||
default: | |||||
rs = query.GroupBy(x => x.GenderNo ?? false).ToDictionary(x => x.Key ? "男" : "女", a => a.Count()); | |||||
break; | |||||
} | |||||
return rs; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -183,6 +183,44 @@ namespace Learun.Application.WorkFlow | |||||
} | } | ||||
} | } | ||||
public IEnumerable<Tuple<string, int, int>> GetWfUseSum() | |||||
{ | |||||
try | |||||
{ | |||||
return nWFSchemeService.GetWfUseSum(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public Dictionary<string, int> GetUseCount() | |||||
{ | |||||
try | |||||
{ | |||||
return nWFSchemeService.GetUseCount(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } |
@@ -1,4 +1,5 @@ | |||||
using Learun.Util; | using Learun.Util; | ||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace Learun.Application.WorkFlow | namespace Learun.Application.WorkFlow | ||||
@@ -110,6 +111,10 @@ namespace Learun.Application.WorkFlow | |||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<NWFSchemeInfoEntity> GetNWFSchemeUseList(string queryJson); | IEnumerable<NWFSchemeInfoEntity> GetNWFSchemeUseList(string queryJson); | ||||
IEnumerable<Tuple<string, int, int>> GetWfUseSum(); | |||||
Dictionary<string, int> GetUseCount(); | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } |
@@ -4,6 +4,7 @@ using Learun.Util; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Data; | using System.Data; | ||||
using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
namespace Learun.Application.WorkFlow | namespace Learun.Application.WorkFlow | ||||
@@ -510,6 +511,48 @@ namespace Learun.Application.WorkFlow | |||||
} | } | ||||
} | } | ||||
public IEnumerable<Tuple<string,int,int>> GetWfUseSum() | |||||
{ | |||||
try | |||||
{ | |||||
var rs = new List<Tuple<string, int, int>>(); | |||||
var dt = new DateTime(DateTime.Now.Year, 1, 1); | |||||
var sum = this.BaseRepository().FindList<NWFSchemeInfoEntity>(x => x.F_EnabledMark == 1).GroupBy(x => x.F_Category).ToDictionary(x=>x.Key,a=>a.Count()); | |||||
var uses = GetUseCount(); | |||||
var keys = sum.Keys.ToList().Union(uses.Keys.ToList()); | |||||
foreach (var k in keys) | |||||
{ | |||||
var s = sum.ContainsKey(k) ? sum[k] : 0; | |||||
var u = uses.ContainsKey(k) ? uses[k] : 0; | |||||
rs.Add(new Tuple<string, int, int>(k, s, u)); | |||||
} | |||||
return rs; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public Dictionary<string,int> GetUseCount() | |||||
{ | |||||
var dt = new DateTime(DateTime.Now.Year, 1, 1); | |||||
var uses = this.BaseRepository().FindList<NWFSchemeInfoEntity>(x => x.F_EnabledMark == 1).Join(this.BaseRepository().FindList<NWFSchemeEntity>(x => x.F_Type == 1), a => a.F_Id, b => b.F_SchemeInfoId, (a, b) => new { a.F_Category, b.F_Id }).Join(this.BaseRepository().FindList<NWFProcessEntity>(x => x.F_CreateDate >= dt), a => a.F_Id, b => b.F_SchemeId, (a, b) => new { a.F_Category, a.F_Id, ProcessId = b.F_Id }).GroupBy(x => x.F_Category).ToDictionary(x => x.Key, a => a.Count()); | |||||
return uses; | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } |