@@ -79,6 +79,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 个人成绩查看 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult StuScoreQueryIndex() | |||
{ | |||
var logininfo = LoginUserInfo.Get(); | |||
ViewBag.StuNo = logininfo.account; | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 毕业证资格审核(班主任) | |||
/// <summary> | |||
/// <returns></returns> | |||
@@ -597,6 +608,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 根据StuNo查询班级课程 | |||
/// </summary> | |||
/// <param name="academicYearNo"></param> | |||
/// <param name="semester"></param> | |||
/// <param name="StuNo"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetLessonNoDataFromStuNo(string academicYearNo, string semester, string StuNo) | |||
{ | |||
var data = stuScoreIBLL.GetLessonNoDataFromStuNo(academicYearNo, semester, StuNo).OrderBy(x => x.value); | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 获取班级成绩列表 | |||
/// <summary> | |||
@@ -638,6 +665,43 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(result); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetScoreListByStuNo(string queryJson) | |||
{ | |||
var data = stuScoreIBLL.GetScoreListByStuNo(queryJson); | |||
var stuData = stuInfoBasicIBLL.GetAllList(); | |||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new | |||
{ | |||
StuId = x.Key.StuId, | |||
StuNo = x.Key.StuNo, | |||
StuName = x.Key.StuName, | |||
FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, | |||
TotalScore = x.Where(m=>m.LessonSortNo=="1").Select(y => y.Score).Sum(), | |||
LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) | |||
}).OrderByDescending(x => x.TotalScore); | |||
var result = new List<Dictionary<string, string>>(); | |||
foreach (var item in aa) | |||
{ | |||
var aaa = new Dictionary<string, string>(); | |||
aaa.Add("StuId", item.StuId); | |||
aaa.Add("StuNo", item.StuNo); | |||
aaa.Add("StuName", item.StuName); | |||
aaa.Add("FinishSchoolMark", item.FinishSchoolMark); | |||
aaa.Add("TotalScore", item.TotalScore.ToString()); | |||
foreach (var lessonInfoItem in item.LessonInfo) | |||
{ | |||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); | |||
} | |||
result.Add(aaa); | |||
} | |||
return Success(result); | |||
} | |||
public ActionResult GetScoreCharts(string AcademicYearNo, string Semester, string ClassNo, string LessonNo) | |||
{ | |||
var data = stuScoreIBLL.GetScoreCharts(AcademicYearNo, Semester, ClassNo, LessonNo); | |||
@@ -0,0 +1,202 @@ | |||
@{ ViewBag.Title = "个人成绩查看"; Layout = "~/Views/Shared/_Index.cshtml"; } | |||
<style> | |||
.lr-select { | |||
width: 150px; | |||
} | |||
</style> | |||
<style id="style1" media="print"> | |||
body, | |||
html { | |||
font-size: 13px; | |||
font-family: "微软雅黑"; | |||
color: #333; | |||
overflow-x: hidden; | |||
letter-spacing: 0; | |||
} | |||
ul { | |||
margin: 0px; | |||
padding: 0px; | |||
list-style: none; | |||
} | |||
li { | |||
list-style: none; | |||
} | |||
table { | |||
border-collapse: collapse; | |||
} | |||
.title ul { | |||
overflow: hidden; | |||
} | |||
.title li { | |||
width: 33.333333%; | |||
float: left; | |||
line-height: 24px | |||
} | |||
.tableBox { | |||
height: 661px; | |||
width: 33%; | |||
float: left; | |||
margin-left: 0.2%; | |||
border: 1px solid #000; | |||
box-sizing: border-box; | |||
} | |||
.tableBox:first-child { | |||
margin-left: 0 | |||
} | |||
.table { | |||
padding: 0; | |||
width: 100%; | |||
} | |||
.table td { | |||
border-top: 1px solid #000; | |||
line-height: 21px; | |||
letter-spacing: 2px; | |||
} | |||
.table tr:first-child { | |||
border-top: 0 | |||
} | |||
.table th, | |||
.table td { | |||
padding: 0px 1px; | |||
border-left: 1px solid #000; | |||
font-size: 13px; | |||
} | |||
.table th:first-child, | |||
.table td:first-child { | |||
border-left: 0px solid #000; | |||
} | |||
.print { | |||
overflow: hidden; | |||
margin-top: 10px; | |||
} | |||
</style> | |||
<div class="lr-layout"> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="AcademicYearNo" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="Semester" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.js") | |||
<script src="~/Content/static/js/LodopFuncs.js"></script> | |||
<script> | |||
var StuNo = "@ViewBag.StuNo"; | |||
var num = 0, | |||
tableNum = 1, | |||
html = ''; | |||
function prints(data, flag) { | |||
//初始化数据 | |||
data.list.push({ | |||
seal: "(单位盖章)", | |||
blank: '以 下 空 白' | |||
}) | |||
num = 0, tableNum = 1, html = ''; | |||
var htmlHead = '<div class="title"><ul><li>学院:' + data.school + '</li><li>专业:' + data.major + '</li><li>班级:' + data.className + '</li></ul><ul><li>学号:' + data.number + '</li><li>姓名:' + data.student + '</li><li>层次:' + data.arrangement + '</li></ul></div><div class="print">', | |||
tableHtml = '<div class="tableBox"><table class="table" cellspacing="0" cellpadding="0"><tr><th style="width:20%">课程类别</th><th style="width:70%">课程名称</th><th style="width:10%">成绩</th></tr>'; | |||
html += htmlHead; | |||
var len = data.list.length - 1; | |||
//数据处理 | |||
$.each(data.list, function (i, n) { //data 循环 | |||
if (num == 0 && i == 0) { | |||
html += tableHtml; | |||
} | |||
$.each(n, function (j, k) { // 学期数据循环 | |||
if (j == 'title') { | |||
html += '<tr><td colspan="3" style="text-align:center"><b>' + k + '</b></td></tr>' | |||
} else if (j == 'list') { | |||
$.each(k, function (m, b) { //具体数据显示 | |||
html += '<tr><td>' + b.type + '</td><td>' + b.className + '</td><td style="text-align:center">' + b.achievement + '</td></tr>'; | |||
numJudge(htmlHead, tableHtml) | |||
}) | |||
} else if (j == 'seal') { | |||
html += '<tr><td colspan="3" style="text-align: right;padding-right:20px">' + k + '</td></tr>'; | |||
} else { | |||
html += '<tr><td colspan="3" style="text-align:center">以 下 空 白</td></tr></table></div>'; | |||
} | |||
numJudge(htmlHead, tableHtml) | |||
}) | |||
}) | |||
for (var i = tableNum; i < 3; i++) { | |||
html += '<div class="tableBox"><table class="table" cellspacing="0" cellpadding="0"></table></div>'; | |||
} | |||
AddPrintContent(html, flag); | |||
}; | |||
function AddPrintContent(html, flag) { | |||
var myHtml = myHtml = html; | |||
var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>"; | |||
var strFormHtml = strBodyStyle + "<body>" + myHtml + "</body>"; | |||
LODOP = getLodop(); | |||
LODOP.PRINT_INIT("个人授课表"); | |||
LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4"); | |||
LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); | |||
LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); | |||
LODOP.ADD_PRINT_HTM(10, 10, '284mm', '196mm', strFormHtml); | |||
if (flag == "preview") { | |||
//打印预览 | |||
LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); | |||
var TaskID1 = LODOP.PREVIEW(); | |||
} else if (flag == "print") { | |||
// 直接打印 | |||
var TaskID1 = LODOP.PRINT(); | |||
} | |||
//打印设计 | |||
// var TaskID1 = LODOP.PRINT_DESIGN(); | |||
}; | |||
function numJudge(htmlHead, tableHtml) { | |||
num++; | |||
if (num > 29) { | |||
num = 0; | |||
if (tableNum >= 3) { | |||
tableNum = 1; | |||
html += '</table></div></div>' + htmlHead + tableHtml | |||
} else { | |||
html += '</table></div>' + tableHtml; | |||
tableNum++ | |||
} | |||
}; | |||
}; | |||
</script> |
@@ -0,0 +1,104 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-06-14 11:02 | |||
* 描 述:个人成绩查看 | |||
*/ | |||
var selectedRow; | |||
var refreshGirdData; | |||
//课程列 | |||
var LessonTemp = []; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
//page.initGird(); | |||
page.bind(); | |||
page.bindSelect(); | |||
}, | |||
bind: function () { | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
var p = {}; | |||
p.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); | |||
p.Semester = $('#Semester').lrselectGet(); | |||
p.StuNo = StuNo; | |||
if (p.AcademicYearNo == null || p.AcademicYearNo == "") { | |||
learun.alert.warning("请选择学年!"); | |||
return; | |||
} | |||
if (p.Semester == null || p.Semester == "") { | |||
learun.alert.warning("请选择学期!"); | |||
return; | |||
} | |||
$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataFromStuNo', p, | |||
function (data) { | |||
var temparr = []; | |||
for (var i = 0; i < data.length; i++) { | |||
var item = {}; | |||
item.label = data[i].text; | |||
item.name = data[i].value; | |||
item.width = 150; | |||
item.align = "left"; | |||
temparr.push(item); | |||
} | |||
LessonTemp = temparr; | |||
page.initGird(); | |||
page.search(p); | |||
}); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
}, | |||
bindSelect: function () { | |||
//学年 | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetAcademicYearNoData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
}, | |||
initGird: function () { | |||
var headData = [ | |||
{ label: '学号', name: 'StuNo', width: 100, align: "left" }, | |||
{ label: '姓名', name: 'StuName', width: 100, align: "left" }, | |||
{ label: '总分', name: 'TotalScore', width: 100, align: "left" }, | |||
]; | |||
var headDatas = headData.concat(LessonTemp); | |||
$("#gridtable")[0].dfop = undefined; | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListByStuNo', | |||
headData: headDatas, | |||
mainId: 'StuNo', | |||
isPage: false, | |||
sidx: 'TotalScore', | |||
sord: 'desc' | |||
}); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -960,6 +960,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\InputScoreIndexInTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\InputScoreIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\Monitor.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreQueryIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\InputScoreIndexOfElectiveInTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\InputScoreIndexOfElective.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\InputScoreIndexInTeacher.js" /> | |||
@@ -6794,6 +6795,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\EADateArrange\InitByConditionForm.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\StatisticIndex.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ADR_Record\StatisticDetailIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreQueryIndex.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -657,6 +657,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public IEnumerable<StuScoreEntity> GetScoreListByStuNo(string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuScoreService.GetScoreListByStuNo(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public List<object> GetStuGraduateInfo(string queryJson) | |||
{ | |||
try | |||
@@ -985,7 +1005,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<WebHelper.YearGrade> GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) | |||
{ | |||
try | |||
{ | |||
return stuScoreService.GetLessonNoDataFromStuNo(academicYearNo, semester, stuNo); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
@@ -176,6 +176,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreEntity> GetScoreListByClassNo(string queryJson); | |||
/// <summary> | |||
/// 获取学生成绩 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreEntity> GetScoreListByStuNo(string queryJson); | |||
/// <summary> | |||
/// 获取个人成绩列表 | |||
@@ -238,5 +244,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
void DoCheckScore(string queryJson, int checkMark); | |||
#endregion | |||
IEnumerable<WebHelper.YearGrade> GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo); | |||
} | |||
} |
@@ -707,8 +707,11 @@ where AcademicYearNo='" + strAcademicYear + "' and Semester='" + strSemester + " | |||
//获取已审核成绩列表 | |||
var stuScoreList = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == academic && x.Semester == semester && x.StuNo == stuNo && x.CheckMark == "1"); | |||
foreach (var scoreEntity in stuScoreList) | |||
{ | |||
scoreEntity.LessonName = scoreEntity.LessonName + (!string.IsNullOrEmpty(scoreEntity.LessonSortNo)&&scoreEntity.LessonSortNo == "2"?"(选修)":""); | |||
} | |||
result.ScoreList = stuScoreList.ToList(); | |||
//获取排名、综合成绩 | |||
var aa = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == academic && x.Semester == semester && x.ClassNo == classNo && x.CheckMark == "1" && x.LessonSortNo == "1"); | |||
var aaa = aa.GroupBy(x => x.StuNo).Select(x => new | |||
@@ -1753,5 +1756,83 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||
} | |||
#endregion | |||
/// <summary> | |||
/// 学生成绩查看含选修 | |||
/// </summary> | |||
/// <param name="academicYearNo"></param> | |||
/// <param name="semester"></param> | |||
/// <param name="stuNo"></param> | |||
/// <returns></returns> | |||
public IEnumerable<WebHelper.YearGrade> GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("select distinct s.LessonNo as value,s.LessonName+(case s.LessonSortNo when '2' then '(选修)' else '' end) as text from stuscore s "); | |||
strSql.Append(" where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.StuNo='" + stuNo + "' "); | |||
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); | |||
} | |||
} | |||
} | |||
public IEnumerable<StuScoreEntity> GetScoreListByStuNo(string queryJson) | |||
{ | |||
try | |||
{ | |||
//参考写法 | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
var tableName = "StuScore"; | |||
if (!queryParam["TableName"].IsEmpty()) | |||
{ | |||
tableName = queryParam["TableName"].ToString(); | |||
} | |||
var strSql = new StringBuilder(); | |||
strSql.Append($"select s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); | |||
strSql.Append(" where 1=1 and s.CheckMark='1' "); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); | |||
strSql.Append(" and s.AcademicYearNo=@AcademicYearNo "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | |||
strSql.Append(" and s.Semester=@Semester "); | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | |||
strSql.Append(" and s.StuNo=@StuNo "); | |||
} | |||
strSql.Append(" group by s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName "); | |||
return this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -255,37 +255,6 @@ namespace Quanjiang.DigitalScholl.DataSync | |||
} | |||
} | |||
} | |||
if (ciItemCollection.Contains("导入导出")) | |||
{ | |||
var sourceinter = sourcedb.FindList<ExcelExportEntity>(); | |||
var targetinter = targetdb.FindList<ExcelExportEntity>(); | |||
foreach (var tItemEntity in sourceinter) | |||
{ | |||
if (!targetinter.Any(m => m.F_Id == tItemEntity.F_Id)) | |||
{ | |||
targetdb.Insert<ExcelExportEntity>(tItemEntity); | |||
} | |||
} | |||
var sourceinter1 = sourcedb.FindList<ExcelImportEntity>(); | |||
var targetinter1 = targetdb.FindList<ExcelImportEntity>(); | |||
foreach (var tItemEntity in sourceinter1) | |||
{ | |||
if (!targetinter1.Any(m => m.F_Id == tItemEntity.F_Id)) | |||
{ | |||
targetdb.Insert<ExcelImportEntity>(tItemEntity); | |||
} | |||
} | |||
var sourceinter2 = sourcedb.FindList<ExcelImportFieldEntity>(); | |||
var targetinter2 = targetdb.FindList<ExcelImportFieldEntity>(); | |||
foreach (var tItemEntity in sourceinter2) | |||
{ | |||
if (!targetinter2.Any(m => m.F_Id == tItemEntity.F_Id)) | |||
{ | |||
targetdb.Insert<ExcelImportFieldEntity>(tItemEntity); | |||
} | |||
} | |||
} | |||
if (ciItemCollection.Contains("桌面主题")) | |||
{ | |||
//主题色块 | |||
@@ -321,6 +290,39 @@ namespace Quanjiang.DigitalScholl.DataSync | |||
} | |||
} | |||
} | |||
if (ciItemCollection.Contains("导入导出")) | |||
{ | |||
var sourceinter = sourcedb.FindList<ExcelExportEntity>(); | |||
var targetinter = targetdb.FindList<ExcelExportEntity>(); | |||
foreach (var tItemEntity in sourceinter) | |||
{ | |||
if (!targetinter.Any(m => m.F_Id == tItemEntity.F_Id)) | |||
{ | |||
targetdb.Insert<ExcelExportEntity>(tItemEntity); | |||
} | |||
} | |||
var sourceinter1 = sourcedb.FindList<ExcelImportEntity>(); | |||
var targetinter1 = targetdb.FindList<ExcelImportEntity>(); | |||
foreach (var tItemEntity in sourceinter1) | |||
{ | |||
if (!targetinter1.Any(m => m.F_Id == tItemEntity.F_Id)) | |||
{ | |||
targetdb.Insert<ExcelImportEntity>(tItemEntity); | |||
} | |||
var sourceinter2 = sourcedb.FindList<ExcelImportFieldEntity>(m => m.F_ImportId == tItemEntity.F_Id); | |||
var targetinter2 = targetdb.FindList<ExcelImportFieldEntity>(m => m.F_ImportId == tItemEntity.F_Id); | |||
if (targetinter2 != null) | |||
{ | |||
foreach (var sourcEntity in sourceinter2) | |||
{ | |||
if (!targetinter2.Any(m => m.F_Id == sourcEntity.F_Id || m.F_ColName == sourcEntity.F_ColName)) | |||
{ | |||
targetdb.Insert<ExcelImportFieldEntity>(sourcEntity); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
targetdb.Commit(); | |||
return true; | |||
} | |||