@@ -0,0 +1,178 @@ | |||||
using Learun.Application.OA; | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Configuration; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Web; | |||||
using System.Web.Mvc; | |||||
using Learun.Application.Base.AuthorizeModule; | |||||
using Learun.Application.Base.SystemModule; | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.TwoDevelopment.LR_Desktop; | |||||
using Learun.Util.Operat; | |||||
using Microsoft.AspNet.SignalR.Client; | |||||
using Microsoft.Owin.Logging; | |||||
using Newtonsoft.Json; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Learun.Application.TwoDevelopment.Permission; | |||||
namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:zl | |||||
/// 日 期:2021.05.20 | |||||
/// 描 述:失物招领管理 | |||||
/// </summary> | |||||
public class LostArticleInfoController : MvcControllerBase | |||||
{ | |||||
private LostArticleInfoIBLL lostArticleInfoIBLL = new LostArticleInfoBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 页面 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页面 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 失物招领表单 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormView() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 认领 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FormClaim() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取分页数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="keyword">关键词</param> | |||||
/// <returns></returns> | |||||
public ActionResult GetPageList(string pagination, string keyword) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = lostArticleInfoIBLL.GetPageList(paginationobj, keyword); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records, | |||||
}; | |||||
return JsonResult(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public ActionResult GetEntity(string keyValue) | |||||
{ | |||||
var data = lostArticleInfoIBLL.GetLostArticleInfoEntity(keyValue); | |||||
data.F_Content = WebHelper.HtmlDecode(data.F_Content); | |||||
return JsonResult(data); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 保存表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost, ValidateAntiForgeryToken, AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, LostArticleInfoEntity entity) | |||||
{ | |||||
entity.F_Content = WebHelper.HtmlEncode(entity.F_Content); | |||||
entity.F_State = 0; | |||||
lostArticleInfoIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 删除表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
lostArticleInfoIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 发布 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult PublishForm(string keyValue) | |||||
{ | |||||
lostArticleInfoIBLL.PublishForm(keyValue); | |||||
return Success("发布成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 认领 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult ClaimForm(string keyValue, LostArticleInfoEntity entity) | |||||
{ | |||||
lostArticleInfoIBLL.ClaimForm(keyValue, entity); | |||||
return Success("认领成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 撤下 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult CancleForm(string keyValue) | |||||
{ | |||||
lostArticleInfoIBLL.CancleForm(keyValue); | |||||
return Success("已撤下!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,30 @@ | |||||
@{ | |||||
ViewBag.Title = "发布失物招领"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">标题<font face="宋体">*</font></div> | |||||
<input id="F_FullHead" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入标题" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">发布时间<font face="宋体">*</font></div> | |||||
<input id="F_ReleaseTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy/MM/dd HH:mm' })" isvalid="yes" checkexpession="NotNull" value="@Learun.Util.Time.GetToday("yyyy/MM/dd HH:mm")" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">捡拾人<font face="宋体">*</font></div> | |||||
<input id="F_Picker" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入捡拾人" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">标题图片</div> | |||||
<div id="F_Image"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">内容</div> | |||||
<div id="editor" style="height:300px;"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/Form.js") |
@@ -0,0 +1,143 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2017.11.11 | |||||
* 描 述:公告通知 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
var isUpdate; | |||||
// 验证数据是否填写完整 | |||||
var validForm; | |||||
// 保存数据 | |||||
var save; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var ue; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
//var loginInfo = top.learun.clientdata.get(['userinfo']); | |||||
$('#F_Image').lrUploader(); | |||||
//内容编辑器 | |||||
ue = UE.getEditor('editor'); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
//$('#form').lrSetFormData(selectedRow); | |||||
//$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); | |||||
$.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { | |||||
$('#form').lrSetFormData(data); | |||||
setTimeout(function () { | |||||
if (data.F_Content) { | |||||
ue.setContent(decodeURI(data.F_Content)); | |||||
}; | |||||
}, 100); | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
// 设置表单数据 | |||||
//setFormData = function (processId) { | |||||
// if (!!processId) { | |||||
// $.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { | |||||
// for (var id in data) { | |||||
// if (!!data[id] && data[id].length > 0) { | |||||
// $('#' + id).jfGridSet('refreshdata', data[id]); | |||||
// } | |||||
// else { | |||||
// if (id == 'Sys_ReceiveFile') { | |||||
// keyValue = data[id].F_DeptRelationId; | |||||
// } | |||||
// $('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
// } | |||||
// } | |||||
// }); | |||||
// } | |||||
//} | |||||
// 验证数据是否填写完整 | |||||
validForm = function () { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
return true; | |||||
}; | |||||
// 保存数据 | |||||
save = function (processId, callBack, i) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(keyValue); | |||||
postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
//callBack(res, formData, i); | |||||
} | |||||
}); | |||||
//var formData = $('body').lrGetFormData(); | |||||
//if (!!processId) { | |||||
// formData.RProcessId = processId; | |||||
//} | |||||
//learun.clientdata.getAsync('dataItem', { | |||||
// key: $("#F_CategoryId").lrselectGet(), | |||||
// code: 'NoticeCategory', | |||||
// callback: function (_data) { | |||||
// $("#F_Category").val(_data.text); | |||||
// } | |||||
//}); | |||||
//$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { | |||||
// // 保存成功后才回调 | |||||
// if (!!callBack) { | |||||
// callBack(res, formData, i); | |||||
// } | |||||
//}); | |||||
}; | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(keyValue); | |||||
postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
//learun.clientdata.getAsync('dataItem', { | |||||
// key: $("#F_CategoryId").lrselectGet(), | |||||
// code: 'NoticeCategory', | |||||
// callback: function (_data) { | |||||
// $("#F_Category").val(_data.text); | |||||
// } | |||||
//}); | |||||
} | |||||
page.init(); | |||||
} | |||||
@@ -0,0 +1,22 @@ | |||||
@{ | |||||
ViewBag.Title = "失物招领认领"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">认领人<font face="宋体">*</font></div> | |||||
<input id="F_User" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入认领人" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">认领时间<font face="宋体">*</font></div> | |||||
<input id="F_UserTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy/MM/dd HH:mm' })" isvalid="yes" checkexpession="NotNull" value="@Learun.Util.Time.GetToday("yyyy/MM/dd HH:mm")" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">认领照片</div> | |||||
<div id="F_ClaimImage"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.js") |
@@ -0,0 +1,143 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2017.11.11 | |||||
* 描 述:公告通知 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
var isUpdate; | |||||
// 验证数据是否填写完整 | |||||
var validForm; | |||||
// 保存数据 | |||||
var save; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var ue; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
//var loginInfo = top.learun.clientdata.get(['userinfo']); | |||||
$('#F_ClaimImage').lrUploader(); | |||||
//内容编辑器 | |||||
//ue = UE.getEditor('editor'); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
//$('#form').lrSetFormData(selectedRow); | |||||
//$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); | |||||
$.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { | |||||
$('#form').lrSetFormData(data); | |||||
setTimeout(function () { | |||||
if (data.F_Content) { | |||||
ue.setContent(decodeURI(data.F_Content)); | |||||
}; | |||||
}, 100); | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
// 设置表单数据 | |||||
//setFormData = function (processId) { | |||||
// if (!!processId) { | |||||
// $.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { | |||||
// for (var id in data) { | |||||
// if (!!data[id] && data[id].length > 0) { | |||||
// $('#' + id).jfGridSet('refreshdata', data[id]); | |||||
// } | |||||
// else { | |||||
// if (id == 'Sys_ReceiveFile') { | |||||
// keyValue = data[id].F_DeptRelationId; | |||||
// } | |||||
// $('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
// } | |||||
// } | |||||
// }); | |||||
// } | |||||
//} | |||||
// 验证数据是否填写完整 | |||||
validForm = function () { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
return true; | |||||
}; | |||||
// 保存数据 | |||||
save = function (processId, callBack, i) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(keyValue); | |||||
//postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/ClaimForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
//callBack(res, formData, i); | |||||
} | |||||
}); | |||||
//var formData = $('body').lrGetFormData(); | |||||
//if (!!processId) { | |||||
// formData.RProcessId = processId; | |||||
//} | |||||
//learun.clientdata.getAsync('dataItem', { | |||||
// key: $("#F_CategoryId").lrselectGet(), | |||||
// code: 'NoticeCategory', | |||||
// callback: function (_data) { | |||||
// $("#F_Category").val(_data.text); | |||||
// } | |||||
//}); | |||||
//$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { | |||||
// // 保存成功后才回调 | |||||
// if (!!callBack) { | |||||
// callBack(res, formData, i); | |||||
// } | |||||
//}); | |||||
}; | |||||
acceptClick = function (callBack) { | |||||
if (!$('#form').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(keyValue); | |||||
//postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); | |||||
$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/ClaimForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
//learun.clientdata.getAsync('dataItem', { | |||||
// key: $("#F_CategoryId").lrselectGet(), | |||||
// code: 'NoticeCategory', | |||||
// callback: function (_data) { | |||||
// $("#F_Category").val(_data.text); | |||||
// } | |||||
//}); | |||||
} | |||||
page.init(); | |||||
} | |||||
@@ -0,0 +1,41 @@ | |||||
@{ | |||||
ViewBag.Title = "发布失物招领"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">公告标题<font face="宋体">*</font></div> | |||||
<input id="F_FullHead" readonly="readonly" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入标题" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">发布时间<font face="宋体">*</font></div> | |||||
<input id="F_ReleaseTime" readonly="readonly" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy/MM/dd HH:mm' })" isvalid="yes" checkexpession="NotNull" value="@Learun.Util.Time.GetToday("yyyy/MM/dd HH:mm")" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">标题图片</div> | |||||
<div id="F_Image" readonly="readonly"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">公告内容</div> | |||||
<div id="editor" style="height:300px;" readonly="readonly"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">认领人</div> | |||||
<input id="F_User" readonly="readonly" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">认领时间</div> | |||||
<input id="F_UserTime" readonly="readonly" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy/MM/dd HH:mm' })" isvalid="yes" checkexpession="NotNull" value="@Learun.Util.Time.GetToday("yyyy/MM/dd HH:mm")" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">认领照片</div> | |||||
<div id="F_ClaimImage" readonly="readonly"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="OANews"> | |||||
<div class="lr-form-item-title">经手人</div> | |||||
<input id="F_ManageUserName" readonly="readonly" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/FormView.js") |
@@ -0,0 +1,55 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2017.11.11 | |||||
* 描 述:公告通知 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
// 设置权限 | |||||
var setAuthorize; | |||||
// 设置表单数据 | |||||
var setFormData; | |||||
var isUpdate; | |||||
// 验证数据是否填写完整 | |||||
var validForm; | |||||
// 保存数据 | |||||
var save; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var ue; | |||||
var page = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
//var loginInfo = top.learun.clientdata.get(['userinfo']); | |||||
$('#F_Image').lrUploader(); | |||||
$('#F_ClaimImage').lrUploader(); | |||||
//内容编辑器 | |||||
ue = UE.getEditor('editor'); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
//$('#form').lrSetFormData(selectedRow); | |||||
//$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); | |||||
$.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { | |||||
$('#form').lrSetFormData(data); | |||||
setTimeout(function () { | |||||
if (data.F_Content) { | |||||
ue.setContent(decodeURI(data.F_Content)); | |||||
} | |||||
}, 100); | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
page.init(); | |||||
} | |||||
@@ -0,0 +1,39 @@ | |||||
@{ | |||||
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_add" class="btn btn-default"><i class="fa fa-plus"></i> <span class="lrlt">录入</span></a> | |||||
<a id="lr_edit" 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_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlt">删除</span></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr-publish" class="btn btn-default"><i class="fa fa-plus"></i> 发布</a> | |||||
<a id="lr-claim" class="btn btn-default"><i class="fa fa-plus"></i> 认领</a> | |||||
<a id="lr-cancle" class="btn btn-default"><i class="fa fa-plus"></i> 撤下</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/Index.js") | |||||
@@ -0,0 +1,237 @@ | |||||
/* | |||||
* 版 本 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 processId = ''; | |||||
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_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '添加', | |||||
url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/Form', | |||||
width: 1000, | |||||
height: 650, | |||||
maxmin: true, | |||||
callBack: function (id) { | |||||
var res = false; | |||||
// 验证数据 | |||||
res = top[id].validForm(); | |||||
// 保存数据 | |||||
if (res) { | |||||
res = top[id].save('', function () { | |||||
page.search(); | |||||
}); | |||||
} | |||||
return res; | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_LId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (keyValue.indexOf(",") != -1) { | |||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
return false; | |||||
} | |||||
var F_State = $('#gridtable').jfGridValue('F_State'); | |||||
if (F_State != "0") { | |||||
learun.alert.warning("当前项目已提交不能编辑!"); | |||||
return; | |||||
} | |||||
learun.layerForm({ | |||||
id: 'formedit', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/Form?keyValue=' + keyValue, | |||||
width: 1000, | |||||
height: 650, | |||||
maxmin: true, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 查看 | |||||
$('#lr_view').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_LId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (keyValue.indexOf(",") != -1) { | |||||
learun.alert.warning("只能选择一条记录查看!"); | |||||
return false; | |||||
} | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '查看', | |||||
url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/FormView?keyValue=' + keyValue, | |||||
width: 800, | |||||
height: 750, | |||||
btn: null | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_LId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/DeleteForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 发布 | |||||
$('#lr-publish').on('click', function () { | |||||
var F_State = $('#gridtable').jfGridValue('F_State'); | |||||
if (F_State != "0") { | |||||
learun.alert.warning("当前项目已提交不能发布!"); | |||||
return; | |||||
} | |||||
var keyValue = $('#gridtable').jfGridValue('F_LId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认发布!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/PublishForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 认领 | |||||
$('#lr-claim').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('F_LId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (keyValue.indexOf(",") != -1) { | |||||
learun.alert.warning("只能选择一条记录进行认领!"); | |||||
return false; | |||||
} | |||||
var F_State = $('#gridtable').jfGridValue('F_State'); | |||||
if (F_State != "1") { | |||||
learun.alert.warning("只有已发布才可以认领!"); | |||||
return; | |||||
} | |||||
learun.layerForm({ | |||||
id: 'formedit', | |||||
title: '认领', | |||||
url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/FormClaim?keyValue=' + keyValue, | |||||
width: 600, | |||||
height: 350, | |||||
maxmin: true, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 撤下 | |||||
$('#lr-cancle').on('click', function () { | |||||
//var F_State = $('#gridtable').jfGridValue('F_State'); | |||||
//if (F_State != "2") { | |||||
// learun.alert.warning("当前项目已认领不能撤下!"); | |||||
// return; | |||||
//} | |||||
var keyValue = $('#gridtable').jfGridValue('F_LId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认撤下!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/CancleForm', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | |||||
initGrid: function () { | |||||
$('#gridtable').jfGrid({ | |||||
url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetPageList', | |||||
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_ReleaseTime", | |||||
index: "F_ReleaseTime", | |||||
width: 140, | |||||
align: "left", | |||||
formatter: function(cellvalue) { | |||||
return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm'); | |||||
} | |||||
}, | |||||
{ label: '拾捡人', name: 'F_Picker', index: 'F_Picker', width: 100, align: 'left' }, | |||||
{ | |||||
label: "状态", name: "F_State", index: "F_State", width: 140, align: "left", | |||||
formatter: function(cellvalue) { | |||||
if (cellvalue == 0) | |||||
return "<span class=\"label label-default\">草稿</span>"; | |||||
else if (cellvalue == 1) | |||||
return "<span class=\"label label-warning\">待认领</span>"; | |||||
else if (cellvalue == 2) | |||||
return "<span class=\"label label-success\">已认领</span>"; | |||||
//else if (cellvalue == 3) | |||||
// return "<span class=\"label label-warning\">已撤下</span>"; | |||||
} | |||||
}, | |||||
//{ label: "创建时间", name: "F_CreateTime", index: "F_CreateDate", width: 130, align: 'left' } | |||||
], | |||||
mainId: 'F_LId', | |||||
reloadSelected: true, | |||||
isMultiselect: true, | |||||
isPage: true, | |||||
sidx: 'F_CreateTime', | |||||
sord: 'desc' | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
$('#gridtable').jfGridSet('reload', param); | |||||
} | |||||
}; | |||||
// 保存数据后回调刷新 | |||||
refreshGirdData = function (res, postData) { | |||||
//if (res && res.code && res.code == 200) { | |||||
// var postData = { | |||||
// schemeCode: 'OA_News',// 填写流程对应模板编号 | |||||
// processId: processId, | |||||
// level: '1', | |||||
// }; | |||||
// learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||||
// learun.loading(false); | |||||
// }); | |||||
//} | |||||
page.search(); | |||||
} | |||||
page.init(); | |||||
} | |||||
@@ -421,6 +421,7 @@ | |||||
<Compile Include="Areas\LR_NewWorkFlow\Controllers\StampInfoController.cs" /> | <Compile Include="Areas\LR_NewWorkFlow\Controllers\StampInfoController.cs" /> | ||||
<Compile Include="Areas\LR_NewWorkFlow\LR_NewWorkFlowAreaRegistration.cs" /> | <Compile Include="Areas\LR_NewWorkFlow\LR_NewWorkFlowAreaRegistration.cs" /> | ||||
<Compile Include="Areas\LR_OAModule\Controllers\EmailController.cs" /> | <Compile Include="Areas\LR_OAModule\Controllers\EmailController.cs" /> | ||||
<Compile Include="Areas\LR_OAModule\Controllers\LostArticleInfoController.cs" /> | |||||
<Compile Include="Areas\LR_OAModule\Controllers\ModuleExportController.cs" /> | <Compile Include="Areas\LR_OAModule\Controllers\ModuleExportController.cs" /> | ||||
<Compile Include="Areas\LR_OAModule\Controllers\NewsController.cs" /> | <Compile Include="Areas\LR_OAModule\Controllers\NewsController.cs" /> | ||||
<Compile Include="Areas\LR_OAModule\Controllers\NoticeController.cs" /> | <Compile Include="Areas\LR_OAModule\Controllers\NoticeController.cs" /> | ||||
@@ -1332,6 +1333,10 @@ | |||||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Form.js" /> | <Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Form.js" /> | ||||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Index.js" /> | <Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\Index.js" /> | ||||
<Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\StampDetailIndex.js" /> | <Content Include="Areas\LR_NewWorkFlow\Views\StampInfo\StampDetailIndex.js" /> | ||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\Form.js" /> | |||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\FormClaim.js" /> | |||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\FormView.js" /> | |||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\Index.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\IndexFlow.js" /> | <Content Include="Areas\LR_OAModule\Views\Notice\IndexFlow.js" /> | ||||
@@ -7409,6 +7414,10 @@ | |||||
<Content Include="Areas\LR_SystemModule\Views\Log\IndexDAM.cshtml" /> | <Content Include="Areas\LR_SystemModule\Views\Log\IndexDAM.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.cshtml" /> | ||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\Form.cshtml" /> | |||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\FormClaim.cshtml" /> | |||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\FormView.cshtml" /> | |||||
<Content Include="Areas\LR_OAModule\Views\LostArticleInfo\Index.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<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" /> | ||||
@@ -132,6 +132,10 @@ | |||||
<Compile Include="Gantt\JQueryGanttEntity.cs" /> | <Compile Include="Gantt\JQueryGanttEntity.cs" /> | ||||
<Compile Include="Gantt\JQueryGanttIBLL.cs" /> | <Compile Include="Gantt\JQueryGanttIBLL.cs" /> | ||||
<Compile Include="Gantt\JQueryGanttService.cs" /> | <Compile Include="Gantt\JQueryGanttService.cs" /> | ||||
<Compile Include="LostArticleInfo\LostArticleInfoBLL.cs" /> | |||||
<Compile Include="LostArticleInfo\LostArticleInfoEntity.cs" /> | |||||
<Compile Include="LostArticleInfo\LostArticleInfoIBLL.cs" /> | |||||
<Compile Include="LostArticleInfo\LostArticleInfoService.cs" /> | |||||
<Compile Include="LR_StampManage\LR_StampManageBLL.cs" /> | <Compile Include="LR_StampManage\LR_StampManageBLL.cs" /> | ||||
<Compile Include="LR_StampManage\LR_StampManageEntity.cs" /> | <Compile Include="LR_StampManage\LR_StampManageEntity.cs" /> | ||||
<Compile Include="LR_StampManage\LR_StampManageIBLL.cs" /> | <Compile Include="LR_StampManage\LR_StampManageIBLL.cs" /> | ||||
@@ -0,0 +1,193 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.OA | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-05-20 15:14 | |||||
/// 描 述:失物招领 | |||||
/// </summary> | |||||
public class LostArticleInfoBLL : LostArticleInfoIBLL | |||||
{ | |||||
private LostArticleInfoService lostArticleInfoService = new LostArticleInfoService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<LostArticleInfoEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return lostArticleInfoService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取LostArticleInfo表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public LostArticleInfoEntity GetLostArticleInfoEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return lostArticleInfoService.GetLostArticleInfoEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
lostArticleInfoService.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 发布 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void PublishForm(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
lostArticleInfoService.PublishForm(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
public void ClaimForm(string keyValue, LostArticleInfoEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
lostArticleInfoService.ClaimForm(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 撤下 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void CancleForm(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
lostArticleInfoService.CancleForm(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
public void SaveEntity(string keyValue, LostArticleInfoEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
lostArticleInfoService.SaveEntity(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,114 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
namespace Learun.Application.OA | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-05-20 15:14 | |||||
/// 描 述:失物招领 | |||||
/// </summary> | |||||
public class LostArticleInfoEntity | |||||
{ | |||||
#region 实体成员 | |||||
/// <summary> | |||||
/// 主键 | |||||
/// </summary> | |||||
[Column("F_LID")] | |||||
public string F_LId { get; set; } | |||||
/// <summary> | |||||
/// 标题 | |||||
/// </summary> | |||||
[Column("F_FULLHEAD")] | |||||
public string F_FullHead { get; set; } | |||||
/// <summary> | |||||
/// 图片 | |||||
/// </summary> | |||||
[Column("F_IMAGE")] | |||||
public string F_Image { get; set; } | |||||
/// <summary> | |||||
/// 内容 | |||||
/// </summary> | |||||
[Column("F_CONTENT")] | |||||
public string F_Content { get; set; } | |||||
/// <summary> | |||||
/// 拾捡人 | |||||
/// </summary> | |||||
[Column("F_PICKER")] | |||||
public string F_Picker { get; set; } | |||||
/// <summary> | |||||
/// 发布人员 | |||||
/// </summary> | |||||
[Column("F_CREATEUSERNAME")] | |||||
public string F_CreateUserName { get; set; } | |||||
/// <summary> | |||||
/// 发布时间 | |||||
/// </summary> | |||||
[Column("F_RELEASETIME")] | |||||
public DateTime? F_ReleaseTime { get; set; } | |||||
/// <summary> | |||||
/// 创建时间 | |||||
/// </summary> | |||||
[Column("F_CREATETIME")] | |||||
public DateTime? F_CreateTime { get; set; } | |||||
/// <summary> | |||||
/// 状态 草稿0、待认领1、已认领2 | |||||
/// </summary> | |||||
[Column("F_STATE")] | |||||
public int? F_State { get; set; } | |||||
/// <summary> | |||||
/// 认领人 | |||||
/// </summary> | |||||
[Column("F_USER")] | |||||
public string F_User { get; set; } | |||||
/// <summary> | |||||
/// 认领时间 | |||||
/// </summary> | |||||
[Column("F_USERTIME")] | |||||
public DateTime? F_UserTime { get; set; } | |||||
/// <summary> | |||||
/// 认领照片 | |||||
/// </summary> | |||||
[Column("F_CLAIMIMAGE")] | |||||
public string F_ClaimImage { get; set; } | |||||
/// <summary> | |||||
/// 经手人 | |||||
/// </summary> | |||||
[Column("F_MANAGEUSERNAME")] | |||||
public string F_ManageUserName { get; set; } | |||||
/// <summary> | |||||
/// 经手人 | |||||
/// </summary> | |||||
[Column("F_MANAGEUSERID")] | |||||
public string F_ManageUserId { get; set; } | |||||
#endregion | |||||
#region 扩展操作 | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create() | |||||
{ | |||||
this.F_LId = Guid.NewGuid().ToString(); | |||||
UserInfo userInfo = LoginUserInfo.Get(); | |||||
this.F_CreateUserName = userInfo.realName; | |||||
this.F_CreateTime = DateTime.Now; | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue) | |||||
{ | |||||
this.F_LId = keyValue; | |||||
} | |||||
#endregion | |||||
#region 扩展字段 | |||||
#endregion | |||||
} | |||||
} | |||||
@@ -0,0 +1,64 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.OA | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-05-20 15:14 | |||||
/// 描 述:失物招领 | |||||
/// </summary> | |||||
public interface LostArticleInfoIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<LostArticleInfoEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取LostArticleInfo表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
LostArticleInfoEntity GetLostArticleInfoEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 发布 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
void PublishForm(string keyValue); | |||||
/// <summary> | |||||
/// 认领 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="entity"></param> | |||||
void ClaimForm(string keyValue, LostArticleInfoEntity entity); | |||||
/// <summary> | |||||
/// 撤下 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
void CancleForm(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
void SaveEntity(string keyValue, LostArticleInfoEntity entity); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,229 @@ | |||||
using Dapper; | |||||
using Learun.DataBase.Repository; | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Data; | |||||
using System.Text; | |||||
namespace Learun.Application.OA | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-05-20 15:14 | |||||
/// 描 述:失物招领 | |||||
/// </summary> | |||||
public class LostArticleInfoService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<LostArticleInfoEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@"t.* | |||||
"); | |||||
strSql.Append(" FROM LostArticleInfo t "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
if (queryParam.HasValues) | |||||
{ | |||||
if (!queryParam["F_FullHead"].IsEmpty()) | |||||
{ | |||||
dp.Add("F_FullHead", "%" + queryParam["F_FullHead"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND t.F_FullHead like @F_FullHead "); | |||||
} | |||||
} | |||||
return this.BaseRepository().FindList<LostArticleInfoEntity>(strSql.ToString(), dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取LostArticleInfo表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public LostArticleInfoEntity GetLostArticleInfoEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository().FindEntity<LostArticleInfoEntity>(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
this.BaseRepository().Delete<LostArticleInfoEntity>(t => t.F_LId == keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
public void SaveEntity(string keyValue, LostArticleInfoEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
entity.Modify(keyValue); | |||||
this.BaseRepository().Update(entity); | |||||
} | |||||
else | |||||
{ | |||||
entity.Create(); | |||||
this.BaseRepository().Insert(entity); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 发布 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void PublishForm(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
//草稿0、待认领1、已认领2 | |||||
string sql = $"update LostArticleInfo set F_State=1 where F_LId='{keyValue}'"; | |||||
this.BaseRepository().ExecuteBySql(sql); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 认领 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void ClaimForm(string keyValue, LostArticleInfoEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
//草稿0、待认领1、已认领2 | |||||
UserInfo userInfo = LoginUserInfo.Get(); | |||||
string sql = $@"update LostArticleInfo set F_State=2,F_User='{entity.F_User}',F_UserTime='{entity.F_UserTime}',F_ClaimImage='{entity.F_ClaimImage}', | |||||
F_ManageUserId='{userInfo.userId}',F_ManageUserName='{userInfo.realName}' where F_LId='{keyValue}'"; | |||||
this.BaseRepository().ExecuteBySql(sql); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 撤下 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void CancleForm(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
//草稿0、待认领1、已认领2 | |||||
string sql = $"update LostArticleInfo set F_State=0 where F_LId='{keyValue}'"; | |||||
this.BaseRepository().ExecuteBySql(sql); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |