Browse Source

Merge branch '塔里木分支' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 塔里木分支

新疆影视学院高职
zhangli 3 years ago
parent
commit
88035ba37c
9 changed files with 520 additions and 71 deletions
  1. +5
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Form.js
  2. +4
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js
  3. +200
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/Form.js
  5. +253
    -62
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs
  6. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml
  7. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs
  8. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs
  9. +30
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs

+ 5
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Form.js View File

@@ -135,8 +135,11 @@ var bootstrap = function ($, learun) {
//$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
//$('#PostRank').lrDataSourceSelect({ code: 'BCdTitleOfTechPost', value: 'titleoftechpostno', text: 'titleoftechpost' });
$('#Photo').lrUploader();
$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
//$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
$('#HighestRecord').lrDataItemSelect({ code: 'HighestEducation'});

//$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' });
$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'HighestEducationAcquisitionMode' });
$('#InitialDegree').lrDataSourceSelect({ code: 'BCdDegree', value: 'degreeno', text: 'degreename' });
$('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });
$('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' });


+ 4
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js View File

@@ -50,7 +50,7 @@ var bootstrap = function ($, learun) {
//政治面貌
$('#PartyFaceNo').lrDataSourceSelect({ code: 'BCdPartyFace', value: 'partyfaceno', text: 'partyface' });
//最高学历
$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
$('#HighestRecord').lrDataItemSelect({ code: 'HighestEducation'});


//民族
@@ -464,12 +464,11 @@ var bootstrap = function ($, learun) {
{
label: "最高学历", name: "HighestRecord", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree',
learun.clientdata.getAsync('dataItem', {
key: value,
keyId: 'culturedegreeno',
code: 'HighestEducation',
callback: function (_data) {
callback(_data['culturedegree']);
callback(_data.text);
}
});
}


+ 200
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs View File

@@ -31,6 +31,12 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
{
private NoticeIBLL noticeIBLL = new NoticeBLL();
private DataItemIBLL dataItemIbll = new DataItemBLL();
private Sys_InformationPushIBLL sys_InformationPushIBLL = new Sys_InformationPushBLL();
private MessageRindIBLL messageRindIBLL = new MessageRindBLL();
private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL();
private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL();
private UserIBLL userIbll = new UserBLL();
private UserRelationIBLL userRelationIBLL = new UserRelationBLL();

private DepartmentReleasePermissionsIBLL departmentReleasePermissionsIbll =
new DepartmentReleasePermissionsBLL();
@@ -316,7 +322,200 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
return Success("保存成功!");
}

[HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)]
public ActionResult SaveFormAndSubmit(string keyValue, NewsEntity entity)
{
entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent);
noticeIBLL.SaveFormAndSubmit(keyValue, entity);
//推送通知
//读取信息推送管理-通知公告推送(01)的配置
var informationPushEntity = sys_InformationPushIBLL.GetEntityByPushItem("01");
if (informationPushEntity != null && informationPushEntity.Status == true)
{
//推送微信
Task.Run(async () => { await DoWeixinPush(entity); });
}
if (entity.F_IsSendFX.HasValue && entity.F_IsSendFX == true)
{
Task.Run(async () =>
{
using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"]))
{
var hubProxy = hubConnection.CreateHubProxy("SignalRHub");
await hubConnection.Start();
await hubProxy.Invoke("PushAnnouncement", entity.F_NewsId, entity.F_FullHead, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(entity.F_NewsContent)).Substring(0, 20), "news", entity.F_SendPostId, entity.F_SendDeptId);
}
});
}
return Success("保存成功!");
}
Task DoWeixinPush(NewsEntity entity)
{
//微信推送
try
{
var allteacherlist = userIbll.GetAllList().Where(m =>
m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师");
var userralationlist = userRelationIBLL.GetUserIdList("2");
var needpostuserlist = new List<UserEntity>();
if (!string.IsNullOrEmpty(entity.F_SendDeptId))
{
if (!entity.F_SendDeptId.Contains(","))
{
var departteacherlist = allteacherlist.Where(m => entity.F_SendDeptId == m.F_DepartmentId);
needpostuserlist.AddRange(departteacherlist.ToList());
if (!string.IsNullOrEmpty(entity.F_SendPostId))
{
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in needpostuserlist)
{
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId));
if (postids > 0)
{
newpostuserlist.Add(uuitem);
}
}
needpostuserlist = newpostuserlist;
}
}
else
{
foreach (var senddeptid in entity.F_SendDeptId.Split(','))
{
var departteacherlist = allteacherlist.Where(m => senddeptid == m.F_DepartmentId);
needpostuserlist.AddRange(departteacherlist.ToList());
if (!string.IsNullOrEmpty(entity.F_SendPostId))
{
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in needpostuserlist)
{
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId));
if (postids > 0)
{
newpostuserlist.Add(uuitem);
}
}
needpostuserlist = newpostuserlist;
}
}
}
}
else
{
if (!string.IsNullOrEmpty(entity.F_SendPostId))
{
//岗位下发
var newpostuserlist = new List<UserEntity>();
foreach (var uuitem in allteacherlist)
{
var postids = userralationlist?.Count(m => m.F_UserId == uuitem.F_UserId && entity.F_SendPostId.Contains(m.F_ObjectId));
if (postids > 0)
{
newpostuserlist.Add(uuitem);
}
}
needpostuserlist = newpostuserlist;
}
else
{
//全员下发
needpostuserlist = allteacherlist.ToList();
}
}
PushWeixin(needpostuserlist, entity.F_FullHead);

