diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentBLL.cs new file mode 100644 index 000000000..0e1bd319d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentBLL.cs @@ -0,0 +1,406 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-11-05 15:25 + /// 描 述:全院学生实训课成绩录入 + /// + public class StuScoreExperimentBLL : StuScoreExperimentIBLL + { + private StuScoreExperimentService stuScoreExperimentService = new StuScoreExperimentService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList(string queryJson) + { + try + { + return stuScoreExperimentService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return stuScoreExperimentService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// 主键 + /// + /// + public StuScoreExperimentEntity GetEntity(string keyValue) + { + try + { + return stuScoreExperimentService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public StuScoreExperimentEntity GetEntityByJson(string queryJson) + { + try + { + return stuScoreExperimentService.GetEntityByJson(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取监控管理列表 + /// + /// + /// + public IEnumerable GetMonitorList(string queryJson) + { + try + { + return stuScoreExperimentService.GetMonitorList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + stuScoreExperimentService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, StuScoreExperimentEntity entity) + { + try + { + stuScoreExperimentService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 学年下拉框信息 + /// + /// + public IEnumerable GetAcademicYearNoData() + { + try + { + return stuScoreExperimentService.GetAcademicYearNoData(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 课程下拉框信息 + /// + /// + public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType) + { + try + { + return stuScoreExperimentService.GetLessonNoDataOfAll(userAccount, userType); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 班级下拉框信息 + /// + /// + public IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo) + { + try + { + return stuScoreExperimentService.GetClassNoData(userAccount, userType, lessonNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 开始录入:占用成绩 + /// + /// + public void StartInputScore(string queryJson) + { + try + { + stuScoreExperimentService.StartInputScore(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 提交成绩 + /// + /// + public void SaveInputScore(List list) + { + try + { + stuScoreExperimentService.SaveInputScore(list); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 提交成绩:取消占用 + /// + /// + public void SaveInputScoreStatus(string queryJson) + { + try + { + stuScoreExperimentService.SaveInputScoreStatus(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public void SaveInputScoreStatus2(string queryJson, string name) + { + try + { + stuScoreExperimentService.SaveInputScoreStatus2(queryJson, name); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + public void DoCheckScore(string queryJson, int checkMark) + { + try + { + stuScoreExperimentService.DoCheckScore(queryJson, checkMark); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 强制提交 + /// + /// + /// + /// + /// + /// + public void SubmitStuScore(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo) + { + try + { + stuScoreExperimentService.SubmitStuScore(AcademicYearNo, Semester, LessonNo, TeachClassNo, EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentIBLL.cs new file mode 100644 index 000000000..8b6c7cd94 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentIBLL.cs @@ -0,0 +1,126 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-11-05 15:25 + /// 描 述:全院学生实训课成绩录入 + /// + public interface StuScoreExperimentIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + IEnumerable GetList(string queryJson); + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// 主键 + /// + /// + StuScoreExperimentEntity GetEntity(string keyValue); + + /// + /// 获取列表数据 + /// + /// + StuScoreExperimentEntity GetEntityByJson(string queryJson); + + /// + /// 获取监控管理列表 + /// + /// + /// + IEnumerable GetMonitorList(string queryJson); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, StuScoreExperimentEntity entity); + #endregion + + #region 扩展数据 + + /// + /// 学年下拉框信息 + /// + /// + IEnumerable GetAcademicYearNoData(); + + /// + /// 课程下拉框信息 + /// + /// + IEnumerable GetLessonNoDataOfAll(string userAccount, string userType); + + /// + /// 班级下拉框信息 + /// + /// + IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo); + + /// + /// 开始录入:占用成绩 + /// + /// + void StartInputScore(string queryJson); + /// + /// 提交成绩 + /// + /// + void SaveInputScore(List list); + /// + /// 提交成绩:取消占用 + /// + /// + void SaveInputScoreStatus(string queryJson); + /// + /// 提交成绩:取消占用【服务】 + /// + /// + void SaveInputScoreStatus2(string queryJson, string name); + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + void DoCheckScore(string queryJson, int checkMark); + + /// + /// 强制提交 + /// + /// + /// + /// + /// + /// + void SubmitStuScore(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo); + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs new file mode 100644 index 000000000..c17d78a93 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs @@ -0,0 +1,616 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-11-05 15:25 + /// 描 述:全院学生实训课成绩录入 + /// + public class StuScoreExperimentService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + public StuScoreExperimentService() + { + fieldSql = @" + t.* + "; + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* FROM StuScoreExperiment t where 1=1 "); + + //学籍异动的学生不显示 + strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus=1) "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + strSql.Append(" and t.F_SchoolId=@F_SchoolId "); + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo=@ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM StuScoreExperiment t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// 主键 + /// + /// + public StuScoreExperimentEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(Convert.ToInt32(keyValue)); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public StuScoreExperimentEntity GetEntityByJson(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* FROM StuScoreExperiment t where 1=1 "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + strSql.Append(" and t.F_SchoolId=@F_SchoolId "); + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo=@ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + + return this.BaseRepository("CollegeMIS").FindEntity(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取监控管理列表 + /// + /// + /// + public IEnumerable GetMonitorList(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + var strSql = new StringBuilder(); + strSql.Append("select AcademicYearNo,Semester,lessonno,TeachClassNo,EmpNo,IsEditable,EditUserId,BeginModifyDate,ModifyDate from StuScoreExperiment where 1=1 "); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and AcademicYearNo = @AcademicYearNo "); + dp.Add("AcademicYearNo", "" + queryParam["AcademicYearNo"].ToString() + "", DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and Semester =@Semester "); + dp.Add("Semester", "" + queryParam["Semester"].ToString() + "", DbType.String); + } + strSql.Append(" group by AcademicYearNo,Semester,lessonno, TeachClassNo, EmpNo, IsEditable, EditUserId, BeginModifyDate, ModifyDate order by IsEditable, BeginModifyDate, edituserid "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ScoreId == Convert.ToInt32(keyValue)); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, StuScoreExperimentEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(Convert.ToInt32(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 + + #region 扩展数据 + + /// + /// 学年下拉框信息 + /// + /// + public IEnumerable GetAcademicYearNoData() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList("select distinct s.AcademicYearNo as value,s.AcademicYearNo as text from StuScoreExperiment s where 1=1 "); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 课程下拉框信息 + /// + /// + public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,s.LessonName as text from StuScoreExperiment s "); + strSql.Append(" left join LessonInfo l on s.LessonNo=l.LessonNo left join CdLessonType t on l.LessonTypeId=t.LTId "); + strSql.Append(" where 1=1 and t.LessonTypeCode='ExperimentLesson' "); //ExperimentLesson代表实训课 + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 班级下拉框信息 + /// + /// + public IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.ClassNo as value,c.ClassName as text from StuScoreExperiment s inner join ClassInfo c on s.ClassNo=c.ClassNo where 1=1 "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(lessonNo)) + { + strSql.Append(" and s.LessonNo='" + lessonNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 开始录入:占用成绩 + /// + /// + public void StartInputScore(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var ClassNo = queryParam["ClassNo"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreExperiment set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and ClassNo='" + ClassNo + "' "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 提交成绩 + /// + /// + public void SaveInputScore(List list) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + foreach (var item in list) + { + item.OrdinaryScore = item.OrdinaryScore.HasValue ? item.OrdinaryScore.Value : 0; + item.TermInScore = item.TermInScore.HasValue ? item.TermInScore.Value : 0; + item.TermEndScore = item.TermEndScore.HasValue ? item.TermEndScore.Value : 0; + item.OtherScore = item.OtherScore.HasValue ? item.OtherScore.Value : 0; + item.Score = item.Score.HasValue ? item.Score.Value : 0; + db.ExecuteBySql($"update StuScoreExperiment set OrdinaryScore={item.OrdinaryScore},TermInScore={item.TermInScore},TermEndScore={item.TermEndScore},OtherScore={item.OtherScore},Score={item.Score},Remark='{item.Remark}' where ScoreId='{item.ScoreId}' "); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 提交成绩:取消占用 + /// + /// + public void SaveInputScoreStatus(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var ClassNo = queryParam["ClassNo"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreExperiment set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and ClassNo='{ClassNo}' "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public void SaveInputScoreStatus2(string queryJson, string name) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var ClassNo = queryParam["ClassNo"].ToString(); + + var now = DateTime.Now; + //var loginUserInfo = LoginUserInfo.Get(); + var loginUserInfo = new + { + account = name.Split('_')[0], + realName = name.Split('_')[1] + }; + + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreExperiment set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and ClassNo='{ClassNo}' "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + public void DoCheckScore(string queryJson, int checkMark) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var ClassNo = queryParam["ClassNo"].ToString(); + + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreExperiment set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and ClassNo='" + ClassNo + "' "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 强制提交 + /// + /// + /// + /// + /// + /// + public void SubmitStuScore(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql( + @"update StuScoreExperiment set IsEditable=1,EditUserId=null,BeginModifyDate=null + where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + + LessonNo + "' and TeachClassNo='" + TeachClassNo + "' and EmpNo='" + EmpNo + "'"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 77f8bb956..c21481ea4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -339,6 +339,9 @@ + + +