Explorar el Código

新增清理重复评教数据方法

新疆影视学院高职
坤 梁 hace 2 años
padre
commit
18134889d5
Se han modificado 6 ficheros con 91 adiciones y 1 borrados
  1. +8
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs
  2. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/AnswerIndex.cshtml
  3. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/AnswerIndex.js
  4. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs
  6. +55
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs

+ 8
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Controllers/Eval_MainController.cs Ver fichero

@@ -237,6 +237,14 @@ namespace Learun.Application.Web.Areas.EvaluationTeach.Controllers
return Success("删除成功!");
}

[HttpPost]
[AjaxOnly]
public ActionResult CleanForm(string VID)
{
ask_MainIBLL.Clean(VID);
return Success("操作成功!");
}

[HttpPost]
[AjaxOnly]
public ActionResult SubmitForm(string keyValue)


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/AnswerIndex.cshtml Ver fichero

@@ -40,8 +40,9 @@
</div>
<div class=" btn-group btn-group-sm" learun-authorize="">
<a id="lr_view" class="btn btn-default"><i class="fa fa-building-o"></i>&nbsp;查看答卷</a>
</div>
<a id="lr_clean" class="btn btn-default"><i class="fa fa-building-o"></i>&nbsp;清理重复数据</a>

</div>
</div>
<div class="lr-layout-body" id="gridtable_stu"></div>


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EvaluationTeach/Views/Eval_Main/AnswerIndex.js Ver fichero

@@ -43,6 +43,11 @@ var bootstrap = function ($, learun) {
$('#lr_refresh').on('click', function () {
location.reload();
});
$('#lr_clean').on('click', function() {
learun.postForm(top.$.rootUrl + '/EvaluationTeach/Eval_Main/CleanForm', { VID: VID }, function () {
refreshGirdData();
});
});
// 答题情况
$('#lr_view').on('click', function () {
var keyValue = $('#gridtable_stu').jfGridValue('VID');


+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainBLL.cs Ver fichero

@@ -304,6 +304,26 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach
}
}
}

public void Clean(string vid)
{
try
{
ask_MainService.Clean(vid);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainIBLL.cs Ver fichero

@@ -75,5 +75,6 @@ namespace Learun.Application.TwoDevelopment.EvaluationTeach
IEnumerable<Eval_QuestionResultEntity> GetQuestionResultCount(string keyValue, string stuno, string EmpNo,
string LessonNo);

void Clean(string vid);
}
}

+ 55
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EvaluationTeach/Eval_Main/Eval_MainService.cs Ver fichero

@@ -600,5 +600,60 @@ where 1=1 ");
}
}

public void Clean(string vid)
{
try
{
var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database;
string sql = @"

select aa.LessonNo,aa.EmpNo,aa.VID,aa.StuNo,bb.IScore,bb.UID,cc.EmpName,aa.LessonName,ee.StuName
from
(
select a.LessonNo,a.LessonName,a.EmpNo,a.AcademicYearNo,a.Semester,b.VID,a.StuNo
from "+ misdbname + @".dbo.StuSelectLessonList a
left join Eval_Main b on a.AcademicYearNo=b.AcademicYearNo and a.Semester=b.Semester
where b.Status=1 and b.VID='"+ vid + @"'
and a.StuNo is not null and a.StuNo <> ''
and a.StuNo not in (select StuNo from " + misdbname + @".dbo.StuInfoBasic where ChangeStatus=1)
) aa
left join
(
select sum(b.IScore) as IScore, a.EmpNo, a.LessonNo, a.UID
from Eval_QuestionResult a
left join Eval_QuestionItems b on a.IID = b.IID
left join Eval_Question c on a.QID=c.QID
where c.VID='"+ vid + @"'
and a.EmpNo is not null and a.EmpNo <> '' and a.LessonNo is not null and a.LessonNo <> '' and a.UID is not null and a.UID <> ''
group by a.EmpNo, a.LessonNo, a.UID
) bb
on aa.EmpNo=bb.EmpNo and aa.LessonNo=bb.LessonNo and aa.StuNo=bb.UID
left join " + misdbname + @".dbo.EmpInfo cc on aa.EmpNo=cc.EmpNo
left join " + misdbname + @".dbo.StuInfoBasic ee on aa.StuNo = ee.StuNo
where 1=1 and iscore>100 order by IScore desc";
var list= this.BaseRepository().FindList<Eval_QuestionResultEntity>(sql);
foreach (var item in list)
{
var questionlist= this.BaseRepository().FindList<Eval_QuestionEntity>("select * from Eval_Question where vid='"+ vid + "'");
foreach (var questionEntity in questionlist)
{
string sql2 = @"select b.* from Eval_Question a left join Eval_QuestionResult b on a.QID=b.QID
where a.vid='"+ vid + "' and b.LessonNo='" + item.LessonNo + "'" +
" and b.EmpNo='" + item.EmpNo + "' and b.uid='" + item.StuNo + "' and b.qid='"+questionEntity.QID+"'";
List<Eval_QuestionResultEntity> Eval_QuestionResultlist = this.BaseRepository().FindList<Eval_QuestionResultEntity>(sql2).ToList();
for (int i = 0; i < Eval_QuestionResultlist.Count()-1; i++)
{
string rid = Eval_QuestionResultlist[i].RID;
BaseRepository().Delete<Eval_QuestionResultEntity>(t=>t.RID== rid);
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
}
}

Cargando…
Cancelar
Guardar