//消息提醒表
PushMessageRemind(needpostuserlist, entity);
return Task.CompletedTask;
}
catch (Exception e)
{
return Task.FromException(e);
}
}

public void PushWeixin(List<UserEntity> needpostuserlist, string title)
{
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity();
string appid = WeChatConfigentity.APPId;
string secret = WeChatConfigentity.secret;
var wechatemplete = weChatTempletIbll.GetWeChatTemplateEntityByCodeConfigId(WeChatConfigentity.ID, "task");
string weixintaskurl = wechatemplete.TUrl;
string weixintasktempid = wechatemplete.TempId;
var responsejson = Util.HttpMethods.HttpGet("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret);

OperateLogModel operateLogModel = new OperateLogModel();
operateLogModel.title = title;
operateLogModel.type = OperationType.Other;
operateLogModel.url = "NoticeController";
operateLogModel.sourceObjectId = "002";
operateLogModel.sourceContentJson = responsejson;
OperatorHelper.Instance.WriteOperateLog(operateLogModel);

foreach (UserEntity userinfo in needpostuserlist)
{
if (userinfo != null && !string.IsNullOrEmpty(userinfo.OpenIdForWeixin))
{
//执行推送任务
if (!string.IsNullOrEmpty(appid) && !string.IsNullOrEmpty(secret) && !string.IsNullOrEmpty(weixintaskurl) && !string.IsNullOrEmpty(weixintasktempid))
{
if (!string.IsNullOrEmpty(responsejson))
{
var weixintokenobj = JsonConvert.DeserializeObject<dynamic>(responsejson);
if (string.IsNullOrEmpty(weixintokenobj.errcode))
{
string access_token = weixintokenobj.access_token;
string jsondata = "{\"touser\":\"" + userinfo.OpenIdForWeixin + "\"," +
"\"template_id\":\"" + weixintasktempid + "\"," +
"\"url\":\"" + weixintaskurl + "\"," +
"\"data\":{" +
"\"first\": {\"value\":\"您有新的未读通知公告\",\"color\":\"#173177\"}," +
"\"keyword1\":{\"value\":\"未读通知公告\",\"color\":\"#173177\"}," +
"\"keyword2\": {\"value\":\"" + title + "\",\"color\":\"#173177\"}," +
"\"keyword3\": {\"value\":\"待查看\",\"color\":\"#173177\"}," +
"\"keyword4\": {\"value\":\"您有新的未读通知公告【" + title + "】\",\"color\":\"#173177\"}" +
"}" +
"}";
string pushresult = Util.HttpMethods.HttpPost("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, jsondata);

operateLogModel.title = title;
operateLogModel.type = OperationType.Other;
operateLogModel.url = "NoticeController";
operateLogModel.sourceObjectId = "002";
operateLogModel.sourceContentJson = pushresult;
OperatorHelper.Instance.WriteOperateLog(operateLogModel);
}
}
}
}
}
}

/// <summary>
/// 消息提醒
/// </summary>
/// <param name="needpostuserlist"></param>
/// <param name="title"></param>
public void PushMessageRemind(List<UserEntity> needpostuserlist, NewsEntity model)
{
foreach (UserEntity userinfo in needpostuserlist)
{
MessageRemindEntity entity = new MessageRemindEntity();
entity.ReceiptId = userinfo.F_UserId;
entity.ReceiptName = userinfo.F_RealName;
entity.SenderId = model.F_CreateUserId;
entity.SenderName = model.F_CreateUserName;
entity.TheTitle = "通知公告";
entity.TheContent = model.F_FullHead;
entity.InstanceId = model.F_NewsId;
entity.ConnectionUrl = "/Utility/ListContentIndex?id=";
entity.SendTime = DateTime.Now;
entity.ReadSigns = false;
messageRindIBLL.SaveEntity("", entity);
}

}


/// <summary>
/// 删除表单数据


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/Form.js View File

@@ -56,7 +56,7 @@ var bootstrap = function ($, learun) {

var postData = $('#form').lrGetFormData(keyValue);
postData["F_NewsContent"] = ue.getContent(null, null, true);
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, postData, function (res) {
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();


+ 253
- 62
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs View File

@@ -113,6 +113,7 @@ namespace Learun.Application.Web.Controllers
#endregion
public ActionResult Index()
{
//判断登录状态码
string account = "";
if (!Request.Headers["account"].IsEmpty())
{
@@ -122,63 +123,48 @@ namespace Learun.Application.Web.Controllers
var result = helper.IsOnLine(account);
if (result.stateCode != 1)
{

return Redirect("NoLogin");
}
var userinfo = LoginUserInfo.Get();
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);


List<ModuleEntity> list = new List<ModuleEntity>();
List<string> offenused = LogBLL.GetGroupLog(userinfo.userId).Select(m => m.F_Module).Take(20).ToList();
var data = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress));
foreach (var oitem in offenused)
{
ModuleEntity fod = data.FirstOrDefault(m => m.F_FullName == oitem);
if (fod != null)
{
list.Add(fod);
}
}
//常用服务
ViewBag.Offenused = list.Take(12);
//内部邮件
//登录用户
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 maildata = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userInfo.userId + "\"}");
var maildataAll = sYS_ReceiveMessageIBLL.GetList("{\"userId\":\"" + userInfo.userId + "\"}");
ViewBag.LanMail = maildata;
ViewBag.LanMailUnRead = maildata.Count(m => m.READFLAG == 0);
//办公事项
paginationobj.sidx = "F_CreateDate";
//ViewBag.TaskList = wfTaskIBLL.GetActiveList(userinfo, paginationobj, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}");

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>();

paginationobj.rows = 100;
var newsList = newsIBLL.GetList("", userinfo.userId);
var newsList = newsIBLL.GetList("", userInfo.userId);
foreach (var newsitemEntity in newsList)
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId))
{
if (!string.IsNullOrEmpty(userinfo.postIds))
if (!string.IsNullOrEmpty(userInfo.postIds))
{
if (userinfo.postIds.Contains(","))
if (userInfo.postIds.Contains(","))
{
foreach (var postid in userinfo.postIds.Split(','))
foreach (var postid in userInfo.postIds.Split(','))
{
if (newsitemEntity.F_SendPostId.Contains(postid))
{
@@ -189,7 +175,7 @@ namespace Learun.Application.Web.Controllers
}
else
{
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds))
if (newsitemEntity.F_SendPostId.Contains(userInfo.postIds))
{
outnewslist.Add(newsitemEntity);
}
@@ -200,7 +186,7 @@ namespace Learun.Application.Web.Controllers
{
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId))
{
if (newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId))
if (newsitemEntity.F_SendDeptId.Contains(userInfo.departmentId))
{
outnewslist.Add(newsitemEntity);
}
@@ -211,28 +197,233 @@ namespace Learun.Application.Web.Controllers
}
}
}
//公文
paginationobj.sidx = "SendTime";
paginationobj.rows = 5;
ViewBag.ReceiveFileList = sys_ReceiveFileIBLL.GetPageList(paginationobj, "{\"ReceiverId\":\"" + userinfo.userId + "\"}");
ViewBag.NewsList = outnewslist;
//底部办公事项
ViewBag.FunctionTypeList = perm_FunctionTypeIBLL.GetListByUserId(userinfo.userId).OrderBy(m => m.FTOrder).Take(7);
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userinfo.userId);
foreach (var ufitem in userfunctionlist)
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(ufitem.FImage))
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(ufitem.FImage)?.F_FilePath;
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
ufitem.FImage = imagePath.Substring(imagePath.IndexOf("Resource") - 1);
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.FunctionList = userfunctionlist;
ViewBag.PublicKey = ConfigurationManager.AppSettings["SSOPublicSecret"];
return View();
ViewBag.NewsListOfxuanchuan = newsListOfxuanchuan;
ViewBag.NewsListOfxuanchuanStr = JsonConvert.SerializeObject(ViewBag.NewsListOfxuanchuan);
//智慧教育
ViewBag.NewsListOfzhihui = outnewslist.Where(x => x.F_CategoryId == "16").Take(6);
ViewBag.NewsListOfzhihuiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhihui);
//专题推荐
var newsListOfzhuanti = outnewslist.Where(x => x.F_CategoryId == "17").Take(7);
foreach (var item in newsListOfzhuanti)
{
if (!string.IsNullOrEmpty(item.F_NewsImage))
{
var imagePath = annexesFileIBLL.GetEntityByFolderId(item.F_NewsImage)?.F_FilePath;
if (!string.IsNullOrEmpty(imagePath))
{
item.F_NewsImage = imagePath.Substring(imagePath.IndexOf("Resource"));
}
else
{
item.F_NewsImage = "/Content/images/DragSSO/noLogin.png";
}
}
}
ViewBag.NewsListOfzhuanti = newsListOfzhuanti;
ViewBag.NewsListOfzhuantiStr = JsonConvert.SerializeObject(ViewBag.NewsListOfzhuanti);
//办公事项-待办任务
paginationobj.sidx = "F_CreateDate";
paginationobj.rows = 4;
var taskListAll = nWFProcessIBLL.GetMyTaskPageList(userInfo, "{}");
ViewBag.TaskList = nWFProcessIBLL.GetMyTaskPageList(userInfo, paginationobj, "{}");
ViewBag.TaskListStr = JsonConvert.SerializeObject(ViewBag.TaskList);
ViewBag.TaskTotalNum = taskListAll.Count();
//办公事项-已办任务
var finishTaskListAll = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, "{}");
ViewBag.FinishTaskList = nWFProcessIBLL.GetMyFinishTaskPageList(userInfo, paginationobj, "{}");
ViewBag.FinishTaskListStr = JsonConvert.SerializeObject(ViewBag.FinishTaskList);
ViewBag.FinishTaskTotalNum = finishTaskListAll.Count();
//办公事项-我发起的
var myListAll = nWFProcessIBLL.GetMyPageList(userInfo.userId, "{}");
ViewBag.MyList = nWFProcessIBLL.GetMyPageList(userInfo.userId, paginationobj, "{}");
ViewBag.MyListStr = JsonConvert.SerializeObject(ViewBag.MyList);
ViewBag.MyListTotalNum = myListAll.Count();
//常用服务
List<ModuleEntity> modulelist = new List<ModuleEntity>();
List<string> offenused = LogBLL.GetGroupLog(userInfo.userId).Select(m => m.F_Module).Take(20).ToList();
var moduledata = moduleIBLL.GetModuleList().Where(m => m.F_EnabledMark == 1 && m.F_DeleteMark == 0 && !string.IsNullOrEmpty(m.F_UrlAddress) && m.F_IsMenu == 1 && m.F_Target == "iframe" && !string.IsNullOrEmpty(m.F_ParentId));
foreach (var oitem in offenused)
{
ModuleEntity fod = moduledata.FirstOrDefault(m => m.F_FullName == oitem);
if (fod != null)
{
//找父级
if (fod.F_ParentId == "0")
{
fod.ParentName = fod.F_FullName;
fod.F_ParentId = fod.F_ModuleId;
}
else
{
var parent1 = moduleIBLL.GetModuleEntity(fod.F_ParentId);
if (parent1 != null)
{
if (parent1.F_ParentId == "0")
{
fod.ParentName = parent1.F_FullName;
fod.F_ParentId = parent1.F_ModuleId;
}
else
{
//下一级
var parent2 = moduleIBLL.GetModuleEntity(parent1.F_ParentId);
if (parent2 != null)
{
if (parent2.F_ParentId == "0")
{
fod.ParentName = parent2.F_FullName;
fod.F_ParentId = parent2.F_ModuleId;
}
else
{
//下一级
var parent3 = moduleIBLL.GetModuleEntity(parent2.F_ParentId);
if (parent3 != null)
{
if (parent3.F_ParentId == "0")
{
fod.ParentName = parent3.F_FullName;
fod.F_ParentId = parent3.F_ModuleId;
}
else
{
//下一级
var parent4 = moduleIBLL.GetModuleEntity(parent3.F_ParentId);
if (parent4 != null)
{
if (parent4.F_ParentId == "0")
{
fod.ParentName = parent4.F_FullName;
fod.F_ParentId = parent4.F_ModuleId;
}
}
}
}
}
}
}
}
}

modulelist.Add(fod);
}
}
ViewBag.OffenusedAll = modulelist;

