diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EvaluationTeach/EvaluationTeahcers/EvaluationTeahcers.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EvaluationTeach/EvaluationTeahcers/EvaluationTeahcers.js index 7f5aad220..ea887bd43 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EvaluationTeach/EvaluationTeahcers/EvaluationTeahcers.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EvaluationTeach/EvaluationTeahcers/EvaluationTeahcers.js @@ -56,6 +56,7 @@ $page.find('.shenBtn').on('tap', function() { + learun.layer.loading(true, "数据提交中..."); var jsonArr= []; var qmustFlag = false; var flag = false; @@ -84,10 +85,12 @@ }) // console.log(jsonArr) if(qmustFlag){ + learun.layer.loading(false); learun.layer.toast('有必选项未选择'); return } if(flag){ + learun.layer.loading(false); learun.layer.toast('有选择项少选或多选'); return } @@ -99,10 +102,20 @@ EmpNo: param.EmpNo, postarray: jsonArr }, (res) => { - learun.layer.toast('操作成功'); - learun.nav.closeCurrent(); - var prepage = learun.nav.getpage('EvaluationTeach'); - prepage.grid.reload(); + learun.layer.loading(false); + if(res) + { + learun.layer.toast('操作成功'); + learun.nav.closeCurrent(); + var prepage = learun.nav.getpage('EvaluationTeach'); + prepage.grid.reload(); + } + else + { + learun.nav.closeCurrent(); + var prepage = learun.nav.getpage('EvaluationTeach'); + prepage.grid.reload(); + } }); }) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs index 10130448b..ed1c7bb8a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs @@ -279,6 +279,11 @@ namespace Learun.Application.Web.Areas.EvaluationTeach.Controllers public ActionResult StudentSubmitForm(string answerlist, string VID, string LessonNo, string EmpNo) { var userinfo = LoginUserInfo.Get(); + //判断当前课程、教师是否已评 + if (ask_MainIBLL.GetQuestionResultCount(VID,userinfo.account,EmpNo,LessonNo).Count()>0) + { + return Fail("检测到您已对当前教师课程进行过评教操作,请勿重复提交。"); + } List entity = answerlist.ToObject>(); ask_MainIBLL.SaveEval_QuestionResultEntity(entity, VID, LessonNo, EmpNo, userinfo.account, userinfo.realName, userinfo.iPAddress); return Success("保存成功!"); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EvalApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EvalApi.cs index e247514a7..f2ace43dd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EvalApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EvalApi.cs @@ -4,6 +4,7 @@ using Learun.Application.TwoDevelopment.EvaluationTeach; using Learun.Util; using Nancy; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.WebApi.Modules { @@ -52,6 +53,10 @@ namespace Learun.Application.WebApi.Modules var queryParam = queryJson.ToJObject(); if (!queryParam["VID"].IsEmpty()&&!queryParam["postarray"].IsEmpty()) { + if (ask_MainIBLL.GetQuestionResultCount(queryParam["VID"].ToString(), userInfo.account, queryParam["EmpNo"].ToString(), queryParam["LessonNo"].ToString()).Count() > 0) + { + return Fail("检测到您已对当前教师课程进行过评教操作,请勿重复提交。"); + } List entity = queryParam["postarray"].ToObject>(); ask_MainIBLL.SaveEval_QuestionResultEntity(entity, queryParam["VID"].ToString(), queryParam["LessonNo"].ToString(), queryParam["EmpNo"].ToString(), userInfo.account, userInfo.realName, userInfo.iPAddress); return Success("保存成功"); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs index 856e59034..a189748a0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs @@ -278,6 +278,32 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach } } + /// + /// 判断当前用户是否已填写对应表单 + /// + /// + /// + /// + /// + /// + public IEnumerable GetQuestionResultCount(string keyValue, string stuno, string EmpNo, string LessonNo) + { + try + { + return ask_MainService.GetQuestionResultCount(keyValue, stuno, EmpNo, LessonNo); + } + 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/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs index 4c155b3c2..038d7a035 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs @@ -64,6 +64,16 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach /// IEnumerable GetTeacherIndexPageList2(Pagination paginationobj, string queryJson); + /// + /// 判断当前用户是否已填写对应表单 + /// + /// + /// + /// + /// + /// + IEnumerable GetQuestionResultCount(string keyValue, string stuno, string EmpNo, + string LessonNo); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs index 85120d8fa..f9224e0c6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs @@ -570,5 +570,35 @@ where 1=1 "); } } + /// + /// 判断当前用户是否已填写对应表单 + /// + /// + /// + /// + /// + /// + public IEnumerable GetQuestionResultCount(string keyValue, string stuno, string EmpNo, string LessonNo) + { + try + { + string sql = @"select c.* from [dbo].[Eval_Main] a left join [dbo].[Eval_Question] b on a.vid=b.vid + left join[dbo].[Eval_QuestionResult] c on b.qid=c.qid + where a.vid='"+keyValue+"' and c.empno='"+EmpNo+"' and c.lessonno= '"+LessonNo+"' and c.uid= '"+stuno+"'"; + return BaseRepository().FindList(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + } }