Browse Source

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

新疆影视学院高职
dyy 2 years ago
parent
commit
db3589c9c2
6 changed files with 126 additions and 4 deletions
  1. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs
  2. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/ViewIndex.cshtml
  3. +10
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/ViewIndex.js
  4. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs
  6. +86
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs

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

@@ -215,6 +215,13 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers

return JsonResult(newsList);
}

public ActionResult GetListOfSelfForView(string queryJson)
{
var newsList = noticeIBLL.GetListOfSelf(queryJson);
return JsonResult(newsList);
}

/// <summary>
/// 查看通知公告
/// </summary>


+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/ViewIndex.cshtml View File

@@ -10,6 +10,9 @@
<div class="lr-layout-tool-item">
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入标题" />
</div>
<div class="lr-layout-tool-item">
<div id='IsRead' class="form-control"></div>
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;<span class="lrlt">查询</span></a>
</div>


+ 10
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/ViewIndex.js View File

@@ -15,10 +15,17 @@ var bootstrap = function ($, learun) {
page.bind();
},
bind: function () {
$('#IsRead').lrselect({
placeholder: '请选择阅读状态',
data: [{ id: '1', text: '已阅读' }, { id: '0', text: '未阅读' }],
value: "id",
text: "text"
});
// 查询
$('#btn_Search').on('click', function () {
var keyword = $('#txt_Keyword').val();
page.search({ keyword: keyword });
var IsRead = $('#IsRead').lrselectGet();
page.search({ keyword: keyword, IsRead: IsRead });
});
// 刷新
$('#lr_refresh').on('click', function () {
@@ -42,7 +49,7 @@ var bootstrap = function ($, learun) {
},
initGrid: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/LR_OAModule/Notice/GetListOfSelf',
url: top.$.rootUrl + '/LR_OAModule/Notice/GetListOfSelfForView',
headData: [
{ label: '公告标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' },
{ label: '公告类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' },
@@ -78,12 +85,11 @@ var bootstrap = function ($, learun) {
page.search();
},
search: function (param) {

param = param || {};
if (category) {
param.categoryId = category;
}
$('#gridtable').jfGridSet('reload', param);
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
// 保存数据后回调刷新


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

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

public IEnumerable<NewsEntity> GetListOfSelf(string queryJson)
{
try
{
return noticeService.GetListOfSelf(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

#region 流程


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

@@ -51,6 +51,7 @@ namespace Learun.Application.OA
/// <param name="keyword">关键词</param>
/// <returns></returns>
IEnumerable<NewsEntity> GetList(string keyword,string categoryId=null);
IEnumerable<NewsEntity> GetListOfSelf(string queryJson);

#endregion



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

@@ -387,6 +387,92 @@ SELECT ruserid from [dbo].[LR_OA_NewsShouldRead] where newsid='{news.F_NewsId}'
}
}

public IEnumerable<NewsEntity> GetListOfSelf(string queryJson)
{
try
{
var userinfo = LoginUserInfo.Get();
var userId = userinfo.userId;
var deptId = userinfo.departmentId;
var postIds = userinfo.postIds;
var strSql = new StringBuilder();
strSql.Append("SELECT t.*,r.RNewsId,r.RTime FROM LR_OA_News t ");
strSql.Append(" left join LR_OA_NewsRead r on t.F_NewsId = r.NewsId and r.RUserId=@userId ");
strSql.Append(" left join lr_base_user u on u.F_UserId=@userId ");
strSql.Append(" WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 and t.F_EnabledMark=1 ");
if (userinfo.account.Contains("20"))
{
strSql.Append(" and t.F_ReleaseTime>CONVERT(datetime,SUBSTRING(u.F_Account,1,4)+'-08-31',120) ");
}

strSql.Append($@" and (
((t.F_SendDeptId is null or len(t.F_SendDeptId)=0) and (t.F_SendPostId is null or len(t.F_SendPostId)=0))
");
if (!string.IsNullOrEmpty(deptId))
{
strSql.Append($" or (t.F_SendDeptId is not null and t.F_SendDeptId like '%{deptId}%')");
}
if (!string.IsNullOrEmpty(postIds))
{
strSql.Append(" or (t.F_SendPostId is not null and ");
if (postIds.Contains(","))
{
string postidSql = " (";
foreach (var postId in postIds)
{
postidSql += $" t.F_SendPostId like '%{postId}%' or";
}

postidSql = postidSql.Substring(0, postidSql.LastIndexOf("or")) + ")";
strSql.Append(postidSql);
}
else
{
strSql.Append($" t.F_SendPostId like '%{postIds}%'");
}

strSql.Append(")");
}

strSql.Append(") ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["keyword"].IsEmpty())
{
strSql.Append($" AND t.F_FullHead Like '{queryParam["keyword"].ToString()}' ");
}
if (!queryParam["categoryId"].IsEmpty())
{
strSql.Append($" AND t.F_CategoryId = '{queryParam["categoryId"].ToString()}'");
}
if (!queryParam["IsRead"].IsEmpty())
{
var IsRead = queryParam["IsRead"].ToString().Trim();
if (IsRead == "1")
{
strSql.Append($" AND (r.RNewsId is not null and len(r.RNewsId)>0)");
}
else
{
strSql.Append($" AND (r.RNewsId is null or len(r.RNewsId)=0)");
}
}
strSql.Append(" ORDER BY t.F_ReleaseTime DESC ");
return this.BaseRepository().FindList<NewsEntity>(strSql.ToString(), new { userId = userId });
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

public void ChangeStatusById(string keyValue, int status, string processId)


Loading…
Cancel
Save