var mm = modulelist.GroupBy(x => x.F_ParentId).Select(x => new ModuleEntity()
{
F_ParentId = x.Key,
ParentName = x.FirstOrDefault().ParentName,
ChildrenList = x.Select(y => new ModuleEntity()
{
F_ModuleId = y.F_ModuleId,
F_FullName = y.F_FullName
}).ToList()
}).ToList();
ViewBag.OffenusedGroup = mm;
ViewBag.OffenusedGroupStr = JsonConvert.SerializeObject(ViewBag.OffenusedGroup);
//查找服务
List<ModuleEntity> searchmodulelist = new List<ModuleEntity>();
foreach (var item in moduledata)
{
if (moduleIBLL.GetColumnList(item.F_ModuleId).Any())
{
item.FirstLetter = Str.PinYin(item.F_FullName).Substring(0, 1);
searchmodulelist.Add(item);
}
}
ViewBag.SearchModule = searchmodulelist;
//校园总览
//专业
var majorData = cdMajorIBLL.GetAllList();
ViewBag.MajorTotalNum = majorData.Count();
//班级
var classInfoData = classInfoIBLL.GetAllClass();
ViewBag.ClassInfoTotalNum = classInfoData.Count();
//学生
var stuInfoData = stuInfoBasicIBLL.GetAllList();
ViewBag.StuInfoTotalNum = stuInfoData.Count();
//教师
var teacherData = empInfoIBLL.GetAllList();
ViewBag.TeacherTotalNum = teacherData.Count();
//教室
var classRoomData = classroomInfoIBLL.GetAllList();
ViewBag.ClassRoomTotalNum = classRoomData.Count();
//课程
var lessonData = lessonInfoIBLL.GetAllList();
ViewBag.LessonTotalNum = lessonData.Count();
//专业总览
//专业学生
var stuByMajor = stuInfoData.GroupBy(x => x.MajorNo).Select(x => new
{
value = x.Select(y => y.StuId).Count(),
name = cdMajorIBLL.GetCdMajorEntityByMajorNo(x.Key)?.MajorName
});
ViewBag.StuByMajorStr = JsonConvert.SerializeObject(stuByMajor);
//流程
var flowType = dataItemIBLL.GetDetailList("FlowSort", "");
var flowList = wfSchemeIBLL.GetWfSchemeStart().ToList();
var allCount = 0;
foreach (var flow in flowType)
{
var count = flowList.Count(a => a.F_Category == flow.F_ItemName);
flow.FlowCount = count;
allCount += count;

}
ViewBag.AllCount = allCount;
ViewBag.FlowType = flowType;
ViewBag.FlowList = JsonConvert.SerializeObject(flowList);
//校园一卡通余额
ViewBag.StuSaveRecordTotalNum = 0;
var stuSaveRecordList = stuSaverecordIBLL.GetListByAccount(userInfo.account).OrderByDescending(x => x.UPLOADDATE);
if (stuSaveRecordList.Any())
{
ViewBag.StuSaveRecordTotalNum = stuSaveRecordList.FirstOrDefault().ODDFARE;
}
//红湖付款码余额
ViewBag.StuConsumptionTotalNum = 0;
var stuConsumptionList = stuConsumptionIBLL.GetListByAccount(userInfo.account);
if (stuConsumptionList.Any())
{
ViewBag.StuConsumptionTotalNum = stuConsumptionList.Select(x => x.OPFARE.ToDecimal()).Sum();
}
//常用链接
var userfunctionlist = perm_FunctionIBLL.GetListByUserId(userInfo.userId);
var ff = userfunctionlist.GroupBy(x => x.FTName).Select(x => new Perm_FunctionEntity()
{
FTName = x.Key,
PFunctionList = x.Select(y => new Perm_FunctionEntity()
{
FId = y.FId,
FTId = y.FTId,
FName = y.FName,
UPId = DESEncrypt.Encrypt(y.FId, ConfigurationManager.AppSettings["SSOPublicSecret"]),//sysid
UserId = DESEncrypt.Encrypt(userInfo.userId, ConfigurationManager.AppSettings["SSOPublicSecret"])//openid
}).Take(8).ToList()
});
ViewBag.FunctionList = ff;
ViewBag.FunctionListStr = JsonConvert.SerializeObject(ViewBag.FunctionList);
return View("DragModelOne");
}

//public ActionResult NoLogin()


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml View File

@@ -617,6 +617,13 @@
border-bottom: 1px solid #E5E5E5;
cursor: pointer
}
.lr-list-line .text{
width: 75%;
overflow: hidden;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.lr-list-line .date {
position: absolute;


+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs View File

@@ -181,6 +181,25 @@ namespace Learun.Application.OA
}
}

public void SaveFormAndSubmit(string keyValue, NewsEntity entity)
{
try
{
noticeService.SaveFormAndSubmit(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion
}
}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs View File

@@ -55,5 +55,6 @@ namespace Learun.Application.OA

void ChangeStatusById(string keyValue, int i, string processId);
NewsEntity GetEntityByProcessId(string processId);
void SaveFormAndSubmit(string keyValue, NewsEntity entity);
}
}

+ 30
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs View File

@@ -218,5 +218,35 @@ namespace Learun.Application.OA
}
}
}

public void SaveFormAndSubmit(string keyValue, NewsEntity entity)
{
try
{
entity.F_TypeId = 2;
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
this.BaseRepository().Update(entity);
}
else
{
entity.Create();
entity.F_EnabledMark = 1;
this.BaseRepository().Insert(entity);
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

Loading…
Cancel
Save