@@ -0,0 +1,120 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||||
using System.Web.Mvc; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyManageController : MvcControllerBase | |||||
{ | |||||
private PartyManageIBLL partyManageIBLL = new PartyManageBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = partyManageIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var PartyCateData = partyManageIBLL.GetPartyCateEntity( keyValue ); | |||||
var PartyManageData = partyManageIBLL.GetPartyManageEntity( PartyCateData.ID ); | |||||
var jsonData = new { | |||||
PartyManage = PartyManageData, | |||||
PartyCate = PartyCateData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
partyManageIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="strEntity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, string strEntity, string strpartyManageEntity) | |||||
{ | |||||
PartyCateEntity entity = strEntity.ToObject<PartyCateEntity>(); | |||||
PartyManageEntity partyManageEntity = strpartyManageEntity.ToObject<PartyManageEntity>(); | |||||
partyManageIBLL.SaveEntity(keyValue,entity,partyManageEntity); | |||||
if (string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
} | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,19 @@ | |||||
@{ | |||||
ViewBag.Title = "党政办管理"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="PartyManage" > | |||||
<div class="lr-form-item-title">所属分类<font face="宋体">*</font></div> | |||||
<div id="CateId" isvalid="yes" checkexpession="NotNull" ></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="PartyManage" > | |||||
<div class="lr-form-item-title">标题<font face="宋体">*</font></div> | |||||
<input id="Title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="PartyManage" > | |||||
<div class="lr-form-item-title">附件上传</div> | |||||
<div id="Filepath" ></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/PartyManage/Form.js") |
@@ -0,0 +1,52 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2023-07-31 16:59 | |||||
* 描 述:党政办管理 | |||||
*/ | |||||
var acceptClick; | |||||
var keyValue = request('keyValue'); | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page = { | |||||
init: function () { | |||||
$('.lr-form-wrap').lrscroll(); | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#CateId').lrDataSourceSelect({ code: 'partycate',value: 'id',text: 'name' }); | |||||
$('#Filepath').lrUploader(); | |||||
}, | |||||
initData: function () { | |||||
if (!!keyValue) { | |||||
$.lrSetForm(top.$.rootUrl + '/PersonnelManagement/PartyManage/GetFormData?keyValue=' + keyValue, function (data) { | |||||
for (var id in data) { | |||||
if (!!data[id].length && data[id].length > 0) { | |||||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||||
} | |||||
else { | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('body').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = {}; | |||||
postData.strpartyManageEntity = JSON.stringify($('[data-table="PartyManage"]').lrGetFormData()); | |||||
postData.strEntity = JSON.stringify($('[data-table="PartyCate"]').lrGetFormData()); | |||||
$.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/PartyManage/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,39 @@ | |||||
@{ | |||||
ViewBag.Title = "党政办管理"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout lr-layout-left-center" id="lr_layout" > | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlg ">树形列表</div> | |||||
<div id="dataTree" class="lr-layout-body"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap "> | |||||
<div class="lr-layout-title"> | |||||
<span id="titleinfo" class="lrlg">列表信息</span> | |||||
</div> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="datesearch"></div> | |||||
</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> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/PartyManage/Index.js") |
@@ -0,0 +1,137 @@ | |||||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
* 创建人:超级管理员 | |||||
* 日 期:2023-07-31 16:59 | |||||
* 描 述:党政办管理 | |||||
*/ | |||||
var refreshGirdData; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var startTime; | |||||
var endTime; | |||||
var page = { | |||||
init: function () { | |||||
page.initGird(); | |||||
page.bind(); | |||||
}, | |||||
bind: function () { | |||||
// 初始化左侧树形数据 | |||||
$('#dataTree').lrtree({ | |||||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetTree?code=partycate&parentId=id&Id=id&showId=name', | |||||
nodeClick: function (item) { | |||||
page.search({ CateId: item.value }); | |||||
} | |||||
}); | |||||
// 时间搜索框 | |||||
$('#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(); | |||||
} | |||||
}); | |||||
// 刷新 | |||||
$('#lr_refresh').on('click', function () { | |||||
location.reload(); | |||||
}); | |||||
// 新增 | |||||
$('#lr_add').on('click', function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '新增', | |||||
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/Form', | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '编辑', | |||||
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/Form?keyValue=' + keyValue, | |||||
width: 600, | |||||
height: 400, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 删除 | |||||
$('#lr_delete').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||||
if (res) { | |||||
learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/PartyManage/DeleteForm', { keyValue: keyValue}, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
// 打印 | |||||
$('#lr_print').on('click', function () { | |||||
$('#gridtable').jqprintTable(); | |||||
}); | |||||
}, | |||||
// 初始化列表 | |||||
initGird: function () { | |||||
$('#gridtable').lrAuthorizeJfGrid({ | |||||
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/GetPageList', | |||||
headData: [ | |||||
{ label: "所属分类", name: "CateId", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op,$cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'partycate', | |||||
key: value, | |||||
keyId: 'id', | |||||
callback: function (_data) { | |||||
callback(_data['name']); | |||||
} | |||||
}); | |||||
}}, | |||||
{ label: "标题", name: "Title", width: 100, align: "left"}, | |||||
{ label: "附件上传", name: "Filepath", width: 100, align: "left"}, | |||||
], | |||||
mainId:'ID', | |||||
isPage: true | |||||
}); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
param.StartTime = startTime; | |||||
param.EndTime = endTime; | |||||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -911,6 +911,7 @@ | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookSubscriptionController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookSubscriptionController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TeacherPlanCheckController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TeacherPlanCheckController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TrainingRoomUseController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TrainingRoomUseController.cs" /> | ||||
<Compile Include="Areas\PersonnelManagement\Controllers\PartyManageController.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | <Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | ||||
@@ -7154,6 +7155,10 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\TrainingRoomUse\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\TrainingRoomUse\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TrainingRoomUse\Form.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\TrainingRoomUse\Form.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\TrainingRoomUse\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\TrainingRoomUse\Form.js" /> | ||||
<Content Include="Areas\PersonnelManagement\Views\PartyManage\Index.cshtml" /> | |||||
<Content Include="Areas\PersonnelManagement\Views\PartyManage\Index.js" /> | |||||
<Content Include="Areas\PersonnelManagement\Views\PartyManage\Form.cshtml" /> | |||||
<Content Include="Areas\PersonnelManagement\Views\PartyManage\Form.js" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | <Folder Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElectivePre\" /> | ||||
@@ -670,6 +670,8 @@ | |||||
<Compile Include="EducationalAdministration\TextBookSubscriptionMap.cs" /> | <Compile Include="EducationalAdministration\TextBookSubscriptionMap.cs" /> | ||||
<Compile Include="EducationalAdministration\TeacherPlanCheckMap.cs" /> | <Compile Include="EducationalAdministration\TeacherPlanCheckMap.cs" /> | ||||
<Compile Include="EducationalAdministration\TrainingRoomUseMap.cs" /> | <Compile Include="EducationalAdministration\TrainingRoomUseMap.cs" /> | ||||
<Compile Include="PersonnelManagement\PartyManageMap.cs" /> | |||||
<Compile Include="PersonnelManagement\PartyCateMap.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | <ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | ||||
@@ -0,0 +1,29 @@ | |||||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||||
using System.Data.Entity.ModelConfiguration; | |||||
namespace Learun.Application.Mapping | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyCateMap : EntityTypeConfiguration<PartyCateEntity> | |||||
{ | |||||
public PartyCateMap() | |||||
{ | |||||
#region 表、主键 | |||||
//表 | |||||
this.ToTable("PARTYCATE"); | |||||
//主键 | |||||
this.HasKey(t => t.ID); | |||||
#endregion | |||||
#region 配置关系 | |||||
#endregion | |||||
} | |||||
} | |||||
} | |||||
@@ -0,0 +1,29 @@ | |||||
using Learun.Application.TwoDevelopment.PersonnelManagement; | |||||
using System.Data.Entity.ModelConfiguration; | |||||
namespace Learun.Application.Mapping | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyManageMap : EntityTypeConfiguration<PartyManageEntity> | |||||
{ | |||||
public PartyManageMap() | |||||
{ | |||||
#region 表、主键 | |||||
//表 | |||||
this.ToTable("PARTYMANAGE"); | |||||
//主键 | |||||
this.HasKey(t => t.ID); | |||||
#endregion | |||||
#region 配置关系 | |||||
#endregion | |||||
} | |||||
} | |||||
} | |||||
@@ -2103,6 +2103,11 @@ | |||||
<Compile Include="EducationalAdministration\TrainingRoomUse\TrainingRoomUseService.cs" /> | <Compile Include="EducationalAdministration\TrainingRoomUse\TrainingRoomUseService.cs" /> | ||||
<Compile Include="EducationalAdministration\TrainingRoomUse\TrainingRoomUseBLL.cs" /> | <Compile Include="EducationalAdministration\TrainingRoomUse\TrainingRoomUseBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\TrainingRoomUse\TrainingRoomUseIBLL.cs" /> | <Compile Include="EducationalAdministration\TrainingRoomUse\TrainingRoomUseIBLL.cs" /> | ||||
<Compile Include="PersonnelManagement\PartyManage\PartyManageEntity.cs" /> | |||||
<Compile Include="PersonnelManagement\PartyManage\PartyCateEntity.cs" /> | |||||
<Compile Include="PersonnelManagement\PartyManage\PartyManageService.cs" /> | |||||
<Compile Include="PersonnelManagement\PartyManage\PartyManageBLL.cs" /> | |||||
<Compile Include="PersonnelManagement\PartyManage\PartyManageIBLL.cs" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | <ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | ||||
@@ -0,0 +1,75 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyCateEntity | |||||
{ | |||||
#region 实体成员 | |||||
/// <summary> | |||||
/// ID | |||||
/// </summary> | |||||
[Column("ID")] | |||||
public string ID { get; set; } | |||||
/// <summary> | |||||
/// Name | |||||
/// </summary> | |||||
[Column("NAME")] | |||||
public string Name { get; set; } | |||||
/// <summary> | |||||
/// Creator | |||||
/// </summary> | |||||
[Column("CREATOR")] | |||||
public string Creator { get; set; } | |||||
/// <summary> | |||||
/// Createtime | |||||
/// </summary> | |||||
[Column("CREATETIME")] | |||||
public DateTime? Createtime { get; set; } | |||||
#endregion | |||||
#region 扩展操作 | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create() | |||||
{ | |||||
this.ID = Guid.NewGuid().ToString(); | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue) | |||||
{ | |||||
this.ID = keyValue; | |||||
} | |||||
#endregion | |||||
#region 扩展字段 | |||||
/// <summary> | |||||
/// 所属分类 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string CateId { get; set; } | |||||
/// <summary> | |||||
/// 标题 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string Title { get; set; } | |||||
/// <summary> | |||||
/// 附件上传 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string Filepath { get; set; } | |||||
#endregion | |||||
} | |||||
} | |||||
@@ -0,0 +1,149 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyManageBLL : PartyManageIBLL | |||||
{ | |||||
private PartyManageService partyManageService = new PartyManageService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<PartyCateEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return partyManageService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取PartyManage表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public PartyManageEntity GetPartyManageEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return partyManageService.GetPartyManageEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取PartyCate表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public PartyCateEntity GetPartyCateEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return partyManageService.GetPartyCateEntity(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 | |||||
{ | |||||
partyManageService.DeleteEntity(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, PartyCateEntity entity,PartyManageEntity partyManageEntity) | |||||
{ | |||||
try | |||||
{ | |||||
partyManageService.SaveEntity(keyValue, entity,partyManageEntity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,73 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyManageEntity | |||||
{ | |||||
#region 实体成员 | |||||
/// <summary> | |||||
/// ID | |||||
/// </summary> | |||||
[Column("ID")] | |||||
public string ID { get; set; } | |||||
/// <summary> | |||||
/// CateId | |||||
/// </summary> | |||||
[Column("CATEID")] | |||||
public string CateId { get; set; } | |||||
/// <summary> | |||||
/// Title | |||||
/// </summary> | |||||
[Column("TITLE")] | |||||
public string Title { get; set; } | |||||
/// <summary> | |||||
/// Creator | |||||
/// </summary> | |||||
[Column("CREATOR")] | |||||
public string Creator { get; set; } | |||||
/// <summary> | |||||
/// Createtime | |||||
/// </summary> | |||||
[Column("CREATETIME")] | |||||
public DateTime? Createtime { get; set; } | |||||
/// <summary> | |||||
/// Updatetime | |||||
/// </summary> | |||||
[Column("UPDATETIME")] | |||||
public DateTime? Updatetime { get; set; } | |||||
/// <summary> | |||||
/// Filepath | |||||
/// </summary> | |||||
[Column("FILEPATH")] | |||||
public string Filepath { get; set; } | |||||
#endregion | |||||
#region 扩展操作 | |||||
/// <summary> | |||||
/// 新增调用 | |||||
/// </summary> | |||||
public void Create() | |||||
{ | |||||
this.ID = Guid.NewGuid().ToString(); | |||||
} | |||||
/// <summary> | |||||
/// 编辑调用 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void Modify(string keyValue) | |||||
{ | |||||
this.ID = keyValue; | |||||
} | |||||
#endregion | |||||
} | |||||
} | |||||
@@ -0,0 +1,54 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public interface PartyManageIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<PartyCateEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取PartyManage表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
PartyManageEntity GetPartyManageEntity(string keyValue); | |||||
/// <summary> | |||||
/// 获取PartyCate表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
PartyCateEntity GetPartyCateEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
void SaveEntity(string keyValue, PartyCateEntity entity,PartyManageEntity partyManageEntity); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,193 @@ | |||||
using Dapper; | |||||
using Learun.DataBase.Repository; | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Data; | |||||
using System.Text; | |||||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2023-07-31 16:59 | |||||
/// 描 述:党政办管理 | |||||
/// </summary> | |||||
public class PartyManageService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<PartyCateEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" | |||||
t.ID, | |||||
t1.CateId, | |||||
t1.Title, | |||||
t1.Filepath | |||||
"); | |||||
strSql.Append(" FROM PartyCate t "); | |||||
strSql.Append(" LEFT JOIN PartyManage t1 ON t1.CateId = t.ID "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
if (!queryParam["CateId"].IsEmpty()) | |||||
{ | |||||
dp.Add("CateId",queryParam["CateId"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.CateId = @CateId "); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(),dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取PartyManage表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public PartyManageEntity GetPartyManageEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindEntity<PartyManageEntity>(t=>t.CateId == keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取PartyCate表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public PartyCateEntity GetPartyCateEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindEntity<PartyCateEntity>(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) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
var partyCateEntity = GetPartyCateEntity(keyValue); | |||||
db.Delete<PartyManageEntity>(t=>t.CateId == partyCateEntity.ID); | |||||
db.Delete<PartyCateEntity>(t=>t.ID == keyValue); | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
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, PartyCateEntity entity,PartyManageEntity partyManageEntity) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
var partyCateEntityTmp = GetPartyCateEntity(keyValue); | |||||
entity.Modify(keyValue); | |||||
db.Update(entity); | |||||
db.Delete<PartyManageEntity>(t=>t.CateId == partyCateEntityTmp.ID); | |||||
partyManageEntity.Create(); | |||||
partyManageEntity.CateId = partyCateEntityTmp.ID; | |||||
db.Insert(partyManageEntity); | |||||
} | |||||
else | |||||
{ | |||||
entity.Create(); | |||||
db.Insert(entity); | |||||
partyManageEntity.Create(); | |||||
partyManageEntity.CateId = entity.ID; | |||||
db.Insert(partyManageEntity); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |