소스 검색

Merge branch '西昌分支' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 西昌分支

西昌缴费二期
zhangli 2 년 전
부모
커밋
ada5fda613
8개의 변경된 파일200개의 추가작업 그리고 222개의 파일을 삭제
  1. +16
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/StudentIndex.js
  2. +16
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElective/Index.js
  3. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config
  4. +157
    -212
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs
  5. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs
  6. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs
  7. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs
  8. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs

+ 16
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/StudentIndex.js 파일 보기

@@ -176,7 +176,7 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetPageListOfStudent',
headData: [
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
@@ -196,6 +196,21 @@ var bootstrap = function ($, learun) {
});
}
},
{
label: "课程类型", name: "LessonTypeId", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
console.log(row.LessonTypeId);

learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonType',
key: row.LessonTypeId,
keyId: 'ltid',
callback: function (_data) {
callback(_data['lessontypename']);
}
});
}
},
{
label: "上课节次", name: "LessonSection", width: 150, align: "left",
formatter: function (cellvalue, row) {


+ 16
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElective/Index.js 파일 보기

@@ -68,7 +68,7 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/GetPageList',
headData: [
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left"},
@@ -87,6 +87,21 @@ var bootstrap = function ($, learun) {
});
}
},
{
label: "课程类型", name: "LessonTypeId", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
console.log(row.LessonTypeId);

learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonType',
key: row.LessonTypeId,
keyId: 'ltid',
callback: function (_data) {
callback(_data['lessontypename']);
}
});
}
},
{
label: "上课节次", name: "LessonSection", width: 150, align: "left",
formatter: function (cellvalue, row) {


+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config 파일 보기

@@ -13,9 +13,9 @@
<add name="CollegeMIS" connectionString="Server=112.45.152.8;Initial Catalog=NewCollegeMIS;User ID=sa;Password=qj@2018" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=112.45.152.8;Initial Catalog=HangFire;User ID=sa;Password=qj@2018" providerName="System.Data.SqlClient" />-->
<!--demo.quanjiang.com-->
<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<!--<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="CollegeMIS" connectionString="Server=123.57.209.16;Initial Catalog=CollegeMIS;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />-->
<!--<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="CollegeMIS" connectionString="Server=123.57.209.16;Initial Catalog=CollegeMIS_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
@@ -38,9 +38,9 @@
<!--<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2_塔里木;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="CollegeMIS" connectionString="Server=123.57.209.16;Initial Catalog=CollegeMIS_塔里木;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />-->
<!--<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="CollegeMIS" connectionString="Server=123.57.209.16;Initial Catalog=CollegeMIS_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="paikeDbString" connectionString="Data Source=10.30.0.11;Database=paike;User ID=root;Password=12345678;" providerName="MySql.Data.MySqlClient" />-->
<add name="paikeDbString" connectionString="Data Source=10.30.0.11;Database=paike;User ID=root;Password=12345678;" providerName="MySql.Data.MySqlClient" />

</connectionStrings>

+ 157
- 212
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs 파일 보기

@@ -659,7 +659,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
}
return result;
}
/// <summary>
/// 按条件同步排课数据
/// </summary>
@@ -674,169 +674,66 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
var classroomData = (await BaseRepository("CollegeMIS").FindListAsync<ClassroomInfoEntity>()).ToList();
if (entity.SyncType == "1")
{
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}");
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
string apiData = await Client.PostAsync(Config.GetValue("ArrangeLessonAPI"), httpContent).Result.Content.ReadAsStringAsync();

