選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

SSOSystemController.cs 95 KiB

4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010
  1. using Learun.Application.Base.SystemModule;
  2. using Learun.Application.OA;
  3. using Learun.Application.Organization;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using Learun.Application.TwoDevelopment.Permission;
  6. using Learun.Application.WorkFlow;
  7. using Learun.Util;
  8. using Learun.Util.Operat;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Configuration;
  12. using System.Linq;
  13. using System.Web;
  14. using System.Web.Mvc;
  15. using Learun.Cache.Base;
  16. using Learun.Cache.Factory;
  17. using Newtonsoft.Json;
  18. using Learun.Application.TwoDevelopment.LR_Desktop;
  19. using Learun.Application.TwoDevelopment.PersonnelManagement;
  20. namespace Learun.Application.Web.Controllers
  21. {
  22. [HandlerLogin(FilterMode.Ignore)]
  23. public class SSOSystemController : MvcControllerBase
  24. {
  25. private Perm_FunctionIBLL perm_FunctionIBLL = new Perm_FunctionBLL();
  26. Perm_UserPermissionIBLL permUserPermissionIbll = new Perm_UserPermissionBLL();
  27. private ModuleIBLL moduleIBLL = new ModuleBLL();
  28. private SYS_ReceiveMessageIBLL sYS_ReceiveMessageIBLL = new SYS_ReceiveMessageBLL();
  29. private UserIBLL userBll = new UserBLL();
  30. private WfTaskIBLL wfTaskIBLL = new WfTaskBLL();
  31. private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();
  32. private NoticeIBLL newsIBLL = new NoticeBLL();
  33. private Perm_FunctionTypeIBLL perm_FunctionTypeIBLL = new Perm_FunctionTypeBLL();
  34. private DataItemIBLL dataItemIBLL = new DataItemBLL();
  35. private WfSchemeIBLL wfSchemeIBLL = new WfSchemeBLL();
  36. AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
  37. private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL();
  38. private Perm_FunctionVisitIBLL functionVisitIbll = new Perm_FunctionVisitBLL();
  39. private ICache redisCache = CacheFactory.CaChe();
  40. private SSO_Drag_DesktopManageIBLL sSO_Drag_DesktopManageIBLL = new SSO_Drag_DesktopManageBLL();
  41. private SYS_SendMessageIBLL sYS_SendMessageIBLL = new SYS_SendMessageBLL();
  42. private CdMajorIBLL cdMajorIBLL = new CdMajorBLL();
  43. private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
  44. private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
  45. private ClassroomInfoIBLL classroomInfoIBLL = new ClassroomInfoBLL();
  46. private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL();
  47. private SSO_Drag_CardSortManageIBLL sSO_Drag_CardSortManageIBLL = new SSO_Drag_CardSortManageBLL();
  48. private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL();
  49. private CdLessonSortIBLL cdLessonSortIBLL = new CdLessonSortBLL();
  50. private CdLessonTypeIBLL cdLessonTypeIBLL = new CdLessonTypeBLL();
  51. private BCdCultureDegreeIBLL bCdCultureDegreeIBLL = new BCdCultureDegreeBLL();
  52. private StuScoreNotPassIBLL stuScoreNotPassIBLL = new StuScoreNotPassBLL();
  53. private Sys_QRCodeInLoginIBLL sys_QRCodeInLoginIBLL = new Sys_QRCodeInLoginBLL();
  54. private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL();
  55. private StuSaverecordIBLL stuSaverecordIBLL = new StuSaverecordBLL();
  56. private StuConsumptionIBLL stuConsumptionIBLL = new StuConsumptionBLL();
  57. #region 统一身份认证2.0
  58. /// <summary>
  59. /// 获取统一认证用户信息
  60. /// </summary>
  61. /// <returns></returns>
  62. public ActionResult authorize()
  63. {
  64. string appid = Request.QueryString["appid"];
  65. string secret = Request.QueryString["secret"];
  66. string appkey = Request.QueryString["appkey"];
  67. if (string.IsNullOrEmpty(appid))
  68. {
  69. return Fail("参数:appid不能为空");
  70. }
  71. if (string.IsNullOrEmpty(secret))
  72. {
  73. return Fail("参数:secret不能为空");
  74. }
  75. if (string.IsNullOrEmpty(appkey))
  76. {
  77. return Fail("参数:appkey不能为空");
  78. }
  79. var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid);
  80. if (application != null)
  81. {
  82. if (Util.DESEncrypt.Decrypt(application.FSecret,
  83. ConfigurationManager.AppSettings["SSOPublicSecret"]).Equals(secret))
  84. {
  85. try
  86. {
  87. var code = DESEncrypt.Decrypt(appkey, "bjqjsso");
  88. if (!string.IsNullOrEmpty(redisCache.Read<string>(code)))
  89. {
  90. return Success(new { useraccount = redisCache.Read<string>(code) });
  91. }
  92. else
  93. {
  94. return Fail("appkey已过期");
  95. }
  96. }
  97. catch (Exception e)
  98. {
  99. return Fail("appkey错误");
  100. }
  101. }
  102. else
  103. {
  104. return Fail("secret错误");
  105. }
  106. }
  107. else
  108. return Fail("未授权的appid");
  109. }
  110. #endregion
  111. public ActionResult Index()
  112. {
  113. //判断登录状态码
  114. string account = "";
  115. if (!Request.Headers["account"].IsEmpty())
  116. {
  117. account = Request.Headers["account"].ToString();
  118. }
  119. OperatorHelper helper = new OperatorHelper();
  120. var result = helper.IsOnLine(account);
  121. if (result.stateCode != 1)
  122. {
  123. return Redirect("NoLogin");
  124. }
  125. //登录用户
  126. var userInfo = LoginUserInfo.Get();
  127. ViewBag.UserId = userInfo.userId;
  128. //桌面管理表、卡片块排序管理表增加默认数据
  129. sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "one");
  130. //获取桌面、卡片块排序列表
  131. ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "one").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate);
  132. ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList);
  133. //分页查询条件设置
  134. Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
  135. //邮件-收件箱
  136. var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
  137. var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
  138. ViewBag.LanMail = maildata;
  139. ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail);
  140. ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0);
  141. //邮件-已发送
  142. paginationobj.sidx = "SENDTIME desc";
  143. var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
  144. var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}");
  145. ViewBag.LanMailSend = mailsenddata;
  146. ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend);
  147. //来往邮件数量
  148. ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count();
  149. //公文
  150. paginationobj.sidx = "SendTime";
  151. ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
  152. ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList);
  153. //公告
  154. List<NewsEntity> outnewslist = new List<NewsEntity>();
  155. var newsList = newsIBLL.GetList("", userInfo.userId);
  156. foreach (var newsitemEntity in newsList)
  157. {
  158. if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  159. {
  160. if (!string.IsNullOrEmpty(userInfo.postIds))
  161. {
  162. if (userInfo.postIds.Contains(","))
  163. {
  164. foreach (var postid in userInfo.postIds.Split(','))
  165. {
  166. if (newsitemEntity.F_SendPostId.Contains(postid))
  167. {
  168. outnewslist.Add(newsitemEntity);
  169. break;
  170. }
  171. }
  172. }
  173. else
  174. {
  175. if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
  176. {
  177. outnewslist.Add(newsitemEntity);
  178. }
  179. }
  180. }
  181. }
  182. else
  183. {
  184. if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  185. {
  186. if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
  187. {
  188. outnewslist.Add(newsitemEntity);
  189. }
  190. }
  191. else
  192. {
  193. outnewslist.Add(newsitemEntity);
  194. }
  195. }
  196. }
  197. ViewBag.NewsList = outnewslist.Take(5);
  198. ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList);
  199. //宣传报道
  200. var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4);
  201. foreach (var item in newsListOfxuanchuan)
  202. {
  203. if (!string.IsNullOrEmpty(item.F_NewsImage))
  204. {
  205. var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
  206. if (!string.IsNullOrEmpty(imagePath))
  207. {
  208. item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
  209. }
  210. else
  211. {
  212. item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
  213. }
  214. }
  215. }
  216. ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
  217. ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
  218. //智慧教育
  219. ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
  220. ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
  221. //专题推荐
  222. var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
  223. foreach (var item in newsListOfzhuanti)
  224. {
  225. if (!string.IsNullOrEmpty(item.F_NewsImage))
  226. {
  227. var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
  228. if (!string.IsNullOrEmpty(imagePath))
  229. {
  230. item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
  231. }
  232. else
  233. {
  234. item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
  235. }
  236. }
  237. }
  238. ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
  239. ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
  240. //办公事项-待办任务
  241. paginationobj.sidx = "F_CreateDate";
  242. paginationobj.rows = 4;
  243. var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
  244. ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
  245. ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
  246. ViewBag.TaskTotalNum = taskListAll.Count();
  247. //办公事项-已办任务
  248. var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
  249. ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
  250. ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
  251. ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
  252. //办公事项-我发起的
  253. var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
  254. ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
  255. ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
  256. ViewBag.MyListTotalNum = myListAll.Count();
  257. //常用服务
  258. List<ModuleEntity> modulelist = new List<ModuleEntity>();
  259. List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
  260. 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));
  261. foreach (var oitem in offenused)
  262. {
  263. ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
  264. if (fod != null)
  265. {
  266. //找父级
  267. if (fod.F_ParentId == "0")
  268. {
  269. fod.ParentName = fod.F_FullName;
  270. fod.F_ParentId = fod.F_ModuleId;
  271. }
  272. else
  273. {
  274. var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
  275. if (parent1 != null)
  276. {
  277. if (parent1.F_ParentId == "0")
  278. {
  279. fod.ParentName = parent1.F_FullName;
  280. fod.F_ParentId = parent1.F_ModuleId;
  281. }
  282. else
  283. {
  284. //下一级
  285. var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
  286. if (parent2 != null)
  287. {
  288. if (parent2.F_ParentId == "0")
  289. {
  290. fod.ParentName = parent2.F_FullName;
  291. fod.F_ParentId = parent2.F_ModuleId;
  292. }
  293. else
  294. {
  295. //下一级
  296. var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
  297. if (parent3 != null)
  298. {
  299. if (parent3.F_ParentId == "0")
  300. {
  301. fod.ParentName = parent3.F_FullName;
  302. fod.F_ParentId = parent3.F_ModuleId;
  303. }
  304. else
  305. {
  306. //下一级
  307. var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
  308. if (parent4 != null)
  309. {
  310. if (parent4.F_ParentId == "0")
  311. {
  312. fod.ParentName = parent4.F_FullName;
  313. fod.F_ParentId = parent4.F_ModuleId;
  314. }
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. }
  323. modulelist.Add(fod);
  324. }
  325. }
  326. ViewBag.OffenusedAll = modulelist;
  327. var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
  328. {
  329. F_ParentId = x.Key,
  330. ParentName = x.FirstOrDefault().ParentName,
  331. ChildrenList = x.Select(y => new ModuleEntity()
  332. {
  333. F_ModuleId = y.F_ModuleId,
  334. F_FullName = y.F_FullName
  335. }).ToList()
  336. }).ToList();
  337. ViewBag.OffenusedGroup = mm;
  338. ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
  339. //查找服务
  340. List<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
  341. foreach (var item in moduledata)
  342. {
  343. if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
  344. {
  345. item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
  346. searchmodulelist.Add(item);
  347. }
  348. }
  349. ViewBag.SearchModule = searchmodulelist;
  350. //校园总览
  351. //专业
  352. var majorData = cdMajorIBLL.GetAllList();
  353. ViewBag.MajorTotalNum = majorData.Count();
  354. //班级
  355. var classInfoData = classInfoIBLL.GetAllClass();
  356. ViewBag.ClassInfoTotalNum = classInfoData.Count();
  357. //学生
  358. var stuInfoData = stuInfoBasicIBLL.GetAllList();
  359. ViewBag.StuInfoTotalNum = stuInfoData.Count();
  360. //教师
  361. var teacherData = empInfoIBLL.GetAllList();
  362. ViewBag.TeacherTotalNum = teacherData.Count();
  363. //教室
  364. var classRoomData = classroomInfoIBLL.GetAllList();
  365. ViewBag.ClassRoomTotalNum = classRoomData.Count();
  366. //课程
  367. var lessonData = lessonInfoIBLL.GetAllList();
  368. ViewBag.LessonTotalNum = lessonData.Count();
  369. //专业总览
  370. //专业学生
  371. var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
  372. {
  373. value = x.Select(y => y.StuId).Count(),
  374. name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
  375. });
  376. ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
  377. //流程
  378. var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
  379. var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  380. var allCount = 0;
  381. foreach (var flow in flowType)
  382. {
  383. var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
  384. flow.FlowCount = count;
  385. allCount += count;
  386. }
  387. ViewBag.AllCount = allCount;
  388. ViewBag.FlowType = flowType;
  389. ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
  390. //校园一卡通余额
  391. ViewBag.StuSaveRecordTotalNum = 0;
  392. var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
  393. if (stuSaveRecordList.Any())
  394. {
  395. ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
  396. }
  397. //红湖付款码余额
  398. ViewBag.StuConsumptionTotalNum = 0;
  399. var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
  400. if (stuConsumptionList.Any())
  401. {
  402. ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
  403. }
  404. //常用链接
  405. var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
  406. var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
  407. {
  408. FTName = x.Key,
  409. PFunctionList = x.Select(y => new Perm_FunctionEntity()
  410. {
  411. FId = y.FId,
  412. FTId = y.FTId,
  413. FName = y.FName,
  414. UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
  415. UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
  416. }).Take(8).ToList()
  417. });
  418. ViewBag.FunctionList = ff;
  419. ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
  420. return View("DragModelOne");
  421. }
  422. //public ActionResult NoLogin()
  423. //{
  424. // var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
  425. // var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  426. // var allCount = 0;
  427. // foreach (var flow in flowType)
  428. // {
  429. // var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
  430. // flow.FlowCount = count;
  431. // allCount += count;
  432. // }
  433. // ViewBag.AllCount = allCount;
  434. // ViewBag.FlowType = flowType;
  435. // ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
  436. // return View();
  437. //}
  438. private UserService userService = new UserService();
  439. public ActionResult ResetPWD(string password)
  440. {
  441. password = Md5Helper.Encrypt(password, 32);
  442. userService.RevisePassword("System", password);
  443. return Success("修改成功");
  444. }
  445. [HandlerLogin(FilterMode.Enforce)]
  446. public ActionResult Work()
  447. {
  448. ViewBag.FlowType = dataItemIBLL.GetDetailList("FlowSort", "");
  449. ViewBag.FlowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  450. return View();
  451. }
  452. //[HandlerLogin(FilterMode.Enforce)]
  453. public ActionResult workTwo()
  454. {
  455. var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
  456. var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  457. var allCount = 0;
  458. foreach (var flow in flowType)
  459. {
  460. var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
  461. flow.FlowCount = count;
  462. allCount += count;
  463. }
  464. ViewBag.AllCount = allCount;
  465. ViewBag.FlowType = flowType;
  466. ViewBag.FlowList = flowList;
  467. return View();
  468. }
  469. [HandlerLogin(FilterMode.Enforce)]
  470. public ActionResult UserService()
  471. {
  472. ViewBag.FlowType = dataItemIBLL.GetDetailList("FlowSort", "");
  473. ViewBag.FlowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  474. return View();
  475. }
  476. [HandlerLogin(FilterMode.Enforce)]
  477. public ActionResult NewsList()
  478. {
  479. var userinfo = LoginUserInfo.Get();
  480. int page = 1;
  481. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
  482. {
  483. page = Convert.ToInt32(Request.QueryString["page"]);
  484. }
  485. //公告
  486. Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
  487. paginationobj.rows = 100;
  488. var newsList = newsIBLL.GetList("", userinfo.userId);
  489. //用户可以看到的通知公告
  490. var newsListSelf = new List<NewsEntity>();
  491. foreach (var newsitemEntity in newsList)
  492. {
  493. if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  494. {
  495. if (!string.IsNullOrEmpty(userinfo.postIds))
  496. {
  497. if (userinfo.postIds.Contains(","))
  498. {
  499. foreach (var postid in userinfo.postIds.Split(','))
  500. {
  501. if (newsitemEntity.F_SendPostId.Contains(postid))
  502. {
  503. newsListSelf.Add(newsitemEntity);
  504. break;
  505. }
  506. }
  507. }
  508. else
  509. {
  510. if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
  511. {
  512. newsListSelf.Add(newsitemEntity);
  513. }
  514. }
  515. }
  516. }
  517. else
  518. {
  519. if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  520. {
  521. if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
  522. {
  523. newsListSelf.Add(newsitemEntity);
  524. }
  525. }
  526. else
  527. {
  528. newsListSelf.Add(newsitemEntity);
  529. }
  530. }
  531. }
  532. foreach (var ufitem in newsListSelf)
  533. {
  534. if (!string.IsNullOrEmpty(ufitem.F_NewsImage))
  535. {
  536. if (annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage) != null)
  537. {
  538. var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage).F_FilePath;
  539. if (!string.IsNullOrEmpty(imagePath))
  540. {
  541. ufitem.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
  542. }
  543. else
  544. {
  545. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  546. }
  547. }
  548. else
  549. {
  550. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  551. }
  552. }
  553. else
  554. {
  555. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  556. }
  557. }
  558. ViewBag.NewsList = newsListSelf;
  559. return View(paginationobj);
  560. }
  561. [HandlerLogin(FilterMode.Enforce)]
  562. public ActionResult newsTwo()
  563. {
  564. var userinfo = LoginUserInfo.Get();
  565. int page = 1;
  566. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
  567. {
  568. page = Convert.ToInt32(Request.QueryString["page"]);
  569. }
  570. //公告
  571. Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
  572. var newsList = newsIBLL.GetList("", userinfo.userId);
  573. //用户可以看到的通知公告
  574. var newsListSelf = new List<NewsEntity>();
  575. foreach (var newsitemEntity in newsList)
  576. {
  577. if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  578. {
  579. if (!string.IsNullOrEmpty(userinfo.postIds))
  580. {
  581. if (userinfo.postIds.Contains(","))
  582. {
  583. foreach (var postid in userinfo.postIds.Split(','))
  584. {
  585. if (newsitemEntity.F_SendPostId.Contains(postid))
  586. {
  587. newsListSelf.Add(newsitemEntity);
  588. break;
  589. }
  590. }
  591. }
  592. else
  593. {
  594. if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
  595. {
  596. newsListSelf.Add(newsitemEntity);
  597. }
  598. }
  599. }
  600. }
  601. else
  602. {
  603. if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  604. {
  605. if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
  606. {
  607. newsListSelf.Add(newsitemEntity);
  608. }
  609. }
  610. else
  611. {
  612. newsListSelf.Add(newsitemEntity);
  613. }
  614. }
  615. }
  616. foreach (var ufitem in newsListSelf)
  617. {
  618. if (!string.IsNullOrEmpty(ufitem.F_NewsImage))
  619. {
  620. if (annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage) != null)
  621. {
  622. var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage).F_FilePath;
  623. if (!string.IsNullOrEmpty(imagePath))
  624. {
  625. ufitem.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
  626. }
  627. else
  628. {
  629. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  630. }
  631. }
  632. else
  633. {
  634. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  635. }
  636. }
  637. else
  638. {
  639. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  640. }
  641. }
  642. //公告
  643. ViewBag.NewsList = newsListSelf;
  644. //内部邮件
  645. paginationobj.sidx = "readflag asc,SENDTIME desc ";
  646. ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
  647. //办公事项
  648. paginationobj.sidx = "F_CreateDate";
  649. //ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
  650. ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
  651. //学校公文
  652. paginationobj.sidx = "SendTime";
  653. ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
  654. return View();
  655. }
  656. public PartialViewResult LanMail()
  657. {
  658. var userinfo = LoginUserInfo.Get();
  659. int page = 1;
  660. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
  661. {
  662. page = Convert.ToInt32(Request.QueryString["page"]);
  663. }
  664. Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "readflag asc,SENDTIME desc", sord = "desc" };
  665. ViewBag.LanMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}");
  666. return PartialView(paginationobj);
  667. }
  668. public PartialViewResult TaskList()
  669. {
  670. var userinfo = LoginUserInfo.Get();
  671. int page = 1;
  672. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
  673. {
  674. page = Convert.ToInt32(Request.QueryString["page"]);
  675. }
  676. Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
  677. ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");
  678. //ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
  679. return PartialView(paginationobj);
  680. }
  681. public PartialViewResult ReceiveFileList()
  682. {
  683. var userinfo = LoginUserInfo.Get();
  684. int page = 1;
  685. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
  686. {
  687. page = Convert.ToInt32(Request.QueryString["page"]);
  688. }
  689. Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "SendTime", sord = "desc" };
  690. ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
  691. return PartialView(paginationobj);
  692. }
  693. public PartialViewResult NewList()
  694. {
  695. var userinfo = LoginUserInfo.Get();
  696. int page = 1;
  697. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
  698. {
  699. page = Convert.ToInt32(Request.QueryString["page"]);
  700. }
  701. //公告
  702. Pagination paginationobj = new Pagination() { rows = 10, page = page, sidx = "F_CreateDate", sord = "desc" };
  703. var newsList = newsIBLL.GetList("", userinfo.userId);
  704. //用户可以看到的通知公告
  705. var newsListSelf = new List<NewsEntity>();
  706. foreach (var newsitemEntity in newsList)
  707. {
  708. if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  709. {
  710. if (!string.IsNullOrEmpty(userinfo.postIds))
  711. {
  712. if (userinfo.postIds.Contains(","))
  713. {
  714. foreach (var postid in userinfo.postIds.Split(','))
  715. {
  716. if (newsitemEntity.F_SendPostId.Contains(postid))
  717. {
  718. newsListSelf.Add(newsitemEntity);
  719. break;
  720. }
  721. }
  722. }
  723. else
  724. {
  725. if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
  726. {
  727. newsListSelf.Add(newsitemEntity);
  728. }
  729. }
  730. }
  731. }
  732. else
  733. {
  734. if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  735. {
  736. if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
  737. {
  738. newsListSelf.Add(newsitemEntity);
  739. }
  740. }
  741. else
  742. {
  743. newsListSelf.Add(newsitemEntity);
  744. }
  745. }
  746. }
  747. foreach (var ufitem in newsListSelf)
  748. {
  749. if (!string.IsNullOrEmpty(ufitem.F_NewsImage))
  750. {
  751. if (annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage) != null)
  752. {
  753. var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.F_NewsImage).F_FilePath;
  754. if (!string.IsNullOrEmpty(imagePath))
  755. {
  756. ufitem.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
  757. }
  758. else
  759. {
  760. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  761. }
  762. }
  763. else
  764. {
  765. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  766. }
  767. }
  768. else
  769. {
  770. ufitem.F_NewsImage = "/Resource/NewsDefault.jpg";
  771. }
  772. }
  773. //公告
  774. ViewBag.NewsList = newsListSelf;
  775. return PartialView(paginationobj);
  776. }
  777. [HandlerLogin(FilterMode.Enforce)]
  778. public ActionResult NewsDetail()
  779. {
  780. return View();
  781. }
  782. public ActionResult Check()
  783. {
  784. try
  785. {
  786. string redi = Request.QueryString["redi"];
  787. if (!string.IsNullOrEmpty(redi))
  788. {
  789. string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
  790. string uid = Request.QueryString["u"];
  791. string pwd = Request.QueryString["p"];
  792. string logintime = Request.QueryString["t"];
  793. string n = Request.QueryString["n"];
  794. string mail = Request.QueryString["mail"];
  795. string sendfile = Request.QueryString["sendfile"];
  796. string task = Request.QueryString["task"];
  797. string gotomain = Request.QueryString["gotomain"];
  798. string nk = Request.QueryString["nk"];
  799. string jx = Request.QueryString["jx"];
  800. string zl = Request.QueryString["zl"];
  801. if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(logintime))
  802. {
  803. decimal decodelogintime = Convert.ToDecimal(DESEncrypt.Decrypt(logintime, publickey));
  804. decimal datetimenow = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMddHHmmss"));
  805. if (datetimenow - 300 <= decodelogintime && datetimenow + 300 >= decodelogintime)
  806. {
  807. string username = DESEncrypt.Decrypt(uid, publickey);
  808. string password = DESEncrypt.Decrypt(pwd, publickey);
  809. UserEntity userEntity = userBll.CheckLogin(username, Md5Helper.Encrypt(password, 32));
  810. LogEntity logEntity = new LogEntity();
  811. logEntity.F_CategoryId = 1;
  812. logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString();
  813. logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login);
  814. logEntity.F_OperateAccount = username + "(" + userEntity.F_RealName + ")";
  815. logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : username;
  816. logEntity.F_Module = Config.GetValue("SoftName");
  817. logEntity.F_Description = "PC端";
  818. if (!userEntity.LoginOk)//登录失败
  819. {
  820. //写入日志
  821. logEntity.F_ExecuteResult = 0;
  822. logEntity.F_ExecuteResultJson = "sso登录失败:" + userEntity.LoginMsg;
  823. logEntity.WriteLog();
  824. return Fail(userEntity.LoginMsg);
  825. }
  826. else
  827. {
  828. OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
  829. //写入日志
  830. logEntity.F_ExecuteResult = 1;
  831. logEntity.F_ExecuteResultJson = "sso登录成功";
  832. logEntity.WriteLog();
  833. var DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"];
  834. var Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port;
  835. if (!string.IsNullOrEmpty(n))
  836. {
  837. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=6252983c-52f5-402c-991b-ad19a9cb1f94&keyValue=" + n));
  838. }
  839. else if (!string.IsNullOrEmpty(mail))
  840. {
  841. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=252878d7-d807-497f-b01e-839bb1b869c6"));
  842. }
  843. else if (!string.IsNullOrEmpty(sendfile))
  844. {
  845. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=19637c39-624d-4be6-b680-04250f8df71f"));
  846. }
  847. else if (!string.IsNullOrEmpty(task))
  848. {
  849. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=56ce34c2-882e-47d1-b12d-5036e3b79fcf"));
  850. }
  851. else if (!string.IsNullOrEmpty(gotomain))
  852. {
  853. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index"));
  854. }
  855. else if (!string.IsNullOrEmpty(nk))
  856. {
  857. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=07ceccd0-cf74-42ec-9b7d-3b36af0be451"));
  858. }
  859. else if (!string.IsNullOrEmpty(jx))
  860. {
  861. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=5f2e3e9b-b0da-421a-b370-671dcae4fc17"));
  862. }
  863. else if (!string.IsNullOrEmpty(zl))
  864. {
  865. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + HttpUtility.UrlEncode(Returnurl + "/Home/Index?autoopen=8dfd9f38-8cab-49ff-b4d1-8b899b1ecbca"));
  866. }
  867. else
  868. {
  869. return Redirect(DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/Index");
  870. }
  871. }
  872. }
  873. else
  874. {
  875. return Fail("时间戳验证失败");
  876. }
  877. }
  878. else
  879. {
  880. return Fail("参数错误");
  881. }
  882. }
  883. else
  884. {
  885. return View();
  886. }
  887. }
  888. catch (Exception e)
  889. {
  890. return Fail("参数错误");
  891. }
  892. }
  893. public ActionResult FirstLogin(Perm_FunctionEntity up)
  894. {
  895. string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
  896. if (up != null && !string.IsNullOrEmpty(up.UPId))
  897. {
  898. perm_FunctionIBLL.SaveEntityByUPId(up.UPId, up);
  899. return Redirect("/SSOSystem/GoTo?sysid=" + DESEncrypt.Encrypt(up.FId, publickey) + "&openid=" + DESEncrypt.Encrypt(up.UserId, publickey));
  900. }
  901. string sysid = Request.QueryString["sysid"];
  902. string strsysid = DESEncrypt.Decrypt(sysid, publickey);
  903. string openid = Request.QueryString["openid"];
  904. string userid = DESEncrypt.Decrypt(openid, publickey);
  905. var uplist = permUserPermissionIbll.GetPerm_UserPermissionEntityByFIdAndUid(strsysid, userid);
  906. if (uplist == null)
  907. {
  908. return Fail("用户未授权。");
  909. }
  910. var perfun = perm_FunctionIBLL.GetPerm_FunctionEntityByUPId(uplist.UPId);
  911. return View(perfun);
  912. }
  913. public ActionResult GoTo()
  914. {
  915. try
  916. {
  917. string redi = Request.QueryString["redi"];
  918. if (!string.IsNullOrEmpty(redi))
  919. {
  920. string publickey = ConfigurationManager.AppSettings["SSOPublicSecret"];
  921. string sysid = Request.QueryString["sysid"];
  922. string strsysid = DESEncrypt.Decrypt(sysid, publickey);
  923. string openid = Request.QueryString["openid"];
  924. string userid = DESEncrypt.Decrypt(openid, publickey);
  925. var uplist = permUserPermissionIbll.GetPerm_UserPermissionEntityByFIdAndUid(strsysid, userid);
  926. Perm_FunctionVisitEntity functionVisitEntity = new Perm_FunctionVisitEntity();
  927. functionVisitEntity.Create();
  928. functionVisitEntity.Fid = strsysid;
  929. functionVisitEntity.PDate = DateTime.Now;
  930. functionVisitEntity.PUId = userid;
  931. var userinfo = userBll.GetEntityByUserId(userid);
  932. functionVisitEntity.PUName = userinfo.F_RealName;
  933. if (uplist == null)
  934. {
  935. functionVisitEntity.PIsLoginSuccess = false;
  936. functionVisitEntity.PContent = "用户未授权";
  937. functionVisitIbll.SaveEntity(null, functionVisitEntity);
  938. return Fail("用户未授权。");
  939. }
  940. var perfun = perm_FunctionIBLL.GetPerm_FunctionEntityByUPId(uplist.UPId);
  941. string secretkey = DESEncrypt.Decrypt(perfun.FSecret, publickey);
  942. if (perfun.FIsManagePage == true)
  943. {
  944. if (!string.IsNullOrEmpty(perfun.FInterfaceUrl))
  945. {
  946. if (!string.IsNullOrEmpty(perfun.UPUserName) && !string.IsNullOrEmpty(perfun.UPPass))
  947. {
  948. functionVisitEntity.PIsLoginSuccess = true;
  949. functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl;
  950. functionVisitIbll.SaveEntity(null, functionVisitEntity);
  951. 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));
  952. }
  953. else
  954. {
  955. functionVisitEntity.PIsLoginSuccess = false;
  956. functionVisitEntity.PContent = "用户未配置转到用户名密码配置页面";
  957. functionVisitIbll.SaveEntity(null, functionVisitEntity);
  958. //用户未配置转到用户名密码配置页面
  959. return Redirect("/SSOSystem/FirstLogin?sysid=" + sysid + "&openid=" + openid);
  960. }
  961. }
  962. else
  963. {
  964. functionVisitEntity.PIsLoginSuccess = false;
  965. functionVisitEntity.PContent = "未配置登录接口地址";
  966. functionVisitIbll.SaveEntity(null, functionVisitEntity);
  967. return Fail("未配置登录接口地址。");
  968. }
  969. }
  970. else
  971. {
  972. if (!string.IsNullOrEmpty(perfun.FUrl))
  973. {
  974. functionVisitEntity.PIsLoginSuccess = true;
  975. functionVisitEntity.PContent = "成功转到统一认证网站:" + perfun.FUrl;
  976. functionVisitIbll.SaveEntity(null, functionVisitEntity);
  977. return Redirect(perfun.FUrl);
  978. }
  979. else
  980. {
  981. functionVisitEntity.PIsLoginSuccess = false;
  982. functionVisitEntity.PContent = "未配置地址";
  983. functionVisitIbll.SaveEntity(null, functionVisitEntity);
  984. return Fail("未配置地址。");
  985. }
  986. }
  987. }
  988. else
  989. {
  990. return View();
  991. }
  992. }
  993. catch (Exception e)
  994. {
  995. return Fail("参数错误。");
  996. }
  997. }
  998. /// <summary>
  999. /// 获取IP
  1000. /// </summary>
  1001. /// <returns></returns>
  1002. private string GetIP()
  1003. {
  1004. string ip = string.Empty;
  1005. if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"]))
  1006. ip = Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]);
  1007. if (string.IsNullOrEmpty(ip))
  1008. ip = Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);
  1009. return ip;
  1010. }
  1011. /// <summary>
  1012. /// 网上办事大厅拖拽版-未登录页面
  1013. /// </summary>
  1014. /// <returns></returns>
  1015. public ActionResult NoLogin()
  1016. {
  1017. //获取错误次数
  1018. ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum();
  1019. //获取高职版跳转地址
  1020. ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"];
  1021. ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port;
  1022. //获取登录页二维码配置信息
  1023. ViewBag.HasQRCode = false;
  1024. var qrcodelist = sys_QRCodeInLoginIBLL.GetList().ToList().Where(x => x.EnabledMark == 1).OrderByDescending(x => x.CreateTime);
  1025. if (qrcodelist.Any())
  1026. {
  1027. ViewBag.HasQRCode = true;
  1028. ViewBag.QRCodeUrl = qrcodelist.FirstOrDefault().QRCodeUrl;
  1029. ViewBag.QRCodeText = qrcodelist.FirstOrDefault().Title;
  1030. }
  1031. //微信快捷登录
  1032. var result4 = teachSwitchIBLL.FindFirst("wxloginforpc");
  1033. ViewBag.WeixinLoginSwitch = result4;
  1034. return View("DragNoLogin");
  1035. }
  1036. /// <summary>
  1037. /// 网上办事大厅拖拽版-未登录页面-微信登录
  1038. /// </summary>
  1039. /// <returns></returns>
  1040. public ActionResult DragNoWxLogin()
  1041. {
  1042. string QQOpenId = Request.QueryString["QQOpenId"];
  1043. string WeixinOpenId = Request.QueryString["WeixinOpenId"];
  1044. ViewBag.WeixinOpenId = WeixinOpenId;
  1045. ViewBag.QQOpenId = QQOpenId;
  1046. //获取错误次数
  1047. ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum();
  1048. //获取高职版跳转地址
  1049. ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"];
  1050. ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port;
  1051. //获取登录页二维码配置信息
  1052. ViewBag.HasQRCode = false;
  1053. var qrcodelist = sys_QRCodeInLoginIBLL.GetList().ToList().Where(x => x.EnabledMark == 1).OrderByDescending(x => x.CreateTime);
  1054. if (qrcodelist.Any())
  1055. {
  1056. ViewBag.HasQRCode = true;
  1057. ViewBag.QRCodeUrl = qrcodelist.FirstOrDefault().QRCodeUrl;
  1058. ViewBag.QRCodeText = qrcodelist.FirstOrDefault().Title;
  1059. }
  1060. return View();
  1061. }
  1062. /// <summary>
  1063. /// 网上办事大厅拖拽版-办事大厅模式
  1064. /// </summary>
  1065. /// <returns></returns>
  1066. public ActionResult DragModelOne()
  1067. {
  1068. //判断登录状态码
  1069. string account = "";
  1070. if (!Request.Headers["account"].IsEmpty())
  1071. {
  1072. account = Request.Headers["account"].ToString();
  1073. }
  1074. OperatorHelper helper = new OperatorHelper();
  1075. var result = helper.IsOnLine(account);
  1076. if (result.stateCode != 1)
  1077. {
  1078. return Redirect("NoLogin");
  1079. }
  1080. //登录用户
  1081. var userInfo = LoginUserInfo.Get();
  1082. ViewBag.UserId = userInfo.userId;
  1083. //桌面管理表、卡片块排序管理表增加默认数据
  1084. sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "one");
  1085. //获取桌面、卡片块排序列表
  1086. ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "one").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate);
  1087. ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList);
  1088. //分页查询条件设置
  1089. Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
  1090. //邮件-收件箱
  1091. var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
  1092. var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
  1093. ViewBag.LanMail = maildata;
  1094. ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail);
  1095. ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0);
  1096. //邮件-已发送
  1097. paginationobj.sidx = "SENDTIME desc";
  1098. var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
  1099. var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}");
  1100. ViewBag.LanMailSend = mailsenddata;
  1101. ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend);
  1102. //来往邮件数量
  1103. ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count();
  1104. //公文
  1105. paginationobj.sidx = "SendTime";
  1106. ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
  1107. ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList);
  1108. //公告
  1109. List<NewsEntity> outnewslist = new List<NewsEntity>();
  1110. var newsList = newsIBLL.GetList("", userInfo.userId);
  1111. foreach (var newsitemEntity in newsList)
  1112. {
  1113. if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  1114. {
  1115. if (!string.IsNullOrEmpty(userInfo.postIds))
  1116. {
  1117. if (userInfo.postIds.Contains(","))
  1118. {
  1119. foreach (var postid in userInfo.postIds.Split(','))
  1120. {
  1121. if (newsitemEntity.F_SendPostId.Contains(postid))
  1122. {
  1123. outnewslist.Add(newsitemEntity);
  1124. break;
  1125. }
  1126. }
  1127. }
  1128. else
  1129. {
  1130. if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
  1131. {
  1132. outnewslist.Add(newsitemEntity);
  1133. }
  1134. }
  1135. }
  1136. }
  1137. else
  1138. {
  1139. if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  1140. {
  1141. if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
  1142. {
  1143. outnewslist.Add(newsitemEntity);
  1144. }
  1145. }
  1146. else
  1147. {
  1148. outnewslist.Add(newsitemEntity);
  1149. }
  1150. }
  1151. }
  1152. ViewBag.NewsList = outnewslist.Take(5);
  1153. ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList);
  1154. //宣传报道
  1155. var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4);
  1156. foreach (var item in newsListOfxuanchuan)
  1157. {
  1158. if (!string.IsNullOrEmpty(item.F_NewsImage))
  1159. {
  1160. var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
  1161. if (!string.IsNullOrEmpty(imagePath))
  1162. {
  1163. item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
  1164. }
  1165. else
  1166. {
  1167. item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
  1168. }
  1169. }
  1170. }
  1171. ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
  1172. ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
  1173. //智慧教育
  1174. ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
  1175. ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
  1176. //专题推荐
  1177. var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
  1178. foreach (var item in newsListOfzhuanti)
  1179. {
  1180. if (!string.IsNullOrEmpty(item.F_NewsImage))
  1181. {
  1182. var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
  1183. if (!string.IsNullOrEmpty(imagePath))
  1184. {
  1185. item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
  1186. }
  1187. else
  1188. {
  1189. item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
  1190. }
  1191. }
  1192. }
  1193. ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
  1194. ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
  1195. //办公事项-待办任务
  1196. paginationobj.sidx = "F_CreateDate";
  1197. paginationobj.rows = 4;
  1198. var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
  1199. ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
  1200. ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
  1201. ViewBag.TaskTotalNum = taskListAll.Count();
  1202. //办公事项-已办任务
  1203. var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
  1204. ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
  1205. ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
  1206. ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
  1207. //办公事项-我发起的
  1208. var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
  1209. ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
  1210. ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
  1211. ViewBag.MyListTotalNum = myListAll.Count();
  1212. //常用服务
  1213. List<ModuleEntity> modulelist = new List<ModuleEntity>();
  1214. List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
  1215. 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));
  1216. foreach (var oitem in offenused)
  1217. {
  1218. ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
  1219. if (fod != null)
  1220. {
  1221. //找父级
  1222. if (fod.F_ParentId == "0")
  1223. {
  1224. fod.ParentName = fod.F_FullName;
  1225. fod.F_ParentId = fod.F_ModuleId;
  1226. }
  1227. else
  1228. {
  1229. var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
  1230. if (parent1 != null)
  1231. {
  1232. if (parent1.F_ParentId == "0")
  1233. {
  1234. fod.ParentName = parent1.F_FullName;
  1235. fod.F_ParentId = parent1.F_ModuleId;
  1236. }
  1237. else
  1238. {
  1239. //下一级
  1240. var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
  1241. if (parent2 != null)
  1242. {
  1243. if (parent2.F_ParentId == "0")
  1244. {
  1245. fod.ParentName = parent2.F_FullName;
  1246. fod.F_ParentId = parent2.F_ModuleId;
  1247. }
  1248. else
  1249. {
  1250. //下一级
  1251. var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
  1252. if (parent3 != null)
  1253. {
  1254. if (parent3.F_ParentId == "0")
  1255. {
  1256. fod.ParentName = parent3.F_FullName;
  1257. fod.F_ParentId = parent3.F_ModuleId;
  1258. }
  1259. else
  1260. {
  1261. //下一级
  1262. var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
  1263. if (parent4 != null)
  1264. {
  1265. if (parent4.F_ParentId == "0")
  1266. {
  1267. fod.ParentName = parent4.F_FullName;
  1268. fod.F_ParentId = parent4.F_ModuleId;
  1269. }
  1270. }
  1271. }
  1272. }
  1273. }
  1274. }
  1275. }
  1276. }
  1277. }
  1278. modulelist.Add(fod);
  1279. }
  1280. }
  1281. ViewBag.OffenusedAll = modulelist;
  1282. var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
  1283. {
  1284. F_ParentId = x.Key,
  1285. ParentName = x.FirstOrDefault().ParentName,
  1286. ChildrenList = x.Select(y => new ModuleEntity()
  1287. {
  1288. F_ModuleId = y.F_ModuleId,
  1289. F_FullName = y.F_FullName
  1290. }).ToList()
  1291. }).ToList();
  1292. ViewBag.OffenusedGroup = mm;
  1293. ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
  1294. //查找服务
  1295. List<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
  1296. foreach (var item in moduledata)
  1297. {
  1298. if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
  1299. {
  1300. item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
  1301. searchmodulelist.Add(item);
  1302. }
  1303. }
  1304. ViewBag.SearchModule = searchmodulelist;
  1305. //校园总览
  1306. //专业
  1307. var majorData = cdMajorIBLL.GetAllList();
  1308. ViewBag.MajorTotalNum = majorData.Count();
  1309. //班级
  1310. var classInfoData = classInfoIBLL.GetAllClass();
  1311. ViewBag.ClassInfoTotalNum = classInfoData.Count();
  1312. //学生
  1313. var stuInfoData = stuInfoBasicIBLL.GetAllList();
  1314. ViewBag.StuInfoTotalNum = stuInfoData.Count();
  1315. //教师
  1316. var teacherData = empInfoIBLL.GetAllList();
  1317. ViewBag.TeacherTotalNum = teacherData.Count();
  1318. //教室
  1319. var classRoomData = classroomInfoIBLL.GetAllList();
  1320. ViewBag.ClassRoomTotalNum = classRoomData.Count();
  1321. //课程
  1322. var lessonData = lessonInfoIBLL.GetAllList();
  1323. ViewBag.LessonTotalNum = lessonData.Count();
  1324. //专业总览
  1325. //专业学生
  1326. var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
  1327. {
  1328. value = x.Select(y => y.StuId).Count(),
  1329. name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
  1330. });
  1331. ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
  1332. //流程
  1333. var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
  1334. var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  1335. var allCount = 0;
  1336. foreach (var flow in flowType)
  1337. {
  1338. var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
  1339. flow.FlowCount = count;
  1340. allCount += count;
  1341. }
  1342. ViewBag.AllCount = allCount;
  1343. ViewBag.FlowType = flowType;
  1344. ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
  1345. //校园一卡通余额
  1346. ViewBag.StuSaveRecordTotalNum = 0;
  1347. var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
  1348. if (stuSaveRecordList.Any())
  1349. {
  1350. ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
  1351. }
  1352. //红湖付款码余额
  1353. ViewBag.StuConsumptionTotalNum = 0;
  1354. var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
  1355. if (stuConsumptionList.Any())
  1356. {
  1357. ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
  1358. }
  1359. //常用链接
  1360. var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
  1361. var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
  1362. {
  1363. FTName = x.Key,
  1364. PFunctionList = x.Select(y => new Perm_FunctionEntity()
  1365. {
  1366. FId = y.FId,
  1367. FTId = y.FTId,
  1368. FName = y.FName,
  1369. UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
  1370. UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
  1371. }).Take(8).ToList()
  1372. });
  1373. ViewBag.FunctionList = ff;
  1374. ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
  1375. return View();
  1376. }
  1377. /// <summary>
  1378. /// 网上办事大厅拖拽版-效率优先模式
  1379. /// </summary>
  1380. /// <returns></returns>
  1381. public ActionResult DragModelTwo()
  1382. {
  1383. //判断登录状态码
  1384. string account = "";
  1385. if (!Request.Headers["account"].IsEmpty())
  1386. {
  1387. account = Request.Headers["account"].ToString();
  1388. }
  1389. OperatorHelper helper = new OperatorHelper();
  1390. var result = helper.IsOnLine(account);
  1391. if (result.stateCode != 1)
  1392. {
  1393. return Redirect("NoLogin");
  1394. }
  1395. //登录用户
  1396. var userInfo = LoginUserInfo.Get();
  1397. ViewBag.UserId = userInfo.userId;
  1398. //桌面管理表、卡片块排序管理表增加默认数据
  1399. sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "two");
  1400. //获取桌面、卡片块排序列表
  1401. ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "two").OrderByDescending(x => x.DefaultFlag).ThenBy(x => x.Sort).ThenBy(x => x.CreateDate);
  1402. ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList);
  1403. //分页查询条件设置
  1404. Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" };
  1405. //邮件-收件箱
  1406. var maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
  1407. var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
  1408. ViewBag.LanMail = maildata;
  1409. ViewBag.LanMailStr = JsonConvert.SerializeObject(ViewBag.LanMail);
  1410. ViewBag.LanMailUnReadCount = maildataAll.Count(m => m.READFLAG == 0);
  1411. //邮件-已发送
  1412. paginationobj.sidx = "SENDTIME desc";
  1413. var mailsenddata = sYS_SendMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
  1414. var mailsenddataAll = sYS_SendMessageIBLL.GetList2("{\"userId\":\"" + userInfo.userId + "\"}");
  1415. ViewBag.LanMailSend = mailsenddata;
  1416. ViewBag.LanMailSendStr = JsonConvert.SerializeObject(ViewBag.LanMailSend);
  1417. //来往邮件数量
  1418. ViewBag.LanMailTotalNum = maildataAll.Count() + mailsenddataAll.Count();
  1419. //公文
  1420. paginationobj.sidx = "SendTime";
  1421. ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userInfo.userId + "\"}");
  1422. ViewBag.ReceiveFileListStr = JsonConvert.SerializeObject(ViewBag.ReceiveFileList);
  1423. //公告
  1424. List<NewsEntity> outnewslist = new List<NewsEntity>();
  1425. var newsList = newsIBLL.GetList("", userInfo.userId);
  1426. foreach (var newsitemEntity in newsList)
  1427. {
  1428. if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
  1429. {
  1430. if (!string.IsNullOrEmpty(userInfo.postIds))
  1431. {
  1432. if (userInfo.postIds.Contains(","))
  1433. {
  1434. foreach (var postid in userInfo.postIds.Split(','))
  1435. {
  1436. if (newsitemEntity.F_SendPostId.Contains(postid))
  1437. {
  1438. outnewslist.Add(newsitemEntity);
  1439. break;
  1440. }
  1441. }
  1442. }
  1443. else
  1444. {
  1445. if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
  1446. {
  1447. outnewslist.Add(newsitemEntity);
  1448. }
  1449. }
  1450. }
  1451. }
  1452. else
  1453. {
  1454. if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
  1455. {
  1456. if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
  1457. {
  1458. outnewslist.Add(newsitemEntity);
  1459. }
  1460. }
  1461. else
  1462. {
  1463. outnewslist.Add(newsitemEntity);
  1464. }
  1465. }
  1466. }
  1467. ViewBag.NewsList = outnewslist.Take(5);
  1468. ViewBag.NewsListStr = JsonConvert.SerializeObject(ViewBag.NewsList);
  1469. //宣传报道
  1470. var newsListOfxuanchuan = outnewslist.Where(x => x.F_CategoryId == "15").Take(4);
  1471. foreach (var item in newsListOfxuanchuan)
  1472. {
  1473. if (!string.IsNullOrEmpty(item.F_NewsImage))
  1474. {
  1475. var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
  1476. if (!string.IsNullOrEmpty(imagePath))
  1477. {
  1478. item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
  1479. }
  1480. else
  1481. {
  1482. item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
  1483. }
  1484. }
  1485. }
  1486. ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
  1487. ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
  1488. //智慧教育
  1489. ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
  1490. ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
  1491. //专题推荐
  1492. var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
  1493. foreach (var item in newsListOfzhuanti)
  1494. {
  1495. if (!string.IsNullOrEmpty(item.F_NewsImage))
  1496. {
  1497. var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
  1498. if (!string.IsNullOrEmpty(imagePath))
  1499. {
  1500. item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
  1501. }
  1502. else
  1503. {
  1504. item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
  1505. }
  1506. }
  1507. }
  1508. ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
  1509. ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
  1510. //办公事项-待办任务
  1511. paginationobj.sidx = "F_CreateDate";
  1512. paginationobj.rows = 4;
  1513. var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
  1514. ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
  1515. ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
  1516. ViewBag.TaskTotalNum = taskListAll.Count();
  1517. //办公事项-已办任务
  1518. var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
  1519. ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
  1520. ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
  1521. ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
  1522. //办公事项-我发起的
  1523. var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
  1524. ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
  1525. ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
  1526. ViewBag.MyListTotalNum = myListAll.Count();
  1527. //常用服务
  1528. List<ModuleEntity> modulelist = new List<ModuleEntity>();
  1529. List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
  1530. 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));
  1531. foreach (var oitem in offenused)
  1532. {
  1533. ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
  1534. if (fod != null)
  1535. {
  1536. //找父级
  1537. if (fod.F_ParentId == "0")
  1538. {
  1539. fod.ParentName = fod.F_FullName;
  1540. fod.F_ParentId = fod.F_ModuleId;
  1541. }
  1542. else
  1543. {
  1544. var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
  1545. if (parent1 != null)
  1546. {
  1547. if (parent1.F_ParentId == "0")
  1548. {
  1549. fod.ParentName = parent1.F_FullName;
  1550. fod.F_ParentId = parent1.F_ModuleId;
  1551. }
  1552. else
  1553. {
  1554. //下一级
  1555. var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
  1556. if (parent2 != null)
  1557. {
  1558. if (parent2.F_ParentId == "0")
  1559. {
  1560. fod.ParentName = parent2.F_FullName;
  1561. fod.F_ParentId = parent2.F_ModuleId;
  1562. }
  1563. else
  1564. {
  1565. //下一级
  1566. var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
  1567. if (parent3 != null)
  1568. {
  1569. if (parent3.F_ParentId == "0")
  1570. {
  1571. fod.ParentName = parent3.F_FullName;
  1572. fod.F_ParentId = parent3.F_ModuleId;
  1573. }
  1574. else
  1575. {
  1576. //下一级
  1577. var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
  1578. if (parent4 != null)
  1579. {
  1580. if (parent4.F_ParentId == "0")
  1581. {
  1582. fod.ParentName = parent4.F_FullName;
  1583. fod.F_ParentId = parent4.F_ModuleId;
  1584. }
  1585. }
  1586. }
  1587. }
  1588. }
  1589. }
  1590. }
  1591. }
  1592. }
  1593. modulelist.Add(fod);
  1594. }
  1595. }
  1596. ViewBag.OffenusedAll = modulelist;
  1597. var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
  1598. {
  1599. F_ParentId = x.Key,
  1600. ParentName = x.FirstOrDefault().ParentName,
  1601. ChildrenList = x.Select(y => new ModuleEntity()
  1602. {
  1603. F_ModuleId = y.F_ModuleId,
  1604. F_FullName = y.F_FullName
  1605. }).ToList()
  1606. }).ToList();
  1607. ViewBag.OffenusedGroup = mm;
  1608. ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
  1609. //todo:
  1610. //删begin
  1611. ViewBag.OffenusedJiao = modulelist.Where(x => x.F_FullName.Contains("教"));
  1612. ViewBag.OffenusedGuan = modulelist.Where(x => x.F_FullName.Contains("管理"));
  1613. ViewBag.Offenused = modulelist.Except(modulelist.Where(x => x.F_FullName.Contains("教") || x.F_FullName.Contains("管理"))).Take(6);
  1614. ViewBag.OffenusedJiaoStr = JsonConvert.SerializeObject(ViewBag.OffenusedJiao);
  1615. ViewBag.OffenusedGuanStr = JsonConvert.SerializeObject(ViewBag.OffenusedGuan);
  1616. ViewBag.OffenusedStr = JsonConvert.SerializeObject(ViewBag.Offenused);
  1617. //删end
  1618. //查找服务
  1619. List<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
  1620. foreach (var item in moduledata)
  1621. {
  1622. if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
  1623. {
  1624. item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
  1625. searchmodulelist.Add(item);
  1626. }
  1627. }
  1628. ViewBag.SearchModule = searchmodulelist;
  1629. //校园总览
  1630. //专业
  1631. var majorData = cdMajorIBLL.GetAllList();
  1632. ViewBag.MajorTotalNum = majorData.Count();
  1633. //班级
  1634. var classInfoData = classInfoIBLL.GetAllClass();
  1635. ViewBag.ClassInfoTotalNum = classInfoData.Count();
  1636. //学生
  1637. var stuInfoData = stuInfoBasicIBLL.GetAllList();
  1638. ViewBag.StuInfoTotalNum = stuInfoData.Count();
  1639. //教师
  1640. var teacherData = empInfoIBLL.GetAllList();
  1641. ViewBag.TeacherTotalNum = teacherData.Count();
  1642. //教室
  1643. var classRoomData = classroomInfoIBLL.GetAllList();
  1644. ViewBag.ClassRoomTotalNum = classRoomData.Count();
  1645. //课程
  1646. var lessonData = lessonInfoIBLL.GetAllList();
  1647. ViewBag.LessonTotalNum = lessonData.Count();
  1648. //专业总览
  1649. //专业学生
  1650. var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
  1651. {
  1652. value = x.Select(y => y.StuId).Count(),
  1653. name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
  1654. });
  1655. ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
  1656. //流程
  1657. var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
  1658. var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  1659. var allCount = 0;
  1660. foreach (var flow in flowType)
  1661. {
  1662. var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
  1663. flow.FlowCount = count;
  1664. allCount += count;
  1665. }
  1666. ViewBag.AllCount = allCount;
  1667. ViewBag.FlowType = flowType;
  1668. ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
  1669. //校园一卡通余额
  1670. ViewBag.StuSaveRecordTotalNum = 0;
  1671. var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
  1672. if (stuSaveRecordList.Any())
  1673. {
  1674. ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
  1675. }
  1676. //红湖付款码余额
  1677. ViewBag.StuConsumptionTotalNum = 0;
  1678. var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
  1679. if (stuConsumptionList.Any())
  1680. {
  1681. ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
  1682. }
  1683. //常用链接
  1684. var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
  1685. var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
  1686. {
  1687. FTName = x.Key,
  1688. PFunctionList = x.Select(y => new Perm_FunctionEntity()
  1689. {
  1690. FId = y.FId,
  1691. FTId = y.FTId,
  1692. FName = y.FName,
  1693. UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
  1694. UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
  1695. }).Take(8).ToList()
  1696. });
  1697. ViewBag.FunctionList = ff;
  1698. ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
  1699. return View();
  1700. }
  1701. /// <summary>
  1702. /// 网上办事大厅拖拽版-管理驾驶舱模式
  1703. /// </summary>
  1704. /// <returns></returns>
  1705. public ActionResult DragModelThree()
  1706. {
  1707. //判断登录状态码
  1708. string account = "";
  1709. if (!Request.Headers["account"].IsEmpty())
  1710. {
  1711. account = Request.Headers["account"].ToString();
  1712. }
  1713. OperatorHelper helper = new OperatorHelper();
  1714. var result = helper.IsOnLine(account);
  1715. if (result.stateCode != 1)
  1716. {
  1717. return Redirect("NoLogin");
  1718. }
  1719. //登录用户
  1720. var userInfo = LoginUserInfo.Get();
  1721. ViewBag.UserId = userInfo.userId;
  1722. //校园总览
  1723. //专业
  1724. var majorData = cdMajorIBLL.GetAllList();
  1725. ViewBag.MajorTotalNum = majorData.Count();
  1726. //班级
  1727. var classInfoData = classInfoIBLL.GetAllClass();
  1728. ViewBag.ClassInfoTotalNum = classInfoData.Count();
  1729. //学生
  1730. var stuInfoData = stuInfoBasicIBLL.GetAllList();
  1731. ViewBag.StuInfoTotalNum = stuInfoData.Count();
  1732. ViewBag.StuInfoTotalNumOfMan = stuInfoData.Where(x => x.GenderNo == true).Count();
  1733. //教师
  1734. var teacherData = empInfoIBLL.GetAllList();
  1735. ViewBag.TeacherTotalNum = teacherData.Count();
  1736. ViewBag.TeacherTotalNumOfMan = teacherData.Where(x => x.GenderNo == true).Count();
  1737. ViewBag.TeacherTotalNumOfBianNei = teacherData.Where(x => x.CompilationCategory == "01").Count();
  1738. //教室
  1739. var classRoomData = classroomInfoIBLL.GetAllList();
  1740. ViewBag.ClassRoomTotalNum = classRoomData.Count();
  1741. //专业总览
  1742. //专业学生
  1743. var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
  1744. {
  1745. value = x.Select(y => y.StuId).Count(),
  1746. name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
  1747. });
  1748. ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
  1749. //流程
  1750. var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
  1751. var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
  1752. var allCount = 0;
  1753. foreach (var flow in flowType)
  1754. {
  1755. var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
  1756. flow.FlowCount = count;
  1757. allCount += count;
  1758. }
  1759. ViewBag.AllCount = allCount;
  1760. ViewBag.FlowType = flowType;
  1761. ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
  1762. //课程总览
  1763. var lessonInfoData = lessonInfoIBLL.GetAllList();
  1764. ViewBag.LessonTotalNum = lessonInfoData.Count();
  1765. ViewBag.OpenLessonTotalNum = lessonInfoData.Where(x => x.CheckMark == true).Count();
  1766. //课程分类下的课程
  1767. var lessonBySort = lessonInfoData.GroupBy(x => x.LessonSortNo).Select(x => new
  1768. {
  1769. value = x.Select(y => y.LessonId).Count(),
  1770. name = cdLessonSortIBLL.GetCdLessonSortEntityByNo(x.Key)?.LessonSortName
  1771. });
  1772. ViewBag.LessonBySortStr = JsonConvert.SerializeObject(lessonBySort);
  1773. //课程类型下的课程
  1774. var lessonByType = lessonInfoData.GroupBy(x => x.LessonTypeId).Select(x => new
  1775. {
  1776. value = x.Select(y => y.LessonId).Count(),
  1777. name = cdLessonTypeIBLL.GetCdLessonTypeEntity(x.Key)?.LessonTypeName
  1778. });
  1779. ViewBag.LessonByTypeStr = JsonConvert.SerializeObject(lessonByType);
  1780. //教师总览
  1781. //教师学历比例
  1782. var teacherByHighestRecord = teacherData.Where(x => !string.IsNullOrEmpty(x.HighestRecord)).GroupBy(x => x.HighestRecord).Select(x => new
  1783. {
  1784. value = x.Select(y => y.EmpId).Count(),
  1785. name = bCdCultureDegreeIBLL.GetEntity(x.Key)?.CultureDegree
  1786. }).OrderByDescending(x => x.value);
  1787. ViewBag.TeacherByHighestRecordStr = JsonConvert.SerializeObject(teacherByHighestRecord);
  1788. //教师年龄比例
  1789. var empInfoAgeRate = empInfoIBLL.GetEmpInfoAgeRate();
  1790. var teacherByAge = new List<object>() {
  1791. new { value = empInfoAgeRate.age1, name = "60岁以上" },
  1792. new { value = empInfoAgeRate.age2, name = "50~60岁" },
  1793. new { value = empInfoAgeRate.age3, name = "40~50岁" },
  1794. new { value = empInfoAgeRate.age4, name = "30~40岁" },
  1795. new { value = empInfoAgeRate.age5, name = "20~30岁" },
  1796. };
  1797. ViewBag.TeacherByAgeStr = JsonConvert.SerializeObject(teacherByAge);
  1798. //学生总览
  1799. //学生成绩预警
  1800. var stuScoreData = stuScoreNotPassIBLL.GetList("{}").Where(x => x.Score == 0).Select(x => new { x.StuNo, x.MajorNo }).Distinct();
  1801. ViewBag.StuScoreWarnTotalNum = stuScoreData.Count();
  1802. var stuScoreByMajor = stuScoreData.GroupBy(x => x.MajorNo).Select(x => new
  1803. {
  1804. value = x.Select(y => y.StuNo).Count(),
  1805. name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
  1806. });
  1807. ViewBag.StuScoreByMajorStr = JsonConvert.SerializeObject(stuScoreByMajor);
  1808. //常用服务
  1809. List<ModuleEntity> modulelist = new List<ModuleEntity>();
  1810. List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
  1811. 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));
  1812. foreach (var oitem in offenused)
  1813. {
  1814. ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
  1815. if (fod != null)
  1816. {
  1817. //找父级
  1818. if (fod.F_ParentId == "0")
  1819. {
  1820. fod.ParentName = fod.F_FullName;
  1821. fod.F_ParentId = fod.F_ModuleId;
  1822. }
  1823. else
  1824. {
  1825. var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
  1826. if (parent1 != null)
  1827. {
  1828. if (parent1.F_ParentId == "0")
  1829. {
  1830. fod.ParentName = parent1.F_FullName;
  1831. fod.F_ParentId = parent1.F_ModuleId;
  1832. }
  1833. else
  1834. {
  1835. //下一级
  1836. var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
  1837. if (parent2 != null)
  1838. {
  1839. if (parent2.F_ParentId == "0")
  1840. {
  1841. fod.ParentName = parent2.F_FullName;
  1842. fod.F_ParentId = parent2.F_ModuleId;
  1843. }
  1844. else
  1845. {
  1846. //下一级
  1847. var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
  1848. if (parent3 != null)
  1849. {
  1850. if (parent3.F_ParentId == "0")
  1851. {
  1852. fod.ParentName = parent3.F_FullName;
  1853. fod.F_ParentId = parent3.F_ModuleId;
  1854. }
  1855. else
  1856. {
  1857. //下一级
  1858. var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
  1859. if (parent4 != null)
  1860. {
  1861. if (parent4.F_ParentId == "0")
  1862. {
  1863. fod.ParentName = parent4.F_FullName;
  1864. fod.F_ParentId = parent4.F_ModuleId;
  1865. }
  1866. }
  1867. }
  1868. }
  1869. }
  1870. }
  1871. }
  1872. }
  1873. }
  1874. modulelist.Add(fod);
  1875. }
  1876. }
  1877. ViewBag.OffenusedAll = modulelist;
  1878. //查找服务
  1879. List<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
  1880. foreach (var item in moduledata)
  1881. {
  1882. if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
  1883. {
  1884. item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
  1885. searchmodulelist.Add(item);
  1886. }
  1887. }
  1888. ViewBag.SearchModule = searchmodulelist;
  1889. return View();
  1890. }
  1891. /// <summary>
  1892. /// 网上办事大厅拖拽版-保存卡片块排序
  1893. /// </summary>
  1894. /// <returns></returns>
  1895. public ActionResult SaveCardSort(string userId, string modelCode, string desktopId, string cardSort)
  1896. {
  1897. sSO_Drag_CardSortManageIBLL.SaveCardSort(userId, modelCode, desktopId, cardSort);
  1898. return Success("操作成功");
  1899. }
  1900. /// <summary>
  1901. /// 网上办事大厅拖拽版-新增桌面
  1902. /// </summary>
  1903. /// <returns></returns>
  1904. public ActionResult AddDesktop(string userId, string modelCode, string desktopName, string desktopCode)
  1905. {
  1906. sSO_Drag_DesktopManageIBLL.AddDesktop(userId, modelCode, desktopName, desktopCode);
  1907. var data = sSO_Drag_DesktopManageIBLL.GetEntityByDesktopCode(userId, modelCode, desktopCode);
  1908. return Success("操作成功", data);
  1909. }
  1910. /// <summary>
  1911. /// 网上办事大厅拖拽版-删除桌面
  1912. /// </summary>
  1913. /// <returns></returns>
  1914. public ActionResult DeleteDesktop(string desktopId)
  1915. {
  1916. sSO_Drag_DesktopManageIBLL.DeleteEntity(desktopId);
  1917. return Success("操作成功");
  1918. }
  1919. /// <summary>
  1920. /// 网上办事大厅拖拽版-修改桌面
  1921. /// </summary>
  1922. /// <returns></returns>
  1923. public ActionResult ModifyDesktop(string desktopId, string desktopName)
  1924. {
  1925. var entity = new SSO_Drag_DesktopManageEntity()
  1926. {
  1927. DesktopName = desktopName
  1928. };
  1929. sSO_Drag_DesktopManageIBLL.SaveEntity(desktopId, entity);
  1930. return Success("操作成功");
  1931. }
  1932. /// <summary>
  1933. /// 网上办事大厅拖拽版-默认桌面恢复默认设置
  1934. /// </summary>
  1935. /// <returns></returns>
  1936. public ActionResult RestoreDefaultDesktop(string desktopId)
  1937. {
  1938. sSO_Drag_DesktopManageIBLL.RestoreDefaultDesktop(desktopId);
  1939. return Success("操作成功");
  1940. }
  1941. }
  1942. }