|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010 |
- 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
- /// <summary>
- /// 获取统一认证用户信息
- /// </summary>
- /// <returns></returns>
- 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<string>(code)))
- {
- return Success(new { useraccount = redisCache.Read<string>(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<NewsEntity> outnewslist = new List<NewsEntity>();
- 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<ModuleEntity> modulelist = new List<ModuleEntity>();
- List<string> 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<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
- 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 majorData = cdMajorIBLL.GetAllList();
- ViewBag.MajorTotalNum = majorData.Count();
- //班级
- var classInfoData = classInfoIBLL.GetAllClass();
- ViewBag.ClassInfoTotalNum = classInfoData.Count();
- //学生
- var stuInfoData = stuInfoBasicIBLL.GetAllList();
- ViewBag.StuInfoTotalNum = stuInfoData.Count();
- //教师
- var teacherData = empInfoIBLL.GetAllList();
- ViewBag.TeacherTotalNum = teacherData.Count();
- //教室
- var classRoomData = classroomInfoIBLL.GetAllList();
- ViewBag.ClassRoomTotalNum = classRoomData.Count();
- //课程
- var lessonData = lessonInfoIBLL.GetAllList();
- ViewBag.LessonTotalNum = lessonData.Count();
- //专业总览
- //专业学生
- 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);
- //流程
- 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<NewsEntity>();
- 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<NewsEntity>();
- 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<NewsEntity>();
- 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("参数错误。");
- }
- }
- /// <summary>
- /// 获取IP
- /// </summary>
- /// <returns></returns>
- 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;
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-未登录页面
- /// </summary>
- /// <returns></returns>
- 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");
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-未登录页面-微信登录
- /// </summary>
- /// <returns></returns>
- 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();
- }
- /// <summary>
- /// 网上办事大厅拖拽版-办事大厅模式
- /// </summary>
- /// <returns></returns>
- 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<NewsEntity> outnewslist = new List<NewsEntity>();
- 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<ModuleEntity> modulelist = new List<ModuleEntity>();
- List<string> 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<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
- 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 majorData = cdMajorIBLL.GetAllList();
- ViewBag.MajorTotalNum = majorData.Count();
- //班级
- var classInfoData = classInfoIBLL.GetAllClass();
- ViewBag.ClassInfoTotalNum = classInfoData.Count();
- //学生
- var stuInfoData = stuInfoBasicIBLL.GetAllList();
- ViewBag.StuInfoTotalNum = stuInfoData.Count();
- //教师
- var teacherData = empInfoIBLL.GetAllList();
- ViewBag.TeacherTotalNum = teacherData.Count();
- //教室
- var classRoomData = classroomInfoIBLL.GetAllList();
- ViewBag.ClassRoomTotalNum = classRoomData.Count();
- //课程
- var lessonData = lessonInfoIBLL.GetAllList();
- ViewBag.LessonTotalNum = lessonData.Count();
- //专业总览
- //专业学生
- 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);
- //流程
- 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();
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-效率优先模式
- /// </summary>
- /// <returns></returns>
- 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<NewsEntity> outnewslist = new List<NewsEntity>();
- 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<ModuleEntity> modulelist = new List<ModuleEntity>();
- List<string> 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<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
- 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 majorData = cdMajorIBLL.GetAllList();
- ViewBag.MajorTotalNum = majorData.Count();
- //班级
- var classInfoData = classInfoIBLL.GetAllClass();
- ViewBag.ClassInfoTotalNum = classInfoData.Count();
- //学生
- var stuInfoData = stuInfoBasicIBLL.GetAllList();
- ViewBag.StuInfoTotalNum = stuInfoData.Count();
- //教师
- var teacherData = empInfoIBLL.GetAllList();
- ViewBag.TeacherTotalNum = teacherData.Count();
- //教室
- var classRoomData = classroomInfoIBLL.GetAllList();
- ViewBag.ClassRoomTotalNum = classRoomData.Count();
- //课程
- var lessonData = lessonInfoIBLL.GetAllList();
- ViewBag.LessonTotalNum = lessonData.Count();
- //专业总览
- //专业学生
- 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);
- //流程
- 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();
- }
- /// <summary>
- /// 网上办事大厅拖拽版-管理驾驶舱模式
- /// </summary>
- /// <returns></returns>
- 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 majorData = cdMajorIBLL.GetAllList();
- ViewBag.MajorTotalNum = majorData.Count();
- //班级
- var classInfoData = classInfoIBLL.GetAllClass();
- ViewBag.ClassInfoTotalNum = classInfoData.Count();
- //学生
- var stuInfoData = stuInfoBasicIBLL.GetAllList();
- ViewBag.StuInfoTotalNum = stuInfoData.Count();
- ViewBag.StuInfoTotalNumOfMan = stuInfoData.Where(x => x.GenderNo == true).Count();
- //教师
- var teacherData = empInfoIBLL.GetAllList();
- ViewBag.TeacherTotalNum = teacherData.Count();
- ViewBag.TeacherTotalNumOfMan = teacherData.Where(x => x.GenderNo == true).Count();
- ViewBag.TeacherTotalNumOfBianNei = teacherData.Where(x => x.CompilationCategory == "01").Count();
- //教室
- var classRoomData = classroomInfoIBLL.GetAllList();
- ViewBag.ClassRoomTotalNum = classRoomData.Count();
- //专业总览
- //专业学生
- 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);
- //流程
- 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();
- //课程分类下的课程
- 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 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<object>() {
- new { value = empInfoAgeRate.age1, name = "60岁以上" },
- new { value = empInfoAgeRate.age2, name = "50~60岁" },
- new { value = empInfoAgeRate.age3, name = "40~50岁" },
- new { value = empInfoAgeRate.age4, name = "30~40岁" },
- new { value = empInfoAgeRate.age5, name = "20~30岁" },
- };
- ViewBag.TeacherByAgeStr = JsonConvert.SerializeObject(teacherByAge);
- //学生总览
- //学生成绩预警
- var stuScoreData = stuScoreNotPassIBLL.GetList("{}").Where(x => x.Score == 0).Select(x => new { x.StuNo, x.MajorNo }).Distinct();
- ViewBag.StuScoreWarnTotalNum = stuScoreData.Count();
- var stuScoreByMajor = stuScoreData.GroupBy(x => x.MajorNo).Select(x => new
- {
- value = x.Select(y => y.StuNo).Count(),
- name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
- });
- ViewBag.StuScoreByMajorStr = JsonConvert.SerializeObject(stuScoreByMajor);
- //常用服务
- List<ModuleEntity> modulelist = new List<ModuleEntity>();
- List<string> 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;
- //查找服务
- List<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
- 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;
-
-
- return View();
- }
- /// <summary>
- /// 网上办事大厅拖拽版-保存卡片块排序
- /// </summary>
- /// <returns></returns>
- public ActionResult SaveCardSort(string userId, string modelCode, string desktopId, string cardSort)
- {
- sSO_Drag_CardSortManageIBLL.SaveCardSort(userId, modelCode, desktopId, cardSort);
- return Success("操作成功");
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-新增桌面
- /// </summary>
- /// <returns></returns>
- public ActionResult AddDesktop(string userId, string modelCode, string desktopName, string desktopCode)
- {
- sSO_Drag_DesktopManageIBLL.AddDesktop(userId, modelCode, desktopName, desktopCode);
- var data = sSO_Drag_DesktopManageIBLL.GetEntityByDesktopCode(userId, modelCode, desktopCode);
- return Success("操作成功", data);
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-删除桌面
- /// </summary>
- /// <returns></returns>
- public ActionResult DeleteDesktop(string desktopId)
- {
- sSO_Drag_DesktopManageIBLL.DeleteEntity(desktopId);
- return Success("操作成功");
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-修改桌面
- /// </summary>
- /// <returns></returns>
- public ActionResult ModifyDesktop(string desktopId, string desktopName)
- {
- var entity = new SSO_Drag_DesktopManageEntity()
- {
- DesktopName = desktopName
- };
- sSO_Drag_DesktopManageIBLL.SaveEntity(desktopId, entity);
- return Success("操作成功");
- }
-
- /// <summary>
- /// 网上办事大厅拖拽版-默认桌面恢复默认设置
- /// </summary>
- /// <returns></returns>
- public ActionResult RestoreDefaultDesktop(string desktopId)
- {
- sSO_Drag_DesktopManageIBLL.RestoreDefaultDesktop(desktopId);
- return Success("操作成功");
- }
-
- }
- }
|