@@ -16,6 +16,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class WorkStaffController : MvcControllerBase | |||
{ | |||
private WorkStaffIBLL workStaffIBLL = new WorkStaffBLL(); | |||
private WorkStaffSonIBLL workStaffSonIBLL = new WorkStaffSonBLL(); | |||
#region 视图功能 | |||
@@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -35,7 +36,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
#endregion | |||
@@ -71,9 +72,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var WorkStaffData = workStaffIBLL.GetWorkStaffEntity( keyValue ); | |||
var jsonData = new { | |||
var WorkStaffData = workStaffIBLL.GetWorkStaffEntity(keyValue); | |||
var WorkStaffSonData = workStaffSonIBLL.GetByStaffId(WorkStaffData.ID); | |||
var jsonData = new | |||
{ | |||
WorkStaff = WorkStaffData, | |||
WorkStaffSon = WorkStaffSonData | |||
}; | |||
return Success(jsonData); | |||
} | |||
@@ -102,13 +106,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
public ActionResult SaveForm(string keyValue, string strEntity, string WorkStaffSonList) | |||
{ | |||
WorkStaffEntity entity = strEntity.ToObject<WorkStaffEntity>(); | |||
workStaffIBLL.SaveEntity(keyValue,entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
List<WorkStaffSonEntity> WorkStaffSonntitEntity = WorkStaffSonList.ToObject<List<WorkStaffSonEntity>>(); | |||
workStaffIBLL.SaveEntity(keyValue, entity, WorkStaffSonntitEntity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
@@ -79,5 +79,9 @@ | |||
<div class="lr-form-item-title">近三年年度考核情况</div> | |||
<textarea id="Triennium" class="form-control" style="height:80px;"></textarea> | |||
</div> | |||
<div class="col-xs-12 title">家庭成员及社会关系</div> | |||
<div class="col-xs-12 lr-form-item lr-form-item-grid"> | |||
<div id="WorkStaffSon"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/WorkStaff/Form.js") |
@@ -15,6 +15,49 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#WorkStaffSon').jfGrid({ | |||
headData: [ | |||
{ | |||
label: '称谓', name: 'Title', width: 100, align: 'left' | |||
, edit: { | |||
type: 'input' | |||
} | |||
}, | |||
{ | |||
label: '姓名', name: 'Name', width: 100, align: 'left' | |||
, edit: { | |||
type: 'input' | |||
} | |||
}, | |||
{ | |||
label: '出身年月', name: 'Birthday', width: 100, align: 'left' | |||
, edit: { | |||
type: 'datatime', | |||
dateformat: '0' | |||
} | |||
}, | |||
{ | |||
label: '籍贯', name: 'Origin', width: 100, align: 'left' | |||
, edit: { | |||
type: 'input' | |||
} | |||
}, | |||
{ | |||
label: '政治面貌', name: 'Political', width: 100, align: 'left' | |||
, edit: { | |||
type: 'input' | |||
} | |||
}, | |||
{ | |||
label: '工作单位及职务', name: 'CompanyPost', width: 100, align: 'left' | |||
, edit: { | |||
type: 'input' | |||
} | |||
}, | |||
], | |||
isEdit: true, | |||
height: 200 | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
@@ -39,6 +82,7 @@ var bootstrap = function ($, learun) { | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
postData.WorkStaffSonList = JSON.stringify($('#WorkStaffSon').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/WorkStaff/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
@@ -0,0 +1,147 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-09-09 11:42 | |||
/// 描 述:公开选调工作人员报名表 | |||
/// </summary> | |||
public class WorkStaffSonBLL : WorkStaffSonIBLL | |||
{ | |||
private WorkStaffSonService WorkStaffSonService = new WorkStaffSonService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<WorkStaffSonEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return WorkStaffSonService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取WorkStaff表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public WorkStaffSonEntity GetWorkStaffSonEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return WorkStaffSonService.GetWorkStaffSonEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取WorkStaff表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public IEnumerable<WorkStaffSonEntity> GetByStaffId(string keyValue) | |||
{ | |||
try | |||
{ | |||
return WorkStaffSonService.GetByStaffId(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 | |||
{ | |||
WorkStaffSonService.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, WorkStaffSonEntity entity) | |||
{ | |||
try | |||
{ | |||
WorkStaffSonService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2022-09-09 10:38 | |||
/// 描 述:家庭成员 | |||
/// </summary> | |||
public class WorkStaffSonEntity | |||
public class WorkStaffSonEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
@@ -70,14 +70,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify() | |||
public void Modify(string keyValue) | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
this.ID = keyValue; | |||
} | |||
#endregion | |||
} | |||
@@ -0,0 +1,50 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-09-09 11:42 | |||
/// 描 述:公开选调工作人员报名表 | |||
/// </summary> | |||
public interface WorkStaffSonIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<WorkStaffSonEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取WorkStaff表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
WorkStaffSonEntity GetWorkStaffSonEntity(string keyValue); | |||
IEnumerable<WorkStaffSonEntity> GetByStaffId(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, WorkStaffSonEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,163 @@ | |||
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.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-09-09 11:42 | |||
/// 描 述:公开选调工作人员报名表 | |||
/// </summary> | |||
public class WorkStaffSonService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<WorkStaffSonEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" * "); | |||
strSql.Append(" FROM WorkStaffSon t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository("CollegeMIS").FindList<WorkStaffSonEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取WorkStaff表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public WorkStaffSonEntity GetWorkStaffSonEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<WorkStaffSonEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取WorkStaff表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public IEnumerable<WorkStaffSonEntity> GetByStaffId(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<WorkStaffSonEntity>(x => x.StaffId == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<WorkStaffSonEntity>(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, WorkStaffSonEntity 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); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -329,6 +329,9 @@ | |||
<Compile Include="EducationalAdministration\VaccinationInfo\VaccinationInfoEntity.cs" /> | |||
<Compile Include="EducationalAdministration\VaccinationInfo\VaccinationInfoIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\VaccinationInfo\VaccinationInfoService.cs" /> | |||
<Compile Include="EducationalAdministration\WorkStaffSon\WorkStaffSonBLL.cs" /> | |||
<Compile Include="EducationalAdministration\WorkStaffSon\WorkStaffSonIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\WorkStaffSon\WorkStaffSonService.cs" /> | |||
<Compile Include="EvaluationTeach\Eval_Main\Eval_MainBLL.cs" /> | |||
<Compile Include="EvaluationTeach\Eval_Main\Eval_MainEntity.cs" /> | |||
<Compile Include="EvaluationTeach\Eval_Main\Eval_MainIBLL.cs" /> | |||