|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062 |
- 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 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<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 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();
- }
-
- /// <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 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();
- }
- /// <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 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<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("操作成功");
- }
-
- [HandlerLogin(FilterMode.Enforce)]
- public ActionResult GetYKTPayed()
- {
- var yktpayed=cdMajorIBLL.GetYKTPayed(LoginUserInfo.Get().account);
- if (yktpayed!=null&& yktpayed.Rows.Count>0)
- {
- return Success(new
- {
- YKTPayed = (yktpayed.Rows[0][0].ToDecimal()/100).ToDecimal(2)
- });
- }
- else
- {
- return Success(new {
- YKTPayed=0
- });
- }
- }
- [HandlerLogin(FilterMode.Enforce)]
- public ActionResult GetYKTBalance()
- {
- var yktpayed = cdMajorIBLL.GetYKTBalance(LoginUserInfo.Get().account);
- if (yktpayed != null && yktpayed.Rows.Count > 0)
- {
- return Success(new
- {
- YKTPayed = (yktpayed.Rows[0][0].ToDecimal()/100).ToDecimal(2)
- });
- }
- else
- {
- return Success(new
- {
- YKTPayed = 0
- });
- }
- }
- }
- }
|