using Learun.Application.OA;
using Learun.Application.OA.File.FileInfo;
using Learun.Application.TwoDevelopment.AssetManagementSystem;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.WorkFlow;
using Learun.Util;
using Nancy;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Learun.Application.WebApi.Modules.Echarts
{
public class EchartsApi : BaseNoAuthentication
{
private NewsIBLL newsIBLL = new NewsBLL();
private SYS_SendMessageIBLL sYS_SendMessageIBLL = new SYS_SendMessageBLL();
private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL();
private FileInfoIBLL fileInfoBLL = new FileInfoBLL();
private NWFSchemeIBLL nWFSchemeIBLL = new NWFSchemeBLL();
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/")
{
Get["/notice/sum"] = NoticeSum;
Get["/notice/monthsum"] = NoticeMonthSum;
Get["/message/sum"] = MessageSum;
Get["/message/monthsum"] = MessageMonthSum;
Get["/receivefile/sum"] = ReceiveFileSum;
Get["/receivefile/monthsum"] = ReceiveFileMonthSum;
Get["/resourcefile/sum"] = ResourceFileSum;
Get["/resourcefile/monthsum"] = ResourceFileMonthSum;
Get["/SchemeInfoCount"] = SchemeInfoCount;
Get["/ProcessNotFinishCount"] = ProcessNotFinishCount;
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;
}
///
/// 新闻数量
///
///
///
public Response NoticeSum(dynamic _)
{
var sum = newsIBLL.GetNewCount();
var res = new { value = sum };
return Res(res);
}
public Response NoticeMonthSum(dynamic _)
{
var dic = newsIBLL.GetMonthCount();
var m = 0;
while (m < 13)
{
m++;
if (!dic.ContainsKey(m))
{
dic.Add(m, 0);
}
}
var cate = new List();
var data = new List();
for (int i = 1; i < 13; i++)
{
cate.Add($"{i}月");
data.Add(dic[i]);
}
var res = new { categories = cate, series = new List