@@ -0,0 +1,121 @@ | |||
using Learun.Application.TwoDevelopment.AdmissionsPlatform; | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Web.Mvc; | |||
namespace Learun.Application.Web.Areas.AdmissionsPlatform.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-09-12 14:43 | |||
/// 描 述:EnrollmentMajorPlanSource | |||
/// </summary> | |||
public class EnrollmentMajorPlanSourceController : MvcControllerBase | |||
{ | |||
private EnrollmentMajorPlanSourceIBLL enrollmentMajorPlanSourceIBLL = new EnrollmentMajorPlanSourceBLL(); | |||
#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="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetList( string queryJson ) | |||
{ | |||
var data = enrollmentMajorPlanSourceIBLL.GetList(queryJson); | |||
return Success(data); | |||
} | |||
/// <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 = enrollmentMajorPlanSourceIBLL.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 data = enrollmentMajorPlanSourceIBLL.GetEntity(keyValue); | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
enrollmentMajorPlanSourceIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue,EnrollmentMajorPlanSourceEntity entity) | |||
{ | |||
enrollmentMajorPlanSourceIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,35 @@ | |||
@{ | |||
ViewBag.Title = "EnrollmentMajorPlanSource"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业计划<font face="宋体">*</font></div> | |||
<div id="MajorPlanId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">省<font face="宋体">*</font></div> | |||
<div id="ProvinceNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">市<font face="宋体">*</font></div> | |||
<div id="CityNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">县<font face="宋体">*</font></div> | |||
<div id="AreaNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">已录人数<font face="宋体">*</font></div> | |||
<input id="JoinNum" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">人数<font face="宋体">*</font></div> | |||
<input id="Num" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">备注<font face="宋体">*</font></div> | |||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AdmissionsPlatform/Views/EnrollmentMajorPlanSource/Form.js") |
@@ -0,0 +1,139 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2023-09-12 14:43 | |||
* 描 述:EnrollmentMajorPlanSource | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var selectedRow = learun.frameTab.currentIframe().selectedRow; | |||
var page = { | |||
init: function () { | |||
page.initData(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#ProvinceNo').lrDataSourceSelect({ | |||
code: 'DIC_PROVINCE', value: 'pcode', text: 'pname', | |||
select: function (item) { | |||
if (!!item) { | |||
$('#CityNo').lrselectRefresh({ | |||
url: "/DIC_CITY/GetListByProvinceCode", | |||
param: { ProvinceCode: item.pcode }, | |||
value: 'CCODE', | |||
text: 'CNAME' | |||
}); | |||
$('#RegionNo').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
} | |||
}); | |||
$('#CityNo').lrselect({ | |||
select: function (item) { | |||
if (!!item) { | |||
$('#AreaNo').lrselectRefresh({ | |||
url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", | |||
param: { cityCode: item.CCODE }, | |||
value: 'ACODE', | |||
text: 'ANAME' | |||
}); | |||
} | |||
} | |||
}); | |||
$('#AreaNo').lrselect(); | |||
$('#MajorPlanId').lrGirdSelect({ | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EnrollmentMajorPlan', | |||
param: { strWhere: " 1=1 " }, | |||
height: 800, | |||
width: 1000, | |||
value: 'id', | |||
text: 'id', | |||
headData: | |||
[ | |||
{ label: "id", name: "id", width: 100, align: "left", ishide: true }, | |||
{ label: "学年", name: "year", width: 100, align: "left" }, | |||
{ label: "学期", name: "semester", width: 100, align: "left" }, | |||
{ | |||
label: "系部", name: "deptno", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||
key: value, | |||
keyId: 'deptno', | |||
callback: function (_data) { | |||
callback(_data['deptname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "majorno", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "招生科类", name: "subjectno", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject', | |||
key: value, | |||
keyId: 'subjectname', | |||
callback: function (_data) { | |||
callback(_data['subjectname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "本专科", name: "recruittype", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
if (cellvalue == 0) { | |||
return "本科" | |||
} else { | |||
return "专科" | |||
} | |||
} | |||
}, | |||
{ label: "招生人数", name: "recruitnum", width: 100, align: "left" }, | |||
{ label: "已招人数", name: "joinnum", width: 100, align: "left" }, | |||
{ label: "备注", name: "remark", width: 200, align: "left" } | |||
], | |||
select: function (item) { | |||
$("#MajorPlanId").val(item.id); | |||
$("#JoinNum").val(item.joinnum); | |||
} | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!selectedRow) { | |||
$('#form').lrSetFormData(selectedRow); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('#form').lrValidform()) { | |||
return false; | |||
} | |||
var postData = $('#form').lrGetFormData(); | |||
$.lrSaveForm(top.$.rootUrl + '/AdmissionsPlatform/EnrollmentMajorPlanSource/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,44 @@ | |||
@{ | |||
ViewBag.Title = "EnrollmentMajorPlanSource"; | |||
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-6 lr-form-item"> | |||
<div class="lr-form-item-title">省</div> | |||
<div id="ProvinceNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">市</div> | |||
<div id="CityNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">县</div> | |||
<div id="AreaNo"></div> | |||
</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> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AdmissionsPlatform/Views/EnrollmentMajorPlanSource/Index.js") |
@@ -0,0 +1,160 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2023-09-12 14:43 | |||
* 描 述:EnrollmentMajorPlanSource | |||
*/ | |||
var selectedRow; | |||
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); | |||
$('#ProvinceNo').lrDataSourceSelect({ | |||
code: 'DIC_PROVINCE', value: 'pcode', text: 'pname', | |||
select: function (item) { | |||
if (!!item) { | |||
$('#CityNo').lrselectRefresh({ | |||
url: "/DIC_CITY/GetListByProvinceCode", | |||
param: { ProvinceCode: item.pcode }, | |||
value: 'CCODE', | |||
text: 'CNAME' | |||
}); | |||
$('#RegionNo').lrselectRefresh({ | |||
url: "", | |||
data: [] | |||
}); | |||
} | |||
} | |||
}); | |||
$('#CityNo').lrselect({ | |||
select: function (item) { | |||
if (!!item) { | |||
$('#AreaNo').lrselectRefresh({ | |||
url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", | |||
param: { cityCode: item.CCODE }, | |||
value: 'ACODE', | |||
text: 'ANAME' | |||
}); | |||
} | |||
} | |||
}); | |||
$('#AreaNo').lrselect(); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
selectedRow = null; | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/AdmissionsPlatform/EnrollmentMajorPlanSource/Form', | |||
width: 700, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/AdmissionsPlatform/EnrollmentMajorPlanSource/Form?keyValue=' + keyValue, | |||
width: 700, | |||
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 + '/AdmissionsPlatform/EnrollmentMajorPlanSource/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/AdmissionsPlatform/EnrollmentMajorPlanSource/GetPageList', | |||
headData: [ | |||
{ | |||
label: '省', name: 'ProvinceNo', width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE', | |||
key: value, | |||
keyId: 'pcode', | |||
callback: function (_data) { | |||
callback(_data['pname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: '市', name: 'CityNo', width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', | |||
key: value, | |||
keyId: 'ccode', | |||
callback: function (_data) { | |||
callback(_data['cname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: '县', name: 'AreaNo', width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA', | |||
key: value, | |||
keyId: 'acode', | |||
callback: function (_data) { | |||
callback(_data['aname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: '人数', name: 'Num', width: 200, align: "left" }, | |||
{ label: '备注', name: 'Reamrk', width: 200, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -895,6 +895,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperChildController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\RepairReportTeacherController.cs" /> | |||
<Compile Include="Areas\AdmissionsPlatform\Controllers\EnrollmentMajorPlanController.cs" /> | |||
<Compile Include="Areas\AdmissionsPlatform\Controllers\EnrollmentMajorPlanSourceController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -6839,6 +6840,10 @@ | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlan\Index.js" /> | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlan\Form.cshtml" /> | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlan\Form.js" /> | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlanSource\Index.cshtml" /> | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlanSource\Index.js" /> | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlanSource\Form.cshtml" /> | |||
<Content Include="Areas\AdmissionsPlatform\Views\EnrollmentMajorPlanSource\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\EducationalAdministration\Views\HomeStatistics\" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.AdmissionsPlatform; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-09-12 14:43 | |||
/// 描 述:EnrollmentMajorPlanSource | |||
/// </summary> | |||
public class EnrollmentMajorPlanSourceMap : EntityTypeConfiguration<EnrollmentMajorPlanSourceEntity> | |||
{ | |||
public EnrollmentMajorPlanSourceMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("ENROLLMENTMAJORPLANSOURCE"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -625,6 +625,7 @@ | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttrmperChildMap.cs" /> | |||
<Compile Include="LogisticsManagement\RepairReport_TeacherMap.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlanMap.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlanSourceMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
/// 日 期:2023-09-11 14:55 | |||
/// 描 述:EnrollmentMajorPlan | |||
/// </summary> | |||
public class EnrollmentMajorPlanEntity | |||
public class EnrollmentMajorPlanEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
@@ -84,6 +84,11 @@ namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
/// </summary> | |||
[Column("RECRUITTYPE")] | |||
public string RecruitType { get; set; } | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
[Column("JOINNUM")] | |||
public int? JoinNum { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -94,6 +99,7 @@ namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
this.CheckMark = "0"; | |||
this.JoinNum = 0; | |||
this.CreateTime = DateTime.Now; | |||
this.CreateUser = LoginUserInfo.Get().userId; | |||
} | |||
@@ -123,7 +123,12 @@ namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
var id = keyValue.Split(','); | |||
foreach (var item in id) | |||
{ | |||
db.Delete(item); | |||
var deletes = db.FindEntity<EnrollmentMajorPlanSourceEntity>(x => x.MajorPlanId == keyValue); | |||
if (deletes != null) | |||
{ | |||
db.Delete(deletes); | |||
} | |||
db.Delete<EnrollmentMajorPlanEntity>(x => x.ID == item); | |||
} | |||
db.Commit(); | |||
} | |||
@@ -0,0 +1,148 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-09-12 14:43 | |||
/// 描 述:EnrollmentMajorPlanSource | |||
/// </summary> | |||
public class EnrollmentMajorPlanSourceBLL : EnrollmentMajorPlanSourceIBLL | |||
{ | |||
private EnrollmentMajorPlanSourceService enrollmentMajorPlanSourceService = new EnrollmentMajorPlanSourceService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<EnrollmentMajorPlanSourceEntity> GetList( string queryJson ) | |||
{ | |||
try | |||
{ | |||
return enrollmentMajorPlanSourceService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<EnrollmentMajorPlanSourceEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return enrollmentMajorPlanSourceService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public EnrollmentMajorPlanSourceEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return enrollmentMajorPlanSourceService.GetEntity(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 | |||
{ | |||
enrollmentMajorPlanSourceService.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> | |||
public void SaveEntity(string keyValue, EnrollmentMajorPlanSourceEntity entity) | |||
{ | |||
try | |||
{ | |||
enrollmentMajorPlanSourceService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-09-12 14:43 | |||
/// 描 述:EnrollmentMajorPlanSource | |||
/// </summary> | |||
public class EnrollmentMajorPlanSourceEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ID | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// MajorPlanId | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MAJORPLANID")] | |||
public string MajorPlanId { get; set; } | |||
/// <summary> | |||
/// ProvinceNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("PROVINCENO")] | |||
public string ProvinceNo { get; set; } | |||
/// <summary> | |||
/// AreaNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("AREANO")] | |||
public string AreaNo { get; set; } | |||
/// <summary> | |||
/// AreaNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CITYNO")] | |||
public string CityNo { get; set; } | |||
/// <summary> | |||
/// Num | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("NUM")] | |||
public int? Num { get; set; } | |||
/// <summary> | |||
/// Reamrk | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("REAMRK")] | |||
public string Reamrk { 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,55 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.AdmissionsPlatform | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-09-12 14:43 | |||
/// 描 述:EnrollmentMajorPlanSource | |||
/// </summary> | |||
public interface EnrollmentMajorPlanSourceIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<EnrollmentMajorPlanSourceEntity> GetList( string queryJson ); | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<EnrollmentMajorPlanSourceEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
EnrollmentMajorPlanSourceEntity GetEntity(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, EnrollmentMajorPlanSourceEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,230 @@ | |||
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.AdmissionsPlatform | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2023-09-12 14:43 | |||
/// 描 述:EnrollmentMajorPlanSource | |||
/// </summary> | |||
public class EnrollmentMajorPlanSourceService : RepositoryFactory | |||
{ | |||
#region 构造函数和属性 | |||
private string fieldSql; | |||
/// <summary> | |||
/// 构造方法 | |||
/// </summary> | |||
public EnrollmentMajorPlanSourceService() | |||
{ | |||
fieldSql = @" t.* "; | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<EnrollmentMajorPlanSourceEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
//参考写法 | |||
//var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
//var dp = new DynamicParameters(new { }); | |||
//dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql); | |||
strSql.Append(" FROM EnrollmentMajorPlanSource t "); | |||
return this.BaseRepository("CollegeMIS").FindList<EnrollmentMajorPlanSourceEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<EnrollmentMajorPlanSourceEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql); | |||
strSql.Append(" FROM EnrollmentMajorPlanSource t "); | |||
return this.BaseRepository("CollegeMIS").FindList<EnrollmentMajorPlanSourceEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public EnrollmentMajorPlanSourceEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<EnrollmentMajorPlanSourceEntity>(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 dp = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
var EIMSPlanEntity = this.BaseRepository("CollegeMIS").FindEntity<EnrollmentMajorPlanSourceEntity>(x => x.ID == keyValue); | |||
var EIMPlanEntity = this.BaseRepository("CollegeMIS").FindEntity<EnrollmentMajorPlanEntity>(x => x.ID == EIMSPlanEntity.MajorPlanId); | |||
EIMPlanEntity.JoinNum = EIMPlanEntity.JoinNum - EIMSPlanEntity.Num; | |||
dp.Update(EIMPlanEntity); | |||
this.BaseRepository("CollegeMIS").Delete<EnrollmentMajorPlanSourceEntity>(t => t.ID == keyValue); | |||
dp.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
dp.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// </summary> | |||
public void SaveEntity(string keyValue, EnrollmentMajorPlanSourceEntity entity) | |||
{ | |||
var dp = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
var EIMPlanEntity = this.BaseRepository("CollegeMIS").FindEntity<EnrollmentMajorPlanEntity>(x => x.ID == entity.MajorPlanId); | |||
var EIMSPlanEntity = this.BaseRepository("CollegeMIS").FindList<EnrollmentMajorPlanSourceEntity>(x => x.MajorPlanId == entity.MajorPlanId && x.ID != keyValue); | |||
if (EIMSPlanEntity != null) | |||
{ | |||
foreach (var item in EIMSPlanEntity) | |||
{ | |||
entity.Num += item.Num; | |||
} | |||
EIMPlanEntity.JoinNum = entity.Num; | |||
dp.Update(EIMPlanEntity); | |||
} | |||
else | |||
{ | |||
EIMPlanEntity.JoinNum = entity.Num; | |||
dp.Update(EIMPlanEntity); | |||
} | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
if (entity.MajorPlanId != null) | |||
{ | |||
var EIMPlanEntity = this.BaseRepository("CollegeMIS").FindEntity<EnrollmentMajorPlanEntity>(x => x.ID == entity.MajorPlanId); | |||
var EIMSPlanEntity = this.BaseRepository("CollegeMIS").FindList<EnrollmentMajorPlanSourceEntity>(x => x.MajorPlanId == entity.MajorPlanId); | |||
if (EIMSPlanEntity != null) | |||
{ | |||
foreach (var item in EIMSPlanEntity) | |||
{ | |||
entity.Num += item.Num; | |||
} | |||
EIMPlanEntity.JoinNum = entity.Num; | |||
dp.Update(EIMPlanEntity); | |||
} | |||
else | |||
{ | |||
EIMPlanEntity.JoinNum = entity.Num; | |||
dp.Update(EIMPlanEntity); | |||
} | |||
} | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
dp.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
dp.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -1925,6 +1925,10 @@ | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlan\EnrollmentMajorPlanService.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlan\EnrollmentMajorPlanBLL.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlan\EnrollmentMajorPlanIBLL.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlanSource\EnrollmentMajorPlanSourceEntity.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlanSource\EnrollmentMajorPlanSourceService.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlanSource\EnrollmentMajorPlanSourceIBLL.cs" /> | |||
<Compile Include="AdmissionsPlatform\EnrollmentMajorPlanSource\EnrollmentMajorPlanSourceBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||