if (!string.IsNullOrEmpty(apiData))
var LessonList = BaseRepository("paikeDbString").FindList<paikeList>(
@"SELECT a.week AS 'week', a.section AS 'section',a.timetext AS 'timetext',c.name AS 'classname',c.number AS 'classnumber',
r.name AS 'roomname',r.number AS 'ClassroomNo',t.name AS 'teachername',t.number AS 'teacherNumber', cu.name AS 'curriculunName',
cu.number AS 'curriculunNumber', s.year AS 'year', s.number AS 'semester'
FROM tb_paike a
LEFT JOIN tb_clazz c ON c.id= a.`clazzid`
LEFT JOIN tb_classroom r ON r.id =a.`classroomid`
LEFT JOIN tb_teacher t ON t.id =a.`teacherid`
LEFT JOIN tb_curriculum cu ON cu.id=a.`curriculunid`
LEFT JOIN tb_semester s ON s.id=a.`semester`
WHERE 1=1 AND c.number IS NOT NULL AND s.year = '" + entity.AcademicYearNo + "' AND s.number ='" + entity.Semester + "'");

if (LessonList.Count() > 0)
{
var data = JsonConvert.DeserializeObject<RootByCondition>(apiData);
var dataList = data.entity.list;
if (dataList.Any())
var oldArrangeLessonTermList = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeLessonTermEntity>()).ToList();
var insertDataList = new List<ArrangeLessonTermEntity>();
foreach (var item in LessonList)
{
var oldArrangeLessonTermList = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeLessonTermEntity>()).ToList();
var insertDataList = new List<ArrangeLessonTermEntity>();
foreach (var item in dataList)
var classinfo = classData.FirstOrDefault(m => m.ClassNo == item.classnumber);
var timesArr = item.timetext.Substring(0, item.timetext.Length - 1).Split(',');
foreach (var timesItem in timesArr)
{
var classinfo = classData.FirstOrDefault(m => m.ClassId == item.clazzSid);

var timesArr = item.timeText.Substring(0, item.timeText.Length - 1).Split(',');
foreach (var timesItem in timesArr)
var insertData = new ArrangeLessonTermEntity
{
if (item.section.Contains(","))
{
foreach (var sec in item.section.Split(','))
{
var insertData = new ArrangeLessonTermEntity
{
ALTId = Guid.NewGuid().ToString(),
LessonDate = DateTime.Parse(timesItem),
AcademicYearNo = item.year,
Semester = item.number,
DeptNo = classinfo?.DeptNo,
MajorNo = classinfo?.MajorNo,
LessonNo = item.curriculunNumber,
LessonName = item.curriculunName,
TeachClassNo = item.curriculunName + classinfo?.ClassNo,
EmpNo = item.teacherNumber,
EmpName = item.teacherName,
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonId == item.curriculunSid)?.LessonSortNo,
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomId == item.classRoomSid)?.ClassroomNo,
LessonTime = item.week + sec,
CheckMark = "1",
F_SchoolId = item.schoolSid
};
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
&& m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
&& m.F_SchoolId == insertData.F_SchoolId) == 0
&& insertDataList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
&& m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
&& m.F_SchoolId == insertData.F_SchoolId) == 0)
{
insertDataList.Add(insertData);
}
//if (!oldArrangeLessonTermList.Any(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
// && m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
// && m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
// && m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
// && m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
// && m.F_SchoolId == insertData.F_SchoolId)
// && !insertDataList.Any(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
// && m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
// && m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
// && m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
// && m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
// && m.F_SchoolId == insertData.F_SchoolId))
//{
// insertDataList.Add(insertData);
//}
}
}
else
{
var insertData = new ArrangeLessonTermEntity
{
ALTId = Guid.NewGuid().ToString(),
LessonDate = DateTime.Parse(timesItem),
AcademicYearNo = item.year,
Semester = item.number,
DeptNo = classinfo?.DeptNo,
MajorNo = classinfo?.MajorNo,
LessonNo = item.curriculunNumber,
LessonName = item.curriculunName,
TeachClassNo = item.curriculunName + classinfo?.ClassNo,
EmpNo = item.teacherNumber,
EmpName = item.teacherName,
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonId == item.curriculunSid)?.LessonSortNo,
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomId == item.classRoomSid)?.ClassroomNo,
LessonTime = item.week + item.section,
CheckMark = "1",
F_SchoolId = item.schoolSid
};
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
&& m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
&& m.F_SchoolId == insertData.F_SchoolId) == 0
&& insertDataList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate
&& m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
&& m.F_SchoolId == insertData.F_SchoolId) == 0)
{
insertDataList.Add(insertData);
}
}
ALTId = Guid.NewGuid().ToString(),
LessonDate = DateTime.Parse(timesItem),
AcademicYearNo = item.year,
Semester = item.semester,
DeptNo = classinfo?.DeptNo,
MajorNo = classinfo?.MajorNo,
LessonNo = item.curriculunNumber,
LessonName = item.curriculunName,
TeachClassNo = item.curriculunName + classinfo?.ClassNo,
EmpNo = item.teacherNumber,
EmpName = item.teachername,
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.curriculunNumber)?.LessonSortNo,
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomNo == item.ClassroomNo)?.ClassroomNo,
LessonTime = item.week + item.section,
CheckMark = "1",
F_SchoolId = entity.F_SchoolId
};
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate.Value.Date == insertData.LessonDate.Value.Date
&& m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
&& m.F_SchoolId == insertData.F_SchoolId) == 0
&& insertDataList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester
&& m.LessonNo == insertData.LessonNo && m.LessonDate.Value.Date == insertData.LessonDate.Value.Date
&& m.DeptNo == insertData.DeptNo && m.MajorNo == insertData.MajorNo
&& m.TeachClassNo == insertData.TeachClassNo && m.EmpNo == insertData.EmpNo
&& m.ClassroomNo == insertData.ClassroomNo && m.LessonTime == insertData.LessonTime
&& m.F_SchoolId == insertData.F_SchoolId) == 0)
{
insertDataList.Add(insertData);
BaseRepository("CollegeMIS").Insert(insertData);
}
}
await BaseRepository("CollegeMIS").InsertAsync(insertDataList);

