using Learun.Application.Base.SystemModule;
using Learun.Application.OA;
using Learun.Application.Organization;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.TwoDevelopment.Permission;
using Learun.Application.WorkFlow;
using Learun.Util;
using Learun.Util.Operat;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Learun.Cache.Base;
using Learun.Cache.Factory;
using Newtonsoft.Json;
using Learun.Application.TwoDevelopment.LR_Desktop;
using Learun.Application.TwoDevelopment.PersonnelManagement;
namespace Learun.Application.Web.Controllers
{
[HandlerLogin(FilterMode.Ignore)]
public class SSOSystemController : MvcControllerBase
{
private Perm_FunctionIBLL perm_FunctionIBLL = new Perm_FunctionBLL();
Perm_UserPermissionIBLL permUserPermissionIbll = new Perm_UserPermissionBLL();
private ModuleIBLL moduleIBLL = new ModuleBLL();
private SYS_ReceiveMessageIBLL sYS_ReceiveMessageIBLL = new SYS_ReceiveMessageBLL();
private UserIBLL userBll = new UserBLL();
private WfTaskIBLL wfTaskIBLL = new WfTaskBLL();
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();
private NoticeIBLL newsIBLL = new NoticeBLL();
private Perm_FunctionTypeIBLL perm_FunctionTypeIBLL = new Perm_FunctionTypeBLL();
private DataItemIBLL dataItemIBLL = new DataItemBLL();
private WfSchemeIBLL wfSchemeIBLL = new WfSchemeBLL();
AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL();
private Perm_FunctionVisitIBLL functionVisitIbll = new Perm_FunctionVisitBLL();
private ICache redisCache = CacheFactory.CaChe();
private SSO_Drag_DesktopManageIBLL sSO_Drag_DesktopManageIBLL = new SSO_Drag_DesktopManageBLL();
private SYS_SendMessageIBLL sYS_SendMessageIBLL = new SYS_SendMessageBLL();
private CdMajorIBLL cdMajorIBLL = new CdMajorBLL();
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
private ClassroomInfoIBLL classroomInfoIBLL = new ClassroomInfoBLL();
private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL();
private SSO_Drag_CardSortManageIBLL sSO_Drag_CardSortManageIBLL = new SSO_Drag_CardSortManageBLL();
private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL();
private CdLessonSortIBLL cdLessonSortIBLL = new CdLessonSortBLL();
private CdLessonTypeIBLL cdLessonTypeIBLL = new CdLessonTypeBLL();
private BCdCultureDegreeIBLL bCdCultureDegreeIBLL = new BCdCultureDegreeBLL();
private StuScoreNotPassIBLL stuScoreNotPassIBLL = new StuScoreNotPassBLL();
private Sys_QRCodeInLoginIBLL sys_QRCodeInLoginIBLL = new Sys_QRCodeInLoginBLL();
private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL();
private StuSaverecordIBLL stuSaverecordIBLL = new StuSaverecordBLL();
private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL();
#region 统一身份认证2.0
///
/// 获取统一认证用户信息
///
///
public ActionResult authorize()
{
string appid = Request.QueryString["appid"];
string secret = Request.QueryString["secret"];
string appkey = Request.QueryString["appkey"];
if (string.IsNullOrEmpty(appid))
{
return Fail("参数:appid 不能为空");
}
if (string.IsNullOrEmpty(secret))
{
return Fail("参数:secret 不能为空");
}
if (string.IsNullOrEmpty(appkey))
{
return Fail("参数:appkey 不能为空");
}
var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
if (application != null)
{
if (Util.DESEncrypt.Decrypt(application.FSecret,
ConfigurationManager.AppSettings["SSOPublicSecret"]).Equals(secret))
{
try
{
var code = DESEncrypt.Decrypt(appkey, "bjqjsso");
if (!string.IsNullOrEmpty(redisCache.Read(code)))
{
return Success(new { useraccount = redisCache.Read(code) });
}
else
{
return Fail("appkey已过期");
}
}
catch (Exception e)
{
return Fail("appkey错误");
}
}
else
{
return Fail("secret错误");
}
}
else
return Fail("未授权的appid");
}
#endregion
public ActionResult Index()
{
//判断登录状态码
string account = "";
if (!Request.Headers["account"].IsEmpty())
{
account = Request.Headers["account"].ToString();
}
OperatorHelper helper = new OperatorHelper();
var result = helper.IsOnLine(account);
if (result.stateCode != 1)
{
return Redirect("NoLogin");
}
//登录用户
var userInfo = LoginUserInfo.Get();
ViewBag.UserId = userInfo.userId;
//桌面管理表、卡片块排序管理表增加默认数据
sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "one");
//获取桌面、卡片块排序列表
ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "one").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate);
ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList);
//分页查询条件设置
Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
//邮件-收件箱
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMail = maildata;
ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail);
ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0);
//邮件-已发送
paginationobj.sidx = "SENDTIME desc";
var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMailSend = mailsenddata;
ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend);
//来往邮件数量
ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count();
//公文
paginationobj.sidx = "SendTime";
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList);
//公告
List outnewslist = new List();
var newsList = newsIBLL.GetList("", userInfo.userId);
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
outnewslist.Add(newsitemEntity);
break;
}
}
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
outnewslist.Add(newsitemEntity);
}
}
}
}
else
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
outnewslist.Add(newsitemEntity);
}
}
else
{
outnewslist.Add(newsitemEntity);
}
}
}
ViewBag.NewsList = outnewslist.Take(5);
ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList);
//宣传报道
var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4);
foreach (var item in newsListOfxuanchuan)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
//智慧教育
ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
//专题推荐
var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
foreach (var item in newsListOfzhuanti)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
//办公事项-待办任务
paginationobj.sidx = "F_CreateDate";
paginationobj.rows = 4;
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
ViewBag.TaskTotalNum = taskListAll.Count();
//办公事项-已办任务
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
//办公事项-我发起的
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
ViewBag.MyListTotalNum = myListAll.Count();
//常用服务
List modulelist = new List();
List offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
var moduledata = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress) && m.F_IsMenu == 1 && m.F_Target == "iframe" && !string.IsNullOrEmpty(m.F_ParentId));
foreach (var oitem in offenused)
{
ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
if (fod != null)
{
//找父级
if (fod.F_ParentId == "0")
{
fod.ParentName = fod.F_FullName;
fod.F_ParentId = fod.F_ModuleId;
}
else
{
var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
if (parent1 != null)
{
if (parent1.F_ParentId == "0")
{
fod.ParentName = parent1.F_FullName;
fod.F_ParentId = parent1.F_ModuleId;
}
else
{
//下一级
var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
if (parent2 != null)
{
if (parent2.F_ParentId == "0")
{
fod.ParentName = parent2.F_FullName;
fod.F_ParentId = parent2.F_ModuleId;
}
else
{
//下一级
var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
if (parent3 != null)
{
if (parent3.F_ParentId == "0")
{
fod.ParentName = parent3.F_FullName;
fod.F_ParentId = parent3.F_ModuleId;
}
else
{
//下一级
var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
if (parent4 != null)
{
if (parent4.F_ParentId == "0")
{
fod.ParentName = parent4.F_FullName;
fod.F_ParentId = parent4.F_ModuleId;
}
}
}
}
}
}
}
}
}
modulelist.Add(fod);
}
}
ViewBag.OffenusedAll = modulelist;
var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
{
F_ParentId = x.Key,
ParentName = x.FirstOrDefault().ParentName,
ChildrenList = x.Select(y => new ModuleEntity()
{
F_ModuleId = y.F_ModuleId,
F_FullName = y.F_FullName
}).ToList()
}).ToList();
ViewBag.OffenusedGroup = mm;
ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
//查找服务
List searchmodulelist = new List();
foreach (var item in moduledata)
{
if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
{
item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
searchmodulelist.Add(item);
}
}
ViewBag.SearchModule = searchmodulelist;
//校园总览
//专业
var countinfos = cdMajorIBLL.GetCountInfos();
ViewBag.MajorTotalNum = countinfos.Rows[0]["zy_nums"];
//班级
//var classInfoData = classInfoIBLL.GetAllClass();
ViewBag.ClassInfoTotalNum = countinfos.Rows[0]["bj_nums"];
//学生
//var stuInfoData = stuInfoBasicIBLL.GetAllList();
ViewBag.StuInfoTotalNum = countinfos.Rows[0]["stu_nums"];
//教师
//var teacherData = empInfoIBLL.GetAllList();
ViewBag.TeacherTotalNum = countinfos.Rows[0]["tea_nums"];
//教室
//var classRoomData = classroomInfoIBLL.GetAllList();
ViewBag.ClassRoomTotalNum = countinfos.Rows[0]["js_nums"];
//课程
//var lessonData = lessonInfoIBLL.GetAllList();
ViewBag.LessonTotalNum = countinfos.Rows[0]["kc_nums"];
//专业总览
//专业学生
var majorstu=cdMajorIBLL.Getmajorstu().ToJson();
//var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
//{
// value = x.Select(y => y.StuId).Count(),
// name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
//});
//ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
ViewBag.StuByMajorStr = majorstu;
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
var allCount = 0;
foreach (var flow in flowType)
{
var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
flow.FlowCount = count;
allCount += count;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
//校园一卡通余额
ViewBag.StuSaveRecordTotalNum = 0;
//var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
//if (stuSaveRecordList.Any())
//{
// ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
//}
//红湖付款码余额
ViewBag.StuConsumptionTotalNum = 0;
//var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
//if (stuConsumptionList.Any())
//{
// ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
//}
//常用链接
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
{
FTName = x.Key,
PFunctionList = x.Select(y => new Perm_FunctionEntity()
{
FId = y.FId,
FTId = y.FTId,
FName = y.FName,
UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
}).Take(8).ToList()
});
ViewBag.FunctionList = ff;
ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
return View("DragModelOne");
}
//public ActionResult NoLogin()
//{
// var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
// var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
// var allCount = 0;
// foreach (var flow in flowType)
// {
// var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
// flow.FlowCount = count;
// allCount += count;
// }
// ViewBag.AllCount = allCount;
// ViewBag.FlowType = flowType;
// ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
// return View();
//}
private UserService userService = new UserService();
public ActionResult ResetPWD(string password)
{
password = Md5Helper.Encrypt(password, 32);
userService.RevisePassword("System", password);
return Success("修改成功");
}
[HandlerLogin(FilterMode.Enforce)]
public ActionResult Work()
{
ViewBag.FlowType = dataItemIBLL.GetDetailList("FlowSort", "");
ViewBag.FlowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
return View();
}
//[HandlerLogin(FilterMode.Enforce)]
public ActionResult workTwo()
{
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
var allCount = 0;
foreach (var flow in flowType)
{
var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
flow.FlowCount = count;
allCount += count;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = flowList;
return View();
}
[HandlerLogin(FilterMode.Enforce)]
public ActionResult UserService()
{
ViewBag.FlowType = dataItemIBLL.GetDetailList("FlowSort", "");
ViewBag.FlowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
return View();
}
[HandlerLogin(FilterMode.Enforce)]
public ActionResult NewsList()
{
var userinfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
//公告
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
paginationobj.rows = 100;
var newsList = newsIBLL.GetList("", userinfo.userId);
//用户可以看到的通知公告
var newsListSelf = new List();
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
{
if (userinfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
newsListSelf.Add(newsitemEntity);
break;
}
}
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
{
newsListSelf.Add(newsitemEntity);
}
}
}
}
else
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
{
newsListSelf.Add(newsitemEntity);
}
}
else
{
newsListSelf.Add(newsitemEntity);
}
}
}
foreach (var ufitem in newsListSelf)
{
if (!string.IsNullOrEmpty(ufitem.F_NewsImage))
{
if (annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage) != null)
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage).F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
ufitem.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
ViewBag.NewsList = newsListSelf;
return View(paginationobj);
}
[HandlerLogin(FilterMode.Enforce)]
public ActionResult newsTwo()
{
var userinfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
//公告
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
var newsList = newsIBLL.GetList("", userinfo.userId);
//用户可以看到的通知公告
var newsListSelf = new List();
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
{
if (userinfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
newsListSelf.Add(newsitemEntity);
break;
}
}
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
{
newsListSelf.Add(newsitemEntity);
}
}
}
}
else
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
{
newsListSelf.Add(newsitemEntity);
}
}
else
{
newsListSelf.Add(newsitemEntity);
}
}
}
foreach (var ufitem in newsListSelf)
{
if (!string.IsNullOrEmpty(ufitem.F_NewsImage))
{
if (annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage) != null)
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage).F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
ufitem.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
//公告
ViewBag.NewsList = newsListSelf;
//内部邮件
paginationobj.sidx = "readflag asc,SENDTIME desc ";
ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
//办公事项
paginationobj.sidx = "F_CreateDate";
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
//学校公文
paginationobj.sidx = "SendTime";
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
return View();
}
public PartialViewResult LanMail()
{
var userinfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "readflag asc,SENDTIME desc", sord = "desc" };
ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
return PartialView(paginationobj);
}
public PartialViewResult TaskList()
{
var userinfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
return PartialView(paginationobj);
}
public PartialViewResult ReceiveFileList()
{
var userinfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "SendTime", sord = "desc" };
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
return PartialView(paginationobj);
}
public PartialViewResult NewList()
{
var userinfo = LoginUserInfo.Get();
int page = 1;
if (!string.IsNullOrEmpty(Request.QueryString["page"]))
{
page = Convert.ToInt32(Request.QueryString["page"]);
}
//公告
Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
var newsList = newsIBLL.GetList("", userinfo.userId);
//用户可以看到的通知公告
var newsListSelf = new List();
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
{
if (userinfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
newsListSelf.Add(newsitemEntity);
break;
}
}
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
{
newsListSelf.Add(newsitemEntity);
}
}
}
}
else
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
{
newsListSelf.Add(newsitemEntity);
}
}
else
{
newsListSelf.Add(newsitemEntity);
}
}
}
foreach (var ufitem in newsListSelf)
{
if (!string.IsNullOrEmpty(ufitem.F_NewsImage))
{
if (annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage) != null)
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage).F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
ufitem.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
else
{
ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
}
}
//公告
ViewBag.NewsList = newsListSelf;
return PartialView(paginationobj);
}
[HandlerLogin(FilterMode.Enforce)]
public ActionResult NewsDetail()
{
return View();
}
public ActionResult Check()
{
try
{
string redi = Request.QueryString["redi"];
if (!string.IsNullOrEmpty(redi))
{
string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
string uid = Request.QueryString["u"];
string pwd = Request.QueryString["p"];
string logintime = Request.QueryString["t"];
string n = Request.QueryString["n"];
string mail = Request.QueryString["mail"];
string sendfile = Request.QueryString["sendfile"];
string task = Request.QueryString["task"];
string gotomain = Request.QueryString["gotomain"];
string nk = Request.QueryString["nk"];
string jx = Request.QueryString["jx"];
string zl = Request.QueryString["zl"];
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(logintime))
{
decimal decodelogintime = Convert.ToDecimal(DESEncrypt.Decrypt(logintime, publickey));
decimal datetimenow = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMddHHmmss"));
if (datetimenow - 300 <= decodelogintime && datetimenow + 300 >= decodelogintime)
{
string username = DESEncrypt.Decrypt(uid, publickey);
string password = DESEncrypt.Decrypt(pwd, publickey);
UserEntity userEntity = userBll.CheckLogin(username, Md5Helper.Encrypt(password, 32));
LogEntity logEntity = new LogEntity();
logEntity.F_CategoryId = 1;
logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString();
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login);
logEntity.F_OperateAccount = username + "(" + userEntity.F_RealName + ")";
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : username;
logEntity.F_Module = Config.GetValue("SoftName");
logEntity.F_Description = "PC端";
if (!userEntity.LoginOk)//登录失败
{
//写入日志
logEntity.F_ExecuteResult = 0;
logEntity.F_ExecuteResultJson = "sso登录失败:" + userEntity.LoginMsg;
logEntity.WriteLog();
return Fail(userEntity.LoginMsg);
}
else
{
OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
//写入日志
logEntity.F_ExecuteResult = 1;
logEntity.F_ExecuteResultJson = "sso登录成功";
logEntity.WriteLog();
var DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"];
var Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port;
if (!string.IsNullOrEmpty(n))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=6252983c-52f5-402c-991b-ad19a9cb1f94&keyValue=" + n));
}
else if (!string.IsNullOrEmpty(mail))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=252878d7-d807-497f-b01e-839bb1b869c6"));
}
else if (!string.IsNullOrEmpty(sendfile))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=19637c39-624d-4be6-b680-04250f8df71f"));
}
else if (!string.IsNullOrEmpty(task))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=56ce34c2-882e-47d1-b12d-5036e3b79fcf"));
}
else if (!string.IsNullOrEmpty(gotomain))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index"));
}
else if (!string.IsNullOrEmpty(nk))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=07ceccd0-cf74-42ec-9b7d-3b36af0be451"));
}
else if (!string.IsNullOrEmpty(jx))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=5f2e3e9b-b0da-421a-b370-671dcae4fc17"));
}
else if (!string.IsNullOrEmpty(zl))
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=8dfd9f38-8cab-49ff-b4d1-8b899b1ecbca"));
}
else
{
return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/Index");
}
}
}
else
{
return Fail("时间戳验证失败");
}
}
else
{
return Fail("参数错误");
}
}
else
{
return View();
}
}
catch (Exception e)
{
return Fail("参数错误");
}
}
public ActionResult FirstLogin(Perm_FunctionEntity up)
{
string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
if (up != null && !string.IsNullOrEmpty(up.UPId))
{
perm_FunctionIBLL.SaveEntityByUPId(up.UPId, up);
return Redirect("/SSOSystem/GoTo?sysid=" + DESEncrypt.Encrypt(up.FId, publickey) + "&openid=" + DESEncrypt.Encrypt(up.UserId, publickey));
}
string sysid = Request.QueryString["sysid"];
string strsysid = DESEncrypt.Decrypt(sysid, publickey);
string openid = Request.QueryString["openid"];
string userid = DESEncrypt.Decrypt(openid, publickey);
var uplist = permUserPermissionIbll.GetPerm_UserPermissionEntityByFIdAndUid(strsysid, userid);
if (uplist == null)
{
return Fail("用户未授权。");
}
var perfun = perm_FunctionIBLL.GetPerm_FunctionEntityByUPId(uplist.UPId);
return View(perfun);
}
public ActionResult GoTo()
{
try
{
string redi = Request.QueryString["redi"];
if (!string.IsNullOrEmpty(redi))
{
string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
string sysid = Request.QueryString["sysid"];
string strsysid = DESEncrypt.Decrypt(sysid, publickey);
string openid = Request.QueryString["openid"];
string userid = DESEncrypt.Decrypt(openid, publickey);
var uplist = permUserPermissionIbll.GetPerm_UserPermissionEntityByFIdAndUid(strsysid, userid);
Perm_FunctionVisitEntity functionVisitEntity = new Perm_FunctionVisitEntity();
functionVisitEntity.Create();
functionVisitEntity.Fid = strsysid;
functionVisitEntity.PDate = DateTime.Now;
functionVisitEntity.PUId = userid;
var userinfo = userBll.GetEntityByUserId(userid);
functionVisitEntity.PUName = userinfo.F_RealName;
if (uplist == null)
{
functionVisitEntity.PIsLoginSuccess = false;
functionVisitEntity.PContent = "用户未授权";
functionVisitIbll.SaveEntity(null, functionVisitEntity);
return Fail("用户未授权。");
}
var perfun = perm_FunctionIBLL.GetPerm_FunctionEntityByUPId(uplist.UPId);
string secretkey = DESEncrypt.Decrypt(perfun.FSecret, publickey);
if (perfun.FIsManagePage == true)
{
if (!string.IsNullOrEmpty(perfun.FInterfaceUrl))
{
if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass))
{
functionVisitEntity.PIsLoginSuccess = true;
functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl;
functionVisitIbll.SaveEntity(null, functionVisitEntity);
return Redirect(perfun.FInterfaceUrl + "?u=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPUserName, secretkey), publickey) + "&p=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(perfun.UPPass, secretkey), publickey) + "&t=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(DateTime.Now.ToString("yyyyMMddHHmmss"), secretkey), publickey) + "&ip=" + DESEncrypt.Encrypt(DESEncrypt.Encrypt(GetIP(), secretkey), publickey));
}
else
{
functionVisitEntity.PIsLoginSuccess = false;
functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面";
functionVisitIbll.SaveEntity(null, functionVisitEntity);
//用户未配置转到用户名密码配置页面
return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid);
}
}
else
{
functionVisitEntity.PIsLoginSuccess = false;
functionVisitEntity.PContent = "未配置登录接口地址";
functionVisitIbll.SaveEntity(null, functionVisitEntity);
return Fail("未配置登录接口地址。");
}
}
else
{
if (!string.IsNullOrEmpty(perfun.FUrl))
{
functionVisitEntity.PIsLoginSuccess = true;
functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl;
functionVisitIbll.SaveEntity(null, functionVisitEntity);
return Redirect(perfun.FUrl);
}
else
{
functionVisitEntity.PIsLoginSuccess = false;
functionVisitEntity.PContent = "未配置地址";
functionVisitIbll.SaveEntity(null, functionVisitEntity);
return Fail("未配置地址。");
}
}
}
else
{
return View();
}
}
catch (Exception e)
{
return Fail("参数错误。");
}
}
///
/// 获取IP
///
///
private string GetIP()
{
string ip = string.Empty;
if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"]))
ip = Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]);
if (string.IsNullOrEmpty(ip))
ip = Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);
return ip;
}
///
/// 网上办事大厅拖拽版-未登录页面
///
///
public ActionResult NoLogin()
{
//获取错误次数
ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum();
//获取高职版跳转地址
ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"];
ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port;
//获取登录页二维码配置信息
ViewBag.HasQRCode = false;
var qrcodelist = sys_QRCodeInLoginIBLL.GetList().ToList().Where(x => x.EnabledMark == 1).OrderByDescending(x => x.CreateTime);
if (qrcodelist.Any())
{
ViewBag.HasQRCode = true;
ViewBag.QRCodeUrl = qrcodelist.FirstOrDefault().QRCodeUrl;
ViewBag.QRCodeText = qrcodelist.FirstOrDefault().Title;
}
//微信快捷登录
var result4 = teachSwitchIBLL.FindFirst("wxloginforpc");
ViewBag.WeixinLoginSwitch = result4;
return View("DragNoLogin");
}
///
/// 网上办事大厅拖拽版-未登录页面-微信登录
///
///
public ActionResult DragNoWxLogin()
{
string QQOpenId = Request.QueryString["QQOpenId"];
string WeixinOpenId = Request.QueryString["WeixinOpenId"];
ViewBag.WeixinOpenId = WeixinOpenId;
ViewBag.QQOpenId = QQOpenId;
//获取错误次数
ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum();
//获取高职版跳转地址
ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"];
ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port;
//获取登录页二维码配置信息
ViewBag.HasQRCode = false;
var qrcodelist = sys_QRCodeInLoginIBLL.GetList().ToList().Where(x => x.EnabledMark == 1).OrderByDescending(x => x.CreateTime);
if (qrcodelist.Any())
{
ViewBag.HasQRCode = true;
ViewBag.QRCodeUrl = qrcodelist.FirstOrDefault().QRCodeUrl;
ViewBag.QRCodeText = qrcodelist.FirstOrDefault().Title;
}
return View();
}
///
/// 网上办事大厅拖拽版-办事大厅模式
///
///
public ActionResult DragModelOne()
{
//判断登录状态码
string account = "";
if (!Request.Headers["account"].IsEmpty())
{
account = Request.Headers["account"].ToString();
}
OperatorHelper helper = new OperatorHelper();
var result = helper.IsOnLine(account);
if (result.stateCode != 1)
{
return Redirect("NoLogin");
}
//登录用户
var userInfo = LoginUserInfo.Get();
ViewBag.UserId = userInfo.userId;
//桌面管理表、卡片块排序管理表增加默认数据
sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "one");
//获取桌面、卡片块排序列表
ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "one").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate);
ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList);
//分页查询条件设置
Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
//邮件-收件箱
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMail = maildata;
ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail);
ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0);
//邮件-已发送
paginationobj.sidx = "SENDTIME desc";
var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMailSend = mailsenddata;
ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend);
//来往邮件数量
ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count();
//公文
paginationobj.sidx = "SendTime";
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList);
//公告
List outnewslist = new List();
var newsList = newsIBLL.GetList("", userInfo.userId);
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
outnewslist.Add(newsitemEntity);
break;
}
}
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
outnewslist.Add(newsitemEntity);
}
}
}
}
else
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
outnewslist.Add(newsitemEntity);
}
}
else
{
outnewslist.Add(newsitemEntity);
}
}
}
ViewBag.NewsList = outnewslist.Take(5);
ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList);
//宣传报道
var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4);
foreach (var item in newsListOfxuanchuan)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
//智慧教育
ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
//专题推荐
var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
foreach (var item in newsListOfzhuanti)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
//办公事项-待办任务
paginationobj.sidx = "F_CreateDate";
paginationobj.rows = 4;
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
ViewBag.TaskTotalNum = taskListAll.Count();
//办公事项-已办任务
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
//办公事项-我发起的
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
ViewBag.MyListTotalNum = myListAll.Count();
//常用服务
List modulelist = new List();
List offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
var moduledata = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress) && m.F_IsMenu == 1 && m.F_Target == "iframe" && !string.IsNullOrEmpty(m.F_ParentId));
foreach (var oitem in offenused)
{
ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
if (fod != null)
{
//找父级
if (fod.F_ParentId == "0")
{
fod.ParentName = fod.F_FullName;
fod.F_ParentId = fod.F_ModuleId;
}
else
{
var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
if (parent1 != null)
{
if (parent1.F_ParentId == "0")
{
fod.ParentName = parent1.F_FullName;
fod.F_ParentId = parent1.F_ModuleId;
}
else
{
//下一级
var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
if (parent2 != null)
{
if (parent2.F_ParentId == "0")
{
fod.ParentName = parent2.F_FullName;
fod.F_ParentId = parent2.F_ModuleId;
}
else
{
//下一级
var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
if (parent3 != null)
{
if (parent3.F_ParentId == "0")
{
fod.ParentName = parent3.F_FullName;
fod.F_ParentId = parent3.F_ModuleId;
}
else
{
//下一级
var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
if (parent4 != null)
{
if (parent4.F_ParentId == "0")
{
fod.ParentName = parent4.F_FullName;
fod.F_ParentId = parent4.F_ModuleId;
}
}
}
}
}
}
}
}
}
modulelist.Add(fod);
}
}
ViewBag.OffenusedAll = modulelist;
var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
{
F_ParentId = x.Key,
ParentName = x.FirstOrDefault().ParentName,
ChildrenList = x.Select(y => new ModuleEntity()
{
F_ModuleId = y.F_ModuleId,
F_FullName = y.F_FullName
}).ToList()
}).ToList();
ViewBag.OffenusedGroup = mm;
ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
//查找服务
List searchmodulelist = new List();
foreach (var item in moduledata)
{
if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
{
item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
searchmodulelist.Add(item);
}
}
ViewBag.SearchModule = searchmodulelist;
//校园总览
//专业
var countinfos = cdMajorIBLL.GetCountInfos();
ViewBag.MajorTotalNum = countinfos.Rows[0]["zy_nums"];
//班级
//var classInfoData = classInfoIBLL.GetAllClass();
ViewBag.ClassInfoTotalNum = countinfos.Rows[0]["bj_nums"];
//学生
//var stuInfoData = stuInfoBasicIBLL.GetAllList();
ViewBag.StuInfoTotalNum = countinfos.Rows[0]["stu_nums"];
//教师
//var teacherData = empInfoIBLL.GetAllList();
ViewBag.TeacherTotalNum = countinfos.Rows[0]["tea_nums"];
//教室
//var classRoomData = classroomInfoIBLL.GetAllList();
ViewBag.ClassRoomTotalNum = countinfos.Rows[0]["js_nums"];
//课程
//var lessonData = lessonInfoIBLL.GetAllList();
ViewBag.LessonTotalNum = countinfos.Rows[0]["kc_nums"];
//专业总览
//专业学生
var majorstu = cdMajorIBLL.Getmajorstu().ToJson();
//var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
//{
// value = x.Select(y => y.StuId).Count(),
// name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
//});
//ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
ViewBag.StuByMajorStr = majorstu;
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
var allCount = 0;
foreach (var flow in flowType)
{
var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
flow.FlowCount = count;
allCount += count;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
//校园一卡通余额
ViewBag.StuSaveRecordTotalNum = 0;
//var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
//if (stuSaveRecordList.Any())
//{
// ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
//}
//红湖付款码余额
ViewBag.StuConsumptionTotalNum = 0;
//var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
//if (stuConsumptionList.Any())
//{
// ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
//}
//常用链接
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
{
FTName = x.Key,
PFunctionList = x.Select(y => new Perm_FunctionEntity()
{
FId = y.FId,
FTId = y.FTId,
FName = y.FName,
UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
}).Take(8).ToList()
});
ViewBag.FunctionList = ff;
ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
return View();
}
///
/// 网上办事大厅拖拽版-效率优先模式
///
///
public ActionResult DragModelTwo()
{
//判断登录状态码
string account = "";
if (!Request.Headers["account"].IsEmpty())
{
account = Request.Headers["account"].ToString();
}
OperatorHelper helper = new OperatorHelper();
var result = helper.IsOnLine(account);
if (result.stateCode != 1)
{
return Redirect("NoLogin");
}
//登录用户
var userInfo = LoginUserInfo.Get();
ViewBag.UserId = userInfo.userId;
//桌面管理表、卡片块排序管理表增加默认数据
sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "two");
//获取桌面、卡片块排序列表
ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "two").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate);
ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList);
//分页查询条件设置
Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
//邮件-收件箱
var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMail = maildata;
ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail);
ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0);
//邮件-已发送
paginationobj.sidx = "SENDTIME desc";
var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMailSend = mailsenddata;
ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend);
//来往邮件数量
ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count();
//公文
paginationobj.sidx = "SendTime";
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList);
//公告
List outnewslist = new List();
var newsList = newsIBLL.GetList("", userInfo.userId);
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
outnewslist.Add(newsitemEntity);
break;
}
}
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
outnewslist.Add(newsitemEntity);
}
}
}
}
else
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
outnewslist.Add(newsitemEntity);
}
}
else
{
outnewslist.Add(newsitemEntity);
}
}
}
ViewBag.NewsList = outnewslist.Take(5);
ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList);
//宣传报道
var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4);
foreach (var item in newsListOfxuanchuan)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
//智慧教育
ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
//专题推荐
var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
foreach (var item in newsListOfzhuanti)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
//办公事项-待办任务
paginationobj.sidx = "F_CreateDate";
paginationobj.rows = 4;
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
ViewBag.TaskTotalNum = taskListAll.Count();
//办公事项-已办任务
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
//办公事项-我发起的
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
ViewBag.MyListTotalNum = myListAll.Count();
//常用服务
List modulelist = new List();
List offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
var moduledata = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress) && m.F_IsMenu == 1 && m.F_Target == "iframe" && !string.IsNullOrEmpty(m.F_ParentId));
foreach (var oitem in offenused)
{
ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
if (fod != null)
{
//找父级
if (fod.F_ParentId == "0")
{
fod.ParentName = fod.F_FullName;
fod.F_ParentId = fod.F_ModuleId;
}
else
{
var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
if (parent1 != null)
{
if (parent1.F_ParentId == "0")
{
fod.ParentName = parent1.F_FullName;
fod.F_ParentId = parent1.F_ModuleId;
}
else
{
//下一级
var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
if (parent2 != null)
{
if (parent2.F_ParentId == "0")
{
fod.ParentName = parent2.F_FullName;
fod.F_ParentId = parent2.F_ModuleId;
}
else
{
//下一级
var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
if (parent3 != null)
{
if (parent3.F_ParentId == "0")
{
fod.ParentName = parent3.F_FullName;
fod.F_ParentId = parent3.F_ModuleId;
}
else
{
//下一级
var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
if (parent4 != null)
{
if (parent4.F_ParentId == "0")
{
fod.ParentName = parent4.F_FullName;
fod.F_ParentId = parent4.F_ModuleId;
}
}
}
}
}
}
}
}
}
modulelist.Add(fod);
}
}
ViewBag.OffenusedAll = modulelist;
var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
{
F_ParentId = x.Key,
ParentName = x.FirstOrDefault().ParentName,
ChildrenList = x.Select(y => new ModuleEntity()
{
F_ModuleId = y.F_ModuleId,
F_FullName = y.F_FullName
}).ToList()
}).ToList();
ViewBag.OffenusedGroup = mm;
ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
//todo:
//删begin
ViewBag.OffenusedJiao = modulelist.Where(x => x.F_FullName.Contains("教"));
ViewBag.OffenusedGuan = modulelist.Where(x => x.F_FullName.Contains("管理"));
ViewBag.Offenused = modulelist.Except(modulelist.Where(x => x.F_FullName.Contains("教") || x.F_FullName.Contains("管理"))).Take(6);
ViewBag.OffenusedJiaoStr = JsonConvert.SerializeObject(ViewBag.OffenusedJiao);
ViewBag.OffenusedGuanStr = JsonConvert.SerializeObject(ViewBag.OffenusedGuan);
ViewBag.OffenusedStr = JsonConvert.SerializeObject(ViewBag.Offenused);
//删end
//查找服务
List searchmodulelist = new List();
foreach (var item in moduledata)
{
if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
{
item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
searchmodulelist.Add(item);
}
}
ViewBag.SearchModule = searchmodulelist;
//校园总览
//专业
var countinfos = cdMajorIBLL.GetCountInfos();
ViewBag.MajorTotalNum = countinfos.Rows[0]["zy_nums"];
//班级
//var classInfoData = classInfoIBLL.GetAllClass();
ViewBag.ClassInfoTotalNum = countinfos.Rows[0]["bj_nums"];
//学生
//var stuInfoData = stuInfoBasicIBLL.GetAllList();
ViewBag.StuInfoTotalNum = countinfos.Rows[0]["stu_nums"];
//教师
//var teacherData = empInfoIBLL.GetAllList();
ViewBag.TeacherTotalNum = countinfos.Rows[0]["tea_nums"];
//教室
//var classRoomData = classroomInfoIBLL.GetAllList();
ViewBag.ClassRoomTotalNum = countinfos.Rows[0]["js_nums"];
//课程
//var lessonData = lessonInfoIBLL.GetAllList();
ViewBag.LessonTotalNum = countinfos.Rows[0]["kc_nums"];
//专业总览
//专业学生
var majorstu = cdMajorIBLL.Getmajorstu().ToJson();
//var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
//{
// value = x.Select(y => y.StuId).Count(),
// name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
//});
//ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
ViewBag.StuByMajorStr = majorstu;
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
var allCount = 0;
foreach (var flow in flowType)
{
var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
flow.FlowCount = count;
allCount += count;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
//校园一卡通余额
ViewBag.StuSaveRecordTotalNum = 0;
//var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
//if (stuSaveRecordList.Any())
//{
// ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
//}
//红湖付款码余额
ViewBag.StuConsumptionTotalNum = 0;
//var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
//if (stuConsumptionList.Any())
//{
// ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
//}
//常用链接
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
{
FTName = x.Key,
PFunctionList = x.Select(y => new Perm_FunctionEntity()
{
FId = y.FId,
FTId = y.FTId,
FName = y.FName,
UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
}).Take(8).ToList()
});
ViewBag.FunctionList = ff;
ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
return View();
}
///
/// 网上办事大厅拖拽版-管理驾驶舱模式
///
///
public ActionResult DragModelThree()
{
//判断登录状态码
string account = "";
if (!Request.Headers["account"].IsEmpty())
{
account = Request.Headers["account"].ToString();
}
OperatorHelper helper = new OperatorHelper();
var result = helper.IsOnLine(account);
if (result.stateCode != 1)
{
return Redirect("NoLogin");
}
//登录用户
var userInfo = LoginUserInfo.Get();
ViewBag.UserId = userInfo.userId;
//校园总览
//专业
var countinfos = cdMajorIBLL.GetCountInfos();
ViewBag.MajorTotalNum = countinfos.Rows[0]["zy_nums"];
//班级
//var classInfoData = classInfoIBLL.GetAllClass();
ViewBag.ClassInfoTotalNum = countinfos.Rows[0]["bj_nums"];
//学生
//var stuInfoData = stuInfoBasicIBLL.GetAllList();
ViewBag.StuInfoTotalNum = countinfos.Rows[0]["stu_nums"];
//教师
//var teacherData = empInfoIBLL.GetAllList();
ViewBag.TeacherTotalNum = countinfos.Rows[0]["tea_nums"];
//教室
//var classRoomData = classroomInfoIBLL.GetAllList();
ViewBag.ClassRoomTotalNum = countinfos.Rows[0]["js_nums"];
//课程
//var lessonData = lessonInfoIBLL.GetAllList();
ViewBag.LessonTotalNum = countinfos.Rows[0]["kc_nums"];
//专业总览
//专业学生
var majorstu = cdMajorIBLL.Getmajorstu().ToJson();
//var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
//{
// value = x.Select(y => y.StuId).Count(),
// name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
//});
//ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
ViewBag.StuByMajorStr = majorstu;
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
var allCount = 0;
foreach (var flow in flowType)
{
var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
flow.FlowCount = count;
allCount += count;
}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
//课程总览
var lessonInfoData = lessonInfoIBLL.GetAllList();
//ViewBag.LessonTotalNum = lessonInfoData.Count();
//ViewBag.OpenLessonTotalNum = lessonInfoData.Where(x => x.CheckMark == true).Count();
ViewBag.OpenLessonTotalNum = ViewBag.LessonTotalNum;
//课程分类下的课程
var lessonBySort = lessonInfoData.GroupBy(x => x.LessonSortNo).Select(x => new
{
value = x.Select(y => y.LessonId).Count(),
name = cdLessonSortIBLL.GetCdLessonSortEntityByNo(x.Key)?.LessonSortName
});
ViewBag.LessonBySortStr = JsonConvert.SerializeObject(lessonBySort);
//课程类型下的课程
var lessonByType = lessonInfoData.GroupBy(x => x.LessonTypeId).Select(x => new
{
value = x.Select(y => y.LessonId).Count(),
name = cdLessonTypeIBLL.GetCdLessonTypeEntity(x.Key)?.LessonTypeName
});
ViewBag.LessonByTypeStr = JsonConvert.SerializeObject(lessonByType);
//教师总览
//教师学历比例
var teacherData = empInfoIBLL.GetAllList();
var teacherByHighestRecord = teacherData.Where(x => !string.IsNullOrEmpty(x.HighestRecord)).GroupBy(x => x.HighestRecord).Select(x => new
{
value = x.Select(y => y.EmpId).Count(),
name = bCdCultureDegreeIBLL.GetEntity(x.Key)?.CultureDegree
}).OrderByDescending(x => x.value);
ViewBag.TeacherByHighestRecordStr = JsonConvert.SerializeObject(teacherByHighestRecord);
//教师年龄比例
var empInfoAgeRate = empInfoIBLL.GetEmpInfoAgeRate();
var teacherByAge = new List