Parcourir la source

增加评教只能提交一次的后台方法验证,优化h5提交方法

娄底高职分支
liangkun il y a 2 ans
Parent
révision
d666222018
6 fichiers modifiés avec 93 ajouts et 4 suppressions
  1. +17
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EvaluationTeach/EvaluationTeahcers/EvaluationTeahcers.js
  2. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs
  3. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EvalApi.cs
  4. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs
  5. +10
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs
  6. +30
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs

+ 17
- 4
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EvaluationTeach/EvaluationTeahcers/EvaluationTeahcers.js Voir le fichier

@@ -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();
}
});
})



+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs Voir le fichier

@@ -281,6 +281,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<Eval_QuestionResultEntity> entity = answerlist.ToObject<List<Eval_QuestionResultEntity>>();
ask_MainIBLL.SaveEval_QuestionResultEntity(entity, VID, LessonNo, EmpNo, userinfo.account, userinfo.realName, userinfo.iPAddress);
return Success("保存成功!");


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EvalApi.cs Voir le fichier

@@ -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<Eval_QuestionResultEntity> entity = queryParam["postarray"].ToObject<List<Eval_QuestionResultEntity>>();
ask_MainIBLL.SaveEval_QuestionResultEntity(entity, queryParam["VID"].ToString(), queryParam["LessonNo"].ToString(), queryParam["EmpNo"].ToString(), userInfo.account, userInfo.realName, userInfo.iPAddress);
return Success("保存成功");


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs Voir le fichier

@@ -278,6 +278,32 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach
}
}

/// <summary>
/// 判断当前用户是否已填写对应表单
/// </summary>
/// <param name="keyValue"></param>
/// <param name="stuno"></param>
/// <param name="EmpNo"></param>
/// <param name="LessonNo"></param>
/// <returns></returns>
public IEnumerable<Eval_QuestionResultEntity> 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);
}
}
}
public bool HasEnabled(string keyValue)
{
try


+ 10
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs Voir le fichier

@@ -64,6 +64,16 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach
/// <returns></returns>
IEnumerable<Eval_QuestionResultEntity> GetTeacherIndexPageList2(Pagination paginationobj, string queryJson);

/// <summary>
/// 判断当前用户是否已填写对应表单
/// </summary>
/// <param name="keyValue"></param>
/// <param name="stuno"></param>
/// <param name="EmpNo"></param>
/// <param name="LessonNo"></param>
/// <returns></returns>
IEnumerable<Eval_QuestionResultEntity> GetQuestionResultCount(string keyValue, string stuno, string EmpNo,
string LessonNo);

bool HasEnabled(string keyValue);
}


+ 30
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs Voir le fichier

@@ -570,6 +570,36 @@ where 1=1 ");
}
}

/// <summary>
/// 判断当前用户是否已填写对应表单
/// </summary>
/// <param name="keyValue"></param>
/// <param name="stuno"></param>
/// <param name="EmpNo"></param>
/// <param name="LessonNo"></param>
/// <returns></returns>
public IEnumerable<Eval_QuestionResultEntity> 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<Eval_QuestionResultEntity>(sql);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public bool HasEnabled(string keyValue)
{
try


Chargement…
Annuler
Enregistrer