//TeachClass数据处理
// var arrangeLessonTermData = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeLessonTermEntity>(@"select F_SchoolId,AcademicYearNo,Semester,DeptNo,majorno,lessonno,replace(teachclassno,lessonname,'') as teachclassno,empno from [dbo].[ArrangeLessonTerm]
//where (AcademicYearNo = '" + stringAcademicYear + "') and semester='" + stringSemester + "' and F_SchoolId = '" + stringSchoolId + @"'
//group by F_SchoolId,AcademicYearNo,Semester,DeptNo,majorno,lessonno,replace(teachclassno,lessonname,'') ,empno ")).ToList();
// var TeachClassData = (await BaseRepository("CollegeMIS").FindListAsync<TeachClassEntity>(@"SELECT *
//FROM TeachClass
//WHERE (AcademicYearNo = '" + stringAcademicYear + "') and semester='" + stringSemester + "' and F_SchoolId='" + stringSchoolId + "' ")).ToList();
// var insertTeachClassDataList = new List<TeachClassEntity>();
// if (arrangeLessonTermData.Any())
// {
// foreach (var altitem in arrangeLessonTermData)
// {
// var insertTeachClassData = new TeachClassEntity()
// {
// AcademicYearNo = altitem.AcademicYearNo,
// Semester = altitem.Semester,
// DeptNo = altitem.DeptNo,
// MajorNo = altitem.MajorNo,
// LessonNo = altitem.LessonNo,
// Grade = classData.FirstOrDefault(m => m.ClassNo == altitem.TeachClassNo)?.Grade,
// LessonSortNo ="1",
// TeachClassNo = altitem.TeachClassNo,
// EmpNo = altitem.EmpNo,
// F_SchoolId = altitem.F_SchoolId
// };
// //非空判断
// if (TeachClassData.Count(m => m.AcademicYearNo == insertTeachClassData.AcademicYearNo &&
// m.Semester == insertTeachClassData.Semester && m.DeptNo == insertTeachClassData.DeptNo &&
// m.MajorNo == insertTeachClassData.MajorNo && m.LessonNo == insertTeachClassData.LessonNo &&
// m.Grade == insertTeachClassData.Grade && m.LessonSortNo == insertTeachClassData.LessonSortNo &&
// m.TeachClassNo == insertTeachClassData.TeachClassNo && m.EmpNo == insertTeachClassData.EmpNo &&
// m.F_SchoolId == insertTeachClassData.F_SchoolId) == 0
// && insertTeachClassDataList.Count(m => m.AcademicYearNo == insertTeachClassData.AcademicYearNo &&
// m.Semester == insertTeachClassData.Semester && m.DeptNo == insertTeachClassData.DeptNo &&
// m.MajorNo == insertTeachClassData.MajorNo && m.LessonNo == insertTeachClassData.LessonNo &&
// m.Grade == insertTeachClassData.Grade && m.LessonSortNo == insertTeachClassData.LessonSortNo &&
// m.TeachClassNo == insertTeachClassData.TeachClassNo && m.EmpNo == insertTeachClassData.EmpNo &&
// m.F_SchoolId == insertTeachClassData.F_SchoolId) == 0)
// {
// insertTeachClassDataList.Add(insertTeachClassData);
// }

