Kaynağa Gözat

【修改】实训课成绩录入接口;

怀来职教中心中职
dyy 1 yıl önce
ebeveyn
işleme
a13f1e1971
4 değiştirilmiş dosya ile 1151 ekleme ve 0 silme
  1. +406
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentBLL.cs
  2. +126
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentIBLL.cs
  3. +616
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs
  4. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 406
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentBLL.cs Dosyayı Görüntüle

@@ -0,0 +1,406 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-11-05 15:25
/// 描 述:全院学生实训课成绩录入
/// </summary>
public class StuScoreExperimentBLL : StuScoreExperimentIBLL
{
private StuScoreExperimentService stuScoreExperimentService = new StuScoreExperimentService();

#region 获取数据

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
public IEnumerable<StuScoreExperimentEntity> GetList(string queryJson)
{
try
{
return stuScoreExperimentService.GetList(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取列表分页数据
/// <param name="pagination">分页参数</param>
/// <summary>
/// <returns></returns>
public IEnumerable<StuScoreExperimentEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return stuScoreExperimentService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 获取实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public StuScoreExperimentEntity GetEntity(string keyValue)
{
try
{
return stuScoreExperimentService.GetEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
public StuScoreExperimentEntity GetEntityByJson(string queryJson)
{
try
{
return stuScoreExperimentService.GetEntityByJson(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取监控管理列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
public IEnumerable<StuScoreExperimentEntity> GetMonitorList(string queryJson)
{
try
{
return stuScoreExperimentService.GetMonitorList(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void DeleteEntity(string keyValue)
{
try
{
stuScoreExperimentService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
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 扩展数据

/// <summary>
/// 学年下拉框信息
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> GetAcademicYearNoData()
{
try
{
return stuScoreExperimentService.GetAcademicYearNoData();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 课程下拉框信息
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> GetLessonNoDataOfAll(string userAccount, string userType)
{
try
{
return stuScoreExperimentService.GetLessonNoDataOfAll(userAccount, userType);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 班级下拉框信息
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> 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);
}
}
}

/// <summary>
/// 开始录入:占用成绩
/// <summary>
/// <returns></returns>
public void StartInputScore(string queryJson)
{
try
{
stuScoreExperimentService.StartInputScore(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 提交成绩
/// <summary>
/// <returns></returns>
public void SaveInputScore(List<StuScoreExperimentEntity> list)
{
try
{
stuScoreExperimentService.SaveInputScore(list);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 提交成绩:取消占用
/// <summary>
/// <returns></returns>
public void SaveInputScoreStatus(string queryJson)
{
try
{
stuScoreExperimentService.SaveInputScoreStatus(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 提交成绩:取消占用【服务】
/// <summary>
/// <returns></returns>
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);
}
}
}

/// <summary>
/// 审核成绩
/// </summary>
/// <param name="queryJson"></param>
/// <param name="checkMark">已审核:1;未审核:0;</param>
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);
}
}
}

/// <summary>
/// 强制提交
/// </summary>
/// <param name="AcademicYearNo"></param>
/// <param name="Semester"></param>
/// <param name="LessonNo"></param>
/// <param name="TeachClassNo"></param>
/// <param name="EmpNo"></param>
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
}
}

+ 126
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentIBLL.cs Dosyayı Görüntüle

@@ -0,0 +1,126 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-11-05 15:25
/// 描 述:全院学生实训课成绩录入
/// </summary>
public interface StuScoreExperimentIBLL
{
#region 获取数据

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
IEnumerable<StuScoreExperimentEntity> GetList(string queryJson);
/// <summary>
/// 获取列表分页数据
/// <param name="pagination">分页参数</param>
/// <summary>
/// <returns></returns>
IEnumerable<StuScoreExperimentEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
StuScoreExperimentEntity GetEntity(string keyValue);

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
StuScoreExperimentEntity GetEntityByJson(string queryJson);

/// <summary>
/// 获取监控管理列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
IEnumerable<StuScoreExperimentEntity> GetMonitorList(string queryJson);
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
void DeleteEntity(string keyValue);
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
void SaveEntity(string keyValue, StuScoreExperimentEntity entity);
#endregion

#region 扩展数据

/// <summary>
/// 学年下拉框信息
/// </summary>
/// <returns></returns>
IEnumerable<WebHelper.YearGrade> GetAcademicYearNoData();

/// <summary>
/// 课程下拉框信息
/// </summary>
/// <returns></returns>
IEnumerable<WebHelper.YearGrade> GetLessonNoDataOfAll(string userAccount, string userType);

/// <summary>
/// 班级下拉框信息
/// </summary>
/// <returns></returns>
IEnumerable<WebHelper.YearGrade> GetClassNoData(string userAccount, string userType, string lessonNo);

/// <summary>
/// 开始录入:占用成绩
/// <summary>
/// <returns></returns>
void StartInputScore(string queryJson);
/// <summary>
/// 提交成绩
/// <summary>
/// <returns></returns>
void SaveInputScore(List<StuScoreExperimentEntity> list);
/// <summary>
/// 提交成绩:取消占用
/// <summary>
/// <returns></returns>
void SaveInputScoreStatus(string queryJson);
/// <summary>
/// 提交成绩:取消占用【服务】
/// <summary>
/// <returns></returns>
void SaveInputScoreStatus2(string queryJson, string name);

/// <summary>
/// 审核成绩
/// </summary>
/// <param name="queryJson"></param>
/// <param name="checkMark">已审核:1;未审核:0;</param>
void DoCheckScore(string queryJson, int checkMark);

/// <summary>
/// 强制提交
/// </summary>
/// <param name="AcademicYearNo"></param>
/// <param name="Semester"></param>
/// <param name="LessonNo"></param>
/// <param name="TeachClassNo"></param>
/// <param name="EmpNo"></param>
void SubmitStuScore(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo);

#endregion
}
}

+ 616
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs Dosyayı Görüntüle

@@ -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
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-11-05 15:25
/// 描 述:全院学生实训课成绩录入
/// </summary>
public class StuScoreExperimentService : RepositoryFactory
{
#region 构造函数和属性

private string fieldSql;
public StuScoreExperimentService()
{
fieldSql = @"
t.*
";
}
#endregion

#region 获取数据

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
public IEnumerable<StuScoreExperimentEntity> 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<StuScoreExperimentEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取列表分页数据
/// <param name="pagination">分页参数</param>
/// <summary>
/// <returns></returns>
public IEnumerable<StuScoreExperimentEntity> 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<StuScoreExperimentEntity>(strSql.ToString(), pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 获取实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public StuScoreExperimentEntity GetEntity(string keyValue)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<StuScoreExperimentEntity>(Convert.ToInt32(keyValue));
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
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<StuScoreExperimentEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取监控管理列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
public IEnumerable<StuScoreExperimentEntity> 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<StuScoreExperimentEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void DeleteEntity(string keyValue)
{
try
{
this.BaseRepository("CollegeMIS").Delete<StuScoreExperimentEntity>(t => t.ScoreId == Convert.ToInt32(keyValue));
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
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 扩展数据

/// <summary>
/// 学年下拉框信息
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> GetAcademicYearNoData()
{
try
{
var data = this.BaseRepository("CollegeMIS").FindList<WebHelper.YearGrade>("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);
}
}
}

/// <summary>
/// 课程下拉框信息
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> 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<WebHelper.YearGrade>(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);
}
}
}

/// <summary>
/// 班级下拉框信息
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> 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<WebHelper.YearGrade>(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);
}
}
}

/// <summary>
/// 开始录入:占用成绩
/// <summary>
/// <returns></returns>
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<ClassInfoEntity>(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);
}
}
}

/// <summary>
/// 提交成绩
/// <summary>
/// <returns></returns>
public void SaveInputScore(List<StuScoreExperimentEntity> 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);
}
}
}

/// <summary>
/// 提交成绩:取消占用
/// <summary>
/// <returns></returns>
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<ClassInfoEntity>(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);
}
}
}
/// <summary>
/// 提交成绩:取消占用【服务】
/// <summary>
/// <returns></returns>
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<ClassInfoEntity>(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);
}
}
}

