|
@@ -225,7 +225,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
{ |
|
|
{ |
|
|
var userInfo = LoginUserInfo.Get(); |
|
|
var userInfo = LoginUserInfo.Get(); |
|
|
var strSql = new StringBuilder(); |
|
|
var strSql = new StringBuilder(); |
|
|
strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,'0' as Status,c.ClassName "); |
|
|
|
|
|
|
|
|
strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,'1' as Status,c.ClassName "); |
|
|
strSql.Append(" FROM StuInfoBasic t left join StuInfoBasic tt on t.ClassNo=tt.ClassNo left join ClassInfo c on t.ClassNo=c.ClassNo "); |
|
|
strSql.Append(" FROM StuInfoBasic t left join StuInfoBasic tt on t.ClassNo=tt.ClassNo left join ClassInfo c on t.ClassNo=c.ClassNo "); |
|
|
strSql.Append(" WHERE 1=1 "); |
|
|
strSql.Append(" WHERE 1=1 "); |
|
|
var queryParam = queryJson.ToJObject(); |
|
|
var queryParam = queryJson.ToJObject(); |
|
@@ -269,16 +269,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
var dp = new DynamicParameters(new { }); |
|
|
var dp = new DynamicParameters(new { }); |
|
|
var nowDate = DateTime.Now.Date; |
|
|
var nowDate = DateTime.Now.Date; |
|
|
var nextDate = DateTime.Now.AddDays(1).Date; |
|
|
var nextDate = DateTime.Now.AddDays(1).Date; |
|
|
strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,c.ClassName "); |
|
|
|
|
|
strSql.Append(" ,g.ID,case when g.Status is null then '0' else g.Status end as Status,g.Temperature,g.ProcessingResult,g.Remark,g.MeasureTime "); |
|
|
|
|
|
|
|
|
strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,'1' as Status,c.ClassName "); |
|
|
|
|
|
if (!queryParam["MeasureTime"].IsEmpty() && queryParam["MeasureTime"].ToString() != "-1") |
|
|
|
|
|
{ |
|
|
|
|
|
strSql.Append(" ,g.ID,case when g.Status is null then '1' else g.Status end as Status,g.Temperature,g.ProcessingResult,g.Remark,g.MeasureTime "); |
|
|
|
|
|
} |
|
|
strSql.Append(" FROM StuInfoBasic t left join StuInfoBasic tt on t.ClassNo=tt.ClassNo left join ClassInfo c on t.ClassNo=c.ClassNo "); |
|
|
strSql.Append(" FROM StuInfoBasic t left join StuInfoBasic tt on t.ClassNo=tt.ClassNo left join ClassInfo c on t.ClassNo=c.ClassNo "); |
|
|
strSql.Append(" left join Thermography g on t.StuNo=g.PersonBeingMeasured and t.ClassNo=g.ClassNo and t.DeptNo=g.DeptNo and t.MajorNo=g.DeptNo "); |
|
|
|
|
|
strSql.Append(" and g.MeasureDate >='" + nowDate + "' and g.MeasureDate<'" + nextDate + "' "); |
|
|
|
|
|
if (!queryParam["MeasureTime"].IsEmpty()) |
|
|
|
|
|
|
|
|
if (!queryParam["MeasureTime"].IsEmpty() && queryParam["MeasureTime"].ToString() != "-1") |
|
|
{ |
|
|
{ |
|
|
|
|
|
strSql.Append(" left join Thermography g on t.StuNo=g.PersonBeingMeasured and t.ClassNo=g.ClassNo and t.DeptNo=g.DeptNo and t.MajorNo=g.DeptNo "); |
|
|
|
|
|
strSql.Append(" and g.MeasureDate >='" + nowDate + "' and g.MeasureDate<'" + nextDate + "' "); |
|
|
|
|
|
|
|
|
dp.Add("MeasureTime", queryParam["MeasureTime"].ToString(), DbType.String); |
|
|
dp.Add("MeasureTime", queryParam["MeasureTime"].ToString(), DbType.String); |
|
|
strSql.Append(" and g.MeasureTime=@MeasureTime "); |
|
|
strSql.Append(" and g.MeasureTime=@MeasureTime "); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
strSql.Append(" WHERE 1=1 "); |
|
|
strSql.Append(" WHERE 1=1 "); |
|
|
if (!queryParam["MeasurerID"].IsEmpty()) |
|
|
if (!queryParam["MeasurerID"].IsEmpty()) |
|
|
{ |
|
|
{ |
|
@@ -390,16 +395,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
if (!string.IsNullOrEmpty(keyValue)) |
|
|
|
|
|
|
|
|
//限制测温时间(上午、中午、晚上)时:判断学生是否已测温,是则更新,否则新增;不限制测温时间时:新增; |
|
|
|
|
|
if (entity.MeasureTime == "-1") |
|
|
{ |
|
|
{ |
|
|
entity.Modify(keyValue, userInfo); |
|
|
|
|
|
this.BaseRepository("CollegeMIS").Update(entity); |
|
|
|
|
|
|
|
|
entity.Create(userInfo); |
|
|
|
|
|
this.BaseRepository("CollegeMIS").Insert(entity); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
entity.Create(userInfo); |
|
|
|
|
|
this.BaseRepository("CollegeMIS").Insert(entity); |
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(keyValue)) |
|
|
|
|
|
{ |
|
|
|
|
|
entity.Modify(keyValue, userInfo); |
|
|
|
|
|
this.BaseRepository("CollegeMIS").Update(entity); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
entity.Create(userInfo); |
|
|
|
|
|
this.BaseRepository("CollegeMIS").Insert(entity); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
LogEntity logEntity = new LogEntity(); |
|
|
LogEntity logEntity = new LogEntity(); |
|
|
logEntity.F_LogId = Guid.NewGuid().ToString(); |
|
|
logEntity.F_LogId = Guid.NewGuid().ToString(); |
|
|
logEntity.F_Module = "Thermography"; |
|
|
logEntity.F_Module = "Thermography"; |
|
@@ -527,11 +542,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
entity.MeasureDate = now; |
|
|
entity.MeasureDate = now; |
|
|
entity.MeasureTime = measureTime; |
|
|
entity.MeasureTime = measureTime; |
|
|
entity.CreateTime = now; |
|
|
entity.CreateTime = now; |
|
|
//判断学生是否已测温 |
|
|
|
|
|
var model = db.FindEntity<ThermographyEntity>(x => x.PersonBeingMeasured == entity.PersonBeingMeasured && x.MeasureTime == measureTime && x.MeasureDate >= nowDate && x.MeasureDate < nextDate); |
|
|
|
|
|
if (model != null) |
|
|
|
|
|
|
|
|
//限制测温时间(上午、中午、晚上)时:判断学生是否已测温,是则更新,否则新增;不限制测温时间时:新增; |
|
|
|
|
|
if (measureTime != "-1") |
|
|
{ |
|
|
{ |
|
|
db.Delete(model); |
|
|
|
|
|
|
|
|
var model = db.FindEntity<ThermographyEntity>(x => x.PersonBeingMeasured == entity.PersonBeingMeasured && x.MeasureTime == measureTime && x.MeasureDate >= nowDate && x.MeasureDate < nextDate); |
|
|
|
|
|
if (model != null) |
|
|
|
|
|
{ |
|
|
|
|
|
db.Delete(model); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
entity.Create(userInfo); |
|
|
entity.Create(userInfo); |
|
|
db.Insert(entity); |
|
|
db.Insert(entity); |
|
|