// }
// await BaseRepository("CollegeMIS").InsertAsync(insertTeachClassDataList);
// }

}

}
}
else
@@ -861,7 +758,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
LEFT JOIN tb_curriculum curriculum ON curriculum.id = a.curriculum
LEFT JOIN tb_classroom room ON room.id = a.classroom
LEFT JOIN tb_teacher teacher ON teacher.id = a.teacher
WHERE semester.year = '" + entity.AcademicYearNo + "' AND semester.number = '" + entity.Semester + "'");
WHERE a.type='1' and semester.year = '" + entity.AcademicYearNo + "' AND semester.number = '" + entity.Semester + "'");
var TeachClassData = (await BaseRepository("CollegeMIS").FindListAsync<TeachClassEntity>(@"SELECT *
FROM TeachClass
WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + entity.Semester + "' and F_SchoolId='" + entity.F_SchoolId + "' ")).ToList();
@@ -928,41 +825,64 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
{
try
{
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}");
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
string apiData = await Client.PostAsync(Config.GetValue("OpenLessonPlanAPI"), httpContent).Result.Content.ReadAsStringAsync();
var TeachList = BaseRepository("paikeDbString").FindList<TeachClassEntity>(
@"select m.name AS 'MajorName', m.number AS 'MajorNo', tt.EmpNo AS 'EmpNo',
tt.EmpName AS 'EmpName', sc.name AS 'F_SchoolName', sc.sid AS 'F_SchoolId',
p.grade AS 'Grade', p.classhour AS 'classhour', curr.name AS 'LessonName', curr.number AS 'LessonNo',
s.year AS 'AcademicYearNo', s.number AS 'Semester' FROM tb_major_plan p
LEFT JOIN (
SELECT
t.teacher,
GROUP_CONCAT(DISTINCT c.`name`) AS 'EmpName',
GROUP_CONCAT(DISTINCT c.number) AS 'EmpNo'
FROM
tb_major_plan t
LEFT JOIN tb_teacher c ON FIND_IN_SET(c.id, t.teacher) > 0
GROUP BY
t.teacher
) tt ON tt.teacher = p.teacher
LEFT JOIN tb_semester s ON s.id=p.`semester`
LEFT JOIN tb_school sc ON sc.`id`= p.`school`
LEFT JOIN tb_major m ON m.id=p.major
LEFT JOIN tb_course cour ON cour.id= p.`course`
LEFT JOIN tb_curriculum curr ON curr.id=cour.`course`
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" + entity.Semester
+ "' AND sc.sid = '" + entity.F_SchoolId + "' AND curr.`ification` ='1' ORDER BY p.`major` ");

var majorData = (await BaseRepository("CollegeMIS").FindListAsync<CdMajorEntity>()).ToList();
var lessonData = (await BaseRepository("CollegeMIS").FindListAsync<LessonInfoEntity>()).ToList();
if (!string.IsNullOrEmpty(apiData))

if (TeachList.Count() > 0)
{
var data = JsonConvert.DeserializeObject<RootOfPlanByCondition>(apiData);
var dataList = data.entity.list;
var openLessonPlanData = await BaseRepository("CollegeMIS").FindListAsync<OpenLessonPlanEntity>();
if (dataList.Any())
var now = DateTime.Now;
var insertDataList = new List<OpenLessonPlanEntity>();

foreach (var item in TeachList)
{
var insertDataList = new List<OpenLessonPlanEntity>();
var now = DateTime.Now;
foreach (var item in dataList)
foreach (var itemTeach in item.EmpNo.Split(','))
{
var insertData = new OpenLessonPlanEntity()
{
TeachNo = itemTeach,
MakeDate = now,
AcademicYearNo = item.semester.year,
Semester = item.semester.number,
DeptNo = majorData.FirstOrDefault(m => m.ID == item.major.sid)?.DeptNo,
MajorNo = item.major.number,
LessonNo = item.course.course.number,
LessonName = item.course.course.name,
AcademicYearNo = item.AcademicYearNo,
Semester = item.Semester,
DeptNo = majorData.FirstOrDefault(m => m.MajorNo == item.MajorNo)?.DeptNo,
MajorNo = item.MajorNo,
LessonNo = item.LessonNo,
LessonName = item.LessonName,
PartCode = "",
Grade = item.grade,
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.course.course.number)?.LessonSortNo,
LessonSortDetailNo = lessonData.FirstOrDefault(m => m.LessonNo == item.course.course.number)?.LessonSortDetailNo,
StartWeek = item.semester.yesNo,
EndWeek = item.semester.week,
Grade = item.Grade,
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.LessonSortNo)
?.LessonSortNo,
LessonSortDetailNo = lessonData
.FirstOrDefault(m => m.LessonNo == item.LessonSortDetailNo)?.LessonSortDetailNo,
StartWeek = item.StartWeek,
EndWeek = item.EndWeek,
CheckStyleNo = "1",
ScoreRecordStyleNo = "1",
TeachDeptNo = majorData.FirstOrDefault(m => m.ID == item.major.sid)?.DeptNo,
TeachDeptNo = majorData.FirstOrDefault(m => m.MajorNo == item.MajorNo)?.DeptNo,
StudyScore = 0,
AmendDate = now,
ClassroomType = 1,
@@ -970,36 +890,35 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest
CheckMarkDept = "1",
CheckMark = "1",
TestMark = 0,
F_SchoolId = item.school.sid
F_SchoolId = item.F_SchoolId
};
if (openLessonPlanData.Count(m => m.AcademicYearNo == insertData.AcademicYearNo &&
m.Semester == insertData.Semester &&
m.DeptNo == insertData.DeptNo &&
m.MajorNo == insertData.MajorNo &&
m.LessonNo == insertData.LessonNo &&
m.Grade == insertData.Grade &&
m.LessonSortNo == insertData.LessonSortNo &&
m.LessonName == insertData.LessonName &&
m.F_SchoolId == insertData.F_SchoolId) == 0 && insertDataList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo &&
m.Semester == insertData.Semester &&
m.DeptNo == insertData.DeptNo &&
m.MajorNo == insertData.MajorNo &&
m.LessonNo == insertData.LessonNo &&
m.Grade == insertData.Grade &&
m.LessonSortNo == insertData.LessonSortNo &&
m.LessonName == insertData.LessonName &&
m.F_SchoolId == insertData.F_SchoolId) == 0)
m.F_SchoolId == insertData.F_SchoolId) == 0 &&
insertDataList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo &&
m.Semester == insertData.Semester &&
m.MajorNo == insertData.MajorNo &&
m.LessonNo == insertData.LessonNo &&
m.Grade == insertData.Grade &&
m.LessonSortNo == insertData.LessonSortNo &&
m.LessonName == insertData.LessonName &&
m.F_SchoolId == insertData.F_SchoolId) == 0)
{
insertDataList.Add(insertData);
}
}
await BaseRepository("CollegeMIS").InsertAsync(insertDataList);
}
await BaseRepository("CollegeMIS").InsertAsync(insertDataList);
}
//学生选课数据
var TeachClassData = (await BaseRepository("CollegeMIS").FindListAsync<TeachClassEntity>(@"SELECT *
FROM TeachClass
WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + entity.Semester + "' and F_SchoolId='" + entity.F_SchoolId + "' ")).ToList();
FROM TeachClass
WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + entity.Semester + "' and F_SchoolId='" + entity.F_SchoolId + "' ")).ToList();
var stuinfobasicData = (await BaseRepository("CollegeMIS").FindListAsync<StuInfoBasicEntity>()).ToList();
var stuSelectLessonListEntityData = (await BaseRepository("CollegeMIS").FindListAsync<StuSelectLessonListEntity>()).ToList();
var insertStuSelectLessonListDataList = new List<StuSelectLessonListEntity>();
@@ -1093,34 +1012,44 @@ WHERE (AcademicYearNo = '" + entity.AcademicYearNo + "') and semester='" + ent
public async Task<bool> AsyncModifyArrangeLessonDataByCondition(ArrangeLessonTermEntity entity)
{
bool result = false;
var db = BaseRepository("CollegeMIS");
try
{
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}");
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
string apiData = await Client.PostAsync(Config.GetValue("ModifyArrangeLessonAPI"), httpContent).Result.Content.ReadAsStringAsync();

if (!string.IsNullOrEmpty(apiData))
if (entity.SyncType == "1")
{
var data = JsonConvert.DeserializeObject<Root>(apiData);
if (data.success)
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}");
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
string apiData = await Client.PostAsync(Config.GetValue("ModifyArrangeLessonAPI"), httpContent).Result.Content.ReadAsStringAsync();

if (!string.IsNullOrEmpty(apiData))
{
var executeResult = await BaseRepository("CollegeMIS").ExecuteAsyncBySql(
$"delete from ArrangeLessonTerm where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
await BaseRepository("CollegeMIS").ExecuteAsyncBySql(
$"delete from TeachClass where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
await BaseRepository("CollegeMIS").ExecuteAsyncBySql(
$"delete from OpenLessonPlan where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
await BaseRepository("CollegeMIS").ExecuteAsyncBySql(
$"delete from StuSelectLessonList where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
if (executeResult > 0)
var data = JsonConvert.DeserializeObject<Root>(apiData);
if (data.success)
{
db.BeginTrans();
db.ExecuteBySql(
$"delete from ArrangeLessonTerm where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.Commit();
result = true;
}
}
}
else
{
db.BeginTrans();
db.ExecuteBySql(
$"delete from TeachClass where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.ExecuteBySql(
$"delete from OpenLessonPlan where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.ExecuteBySql(
$"delete from StuSelectLessonList where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
db.Commit();
result = true;
}
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
@@ -2741,7 +2670,23 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les

#endregion


public class paikeList
{
public string week { get; set; }
public string section { get; set; }
public string timetext { get; set; }
public string classname { get; set; }
public string classnumber { get; set; }
public string roomname { get; set; }
public string ClassroomNo { get; set; }
public string teachername { get; set; }
public string teacherNumber { get; set; }
public string curriculunName { get; set; }
public string curriculunNumber { get; set; }
public string year { get; set; }
public string semester { get; set; }
public string schoolno { get; set; }
}
#endregion
}



+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs 파일 보기

@@ -222,6 +222,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[NotMapped] public string LessonNo2 { get; set; }
[NotMapped] public string EmpNo2 { get; set; }
[NotMapped] public string LessonTypeId { get; set; }

/// <summary>
/// 选课专业列表
/// </summary>


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs 파일 보기

@@ -100,9 +100,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var EADateArrangeEntityAboutElective = this.BaseRepository("CollegeMIS").FindEntity<EADateArrangeEntity>(x => x.WorkName == "选课" && x.MakeDate <= now && x.EndDate >= now && x.CheckMark == "1");

var strSql = new StringBuilder();
strSql.Append(@"select b.*,c.StuNo,c.StuName,c.Status,cp.Status as StatusPre from ElectiveMajor a left join OpenLessonPlanOfElective b on a.OLPOEId=b.Id
strSql.Append(@"select b.*,leif.LessonTypeId,c.StuNo,c.StuName,c.Status,cp.Status as StatusPre from ElectiveMajor a left join OpenLessonPlanOfElective b on a.OLPOEId=b.Id
left join StuSelectLessonListOfElective c on b.Id=c.OLPEId and c.StuNo=@StuNo
left join StuSelectLessonListOfElectivePre cp on b.Id=cp.OLPEId and cp.StuNo=@StuNo
left join StuSelectLessonListOfElectivePre cp on b.Id=cp.OLPEId and cp.StuNo=@StuNo left join LessonInfo leif on b.LessonNo=leif.LessonNo
where not exists ( ");
//不显示与已选课程 相同课程名称相同教师的课程
strSql.Append(" select * from StuSelectLessonListOfElective s where s.AcademicYearNo='" + EADateArrangeEntityAboutElective?.AcademicYearNo + "' and s.Semester='" + EADateArrangeEntityAboutElective.Semester + "' and s.StuNo=@StuNo and s.Status <>3 and s.LessonName=b.LessonName and s.EmpNo=b.EmpNo and s.OLPEId!=b.Id ");


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs 파일 보기

@@ -212,6 +212,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#region 扩展字段

[NotMapped] public string F_SchoolId { get; set; }
[NotMapped] public string LessonTypeId { get; set; }

#endregion
}


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs 파일 보기

@@ -29,8 +29,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT t.* ");
strSql.Append(" FROM StuSelectLessonListOfElective t ");
strSql.Append("SELECT t.*,leif.LessonTypeId ");
strSql.Append(" FROM StuSelectLessonListOfElective t left join LessonInfo leif on t.LessonNo=leif.LessonNo ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数


불러오는 중...
취소
저장