/// <summary>
/// 审核成绩
/// </summary>
/// <param name="queryJson"></param>
/// <param name="checkMark">已审核:1;未审核:0;</param>
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<ClassInfoEntity>(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);
}
}
}

/// <summary>
/// 强制提交
/// </summary>
/// <param name="AcademicYearNo"></param>
/// <param name="Semester"></param>
/// <param name="LessonNo"></param>
/// <param name="TeachClassNo"></param>
/// <param name="EmpNo"></param>
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

}
}

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj Dosyayı Görüntüle

@@ -339,6 +339,9 @@
<Compile Include="EducationalAdministration\StuPunishmentTran\StuPunishmentTranIBLL.cs" />
<Compile Include="EducationalAdministration\StuPunishmentTran\StuPunishmentTranService.cs" />
<Compile Include="EducationalAdministration\StuScoreExperiment\StuScoreExperimentEntity.cs" />
<Compile Include="EducationalAdministration\StuScoreExperiment\StuScoreExperimentBLL.cs" />
<Compile Include="EducationalAdministration\StuScoreExperiment\StuScoreExperimentIBLL.cs" />
<Compile Include="EducationalAdministration\StuScoreExperiment\StuScoreExperimentService.cs" />
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassBLL.cs" />
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassEntity.cs" />
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassIBLL.cs" />


Yükleniyor…
İptal
Kaydet