@@ -0,0 +1,138 @@ | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VoteManagementController : MvcControllerBase | |||
{ | |||
private VoteManagementIBLL voteManagementIBLL = new VoteManagementBLL(); | |||
#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 = voteManagementIBLL.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 VoteManagementData = voteManagementIBLL.GetVoteManagementEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
VoteManagement = VoteManagementData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
voteManagementIBLL.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) | |||
{ | |||
VoteManagementEntity entity = strEntity.ToObject<VoteManagementEntity>(); | |||
voteManagementIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 投票 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DoVote(string keyValue) | |||
{ | |||
var loginUserInfo = LoginUserInfo.Get(); | |||
var vpentity = voteManagementIBLL.GetVotePeopleEntityByUserId(keyValue, loginUserInfo.userId); | |||
if (vpentity != null) | |||
{ | |||
return Fail("当前项已投票!"); | |||
} | |||
voteManagementIBLL.DoVote(keyValue, loginUserInfo.userId); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
ViewBag.Title = "投票管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="VoteManagement" > | |||
<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="VoteManagement" > | |||
<div class="lr-form-item-title">内容<font face="宋体">*</font></div> | |||
<textarea id="Contents" class="form-control" style="height:100px;" isvalid="yes" checkexpession="NotNull" ></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="VoteManagement" > | |||
<div class="lr-form-item-title">方式</div> | |||
<input id="Style" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="VoteManagement" > | |||
<div class="lr-form-item-title">时间<font face="宋体">*</font></div> | |||
<input id="Time" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#Time').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="VoteManagement" > | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" ></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/VoteManagement/Form.js") |
@@ -0,0 +1,50 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2023-03-13 17:39 | |||
* 描 述:投票管理 | |||
*/ | |||
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 () { | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/PersonnelManagement/VoteManagement/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 = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/VoteManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,43 @@ | |||
@{ | |||
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"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">主题</div> | |||
<input id="Title" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">内容</div> | |||
<input id="Contents" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</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> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_vote" 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/PersonnelManagement/Views/VoteManagement/Index.js") |
@@ -0,0 +1,104 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2023-03-13 17:39 | |||
* 描 述:投票管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/PersonnelManagement/VoteManagement/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/VoteManagement/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/VoteManagement/DeleteForm', { keyValue: keyValue}, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 投票 | |||
$('#lr_vote').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认投票该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/VoteManagement/DoVote', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/PersonnelManagement/VoteManagement/GetPageList', | |||
headData: [ | |||
{ label: "主题", name: "Title", width: 150, align: "left"}, | |||
{ label: "内容", name: "Contents", width: 150, align: "left"}, | |||
{ label: "方式", name: "Style", width: 100, align: "left"}, | |||
{ label: "时间", name: "Time", width: 100, align: "left"}, | |||
], | |||
mainId:'Id', | |||
isPage: true, | |||
sidx:'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -878,6 +878,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuCommentController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\LeagueMemberAppraiseController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\WP_OfficeConfigController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\VoteManagementController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6474,6 +6475,10 @@ | |||
<Content Include="Areas\PersonnelManagement\Views\WP_OfficeConfig\Index.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\WP_OfficeConfig\Form.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\WP_OfficeConfig\Form.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\VoteManagement\Index.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\VoteManagement\Index.js" /> | |||
<Content Include="Areas\PersonnelManagement\Views\VoteManagement\Form.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\VoteManagement\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\HomeStatistics\" /> | |||
@@ -12,5 +12,4 @@ | |||
<!--塔里木中间库一卡通--> | |||
<!--<add name="TLMYKTDBString" connectionString="Data Source=orcl;Persist Security Info=True;User ID=bjqj;Password=bjqj;" providerName="System.Data.OracleClient" />--> | |||
<add name="TLMZYMIDDLEString" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=39.98.73.155)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=TLMZYMIDDLE)));Persist Security Info=True;User ID=digitalschool;Password=digitalschool;" providerName="Oracle.ManagedDataAccess.Client" /> | |||
<add name="CollegeMISFor30" connectionString="Server=123.57.209.16;Initial Catalog=CollegeMIS_娄底;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
</connectionStrings> |
@@ -253,6 +253,7 @@ | |||
<Compile Include="PersonnelManagement\SRProjectMap.cs" /> | |||
<Compile Include="PersonnelManagement\SRWorkMap.cs" /> | |||
<Compile Include="PersonnelManagement\StudyGuideMap.cs" /> | |||
<Compile Include="PersonnelManagement\VotePeopleMap.cs" /> | |||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||
<Compile Include="LR_Authorize\DataAuthorizeConditionMap.cs" /> | |||
<Compile Include="LR_Authorize\DataAuthorizeRelationMap.cs" /> | |||
@@ -611,6 +612,7 @@ | |||
<Compile Include="EducationalAdministration\StuCommentMap.cs" /> | |||
<Compile Include="PersonnelManagement\LeagueMemberAppraiseMap.cs" /> | |||
<Compile Include="PersonnelManagement\WP_OfficeConfigMap.cs" /> | |||
<Compile Include="PersonnelManagement\VoteManagementMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VoteManagementMap : EntityTypeConfiguration<VoteManagementEntity> | |||
{ | |||
public VoteManagementMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("VOTEMANAGEMENT"); | |||
//主键 | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VotePeopleMap : EntityTypeConfiguration<VotePeopleEntity> | |||
{ | |||
public VotePeopleMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("VOTEPEOPLE"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -548,6 +548,7 @@ | |||
<Compile Include="PersonnelManagement\StudyGuide\StudyGuideEntity.cs" /> | |||
<Compile Include="PersonnelManagement\StudyGuide\StudyGuideIBLL.cs" /> | |||
<Compile Include="PersonnelManagement\StudyGuide\StudyGuideService.cs" /> | |||
<Compile Include="PersonnelManagement\VotePeople\VotePeopleEntity.cs" /> | |||
<Compile Include="PersonnelManagement\WorkStudyPositionApply\WorkStudyPositionApplyBLL.cs" /> | |||
<Compile Include="PersonnelManagement\WorkStudyPositionApply\WorkStudyPositionApplyEntity.cs" /> | |||
<Compile Include="PersonnelManagement\WorkStudyPositionApply\WorkStudyPositionApplyIBLL.cs" /> | |||
@@ -1876,6 +1877,10 @@ | |||
<Compile Include="PersonnelManagement\WP_OfficeConfig\WP_OfficeConfigService.cs" /> | |||
<Compile Include="PersonnelManagement\WP_OfficeConfig\WP_OfficeConfigBLL.cs" /> | |||
<Compile Include="PersonnelManagement\WP_OfficeConfig\WP_OfficeConfigIBLL.cs" /> | |||
<Compile Include="PersonnelManagement\VoteManagement\VoteManagementEntity.cs" /> | |||
<Compile Include="PersonnelManagement\VoteManagement\VoteManagementService.cs" /> | |||
<Compile Include="PersonnelManagement\VoteManagement\VoteManagementBLL.cs" /> | |||
<Compile Include="PersonnelManagement\VoteManagement\VoteManagementIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,171 @@ | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VoteManagementBLL : VoteManagementIBLL | |||
{ | |||
private VoteManagementService voteManagementService = new VoteManagementService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<VoteManagementEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return voteManagementService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取VoteManagement表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public VoteManagementEntity GetVoteManagementEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return voteManagementService.GetVoteManagementEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取VotePeople表实体 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public VotePeopleEntity GetVotePeopleEntityByUserId(string keyValue, string userId) | |||
{ | |||
try | |||
{ | |||
return voteManagementService.GetVotePeopleEntityByUserId(keyValue, userId); | |||
} | |||
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 | |||
{ | |||
voteManagementService.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, VoteManagementEntity entity) | |||
{ | |||
try | |||
{ | |||
voteManagementService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 投票 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DoVote(string keyValue, string userId) | |||
{ | |||
try | |||
{ | |||
voteManagementService.DoVote(keyValue, userId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,94 @@ | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VoteManagementEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 主题 | |||
/// </summary> | |||
[Column("TITLE")] | |||
public string Title { get; set; } | |||
/// <summary> | |||
/// 内容 | |||
/// </summary> | |||
[Column("CONTENTS")] | |||
public string Contents { get; set; } | |||
/// <summary> | |||
/// 方式 | |||
/// </summary> | |||
[Column("STYLE")] | |||
public string Style { get; set; } | |||
/// <summary> | |||
/// 时间 | |||
/// </summary> | |||
[Column("TIME")] | |||
public DateTime? Time { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
/// <summary> | |||
/// CreateUserId | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// CreateTime | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// ModifyUserId | |||
/// </summary> | |||
[Column("MODIFYUSERID")] | |||
public string ModifyUserId { get; set; } | |||
/// <summary> | |||
/// ModifyTime | |||
/// </summary> | |||
[Column("MODIFYTIME")] | |||
public DateTime? ModifyTime { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateTime = DateTime.Now; | |||
this.CreateUserId = LoginUserInfo.Get().userId; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
this.ModifyTime = DateTime.Now; | |||
this.ModifyUserId = LoginUserInfo.Get().userId; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,60 @@ | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public interface VoteManagementIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<VoteManagementEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取VoteManagement表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
VoteManagementEntity GetVoteManagementEntity(string keyValue); | |||
/// <summary> | |||
/// 获取VotePeople表实体 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
VotePeopleEntity GetVotePeopleEntityByUserId(string keyValue, string userId); | |||
#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, VoteManagementEntity entity); | |||
/// <summary> | |||
/// 投票 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DoVote(string keyValue, string userId); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,204 @@ | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VoteManagementService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<VoteManagementEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM VoteManagement t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["Title"].IsEmpty()) | |||
{ | |||
dp.Add("Title", "%" + queryParam["Title"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Title Like @Title "); | |||
} | |||
if (!queryParam["Contents"].IsEmpty()) | |||
{ | |||
dp.Add("Contents", "%" + queryParam["Contents"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Contents Like @Contents "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<VoteManagementEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取VoteManagement表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public VoteManagementEntity GetVoteManagementEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<VoteManagementEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取VotePeople表实体 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public VotePeopleEntity GetVotePeopleEntityByUserId(string keyValue, string userId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<VotePeopleEntity>(x => x.VMId == keyValue && x.CreateUserId == userId); | |||
} | |||
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("CollegeMIS").Delete<VoteManagementEntity>(t => t.Id == 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, VoteManagementEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 投票 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DoVote(string keyValue, string userId) | |||
{ | |||
try | |||
{ | |||
var entity = new VotePeopleEntity() | |||
{ | |||
VMId = keyValue, | |||
CreateUserId = userId, | |||
CreateTime = DateTime.Now | |||
}; | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,60 @@ | |||
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-03-13 17:39 | |||
/// 描 述:投票管理 | |||
/// </summary> | |||
public class VotePeopleEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 投票主题 | |||
/// </summary> | |||
[Column("VMId")] | |||
public string VMId { get; set; } | |||
/// <summary> | |||
/// CreateUserId | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { 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 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -51,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
dp.Add("IsEnabled",queryParam["IsEnabled"].ToString(), DbType.String); | |||
strSql.Append(" AND t.IsEnabled = @IsEnabled "); | |||
} | |||
return this.BaseRepository("CollegeMISFor30").FindList<WP_OfficeConfigEntity>(strSql.ToString(),dp, pagination); | |||
return this.BaseRepository("CollegeMIS").FindList<WP_OfficeConfigEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -75,7 +75,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMISFor30").FindEntity<WP_OfficeConfigEntity>(keyValue); | |||
return this.BaseRepository("CollegeMIS").FindEntity<WP_OfficeConfigEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -102,7 +102,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMISFor30").Delete<WP_OfficeConfigEntity>(t=>t.Id == keyValue); | |||
this.BaseRepository("CollegeMIS").Delete<WP_OfficeConfigEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -129,12 +129,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMISFor30").Update(entity); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMISFor30").Insert(entity); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||