@@ -289,11 +289,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
StuName = StuEnrollData.StuName, | |||
IDCard = StuEnrollData.IDCard, | |||
IdCardPto1 = StuEnrollData.IdCardPto1, | |||
//StuId= StuEnrollData.StuId, | |||
//StuId= StuEnrollData.StuId, | |||
//StuId= StuEnrollData.StuId, | |||
//StuId= StuEnrollData.StuId, | |||
//StuId= StuEnrollData.StuId, | |||
}, | |||
}; | |||
return Success(jsonData); | |||
@@ -388,6 +383,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue); | |||
//获取中考成绩 | |||
var MidExamScoreData = stuEnrollIBLL.GetMidExamScoreData(keyValue).OrderBy(x => x.sort); | |||
if (string.IsNullOrEmpty(StuEnrollData.CheckInUrl)) | |||
{ | |||
StuEnrollData.CheckInUrl = Guid.NewGuid().ToString(); | |||
@@ -406,6 +403,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
var jsonData = new | |||
{ | |||
StuEnroll = StuEnrollData, | |||
StuEnrollMidExamScore = MidExamScoreData | |||
}; | |||
return Success(jsonData); | |||
} | |||
@@ -421,13 +419,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
if (string.IsNullOrEmpty(student.PhotoUrl)) | |||
{ | |||
student.PhotoUrl = Guid.NewGuid().ToString(); | |||
stuEnrollIBLL.SaveEntity(student.StuId,student); | |||
stuEnrollIBLL.SaveEntity(student.StuId, student); | |||
} | |||
var annexEntity = annexesFileIBLL.GetEntityByFolderId(student.PhotoUrl); | |||
if (annexEntity == null) | |||
{ | |||
annexEntity=new AnnexesFileEntity(); | |||
annexEntity = new AnnexesFileEntity(); | |||
annexEntity.Create(); | |||
annexEntity.F_Id = Guid.NewGuid().ToString(); | |||
} | |||
@@ -451,11 +449,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult GetYearListByClass() | |||
{ | |||
var classList = classInfoIBLL.GetAllClass().ToList(); | |||
var result = classList.GroupBy(a => a.Grade).Select(m=>m.Key).ToList(); | |||
List<object> list=new List<object>(); | |||
var result = classList.GroupBy(a => a.Grade).Select(m => m.Key).ToList(); | |||
List<object> list = new List<object>(); | |||
foreach (var item in result) | |||
{ | |||
list.Add(new{year=item}); | |||
list.Add(new { year = item }); | |||
} | |||
return Success(list); | |||
@@ -978,7 +976,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
stuEnrollIBLL.Admission(keyValue, IsAdmission); | |||
return Success("保存成功"); | |||
} | |||
#endregion | |||
} | |||
@@ -50,9 +50,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string EmpNo, string strEntity) | |||
public ActionResult SaveForm(string keyValue, string EmpNo, string strEntity, string scoreList) | |||
{ | |||
StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>(); | |||
List<StuEnrollMidExamScoreEntity> scoreData = scoreList.ToObject<List<StuEnrollMidExamScoreEntity>>(); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
var model = stuEnrollIBLL.GetEntityByPersonalData(entity.IDCard, entity.StuMobile); | |||
@@ -62,7 +63,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
} | |||
} | |||
entity.EmpNo = EmpNo; | |||
stuEnrollIBLL.SaveEnroll(keyValue, entity); | |||
stuEnrollIBLL.SaveEnroll(keyValue, entity, scoreData); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
@@ -29,8 +29,9 @@ | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="StuEnroll"> | |||
<div class="lr-form-item-title">中考总分<font face="宋体">*</font></div> | |||
<input id="MidTermExam" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
<input id="MidTermExam" type="text" class="form-control" readonly="readonly" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div id="scoreDiv"></div> | |||
<div class="col-xs-6 lr-form-item" data-table="StuEnroll"> | |||
<div class="lr-form-item-title">毕业学校<font face="宋体">*</font></div> | |||
<input id="FromSchool" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
@@ -97,6 +97,23 @@ var bootstrap = function ($, learun) { | |||
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); | |||
//计算中考总分 | |||
$('#scoreDiv').on('change', | |||
'.SEMidExamScore', | |||
function () { | |||
var scoreSum = 0; | |||
$.each($("#scoreDiv .SEMidExamScore"), | |||
function (i, item) { | |||
if (!!item.value) { | |||
scoreSum += parseFloat(item.value); | |||
} | |||
}); | |||
if (scoreSum > 0) { | |||
$('#MidTermExam').val(scoreSum.toFixed(2)); | |||
} | |||
}); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
@@ -110,7 +127,17 @@ var bootstrap = function ($, learun) { | |||
} | |||
} | |||
MajorNo = data.StuEnroll.MajorNo; | |||
var str = ''; | |||
if (!!data.StuEnrollMidExamScore) { | |||
$.each(data.StuEnrollMidExamScore, | |||
function (i, item) { | |||
str += '<div class="col-xs-6 lr-form-item" data-table="StuEnrollMidExamScore">'; | |||
str += '<div class="lr-form-item-title">' + item.subjectName + '</div>'; | |||
str += '<input id="' + item.Id + '" type="text" class="form-control SEMidExamScore" value="' + item.score + '" />'; | |||
str += '</div>'; | |||
}); | |||
$('#scoreDiv').html(str); | |||
} | |||
}); | |||
} | |||
} | |||
@@ -119,9 +146,19 @@ var bootstrap = function ($, learun) { | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
} var scoreList = []; | |||
$.each($("#scoreDiv .SEMidExamScore"), | |||
function (i, item) { | |||
var entity = { | |||
Id: item.id, | |||
score: item.value | |||
}; | |||
scoreList.push(entity); | |||
}); | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
strEntity: JSON.stringify($('body').lrGetFormData()), | |||
scoreList: JSON.stringify(scoreList) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollPhone/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
@@ -131,9 +168,5 @@ var bootstrap = function ($, learun) { | |||
}); | |||
}; | |||
page.init(); | |||
//console.log('MajorNo=', MajorNo); | |||
//if (MajorNo) { | |||
// console.log(333); | |||
// $('#MajorNo').lrselectSet(MajorNo); | |||
//} | |||
} |
@@ -57,7 +57,7 @@ var bootstrap = function ($, learun) { | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollForm?keyValue=' + keyValue, | |||
width: 700, | |||
width: 900, | |||
height: 700, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
@@ -1,5 +1,5 @@ | |||
@{ | |||
Layout = null; | |||
} | |||
@@ -155,9 +155,10 @@ | |||
<span class="chickInputLable"><span>*</span> 毕业学校</span> | |||
<input type="text" id="FromSchool" name="FromSchool" lay-verify="required" placeholder="请输入毕业学校" class="layui-input"> | |||
</div> | |||
<div id="scoreDiv"></div> | |||
<div class="chickInput"> | |||
<span class="chickInputLable"><span>*</span> 中考总分</span> | |||
<input type="number" id="MidTermExam" name="MidTermExam" lay-verify="required" placeholder="请输入中考总分" class="layui-input"> | |||
<input type="number" id="MidTermExam" name="MidTermExam" readonly="readonly" placeholder="请输入中考总分" class="layui-input"> | |||
</div> | |||
<div class="chickInput"> | |||
<span class="chickInputLable"> 特长</span> | |||
@@ -281,10 +282,22 @@ | |||
return; | |||
} | |||
var strEntity = JSON.stringify(data.field); | |||
//strEntity.EmpNo = EmpNo; | |||
var scoreList = []; | |||
$.each($("#scoreDiv").find('input'), | |||
function (i, item) { | |||
var entity = { | |||
subjectName: item.name, | |||
subjectCode: item.id, | |||
score: item.value | |||
}; | |||
scoreList.push(entity); | |||
}); | |||
$.ajax({ | |||
url: '/EducationalAdministration/StuEnrollPhone/SaveForm?keyValue=&EmpNo=' + EmpNo, | |||
data: { strEntity: strEntity }, | |||
data: { strEntity: strEntity, scoreList: JSON.stringify(scoreList) }, | |||
type: "POST", | |||
dataType: "json", | |||
async: true, | |||
@@ -459,29 +472,46 @@ | |||
form.render(); | |||
}); | |||
//监听县区 | |||
form.on('select(County)', function (data) { | |||
//2022.7.14 去掉根据地区绑定专业下拉框 | |||
//绑定专业 | |||
//$.ajax({ | |||
// url: "/EducationalAdministration/EmpInfoEnternal/GetMap?code=" + "CdMajorInfo" + "&where=" + "Area='" + data.value + "'", | |||
// async: false, | |||
// success: function (msg) { | |||
// var companys = $.parseJSON(msg).data.data; | |||
// var str = '<option value="">请选择</option>'; | |||
// $.each(companys, | |||
// function (i, item) { | |||
// str += '<option value="' + item.id + '">' + item.majorname + '</option>' | |||
// }) | |||
// $("#MajorNo").html(str); | |||
// }, | |||
//}); | |||
form.render(); | |||
}); | |||
//form.on('select(County)', function (data) { | |||
//2022.7.14 去掉根据地区绑定专业下拉框 | |||
//绑定专业 | |||
//$.ajax({ | |||
// url: "/EducationalAdministration/EmpInfoEnternal/GetMap?code=" + "CdMajorInfo" + "&where=" + "Area='" + data.value + "'", | |||
// async: false, | |||
// success: function (msg) { | |||
// var companys = $.parseJSON(msg).data.data; | |||
// var str = '<option value="">请选择</option>'; | |||
// $.each(companys, | |||
// function (i, item) { | |||
// str += '<option value="' + item.id + '">' + item.majorname + '</option>' | |||
// }) | |||
// $("#MajorNo").html(str); | |||
// }, | |||
//}); | |||
//form.render(); | |||
//}); | |||
}); | |||
$(window).load(function () { | |||
//$('.chickInputBoxs input').attr('lay-verify', 'required'); | |||
//中考科目 | |||
$.ajax({ | |||
url: "/EducationalAdministration/EmpInfoEnternal/GetDataItemMap?code=" + "MidTermSubject", | |||
async: false, | |||
success: function (msg) { | |||
var data = $.parseJSON(msg).data; | |||
var str = ''; | |||
$.each(data, | |||
function (i, item) { | |||
str += '<div class="chickInput">'; | |||
str += '<span class="chickInputLable"><span>*</span>' + item.F_ItemName + '</span>'; | |||
str += '<input type="number" id="' + item.F_ItemValue + '" name="' + item.F_ItemName + '" lay-verify="required" placeholder="请输入' + item.F_ItemName + '" class="layui-input">'; | |||
str += '</div>'; | |||
}); | |||
$("#scoreDiv").html(str); | |||
}, | |||
}); | |||
//专业 | |||
$.ajax({ | |||
url: "/EducationalAdministration/EmpInfoEnternal/GetMap?code=" + "CdMajorInfo", | |||
@@ -541,6 +571,21 @@ | |||
}); | |||
renderForm(); | |||
//计算总分 | |||
$('#scoreDiv').find('input').on('change', | |||
function () { | |||
var scoreSum = 0; | |||
$.each($("#scoreDiv").find('input'), | |||
function (i, item) { | |||
if (!!item.value) { | |||
scoreSum += parseFloat(item.value); | |||
} | |||
}); | |||
if (scoreSum > 0) { | |||
$('#MidTermExam').val(scoreSum.toFixed(2)); | |||
} | |||
}); | |||
}); | |||
@@ -1,7 +1,7 @@ | |||
//api地址 | |||
var serverurl = "http://localhost:31173"; | |||
//当前项目地址 | |||
var currentUrl = "http://192.168.10.46:8048"; | |||
var currentUrl = "http://192.168.10.22:8048"; | |||
//地址栏传参 | |||
function request(d) { | |||
for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) { | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-07-11 14:34 | |||
/// 描 述:宿舍调换申请 | |||
/// </summary> | |||
public class StuEnrollMidExamScoreMap : EntityTypeConfiguration<StuEnrollMidExamScoreEntity> | |||
{ | |||
public StuEnrollMidExamScoreMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("STUENROLLMIDEXAMSCORE"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -67,6 +67,7 @@ | |||
<Compile Include="AssetManagementSystem\Ass_PurchaseItemApplyMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_ScrapItemMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_ScrapMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuEnrollMidExamScoreMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeExamTermItemNewMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonSyncMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemperMap.cs" /> | |||
@@ -176,6 +176,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<StuEnrollMidExamScoreEntity> GetMidExamScoreData(string keyValue) | |||
{ | |||
try | |||
{ | |||
return stuEnrollService.GetMidExamScoreData(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StuEnroll表实体数据 | |||
@@ -464,11 +482,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void SaveEnroll(string keyValue, StuEnrollEntity entity) | |||
public void SaveEnroll(string keyValue, StuEnrollEntity entity, List<StuEnrollMidExamScoreEntity> scoreData) | |||
{ | |||
try | |||
{ | |||
stuEnrollService.SaveEnroll(keyValue, entity); | |||
stuEnrollService.SaveEnroll(keyValue, entity, scoreData); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -34,6 +34,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// <returns></returns> | |||
StuEnrollEntity GetStuEnrollEntity(string keyValue); | |||
IEnumerable<StuEnrollMidExamScoreEntity> GetMidExamScoreData(string keyValue); | |||
StuEnrollEntity GetEntityByPersonalData(string IDCard, string StuMobile); | |||
StuEnrollEntity SearchForm(int type, StuEnrollEntity strEntity); | |||
IEnumerable<ExamSubjectEntity> GetExamDataByStuId(string keyValue); | |||
@@ -53,7 +54,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// <returns></returns> | |||
void SaveEntity(string keyValue, StuEnrollEntity entity); | |||
void SaveEnroll(string keyValue, StuEnrollEntity entity); | |||
void SaveEnroll(string keyValue, StuEnrollEntity entity, List<StuEnrollMidExamScoreEntity> scoreData); | |||
void EditEnrollType(string stuIds, string enrollType); | |||
void AllocationClass(string classNo, string dataJson); | |||
void NewAllocationDormitory(string classNo, string dataJson); | |||
@@ -1945,6 +1945,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<StuEnrollMidExamScoreEntity> GetMidExamScoreData(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<StuEnrollMidExamScoreEntity>(x => x.StuEnrollId == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StuEnroll表实体数据 | |||
/// <param name=""></param> | |||
@@ -2157,28 +2176,55 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public void SaveEnroll(string keyValue, StuEnrollEntity entity) | |||
public void SaveEnroll(string keyValue, StuEnrollEntity entity, List<StuEnrollMidExamScoreEntity> scoreData) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
db.BeginTrans(); | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
db.Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
entity.EnrollStatus = 0; | |||
var sql = $" select top 1 [year] as year,Majorname from CdMajor where ID='{entity.MajorNo}'"; | |||
var majorData = this.BaseRepository("CollegeMIS").FindTable(sql); | |||
var majorData = db.FindTable(sql); | |||
entity.MajorName = majorData.Rows[0]["Majorname"].ToString(); | |||
entity.Year = majorData.Rows[0]["year"].ToString(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
db.Insert(entity); | |||
} | |||
if (scoreData != null && scoreData.Count > 0) | |||
{ | |||
for (int i = 0; i < scoreData.Count; i++) | |||
{ | |||
if (!string.IsNullOrEmpty(scoreData[i].Id)) | |||
{ | |||
db.Update(scoreData[i]); | |||
} | |||
else | |||
{ | |||
StuEnrollMidExamScoreEntity model = new StuEnrollMidExamScoreEntity(); | |||
model.Create(); | |||
model.StuEnrollId = entity.StuId; | |||
model.subjectName = scoreData[i].subjectName; | |||
model.subjectCode = scoreData[i].subjectCode; | |||
model.score = scoreData[i].score; | |||
model.sort = i + 1; | |||
db.Insert(model); | |||
} | |||
} | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
@@ -0,0 +1,66 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 中考成绩 | |||
/// </summary> | |||
public class StuEnrollMidExamScoreEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ID | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 报名表主键 | |||
/// </summary> | |||
[Column("STUENROLLID")] | |||
public string StuEnrollId { get; set; } | |||
/// <summary> | |||
///学科名称 | |||
/// </summary> | |||
[Column("SUBJECTNAME")] | |||
public string subjectName { get; set; } | |||
/// <summary> | |||
/// 学科编码 | |||
/// </summary> | |||
[Column("SUBJECTCODE")] | |||
public string subjectCode { get; set; } | |||
/// <summary> | |||
/// 分数 | |||
/// </summary> | |||
[Column("SCORE")] | |||
public decimal? score { get; set; } | |||
/// <summary> | |||
/// 排序 | |||
/// </summary> | |||
[Column("sort")] | |||
public int? sort { 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 | |||
} | |||
} | |||
@@ -248,6 +248,7 @@ | |||
<Compile Include="EducationalAdministration\StuDisciplineManagement\StuDisciplineManagementEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuDisciplineManagement\StuDisciplineManagementIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuDisciplineManagement\StuDisciplineManagementService.cs" /> | |||
<Compile Include="EducationalAdministration\StuEnrollMidExamScore\StuEnrollMidExamScoreEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuEnrollAmountRecord\StuEnrollAmountRecordBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuEnrollAmountRecord\StuEnrollAmountRecordEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuEnrollAmountRecord\StuEnrollAmountRecordIBLL.cs" /> | |||