diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveDocumentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveDocumentController.cs index 33f60a743..891c892ed 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveDocumentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveDocumentController.cs @@ -4,7 +4,6 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; using System.Linq; -using Learun.Application.Organization; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -19,7 +18,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { private SYS_ReceiveDocumentIBLL sYS_ReceiveDocumentIBLL = new SYS_ReceiveDocumentBLL(); private Sys_ReceiveFileIBLL receiveFileIbll=new Sys_ReceiveFileBLL(); - private RoleIBLL roleIBLL = new RoleBLL(); #region 视图功能 @@ -32,16 +30,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } - /// - /// 主页面 - /// - /// - [HttpGet] - public ActionResult RoleForm() - { - return View(); - } - + /// /// 公文接收归档 /// @@ -140,23 +129,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpGet] [AjaxOnly] - public ActionResult GetRoleData() - { - var data = roleIBLL.GetListForSelect(); - - //var jsonData = new - //{ - // data = data - //}; - - return Success(data); - } - /// - /// 获取表单数据 - /// - /// - [HttpGet] - [AjaxOnly] public ActionResult GetFormData(string keyValue) { var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveFileController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveFileController.cs index 73c1a7e6f..3b7c27e01 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveFileController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_ReceiveFileController.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Linq; using System.Web; using Learun.Application.Base.SystemModule; -using Learun.Application.Base.AuthorizeModule; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -21,7 +20,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL(); private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL(); - private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); #region 视图功能 @@ -302,29 +300,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity); return Success("发送成功"); } - /// - /// 根据角色批示 - /// - /// - [HttpPost] - [AjaxOnly] - public ActionResult RoleReceive(string strEntity) - { - Sys_IssueEntity entity = strEntity.ToObject(); - var data = userRelationIBLL.GetUserIdList(entity.SpecifyReceiver); - string userIds = ""; - foreach (var item in data) - { - if (userIds != "") - { - userIds += ","; - } - userIds += item.F_UserId; - } - entity.SpecifyReceiver = userIds; - sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity); - return Success("发送成功"); - } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_SendFileController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_SendFileController.cs index 777c1c3ed..835ab3110 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_SendFileController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_SendFileController.cs @@ -162,7 +162,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetPageList(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); - var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson); + var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 1); foreach (var item in data) { @@ -206,7 +206,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetPageListParty(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); - var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson); + var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 3); foreach (var item in data) { @@ -366,7 +366,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers sys_SendFileIBLL.ChangeStatusByProcessId(guid, 2); return Success("操作成功!"); } - /// /// 结束下发 /// @@ -381,13 +380,33 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("下发成功!"); } + /// + /// 提交 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult IssueList(string keyValue, string CreateUser) + { - /* public ActionResult ReceiveFile(string keyValue) - { - - return View(); - }*/ - + sys_SendFileIBLL.IssueList(keyValue, CreateUser); + return Success("操作成功!"); + } + + /// + /// 作废 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult CancelList(string keyValue) + { + sys_SendFileIBLL.CancelList(keyValue); + return Success("操作成功!"); + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_ReceiveFile/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_ReceiveFile/Form.js index 1934b0d24..74b57d767 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_ReceiveFile/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_ReceiveFile/Form.js @@ -61,19 +61,14 @@ var bootstrap = function ($, learun) { $('[data-table="' + id + '"]').lrSetFormData(data[id]); $('#Contents').html(data[id].Contents); - - //已读状态 且批示已填写的情况,不可编辑批示 - if (readFlag == 'true' && data[id].SpecifyReceiver && data[id].SpecifyReceiver.length > 0) { - $('#SpecifyReceiver').attr('readonly', 'readonly'); - } } } $("#lrUploader_uploadBtn_Url").hide(); }); //已读状态不可修改批示 - //if (readFlag == 'true') { - // $('#SpecifyReceiver').attr('readonly', 'readonly'); - //} + if (readFlag == 'true') { + $('#SpecifyReceiver').attr('readonly', 'readonly'); + } var data = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Sys_ReceiveFile/GetInstructions?keyValue=' + keyValue, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml index 1849ebe44..34fd97ae8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.cshtml @@ -3,43 +3,39 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
+
主题*
- +
-
-
接收对象
-
+
+
接收对象*
+
-
-
接收人
-
+
+
接收人*
+
-
-
接收部门
-
+
+
接收部门*
+
-
-
接收岗位
-
+
+
接收岗位*
+
-
-
接收角色
-
+
+
接收校区*
+
-
-
接收校区
-
+
+
接收角色*
+
-
-
文号*
- -
-
+
文件
-
+
-
+
正文
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js index f66be45fc..6f2d42780 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Form.js @@ -29,7 +29,7 @@ var bootstrap = function ($, learun) { $('#CompanyId').lrCompanySelect({ type: 'multiple' }); $('#DeptId').lrDepartmentSelect({ type: 'treemultiple' }); $('#PostId').lrPostSelect({ type: 'treemultiple' }); - $('#RoleId').lrRoleSelect({ type: 'treemultiple' }); + $('#RoleId').lrRoleSelect({ code: 'treemultiple' }); $('#ReceiverUserId').lrUserSelect({ type: '1' }); $('#SendType').lrDataItemSelect({ code: 'FileSendType', select: function (item) { @@ -118,7 +118,7 @@ var bootstrap = function ($, learun) { } } }); - $('#SendType').lrselectSet("2"); + $('#SendType').lrselectSet("1"); $('#Url').lrUploader(); var ContentsUE = UE.getEditor('Contents'); $('#Contents')[0].ue = ContentsUE; @@ -132,7 +132,7 @@ var bootstrap = function ($, learun) { } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); - if (item.id === 1 || item.id === "1") { + if (data[id].SendType === 1 || data[id].SendType == "1") { $("#CompanyIddiv").show(); $("#CompanyId").attr("isvalid", "yes"); $("#CompanyId").attr("checkexpession", "NotNull"); @@ -148,7 +148,8 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); - } else if (item.id === 2 || item.id === "2") { + $("#CompanyId").lrselectSet(data[id].ReceiverId); + } else if (data[id].SendType === 2 || data[id].SendType == "2") { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); @@ -164,7 +165,9 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); - } else if (item.id === 3 || item.id === "3") { + $("#DeptId").lrselectSet(data[id].ReceiverId); + } + else if (data[id].SendType === 3 || data[id].SendType === "3") { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); @@ -180,7 +183,9 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); - } else if (item.id === 4 || item.id === "4") { + $("#PostId").lrselectSet(data[id].ReceiverId); + } + else if (data[id].SendType === 4 || data[id].SendType === "4") { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); @@ -196,6 +201,7 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); + $("#ReceiverUserId").lrformselectSet(data[id].ReceiverId); } else { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); @@ -212,6 +218,7 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").show(); $("#RoleId").attr("isvalid", "yes"); $("#RoleId").attr("checkexpession", "NotNull"); + $("#RoleId").lrformselectSet(data[id].ReceiverId); } } } @@ -233,7 +240,7 @@ var bootstrap = function ($, learun) { keyValue = data[id].SFileId; } $('[data-table="' + id + '"]').lrSetFormData(data[id]); - if (item.id === 1 || item.id === "1") { + if (data[id].SendType === 1 || data[id].SendType == "1") { $("#CompanyIddiv").show(); $("#CompanyId").attr("isvalid", "yes"); $("#CompanyId").attr("checkexpession", "NotNull"); @@ -249,7 +256,8 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); - } else if (item.id === 2 || item.id === "2") { + $("#CompanyId").lrselectSet(data[id].ReceiverId); + } else if (data[id].SendType === 2 || data[id].SendType == "2") { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); @@ -265,7 +273,8 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); - } else if (item.id === 3 || item.id === "3") { + $("#DeptId").lrselectSet(data[id].ReceiverId); + } else if (data[id].SendType === 3 || data[id].SendType === "3") { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); @@ -281,7 +290,8 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); - } else if (item.id === 4 || item.id === "4") { + $("#PostId").lrselectSet(data[id].ReceiverId); + } else if (data[id].SendType === 4 || data[id].SendType === "4") { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); @@ -297,6 +307,7 @@ var bootstrap = function ($, learun) { $("#RoleIddiv").hide(); $("#RoleId").removeAttr("isvalid"); $("#RoleId").removeAttr("NotNull"); + $("#ReceiverUserId").lrformselectSet(data[id].ReceiverId); } else { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); @@ -305,14 +316,15 @@ var bootstrap = function ($, learun) { $("#DeptId").removeAttr("isvalid"); $("#DeptId").removeAttr("NotNull"); $("#ReceiverIddiv").hide(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); + $("#ReceiverUserId").removeAttr("isvalid") + $("#ReceiverUserId").removeAttr("isvalid") $("#PostIddiv").hide(); $("#PostId").removeAttr("isvalid"); $("#PostId").removeAttr("NotNull"); $("#RoleIddiv").show(); $("#RoleId").attr("isvalid", "yes"); $("#RoleId").attr("checkexpession", "NotNull"); + $("#RoleId").lrformselectSet(data[id].ReceiverId); } } } @@ -332,18 +344,10 @@ var bootstrap = function ($, learun) { var sendtype = $('#SendType').lrselectGet(); if (sendtype == "1") { formData.ReceiverId = $("#CompanyId").lrselectGet(); - if (($("#CompanyId").find(".lr-select-placeholder").text()).indexOf('请选择') != -1) { - formData.Receiver = ""; - } else { - formData.Receiver = $("#CompanyId").find(".lr-select-placeholder").text(); - } + formData.Receiver = $("#CompanyId").find(".lr-select-placeholder").text(); } else if (sendtype == "2") { formData.ReceiverId = $("#DeptId").lrselectGet(); - if (($("#DeptId").find(".lr-select-placeholder").text()).indexOf('请选择') != -1) { - formData.Receiver = ""; - } else { - formData.Receiver = $("#DeptId").find(".lr-select-placeholder").text(); - } + formData.Receiver = $("#DeptId").find(".lr-select-placeholder").text(); } else if (sendtype == "3") { formData.ReceiverId = $("#PostId").lrselectGet(); formData.Receiver = $("#PostId").find(".lr-select-placeholder").text(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.cshtml index cc6de8169..e218c39a8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.cshtml @@ -8,29 +8,25 @@
-
接收对象
-
+
接收对象*
+
-
接收人
+
接收人*
-
接收部门
-
+
接收部门*
+
-
接收岗位
+
接收岗位*
-
接收校区
+
接收校区*
-
-
文号*
- -
文件
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.js index acb96d1c0..42cfd017d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/FormParty.js @@ -35,10 +35,8 @@ var bootstrap = function ($, learun) { if (item != null && item != undefined) { if (item.id === 1 || item.id === "1") { $("#CompanyIddiv").show(); - $("#CompanyId").removeAttr("isvalid"); - $("#CompanyId").removeAttr("NotNull"); - //$("#CompanyId").attr("isvalid", "yes"); - //$("#CompanyId").attr("checkexpession", "NotNull"); + $("#CompanyId").attr("isvalid", "yes"); + $("#CompanyId").attr("checkexpession", "NotNull"); $("#DeptIddiv").hide(); $("#DeptId").removeAttr("isvalid"); $("#DeptId").removeAttr("NotNull"); @@ -53,10 +51,8 @@ var bootstrap = function ($, learun) { $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); $("#DeptIddiv").show(); - $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("NotNull"); - //$("#DeptId").attr("isvalid", "yes"); - //$("#DeptId").attr("checkexpession", "NotNull"); + $("#DeptId").attr("isvalid", "yes"); + $("#DeptId").attr("checkexpession", "NotNull"); $("#ReceiverIddiv").hide(); $("#ReceiverUserId").removeAttr("isvalid"); $("#ReceiverUserId").removeAttr("NotNull"); @@ -69,15 +65,13 @@ var bootstrap = function ($, learun) { $("#CompanyId").removeAttr("NotNull"); $("#DeptIddiv").hide(); $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("checkexpession"); + $("#DeptId").removeAttr("NotNull"); $("#ReceiverIddiv").hide(); $("#ReceiverUserId").removeAttr("isvalid"); $("#ReceiverUserId").removeAttr("NotNull"); $("#PostIddiv").show(); - $("#PostId").removeAttr("isvalid"); - $("#PostId").removeAttr("NotNull"); - //$("#PostId").attr("isvalid", "yes"); - //$("#PostId").attr("checkexpession", "NotNull"); + $("#PostId").attr("isvalid", "yes"); + $("#PostId").attr("checkexpession", "NotNull"); } else { $("#CompanyIddiv").hide(); $("#CompanyId").removeAttr("isvalid"); @@ -86,21 +80,12 @@ var bootstrap = function ($, learun) { $("#DeptId").removeAttr("isvalid"); $("#DeptId").removeAttr("NotNull"); $("#ReceiverIddiv").show(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); - //$("#ReceiverUserId").attr("isvalid", "yes"); - //$("#ReceiverUserId").attr("checkexpession", "NotNull"); + $("#ReceiverUserId").attr("isvalid", "yes"); + $("#ReceiverUserId").attr("checkexpession", "NotNull"); $("#PostIddiv").hide(); $("#PostId").removeAttr("isvalid"); $("#PostId").removeAttr("NotNull"); } - } else { - $("#CompanyId").removeAttr("isvalid"); - $("#CompanyId").removeAttr("NotNull"); - $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("NotNull"); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); } } }); @@ -168,10 +153,8 @@ var bootstrap = function ($, learun) { $("#DeptId").removeAttr("isvalid"); $("#DeptId").removeAttr("NotNull"); $("#ReceiverIddiv").show(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); - //$("#ReceiverUserId").attr("isvalid", "yes"); - //$("#ReceiverUserId").attr("checkexpession", "NotNull"); + $("#ReceiverUserId").attr("isvalid", "yes"); + $("#ReceiverUserId").attr("checkexpession", "NotNull"); $("#PostIddiv").hide(); $("#PostId").removeAttr("isvalid"); $("#PostId").removeAttr("NotNull"); @@ -199,10 +182,8 @@ var bootstrap = function ($, learun) { $('[data-table="' + id + '"]').lrSetFormData(data[id]); if (data[id].SendType === 1 || data[id].SendType == "1") { $("#CompanyIddiv").show(); - $("#CompanyId").removeAttr("isvalid"); - $("#CompanyId").removeAttr("NotNull"); - //$("#CompanyId").attr("isvalid", "yes"); - //$("#CompanyId").attr("checkexpession", "NotNull"); + $("#CompanyId").attr("isvalid", "yes"); + $("#CompanyId").attr("checkexpession", "NotNull"); $("#DeptIddiv").hide(); $("#DeptId").removeAttr("isvalid"); $("#DeptId").removeAttr("NotNull"); @@ -218,10 +199,8 @@ var bootstrap = function ($, learun) { $("#CompanyId").removeAttr("isvalid"); $("#CompanyId").removeAttr("NotNull"); $("#DeptIddiv").show(); - $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("NotNull"); - //$("#DeptId").attr("isvalid", "yes"); - //$("#DeptId").attr("checkexpession", "NotNull"); + $("#DeptId").attr("isvalid", "yes"); + $("#DeptId").attr("checkexpession", "NotNull"); $("#ReceiverIddiv").hide(); $("#ReceiverUserId").removeAttr("isvalid"); $("#ReceiverUserId").removeAttr("NotNull"); @@ -240,10 +219,8 @@ var bootstrap = function ($, learun) { $("#ReceiverUserId").removeAttr("isvalid"); $("#ReceiverUserId").removeAttr("NotNull"); $("#PostIddiv").show(); - $("#PostId").removeAttr("isvalid"); - $("#PostId").removeAttr("NotNull"); - //$("#PostId").attr("isvalid", "yes"); - //$("#PostId").attr("checkexpession", "NotNull"); + $("#PostId").attr("isvalid", "yes"); + $("#PostId").attr("checkexpession", "NotNull"); $("#PostId").lrselectSet(data[id].ReceiverId); } else { $("#CompanyIddiv").hide(); @@ -253,10 +230,8 @@ var bootstrap = function ($, learun) { $("#DeptId").removeAttr("isvalid"); $("#DeptId").removeAttr("NotNull"); $("#ReceiverIddiv").show(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); - //$("#ReceiverUserId").attr("isvalid", "yes"); - //$("#ReceiverUserId").attr("checkexpession", "NotNull"); + $("#ReceiverUserId").attr("isvalid", "yes"); + $("#ReceiverUserId").attr("checkexpession", "NotNull"); $("#PostIddiv").hide(); $("#PostId").removeAttr("isvalid"); $("#PostId").removeAttr("NotNull"); @@ -280,31 +255,16 @@ var bootstrap = function ($, learun) { var sendtype = $('#SendType').lrselectGet(); if (sendtype == "1") { formData.ReceiverId = $("#CompanyId").lrselectGet(); - - if (($("#CompanyId").find(".lr-select-placeholder").text()).indexOf('请选择') != -1) { - formData.Receiver = ""; - } else { - formData.Receiver = $("#CompanyId").find(".lr-select-placeholder").text(); - } + formData.Receiver = $("#CompanyId").find(".lr-select-placeholder").text(); } else if (sendtype == "2") { formData.ReceiverId = $("#DeptId").lrselectGet(); - - if (($("#DeptId").find(".lr-select-placeholder").text()).indexOf('请选择') != -1) { - formData.Receiver = ""; - } else { - formData.Receiver = $("#DeptId").find(".lr-select-placeholder").text(); - } + formData.Receiver = $("#DeptId").find(".lr-select-placeholder").text(); } else if (sendtype == "3") { formData.ReceiverId = $("#PostId").lrselectGet(); formData.Receiver = $("#PostId").find(".lr-select-placeholder").text(); } else { formData.ReceiverId = $("#ReceiverUserId").lrformselectGet(); - - if (($("#ReceiverUserId").find("span").text()).indexOf('请选择') != -1) { - formData.Receiver = ""; - } else { - formData.Receiver = $("#ReceiverUserId").find("span").text(); - } + formData.Receiver = $("#ReceiverUserId").find("span").text(); } if (!!processId) { formData.SProcessId = processId; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.cshtml index 47b5ee5f1..6b50d66ad 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.cshtml @@ -7,9 +7,6 @@
-
-
-
@@ -17,30 +14,6 @@
主题
-
-
接收对象
-
-
-
-
接收人
-
-
-
-
接收部门
-
-
-
-
接收岗位
-
-
-
-
接收校区
-
-
-
-
文号
- -
@@ -56,9 +29,10 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.js index 65baed317..7806639de 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/Index.js @@ -8,114 +8,19 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var processId = ''; - var startTime; - var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { - // 时间搜索框 - $('#datesearch').lrdate({ - dfdata: [ - { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } - ], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: '1', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - page.search(); - } - - }); $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); - }, 250, 400); + }, 220, 400); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - $("#ReceiverIddiv").hide(); - $("#PostIddiv").hide(); - $('#CompanyId').lrCompanySelect({ type: 'multiple' }); - $('#DeptId').lrDepartmentSelect({ type: 'treemultiple' }); - $('#PostId').lrPostSelect({ type: 'treemultiple' }); - $('#ReceiverUserId').lrUserSelect({ type: '1' }); - $('#SendType').lrDataItemSelect({ - code: 'FileSendType', select: function (item) { - if (item != null && item != undefined) { - if (item.id === 1 || item.id === "1") { - $("#CompanyIddiv").show(); - $("#CompanyId").attr("isvalid", "yes"); - $("#CompanyId").attr("checkexpession", "NotNull"); - $("#DeptIddiv").hide(); - $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("NotNull"); - $("#ReceiverIddiv").hide(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); - $("#PostIddiv").hide(); - $("#PostId").removeAttr("isvalid"); - $("#PostId").removeAttr("NotNull"); - } else if (item.id === 2 || item.id === "2") { - $("#CompanyIddiv").hide(); - $("#CompanyId").removeAttr("isvalid"); - $("#CompanyId").removeAttr("NotNull"); - $("#DeptIddiv").show(); - $("#DeptId").attr("isvalid", "yes"); - $("#DeptId").attr("checkexpession", "NotNull"); - $("#ReceiverIddiv").hide(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); - $("#PostIddiv").hide(); - $("#PostId").removeAttr("isvalid"); - $("#PostId").removeAttr("NotNull"); - } else if (item.id === 3 || item.id === "3") { - $("#CompanyIddiv").hide(); - $("#CompanyId").removeAttr("isvalid"); - $("#CompanyId").removeAttr("NotNull"); - $("#DeptIddiv").hide(); - $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("NotNull"); - $("#ReceiverIddiv").hide(); - $("#ReceiverUserId").removeAttr("isvalid"); - $("#ReceiverUserId").removeAttr("NotNull"); - $("#PostIddiv").show(); - $("#PostId").attr("isvalid", "yes"); - $("#PostId").attr("checkexpession", "NotNull"); - } else { - $("#CompanyIddiv").hide(); - $("#CompanyId").removeAttr("isvalid"); - $("#CompanyId").removeAttr("NotNull"); - $("#DeptIddiv").hide(); - $("#DeptId").removeAttr("isvalid"); - $("#DeptId").removeAttr("NotNull"); - $("#ReceiverIddiv").show(); - $("#ReceiverUserId").attr("isvalid", "yes"); - $("#ReceiverUserId").attr("checkexpession", "NotNull"); - $("#PostIddiv").hide(); - $("#PostId").removeAttr("isvalid"); - $("#PostId").removeAttr("NotNull"); - } - } - } - }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ @@ -233,16 +138,43 @@ var bootstrap = function ($, learun) { }); } }); - // 结束下发 - $('#lr_OverIssue').on('click', function () { + // 下发 + $('#lr_nosubmit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('SFileId'); + var CreateUser = learun.clientdata.get(['userinfo']).realName; if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否结束下发!', function (res) { + var SendFlag = $('#gridtable').jfGridValue('SendFlag'); + if (SendFlag !== 0) { + learun.alert.warning("当前项目已下发,请勿重复下发!"); + return; + } + learun.layerConfirm('是否确认提交该项!', function (res) { if (res) { - processId = learun.newGuid(); - learun.postForm(top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/OverIssue', { keyValue: keyValue, }, function (res) { - page.search(); - }); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/IssueList', + { + keyValue: keyValue, CreateUser: CreateUser + }), + function (res) { + refreshGirdData(res, {}); + } + } + }); + } + }); + // 作废 + $('#lr_cancel').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('SFileId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认作废此公文?', function (res, _index) { + if (res) { + learun.loading(true, '作废流程中...'); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/CancelList', + { + keyValue: keyValue + }), + function (res) { + refreshGirdData(res, {}); + } } }); } @@ -254,7 +186,6 @@ var bootstrap = function ($, learun) { url: top.$.rootUrl + '/EducationalAdministration/Sys_SendFile/GetPageList', headData: [ { label: "主题", name: "Title", width: 300, align: "left" }, - { label: "文号", name: "DocNo", width: 300, align: "left" }, { label: "接收对象", name: "SendType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -267,7 +198,7 @@ var bootstrap = function ($, learun) { }); } }, - { + { label: "接收人", name: "Receiver", width: 300, align: "left" }, { @@ -276,7 +207,6 @@ var bootstrap = function ($, learun) { { label: "下发时间", name: "SendTime", width: 150, align: "left" }, - { label: "状态", name: "SendFlag", width: 100, align: "left", formatter: function (cellvalue, row) { @@ -289,22 +219,15 @@ var bootstrap = function ($, learun) { } } }, - { - label: "阅读数/接受人数", name: "NumberPeople", width: 150, align: "left" - }, - ], mainId: 'SFileId', + sidx: 'SendFlag asc,SendTime desc', isPage: true }); - //page.search(); + page.search(); }, search: function (param) { param = param || {}; - param.StartTime = startTime; - param.EndTime = endTime; - param.ReceiverId = param.DeptId + param.ReceiverUserId + param.PostId + param.CompanyId; - param.SqlParameter = ' AND SendFlag<>4 and STypeId=1'; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/IndexParty.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/IndexParty.js index 1c86b629e..f2a86e0cf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/IndexParty.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_SendFile/IndexParty.js @@ -238,7 +238,6 @@ var bootstrap = function ($, learun) { param = param || {}; param.StartTime = startTime; param.EndTime = endTime; - param.STypeId = 3; param.SqlParameter = ' AND SendFlag<>4'; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileBLL.cs index 423b9965a..a7f6b7b82 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileBLL.cs @@ -228,6 +228,70 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 非流程提交(下发) + /// + /// + public void IssueList(string keyValue, string CreateUser) + { + try + { + sys_SendFileService.IssueList(keyValue, CreateUser); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void NoProcessId(string keyValue, int status) + { + try + { + sys_SendFileService.NoProcessId(keyValue, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 作废 + /// + /// + public void CancelList(string keyValue) + { + try + { + sys_SendFileService.CancelList(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileEntity.cs index 61b1922e2..8ceadf7c0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileEntity.cs @@ -91,7 +91,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("DOCNO")] public string DocNo { get; set; } #endregion - [NotMapped] + [NotMapped] public string NumberPeople { get; set; } #region 扩展操作 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileIBLL.cs index c39fba50e..2555779c0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileIBLL.cs @@ -61,5 +61,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion void OverIssue(string keyValue); + /// + /// 非流程下发 + /// + /// + /// + void IssueList(string keyValue, string CreateUser); + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + void NoProcessId(string keyValue, int status); + + void CancelList(string keyValue); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs index 012643104..75589fc84 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_SendFile/Sys_SendFileService.cs @@ -44,66 +44,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); - if (queryParam["StartTime"].ToString() != "1753-01-01" && queryParam["EndTime"].ToString() != "3000-01-01") - { - dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); - dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); - strSql.Append(" AND ( t.SendTime >= @startTime AND t.SendTime <= @endTime or (t.SendTime is null or len(t.SendTime)=0)) "); - } - if (!queryParam["Title"].IsEmpty()) { dp.Add("Title", "%" + queryParam["Title"].ToString() + "%", DbType.String); strSql.Append(" AND t.Title Like @Title "); } - if (!queryParam["DocNo"].IsEmpty()) - { - dp.Add("DocNo", "%" + queryParam["DocNo"].ToString() + "%", DbType.String); - strSql.Append(" AND t.DocNo Like @DocNo "); - } if (!queryParam["SenderId"].IsEmpty()) { dp.Add("SenderId", "" + queryParam["SenderId"].ToString() + "", DbType.String); strSql.Append(" AND t.SenderId = @SenderId "); } - if (!queryParam["Receiver"].IsEmpty()) - { - dp.Add("Receiver", "%" + queryParam["Receiver"].ToString() + "%", DbType.String); - strSql.Append(" AND t.Receiver Like @Receiver "); - } - if (!queryParam["ReceiverId"].IsEmpty()) - { - if (queryParam["ReceiverId"].ToString().Contains(",")) - { - var arr = queryParam["ReceiverId"].ToString().Split(','); - var str = ""; - str += " AND ("; - - foreach (var item in arr) - { - str += $" t.ReceiverId Like '%{item}%' and"; - } - - str=str.Remove(str.LastIndexOf("and"), 3); - str += " )"; - strSql.Append(str); - } - else - { - strSql.Append($" AND t.ReceiverId Like '%{queryParam["ReceiverId"].ToString()}%' "); - } - - } - if (!queryParam["SendType"].IsEmpty()) - { - dp.Add("SendType", "" + queryParam["SendType"].ToString() + "", DbType.String); - strSql.Append(" AND t.SendType = @SendType "); - } - //sql条件 - if (!queryParam["SqlParameter"].IsEmpty()) - { - strSql.Append(queryParam["SqlParameter"].ToString()); - } + //if (!queryParam["Receiver"].IsEmpty()) + //{ + // dp.Add("Receiver", "%" + queryParam["Receiver"].ToString() + "%", DbType.String); + // strSql.Append(" AND t.Receiver Like @Receiver "); + //} + ////sql条件 + //if (!queryParam["SqlParameter"].IsEmpty()) + //{ + // strSql.Append(queryParam["SqlParameter"].ToString()); + //} return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) @@ -530,6 +490,269 @@ on a.F_UserId=b.F_UserId where b.F_ObjectId in(" + string.Join(",", ppostid) + } } } + + /// + /// 非流程提交(下发) + /// + /// + public void IssueList(string keyValue, string CreateUser) + { + try + { + var entity = this.BaseRepository().FindEntity(a => a.SFileId == keyValue); + if (null != entity) + { + entity.SendFlag = 2; + entity.SendTime = DateTime.Now; + NoProcessId(keyValue, 2); + } + + this.BaseRepository().Update(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 修改审批状态 + /// + /// + /// + public void NoProcessId(string keyValue, int status) + { + if (status == 2) + { + var db = BaseRepository().BeginTrans(); + try + { + var needpostuserlist = new List(); + var Sys_SendFile = db.FindEntity(m => m.SFileId == keyValue); + if (Sys_SendFile.SendType == "1") + { + var teacherlist = db.FindList(m => + m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师" && + m.F_CompanyId == Sys_SendFile.ReceiverId); + needpostuserlist = teacherlist.ToList(); + foreach (var tEntity in teacherlist) + { + Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); + receiveFile.Create(); + receiveFile.SFileId = Sys_SendFile.SFileId; + receiveFile.SenderId = Sys_SendFile.SenderId; + receiveFile.Sender = Sys_SendFile.Sender; + receiveFile.ReceiverId = tEntity.F_UserId; + receiveFile.Receiver = tEntity.F_RealName; + receiveFile.Title = Sys_SendFile.Title; + receiveFile.Contents = Sys_SendFile.Contents; + receiveFile.Url = Sys_SendFile.Url; + receiveFile.ReadFlag = false; + receiveFile.SendTime = DateTime.Now; + receiveFile.SendType = Sys_SendFile.SendType; + receiveFile.DelFlag = false; + receiveFile.STypeId = Sys_SendFile.STypeId; + receiveFile.ReplyFlag = false; + receiveFile.SLastDate = Sys_SendFile.SLastDate; + receiveFile.RUrl = Guid.NewGuid().ToString(); + db.Insert(receiveFile); + } + } + else if (Sys_SendFile.SendType == "2") + { + var teacherlist = db.FindList(m => + m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师" && + Sys_SendFile.ReceiverId.Contains(m.F_DepartmentId)); + needpostuserlist = teacherlist.ToList(); + foreach (var tEntity in teacherlist) + { + Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); + receiveFile.Create(); + receiveFile.SFileId = Sys_SendFile.SFileId; + receiveFile.SenderId = Sys_SendFile.SenderId; + receiveFile.Sender = Sys_SendFile.Sender; + receiveFile.ReceiverId = tEntity.F_UserId; + receiveFile.Receiver = tEntity.F_RealName; + receiveFile.Title = Sys_SendFile.Title; + receiveFile.Contents = Sys_SendFile.Contents; + receiveFile.Url = Sys_SendFile.Url; + receiveFile.ReadFlag = false; + receiveFile.SendTime = DateTime.Now; + receiveFile.SendType = Sys_SendFile.SendType; + receiveFile.DelFlag = false; + receiveFile.STypeId = Sys_SendFile.STypeId; + receiveFile.ReplyFlag = false; + receiveFile.SLastDate = Sys_SendFile.SLastDate; + receiveFile.RUrl = Guid.NewGuid().ToString(); + db.Insert(receiveFile); + } + } + else if (Sys_SendFile.SendType == "3") + { + List ppostid = Sys_SendFile.ReceiverId.Split(',').ToList(); + for (int i = 0; i < ppostid.Count; i++) + { + ppostid[i] = "'" + ppostid[i] + "'"; + } + + var teacherlist = db.FindList( + @"select distinct a.* from [dbo].[LR_Base_User] a left join [dbo].[LR_Base_UserRelation] b +on a.F_UserId=b.F_UserId where b.F_ObjectId in(" + string.Join(",", ppostid) + + ") and a.F_DeleteMark<>1 and a.F_EnabledMark=1 and a.F_Description='教师'"); + needpostuserlist = teacherlist.ToList(); + foreach (var tEntity in teacherlist) + { + Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); + receiveFile.Create(); + receiveFile.SFileId = Sys_SendFile.SFileId; + receiveFile.SenderId = Sys_SendFile.SenderId; + receiveFile.Sender = Sys_SendFile.Sender; + receiveFile.ReceiverId = tEntity.F_UserId; + receiveFile.Receiver = tEntity.F_RealName; + receiveFile.Title = Sys_SendFile.Title; + receiveFile.Contents = Sys_SendFile.Contents; + receiveFile.Url = Sys_SendFile.Url; + receiveFile.ReadFlag = false; + receiveFile.SendTime = DateTime.Now; + receiveFile.SendType = Sys_SendFile.SendType; + receiveFile.DelFlag = false; + receiveFile.STypeId = Sys_SendFile.STypeId; + receiveFile.ReplyFlag = false; + receiveFile.SLastDate = Sys_SendFile.SLastDate; + receiveFile.RUrl = Guid.NewGuid().ToString(); + db.Insert(receiveFile); + } + } + else if (Sys_SendFile.SendType == "4") + { + var teacherlist = db.FindList(m => + m.F_DeleteMark != 1 && m.F_EnabledMark == 1 && m.F_Description == "教师" && + Sys_SendFile.ReceiverId.Contains(m.F_UserId)); + needpostuserlist = teacherlist.ToList(); + foreach (var tEntity in teacherlist) + { + Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); + receiveFile.Create(); + receiveFile.SFileId = Sys_SendFile.SFileId; + receiveFile.SenderId = Sys_SendFile.SenderId; + receiveFile.Sender = Sys_SendFile.Sender; + receiveFile.ReceiverId = tEntity.F_UserId; + receiveFile.Receiver = tEntity.F_RealName; + receiveFile.Title = Sys_SendFile.Title; + receiveFile.Contents = Sys_SendFile.Contents; + receiveFile.Url = Sys_SendFile.Url; + receiveFile.ReadFlag = false; + receiveFile.SendTime = DateTime.Now; + receiveFile.SendType = Sys_SendFile.SendType; + receiveFile.DelFlag = false; + receiveFile.STypeId = Sys_SendFile.STypeId; + receiveFile.ReplyFlag = false; + receiveFile.SLastDate = Sys_SendFile.SLastDate; + receiveFile.RUrl = Guid.NewGuid().ToString(); + db.Insert(receiveFile); + } + } + else + { + var teacherlist = db.FindList( + @"select distinct a.* from [dbo].[LR_Base_User] a left join [dbo].[LR_Base_UserRelation] b on a.F_UserId=b.F_UserId where b.F_ObjectId ='" + + Sys_SendFile.ReceiverId + "' and a.F_DeleteMark<>1 and a.F_EnabledMark=1 and a.F_Description='教师'"); + needpostuserlist = teacherlist.ToList(); + foreach (var tEntity in teacherlist) + { + Sys_ReceiveFileEntity receiveFile = new Sys_ReceiveFileEntity(); + receiveFile.Create(); + receiveFile.SFileId = Sys_SendFile.SFileId; + receiveFile.SenderId = Sys_SendFile.SenderId; + receiveFile.Sender = Sys_SendFile.Sender; + receiveFile.ReceiverId = tEntity.F_UserId; + receiveFile.Receiver = tEntity.F_RealName; + receiveFile.Title = Sys_SendFile.Title; + receiveFile.Contents = Sys_SendFile.Contents; + receiveFile.Url = Sys_SendFile.Url; + receiveFile.ReadFlag = false; + receiveFile.SendTime = DateTime.Now; + receiveFile.SendType = Sys_SendFile.SendType; + receiveFile.DelFlag = false; + receiveFile.STypeId = Sys_SendFile.STypeId; + receiveFile.ReplyFlag = false; + receiveFile.SLastDate = Sys_SendFile.SLastDate; + receiveFile.RUrl = Guid.NewGuid().ToString(); + db.Insert(receiveFile); + } + } + Sys_SendFile.SendFlag = 2; + Sys_SendFile.SendTime = DateTime.Now; + db.Update(Sys_SendFile); + db.Commit(); + //读取信息推送管理-公文下发推送(02)的配置 + var informationPushEntity = this.BaseRepository().FindEntity(x => x.PushItem == "02"); + if (informationPushEntity != null && informationPushEntity.Status == true) + { + //微信推送 + try + { + PushWeixin(needpostuserlist, Sys_SendFile.Title); + } + catch (Exception e) + { + } + //飞星推送 + Task.Run(async () => + { + using (var hubConnection = new HubConnection(ConfigurationManager.AppSettings["CommunicationServeraddress"])) + { + var hubProxy = hubConnection.CreateHubProxy("SignalRHub"); + await hubConnection.Start(); + await hubProxy.Invoke("PushAnnouncement", Sys_SendFile.SenderId, Sys_SendFile.Title, Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Length < 20 ? Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)) : Util.Str.ReplaceHtml(HttpUtility.HtmlDecode(Sys_SendFile.Contents)).Substring(0, 20), "sendfile", string.Join(",", needpostuserlist.Select(m => m.F_UserId)), ""); + } + }); + } + + } + catch (Exception ex) + { + db.Rollback(); + } + } + } + + /// + /// 作废 + /// + /// + public void CancelList(string keyValue) + { + try + { + var entity = this.BaseRepository().FindEntity(a => a.SFileId == keyValue); + if (null != entity) + { + entity.SendFlag = 0; + entity.SendTime = DateTime.Now; + this.BaseRepository().Delete(t => t.SFileId == keyValue); + } + this.BaseRepository().Update(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 2cb9d3fe6..d8f93d5c8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -259,8 +259,8 @@ - +