@@ -124,6 +124,19 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||||
}; | }; | ||||
return JsonResult(jsonData); | return JsonResult(jsonData); | ||||
} | } | ||||
public ActionResult GetPageListRevert(string pagination, string keyword) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = noticeIBLL.GetPageListRevert(paginationobj, keyword); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records, | |||||
}; | |||||
return JsonResult(jsonData); | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 查看通知公告 | /// 查看通知公告 | ||||
/// </summary> | /// </summary> | ||||
@@ -407,6 +420,21 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||||
noticeIBLL.DeleteEntity(keyValue); | noticeIBLL.DeleteEntity(keyValue); | ||||
return Success("删除成功!"); | return Success("删除成功!"); | ||||
} | } | ||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult RecycleForm(string keyValue) | |||||
{ | |||||
noticeIBLL.RecycleForm(keyValue,"-1"); | |||||
return Success("操作成功!"); | |||||
} | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult RevertForm(string keyValue) | |||||
{ | |||||
noticeIBLL.RecycleForm(keyValue, "0"); | |||||
return Success("操作成功!"); | |||||
} | |||||
public void PushWeixin(List<UserEntity> needpostuserlist, string title) | public void PushWeixin(List<UserEntity> needpostuserlist, string title) | ||||
{ | { | ||||
var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | var WeChatConfigentity = weChatConfigIbll.GetEnableEntity(); | ||||
@@ -24,6 +24,7 @@ | |||||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlt">查看</span></a> | <a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlt">查看</span></a> | ||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlt">提交</span></a> | <a id="lr_submit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlt">提交</span></a> | ||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlt">删除</span></a> | <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlt">删除</span></a> | ||||
<a id="lr_recycle" class="btn btn-default"><i class="fa fa-circle-o-notch"></i> <span class="lrlt">放入回收站</span></a> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -112,6 +112,19 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
//放入回收站 | |||||
$('#lr_recycle').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_NewsId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认放入回收站!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/RecycleForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 提交 | // 提交 | ||||
$('#lr_submit').on('click', function () { | $('#lr_submit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('F_NewsId'); | var keyValue = $('#gridtable').jfGridValue('F_NewsId'); | ||||
@@ -0,0 +1,31 @@ | |||||
@{ | |||||
ViewBag.Title = "通知公告"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout"> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap lr-layout-wrap-notitle"> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入标题" /> | |||||
</div> | |||||
<div class="lr-layout-tool-item"> | |||||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> <span class="lrlt">查询</span></a> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class="btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class="btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_revert" class="btn btn-default"><i class="fa fa-circle-o-notch"></i> <span class="lrlt">还原</span></a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_OAModule/Views/Notice/IndexRecycle.js") | |||||
@@ -0,0 +1,86 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2017.07.11 | |||||
* 描 述:公告通知 | |||||
*/ | |||||
var refreshGirdData; // 更新数据 | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
page.initGrid(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 查询 | |||||
$('#btn_Search').on('click', function () { | |||||
var keyword = $('#txt_Keyword').val(); | |||||
page.search({ keyword: keyword }); | |||||
}); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
//还原 | |||||
$('#lr_revert').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_NewsId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认还原该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/RevertForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
$('#gridtable').jfGrid({ | |||||
url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageListRevert', | |||||
headData: [ | |||||
{ label: '公告标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' }, | |||||
{ label: '发布人员', name: 'F_CreateUserName', index: 'F_CreateUserName', width: 100, align: 'left' }, | |||||
{ label: '公告类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' }, | |||||
{ | |||||
label: "发布时间", name: "F_ReleaseTime", index: "F_ReleaseTime", width: 140, align: "center", | |||||
formatter: function (cellvalue) { | |||||
return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm'); | |||||
} | |||||
}, | |||||
{ label: '信息来源', name: 'F_SourceName', index: 'F_SourceName', width: 100, align: 'center' }, | |||||
{ label: '阅读次数', name: 'F_PV', index: 'F_PV', width: 80, align: 'center' }, | |||||
{ | |||||
label: "发布状态", name: "F_EnabledMark", index: "F_EnabledMark", width: 80, align: "center", autowidth: false, | |||||
formatter: function (cellvalue) { | |||||
if (cellvalue == 1) { | |||||
return "<span class=\"label label-success\">已发布</span>"; | |||||
} else { | |||||
return "<span class=\"label label-danger\">未发布</span>"; | |||||
} | |||||
} | |||||
}, | |||||
{ label: "创建时间", name: "F_CreateDate", index: "F_CreateDate", width: 130, align: "center" } | |||||
], | |||||
mainId: 'F_NewsId', | |||||
isMultiselect: true, | |||||
isPage: true, | |||||
sidx: 'F_CreateDate', | |||||
sord: 'desc' | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
$('#gridtable').jfGridSet('reload', param); | |||||
} | |||||
}; | |||||
// 保存数据后回调刷新 | |||||
refreshGirdData = function () { | |||||
page.search(); | |||||
} | |||||
page.init(); | |||||
} | |||||
@@ -1279,6 +1279,7 @@ | |||||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\StampDetailIndex.js" /> | <Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\StampDetailIndex.js" /> | ||||
<Content Include="Areas\LR_OAModule\Views\Notice\FormFlowView.js" /> | <Content Include="Areas\LR_OAModule\Views\Notice\FormFlowView.js" /> | ||||
<Content Include="Areas\LR_OAModule\Views\Notice\FormFlow.js" /> | <Content Include="Areas\LR_OAModule\Views\Notice\FormFlow.js" /> | ||||
<Content Include="Areas\LR_OAModule\Views\Notice\IndexRecycle.js" /> | |||||
<Content Include="Areas\LR_OAModule\Views\Notice\IndexFlow.js" /> | <Content Include="Areas\LR_OAModule\Views\Notice\IndexFlow.js" /> | ||||
<Content Include="Areas\LR_OAModule\Views\ResourceFile\BcIndex.js" /> | <Content Include="Areas\LR_OAModule\Views\ResourceFile\BcIndex.js" /> | ||||
<Content Include="Areas\LR_OAModule\Views\Signet\Index.js" /> | <Content Include="Areas\LR_OAModule\Views\Signet\Index.js" /> | ||||
@@ -6897,6 +6898,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Sys_ReceiveDocument\PrintView.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\Sys_ReceiveDocument\PrintView.cshtml" /> | ||||
<Content Include="Areas\LR_OAModule\Views\Notice\IndexRecycle.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | ||||
@@ -40,6 +40,25 @@ namespace Learun.Application.OA | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public IEnumerable<NewsEntity> GetPageListRevert(Pagination pagination, string keyword) | |||||
{ | |||||
try | |||||
{ | |||||
return noticeService.GetPageListRevert(pagination, keyword); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 公告实体 | /// 公告实体 | ||||
/// </summary> | /// </summary> | ||||
@@ -88,6 +107,25 @@ namespace Learun.Application.OA | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public void RecycleForm(string keyValue,string status) | |||||
{ | |||||
try | |||||
{ | |||||
noticeService.RecycleForm(keyValue,status); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存(新增、修改) | /// 保存(新增、修改) | ||||
/// </summary> | /// </summary> | ||||
@@ -20,6 +20,7 @@ namespace Learun.Application.OA | |||||
/// <param name="keyword">关键词</param> | /// <param name="keyword">关键词</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<NewsEntity> GetPageList(Pagination pagination, string keyword); | IEnumerable<NewsEntity> GetPageList(Pagination pagination, string keyword); | ||||
IEnumerable<NewsEntity> GetPageListRevert(Pagination pagination, string keyword); | |||||
/// <summary> | /// <summary> | ||||
/// 公告实体 | /// 公告实体 | ||||
/// </summary> | /// </summary> | ||||
@@ -55,5 +56,6 @@ namespace Learun.Application.OA | |||||
void ChangeStatusById(string keyValue, int i, string processId); | void ChangeStatusById(string keyValue, int i, string processId); | ||||
NewsEntity GetEntityByProcessId(string processId); | NewsEntity GetEntityByProcessId(string processId); | ||||
void RecycleForm(string keyValue,string status); | |||||
} | } | ||||
} | } |
@@ -27,7 +27,31 @@ namespace Learun.Application.OA | |||||
try | try | ||||
{ | { | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 "); | |||||
strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 and F_Status<>'-1' "); | |||||
if (!string.IsNullOrEmpty(keyword)) | |||||
{ | |||||
strSql.Append(" AND F_FullHead like @keyword"); | |||||
} | |||||
return this.BaseRepository().FindList<NewsEntity>(strSql.ToString(), new { keyword = "%" + keyword + "%" }, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public IEnumerable<NewsEntity> GetPageListRevert(Pagination pagination, string keyword) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 2 and F_Status='-1' "); | |||||
if (!string.IsNullOrEmpty(keyword)) | if (!string.IsNullOrEmpty(keyword)) | ||||
{ | { | ||||
strSql.Append(" AND F_FullHead like @keyword"); | strSql.Append(" AND F_FullHead like @keyword"); | ||||
@@ -106,6 +130,37 @@ namespace Learun.Application.OA | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public void RecycleForm(string keyValue,string status) | |||||
{ | |||||
var db = this.BaseRepository().BeginTrans(); | |||||
try | |||||
{ | |||||
var list = keyValue.Split(','); | |||||
foreach (var item in list) | |||||
{ | |||||
var entity = db.FindEntity<NewsEntity>(x => x.F_NewsId == item); | |||||
if (entity != null) | |||||
{ | |||||
entity.F_Status = status; | |||||
db.Update(entity); | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存(新增、修改) | /// 保存(新增、修改) | ||||
/// </summary> | /// </summary> | ||||
@@ -156,7 +211,7 @@ namespace Learun.Application.OA | |||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT t.*,r.RNewsId,r.RTime FROM LR_OA_News t "); | 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_OA_NewsRead r on t.F_NewsId = r.NewsId and r.RUserId=@userId "); | ||||
strSql.Append(" WHERE t.F_TypeId = 2 "); | |||||
strSql.Append(" WHERE t.F_TypeId = 2 and F_Status<>'-1' "); | |||||
if (!string.IsNullOrEmpty(categoryId)) | if (!string.IsNullOrEmpty(categoryId)) | ||||
{ | { | ||||
strSql.Append($" AND F_CategoryId = '{categoryId}'"); | strSql.Append($" AND F_CategoryId = '{categoryId}'"); | ||||