@@ -595,10 +595,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | { | ||||
var semesterAndYear = Common.GetSemesterAndYear(); | var semesterAndYear = Common.GetSemesterAndYear(); | ||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
string year = queryParam["AcademicYearNo"].IsEmpty()? semesterAndYear.AcademicYearShort: queryParam["AcademicYearNo"].ToString(); | |||||
string year = queryParam["AcademicYearNo"].IsEmpty() ? semesterAndYear.AcademicYearShort : queryParam["AcademicYearNo"].ToString(); | |||||
string semester = queryParam["Semester"].IsEmpty() ? semesterAndYear.AcademicYearShort : queryParam["Semester"].ToString(); | string semester = queryParam["Semester"].IsEmpty() ? semesterAndYear.AcademicYearShort : queryParam["Semester"].ToString(); | ||||
var loginInfo = LoginUserInfo.Get(); | var loginInfo = LoginUserInfo.Get(); | ||||
var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description,year, semester); | |||||
var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description, year, semester); | |||||
foreach (var item in data) | foreach (var item in data) | ||||
{ | { | ||||
item.text = string.Format("{0}({1})", item.text, item.value); | item.text = string.Format("{0}({1})", item.text, item.value); | ||||
@@ -733,30 +733,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
var data = stuScoreIBLL.GetScoreListByClassNo(queryJson); | var data = stuScoreIBLL.GetScoreListByClassNo(queryJson); | ||||
//var stuData = stuInfoBasicIBLL.GetAllList(); | //var stuData = stuInfoBasicIBLL.GetAllList(); | ||||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new | |||||
var aa = data.GroupBy(x => new { x.StuNo, x.StuName }).Select(x => new | |||||
{ | { | ||||
StuId = x.Key.StuId, | |||||
StuNo = x.Key.StuNo, | StuNo = x.Key.StuNo, | ||||
StuName = x.Key.StuName, | StuName = x.Key.StuName, | ||||
//FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, | //FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, | ||||
TotalScore = x.Select(y => y.Score).Sum(), | |||||
TotalScore = x.Where(s => s.ExamType == "1").Select(y => y.Score).Sum(), | |||||
LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) | LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) | ||||
}).OrderByDescending(x => x.TotalScore); | }).OrderByDescending(x => x.TotalScore); | ||||
var bb=aa.Select(x=>x.StuNo).ToList(); | |||||
var cc=stuScoreIBLL.GetScoreListByMajor(queryJson).ToList(); | |||||
var bb = aa.Select(x => x.StuNo).ToList(); | |||||
var cc = stuScoreIBLL.GetScoreListByMajor(queryJson).ToList(); | |||||
var result = new List<Dictionary<string, string>>(); | var result = new List<Dictionary<string, string>>(); | ||||
foreach (var item in aa) | foreach (var item in aa) | ||||
{ | { | ||||
var aaa = new Dictionary<string, string>(); | var aaa = new Dictionary<string, string>(); | ||||
aaa.Add("StuId", item.StuId); | |||||
aaa.Add("StuNo", item.StuNo); | aaa.Add("StuNo", item.StuNo); | ||||
aaa.Add("StuName", item.StuName); | aaa.Add("StuName", item.StuName); | ||||
//aaa.Add("FinishSchoolMark", item.FinishSchoolMark); | //aaa.Add("FinishSchoolMark", item.FinishSchoolMark); | ||||
aaa.Add("TotalScore", item.TotalScore.ToString()); | aaa.Add("TotalScore", item.TotalScore.ToString()); | ||||
aaa.Add("OrderClass", (bb.IndexOf(item.StuNo) + 1).ToString()); | aaa.Add("OrderClass", (bb.IndexOf(item.StuNo) + 1).ToString()); | ||||
aaa.Add("OrderMajor",(cc.IndexOf(item.StuNo)+1).ToString()); | |||||
aaa.Add("OrderMajor", (cc.IndexOf(item.StuNo) + 1).ToString()); | |||||
foreach (var lessonInfoItem in item.LessonInfo) | foreach (var lessonInfoItem in item.LessonInfo) | ||||
{ | { | ||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); | aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); | ||||
@@ -817,9 +815,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
var data = stuScoreIBLL.GetScoreListByStuInfo(queryJson); | var data = stuScoreIBLL.GetScoreListByStuInfo(queryJson); | ||||
if (data.Any()) | if (data.Any()) | ||||
{ | { | ||||
data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x=>x.LessonSortNo).ThenBy(x => x.LessonNo); | |||||
data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonSortNo).ThenBy(x => x.LessonNo); | |||||
} | } | ||||
return Success(data); | return Success(data); | ||||
} | } | ||||
@@ -87,6 +87,7 @@ var bootstrap = function ($, learun) { | |||||
{ label: '第二次补考成绩', name: 'ScoreOfNotPassTwo', width: 100, align: "left" }, | { label: '第二次补考成绩', name: 'ScoreOfNotPassTwo', width: 100, align: "left" }, | ||||
{ label: '专业排名', name: 'RankInMajor', width: 100, align: "left" }, | { label: '专业排名', name: 'RankInMajor', width: 100, align: "left" }, | ||||
{ label: '班级排名', name: 'RankInClass', width: 100, align: "left" }, | { label: '班级排名', name: 'RankInClass', width: 100, align: "left" }, | ||||
{ label: '备注', name: 'Remark', width: 100, align: "left" }, | |||||
], | ], | ||||
mainId: 'StuNo', | mainId: 'StuNo', | ||||
isPage: false, | isPage: false, | ||||
@@ -17,6 +17,10 @@ using System.Web; | |||||
using Quanjiang.DigitalScholl.WebLicense; | using Quanjiang.DigitalScholl.WebLicense; | ||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | using Learun.Application.TwoDevelopment.EducationalAdministration; | ||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using Learun.Cache.Base; | |||||
using Learun.Cache.Factory; | |||||
using Quanjiang.DigitalScholl.SendSms; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.Web.Controllers | namespace Learun.Application.Web.Controllers | ||||
{ | { | ||||
@@ -38,6 +42,10 @@ namespace Learun.Application.Web.Controllers | |||||
private LoginModelIBLL loginModelIbll = new LoginModelBLL(); | private LoginModelIBLL loginModelIbll = new LoginModelBLL(); | ||||
private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL(); | private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL(); | ||||
WeChatDevelopIBLL weChatDevelopIbll = new WeChatDevelopBLL(); | WeChatDevelopIBLL weChatDevelopIbll = new WeChatDevelopBLL(); | ||||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||||
private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL(); | |||||
private readonly ISms yixintongSms = new YixintongSms(); | |||||
private ICache redisCache = CacheFactory.CaChe(); | |||||
#endregion | #endregion | ||||
#region 视图功能 | #region 视图功能 | ||||
@@ -510,11 +518,11 @@ namespace Learun.Application.Web.Controllers | |||||
if (error >= 3) | if (error >= 3) | ||||
{ | { | ||||
#region 验证码验证 | #region 验证码验证 | ||||
verifycode = Md5Helper.Encrypt(verifycode.ToLower(), 16); | |||||
if (Session["session_verifycode"].IsEmpty() || verifycode != Session["session_verifycode"].ToString()) | |||||
{ | |||||
return Fail("验证码错误"); | |||||
} | |||||
//verifycode = Md5Helper.Encrypt(verifycode.ToLower(), 16); | |||||
//if (Session["session_verifycode"].IsEmpty() || verifycode != Session["session_verifycode"].ToString()) | |||||
//{ | |||||
// return Fail("验证码错误"); | |||||
//} | |||||
#endregion | #endregion | ||||
} | } | ||||
int ForbidLoginNum = 5; | int ForbidLoginNum = 5; | ||||
@@ -522,14 +530,15 @@ namespace Learun.Application.Web.Controllers | |||||
{ | { | ||||
ForbidLoginNum = Convert.ToInt32(ConfigurationManager.AppSettings["ForbidLoginNum"]); | ForbidLoginNum = Convert.ToInt32(ConfigurationManager.AppSettings["ForbidLoginNum"]); | ||||
} | } | ||||
if (error>= ForbidLoginNum) | |||||
if (error >= ForbidLoginNum) | |||||
{ | { | ||||
var needlockaccount = userBll.GetEntityByMobile(username); | var needlockaccount = userBll.GetEntityByMobile(username); | ||||
userBll.UpdateState(needlockaccount.F_UserId,0); | |||||
userBll.UpdateState(needlockaccount.F_UserId, 0); | |||||
OperatorHelper.Instance.ClearCurrentErrorNum(); | OperatorHelper.Instance.ClearCurrentErrorNum(); | ||||
return Fail("账户已被锁定!"); | return Fail("账户已被锁定!"); | ||||
} | } | ||||
var isSend = GetAccountIsSendMsg(username); | |||||
#region 内部账户验证 | #region 内部账户验证 | ||||
UserEntity userEntity = userBll.CheckLogin(username, password); | UserEntity userEntity = userBll.CheckLogin(username, password); | ||||
@@ -556,6 +565,17 @@ namespace Learun.Application.Web.Controllers | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (!isSend.HasValue) | |||||
return Fail("请检查登录账号信息"); | |||||
if (isSend.Value) | |||||
{ | |||||
if (string.IsNullOrEmpty(verifycode)) | |||||
return Success(new { sendresult = true, msg = "请输入验证码" }); | |||||
var redisKey = $"studentuserlogin_pc_{userEntity.F_Mobile}"; | |||||
if (redisCache.Read<string>(redisKey) != verifycode) | |||||
return Fail("验证码错误或已失效。"); | |||||
redisCache.Remove(redisKey); | |||||
} | |||||
//记录ip | //记录ip | ||||
userBll.UpdateIp(GetIP(), userEntity.F_UserId); | userBll.UpdateIp(GetIP(), userEntity.F_UserId); | ||||
OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 | OperatorHelper.Instance.AddLoginUser(userEntity.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息 | ||||
@@ -564,13 +584,29 @@ namespace Learun.Application.Web.Controllers | |||||
logEntity.F_ExecuteResultJson = "登录成功"; | logEntity.F_ExecuteResultJson = "登录成功"; | ||||
logEntity.WriteLog(); | logEntity.WriteLog(); | ||||
OperatorHelper.Instance.ClearCurrentErrorNum(); | OperatorHelper.Instance.ClearCurrentErrorNum(); | ||||
if (isSend.Value) | |||||
{ | |||||
logEntity = new LogEntity | |||||
{ | |||||
F_CategoryId = 3, | |||||
F_OperateTypeId = "sms", | |||||
F_OperateType = "sms", | |||||
F_OperateAccount = "system", | |||||
F_ExecuteResult = 200, | |||||
F_ExecuteResultJson = "短信发送成功:发送短信成功", | |||||
F_Description = "短信发送:" + userEntity.F_Mobile | |||||
}; | |||||
logEntity.WriteLog(); | |||||
} | |||||
//配置短信发送日志,为登录时效验是否需要发送短信 | |||||
//是否强密码验证 | //是否强密码验证 | ||||
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && up == "false") | if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && up == "false") | ||||
{ | { | ||||
return Success(new { pwd = true }); | return Success(new { pwd = true }); | ||||
} | } | ||||
//每月1号强制用户修改密码 | //每月1号强制用户修改密码 | ||||
if (DateTime.Now.Day == 1 && up == "false"&&teachSwitchIBLL.FindFirst("modifypwdfirstday")) | |||||
if (DateTime.Now.Day == 1 && up == "false" && teachSwitchIBLL.FindFirst("modifypwdfirstday")) | |||||
{ | { | ||||
return Success(new { pwd = true }); | return Success(new { pwd = true }); | ||||
} | } | ||||
@@ -580,16 +616,16 @@ namespace Learun.Application.Web.Controllers | |||||
{ | { | ||||
if (userEntity.F_ModifyPwdDate.HasValue) | if (userEntity.F_ModifyPwdDate.HasValue) | ||||
{ | { | ||||
if ((DateTime.Now-userEntity.F_ModifyPwdDate.Value).Days>30) | |||||
if ((DateTime.Now - userEntity.F_ModifyPwdDate.Value).Days > 30) | |||||
{ | { | ||||
return Success(new { pwdtip = true }); | return Success(new { pwdtip = true }); | ||||
} | } | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (userEntity.F_CreateDate.HasValue && (DateTime.Now-userEntity.F_CreateDate.Value).Days>30) | |||||
if (userEntity.F_CreateDate.HasValue && (DateTime.Now - userEntity.F_CreateDate.Value).Days > 30) | |||||
{ | { | ||||
return Success(new { pwdtip=true }); | |||||
return Success(new { pwdtip = true }); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -783,13 +819,13 @@ namespace Learun.Application.Web.Controllers | |||||
/// <param name="p"></param> | /// <param name="p"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpGet] | [HttpGet] | ||||
public ActionResult CheckLoginForSSOBC(string u,string p) | |||||
public ActionResult CheckLoginForSSOBC(string u, string p) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
string uid = Request.QueryString["u"]; | string uid = Request.QueryString["u"]; | ||||
string pwd = Request.QueryString["p"]; | string pwd = Request.QueryString["p"]; | ||||
if (!string.IsNullOrEmpty(uid)&&!string.IsNullOrEmpty(pwd)) | |||||
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(pwd)) | |||||
{ | { | ||||
string username = uid; | string username = uid; | ||||
string password = pwd; | string password = pwd; | ||||
@@ -818,7 +854,7 @@ namespace Learun.Application.Web.Controllers | |||||
logEntity.F_ExecuteResult = 1; | logEntity.F_ExecuteResult = 1; | ||||
logEntity.F_ExecuteResultJson = "无ui接口登录成功"; | logEntity.F_ExecuteResultJson = "无ui接口登录成功"; | ||||
logEntity.WriteLog(); | logEntity.WriteLog(); | ||||
return Success("login success",new{userType=userEntity?.F_Description}); | |||||
return Success("login success", new { userType = userEntity?.F_Description }); | |||||
} | } | ||||
} | } | ||||
else | else | ||||
@@ -843,7 +879,7 @@ namespace Learun.Application.Web.Controllers | |||||
logEntity.F_CategoryId = 1; | logEntity.F_CategoryId = 1; | ||||
logEntity.F_OperateTypeId = ((int)OperationType.Exit).ToString(); | logEntity.F_OperateTypeId = ((int)OperationType.Exit).ToString(); | ||||
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Exit); | logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Exit); | ||||
logEntity.F_OperateAccount ="第三方无ui"; | |||||
logEntity.F_OperateAccount = "第三方无ui"; | |||||
logEntity.F_OperateUserId = "noui"; | logEntity.F_OperateUserId = "noui"; | ||||
logEntity.F_ExecuteResult = 1; | logEntity.F_ExecuteResult = 1; | ||||
logEntity.F_ExecuteResultJson = "无ui退出系统"; | logEntity.F_ExecuteResultJson = "无ui退出系统"; | ||||
@@ -1015,13 +1051,177 @@ namespace Learun.Application.Web.Controllers | |||||
{ | { | ||||
string appid = "76d40062-349f-486d-b871-35bed08d2f59"; | string appid = "76d40062-349f-486d-b871-35bed08d2f59"; | ||||
string secret = "cgpi"; | string secret = "cgpi"; | ||||
string appkey =Request.QueryString["appkey"]; | |||||
string response = Util.HttpMethods.HttpGet("http://localhost:20472/SSOSystem/authorize?appid=" + appid + "&secret=" + secret + "&appkey="+ appkey); | |||||
string appkey = Request.QueryString["appkey"]; | |||||
string response = Util.HttpMethods.HttpGet("http://localhost:20472/SSOSystem/authorize?appid=" + appid + "&secret=" + secret + "&appkey=" + appkey); | |||||
return Content(response); | return Content(response); | ||||
} | } | ||||
#endregion | #endregion | ||||
#region 登录验证码的验证 | |||||
/// <summary> | |||||
/// 验证是否需要输入验证码 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
public ActionResult LoginVerify(string account) | |||||
{ | |||||
var isSend = GetAccountIsSendMsg(account); | |||||
if (!isSend.HasValue) | |||||
{ | |||||
return Fail("请检查登录账号信息"); | |||||
} | |||||
return Success(new { sendresult = isSend }); | |||||
} | |||||
/// <summary> | |||||
/// 发送短信验证码 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
public ActionResult LoginSendMessage(string account) | |||||
{ | |||||
var isSend = GetAccountIsSendMsg(account); | |||||
if (!isSend.HasValue) | |||||
return Fail("请检查登录账号信息"); | |||||
if (!isSend.Value) | |||||
return Fail("该用户不需要短信登录"); | |||||
var userEntity = userBll.GetEntityByMobile(account); | |||||
if (userEntity == null) | |||||
{ | |||||
userEntity = userBll.GetEntityByAccount(account); | |||||
if (userEntity == null) | |||||
{ | |||||
return Fail("请检查登录账号信息"); | |||||
} | |||||
} | |||||
LogEntity logEntity; | |||||
var redisKey = $"studentuserlogin_pc_{userEntity.F_Mobile}"; | |||||
var msg = redisCache.Read<string>(redisKey); | |||||
if (!string.IsNullOrEmpty(msg)) return Fail("原验证码未过期请使用原验证码。"); | |||||
try | |||||
{ | |||||
//短信发送验证 | |||||
string raRndNum = CommonHelper.RndNum(6); | |||||
var listStr = new List<string> { $"欢迎使用智慧校园,您本次登录的验证码是 {raRndNum}。" }; | |||||
var result = yixintongSms.SendSmsToSingle(userEntity.F_Mobile, SmsType.LoginBind, listStr); | |||||
if (result.Result.code == "0") | |||||
{ | |||||
redisCache.Write<string>(redisKey, raRndNum, new TimeSpan(0, 5, 0)); | |||||
return Success(new { sendstate = true, msg = $"短信发送成功:{raRndNum}" }); | |||||
} | |||||
logEntity = new LogEntity | |||||
{ | |||||
F_CategoryId = 4, | |||||
F_OperateTypeId = "sms", | |||||
F_OperateType = "sms", | |||||
F_OperateAccount = "system", | |||||
F_ExecuteResult = 400, | |||||
F_ExecuteResultJson = "短信发送失败:" + result.Result.message + result.Result.errorType, | |||||
F_Description = "短信发送:" + userEntity.F_Mobile | |||||
}; | |||||
logEntity.WriteLog(); | |||||
return Fail("短信发送失败" + result.Result.message); | |||||
} | |||||
catch (Exception e) | |||||
{ | |||||
logEntity = new LogEntity | |||||
{ | |||||
F_CategoryId = 4, | |||||
F_OperateTypeId = "sms", | |||||
F_OperateType = "sms", | |||||
F_OperateAccount = "system", | |||||
F_ExecuteResult = 400, | |||||
F_ExecuteResultJson = "短信发送失败:" + e.Message, | |||||
F_Description = "短信发送:" + userEntity.F_Mobile | |||||
}; | |||||
logEntity.WriteLog(); | |||||
return Fail("短信发送失败" + e.Message); | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 判断是否需要发送验证码 | |||||
/// </summary> | |||||
/// <param name="account"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
public bool? GetAccountIsSendMsg(string account) | |||||
{ | |||||
var userEntity = userBll.GetEntityByMobile(account); | |||||
if (userEntity == null) | |||||
{ | |||||
userEntity = userBll.GetEntityByAccount(account); | |||||
if (userEntity == null) | |||||
{ | |||||
return null; | |||||
} | |||||
} | |||||
//是否强密码验证 | |||||
bool pwd = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true"; | |||||
//是否发送短信 | |||||
bool whethersendsms = false; | |||||
if (!pwd) | |||||
{ | |||||
#region 学生 | |||||
var studententity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(userEntity.F_Account); | |||||
if (studententity != null) | |||||
{ | |||||
string queryjson = "{\"keywords\":\"" + userEntity.F_Mobile + "\"}"; | |||||
LogEntity lastsendlog = LogBLL.GetlikeList(queryjson); | |||||
if (lastsendlog != null) | |||||
{ | |||||
var aa = ((DateTime)lastsendlog.F_OperateTime - DateTime.Now).TotalMinutes; | |||||
//大于1天就要发短信了 | |||||
if (Math.Abs(aa) > 1 * 24 * 60) | |||||
{ | |||||
whethersendsms = true; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
whethersendsms = true; | |||||
} | |||||
} | |||||
#endregion | |||||
#region 老师 | |||||
var teacherentity = empInfoIBLL.GetEmpInfoEntityByEmpNo(userEntity.F_Account); | |||||
if (teacherentity != null) | |||||
{ | |||||
string queryjson = "{\"keywords\":\"" + userEntity.F_Mobile + "\"}"; | |||||
LogEntity lastsendlog = LogBLL.GetlikeList(queryjson); | |||||
if (lastsendlog != null) | |||||
{ | |||||
var aa = ((DateTime)lastsendlog.F_OperateTime - DateTime.Now).TotalMinutes; | |||||
//大于1天就要发短信了 | |||||
if (Math.Abs(aa) > 1 * 24 * 60) | |||||
{ | |||||
whethersendsms = true; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
whethersendsms = true; | |||||
} | |||||
} | |||||
#endregion | |||||
if (studententity == null && teacherentity == null && userEntity.F_SecurityLevel != 1) | |||||
{ | |||||
return null; | |||||
} | |||||
} | |||||
return whethersendsms; | |||||
} | |||||
#endregion | |||||
/// <summary> | /// <summary> | ||||
/// 获取IP | /// 获取IP | ||||
/// </summary> | /// </summary> | ||||
@@ -7104,6 +7104,10 @@ | |||||
<Project>{1d192591-b85a-41db-ae3a-4bf9765786c1}</Project> | <Project>{1d192591-b85a-41db-ae3a-4bf9765786c1}</Project> | ||||
<Name>Learun.Workflow.Engine</Name> | <Name>Learun.Workflow.Engine</Name> | ||||
</ProjectReference> | </ProjectReference> | ||||
<ProjectReference Include="..\Quanjiang.DigitalScholl.SendSms\Quanjiang.DigitalScholl.SendSms.csproj"> | |||||
<Project>{55F0F08D-2A9F-489A-BE1B-2EEAE80687E6}</Project> | |||||
<Name>Quanjiang.DigitalScholl.SendSms</Name> | |||||
</ProjectReference> | |||||
<ProjectReference Include="..\Quanjiang.DigitalScholl.WebLicense\Quanjiang.DigitalScholl.WebLicense.csproj"> | <ProjectReference Include="..\Quanjiang.DigitalScholl.WebLicense\Quanjiang.DigitalScholl.WebLicense.csproj"> | ||||
<Project>{4D841EAD-3FD8-4FAC-BC67-C4CE6C0D1181}</Project> | <Project>{4D841EAD-3FD8-4FAC-BC67-C4CE6C0D1181}</Project> | ||||
<Name>Quanjiang.DigitalScholl.WebLicense</Name> | <Name>Quanjiang.DigitalScholl.WebLicense</Name> | ||||
@@ -26,21 +26,40 @@ | |||||
width: 880px; | width: 880px; | ||||
margin: auto; | margin: auto; | ||||
} | } | ||||
.tips{ | |||||
position: absolute; | |||||
left: 50%; | |||||
bottom: 35px; | |||||
color: #fff; | |||||
font-size: 13px; | |||||
margin-left: -91px; | |||||
} | |||||
.tips > *{ | |||||
display: inline-block; | |||||
vertical-align: middle; | |||||
} | |||||
.tips img{ | |||||
margin-right: 8px | |||||
} | |||||
.tips { | |||||
position: absolute; | |||||
left: 50%; | |||||
bottom: 35px; | |||||
color: #fff; | |||||
font-size: 13px; | |||||
margin-left: -91px; | |||||
} | |||||
.tips > * { | |||||
display: inline-block; | |||||
vertical-align: middle; | |||||
} | |||||
.tips img { | |||||
margin-right: 8px | |||||
} | |||||
.codeBtn { | |||||
border: 1px solid #DCDFE6; | |||||
padding: 6px 10px; | |||||
color: #606266; | |||||
font-size: 12px; | |||||
cursor: pointer; | |||||
border-radius: 2px; | |||||
position: absolute; | |||||
left: 260px; | |||||
top: 10px; | |||||
} | |||||
.codeBtn:hover { | |||||
border-color: #CBCFD5; | |||||
} | |||||
</style> | </style> | ||||
</head> | </head> | ||||
@@ -59,7 +78,7 @@ | |||||
<div class="lr-login-middle"> | <div class="lr-login-middle"> | ||||
@if (ViewBag.WeixinLoginSwitch) | @if (ViewBag.WeixinLoginSwitch) | ||||
{ | { | ||||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin down" title="使用微信登录"> | |||||
<a href="/Login/LoginForWeixin?login=one" class="wxLogin down" title="使用微信登录"> | |||||
<img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | <img src="~/Content/images/LoginPage/icon.png" alt="" /> 使用微信登录 | ||||
</a> | </a> | ||||
} | } | ||||
@@ -88,12 +107,16 @@ | |||||
</div> | </div> | ||||
<div class="lr-login-input"> | <div class="lr-login-input"> | ||||
<img class="inp_icon" src="~/Content/images/Login/default_psw0.png" alt=""><input id="lr_password" type="password" placeholder="密码"> | <img class="inp_icon" src="~/Content/images/Login/default_psw0.png" alt=""><input id="lr_password" type="password" placeholder="密码"> | ||||
</div> | </div> | ||||
<div class="lr-login-input lr-login-reg"> | |||||
<img class="inp_icon" src="~/Content/images/Login/default_reg0.png" alt=""><input id="lr_verifycode_input" type="text" placeholder="验证码"> | |||||
<img class="code" id="lr_verifycode_img" src="~/Login/VerifyCode" alt="点击切换验证码" title="点击切换验证码" /> | |||||
<div class="lr-login-input" id="needCode" style="display:none;"> | |||||
<img class="inp_icon" src="/Content/images/Login/default_psw0.png" alt=""><input id="lr_verifycode_input" type="text" placeholder="验证码"> | |||||
<span id="sendCode" class="codeBtn">发送验证码</span> | |||||
</div> | </div> | ||||
@*<div class="lr-login-input lr-login-reg"> | |||||
<img class="inp_icon" src="~/Content/images/Login/default_reg0.png" alt=""><input id="lr_verifycode_input" type="text" placeholder="验证码"> | |||||
<img class="code" id="lr_verifycode_img" src="~/Login/VerifyCode" alt="点击切换验证码" title="点击切换验证码" /> | |||||
</div>*@ | |||||
<div class="lr-login-btn" id="lr_login_btn"><span>登录</span></div> | <div class="lr-login-btn" id="lr_login_btn"><span>登录</span></div> | ||||
<br /> | <br /> | ||||
@@ -121,14 +144,14 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="lr-login-footer" style="font-size: 12px;color: #fff;width: 880px;right:0;margin: auto;"> | |||||
<div class="tips"> | |||||
<img src="~/Content/images/LoginPage/tips3.png" alt=""> <span>建议使用360或谷歌浏览器</span> | |||||
</div> | |||||
<div style="position: relative;"> | |||||
Copyright © 2019 数字化智慧校园 版权所有 <span class="OnlineUserNumBox" style="position: absolute;right: 0;top: 0;">在线用户数:<span class="OnlineUserNum">@ViewBag.OnlineUserNum</span>人</span> | |||||
</div> | |||||
<div class="lr-login-footer" style="font-size: 12px;color: #fff;width: 880px;right:0;margin: auto;"> | |||||
<div class="tips"> | |||||
<img src="~/Content/images/LoginPage/tips3.png" alt=""> <span>建议使用360或谷歌浏览器</span> | |||||
</div> | |||||
<div style="position: relative;"> | |||||
Copyright © 2019 数字化智慧校园 版权所有 <span class="OnlineUserNumBox" style="position: absolute;right: 0;top: 0;">在线用户数:<span class="OnlineUserNum">@ViewBag.OnlineUserNum</span>人</span> | |||||
</div> | |||||
</div> | </div> | ||||
<img id="loginFoot" src="~/Content/images/logins/login1.png" alt=""> | <img id="loginFoot" src="~/Content/images/logins/login1.png" alt=""> | ||||
<script src="~/Content/jquery/jquery-1.10.2.min.js"></script> | <script src="~/Content/jquery/jquery-1.10.2.min.js"></script> | ||||
@@ -12,6 +12,7 @@ | |||||
var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | var isBindAccountLogin = request('isBindAccountLogin');//切换账号登录 | ||||
var bindUserName = request('bindUserName');//绑定账号 | var bindUserName = request('bindUserName');//绑定账号 | ||||
var bindUserPassword = request('bindUserPassword');//绑定账号密码 | var bindUserPassword = request('bindUserPassword');//绑定账号密码 | ||||
var needCode = false, hasSendCode = false, time = 0, timeT = '', isSending = false; | |||||
var lrPage = { | var lrPage = { | ||||
init: function () { | init: function () { | ||||
//切换账号登录时:登录页赋值,触发登录事件; | //切换账号登录时:登录页赋值,触发登录事件; | ||||
@@ -114,6 +115,15 @@ | |||||
$("#lr_login_btn").on('click', function () { | $("#lr_login_btn").on('click', function () { | ||||
lrPage.login(); | lrPage.login(); | ||||
}); | }); | ||||
// 发送验证码事件 | |||||
$("#sendCode").on('click', function () { | |||||
lrPage.sendCode(); | |||||
}); | |||||
// 账户失去焦点事件 | |||||
$("#lr_username").on('blur', function () { | |||||
lrPage.getNeedCode(); | |||||
}); | |||||
}, | }, | ||||
login: function () { | login: function () { | ||||
lrPage.tip(); | lrPage.tip(); | ||||
@@ -159,6 +169,11 @@ | |||||
dataType: "json", | dataType: "json", | ||||
success: function (res) { | success: function (res) { | ||||
if (res.code == 200) { | if (res.code == 200) { | ||||
if (res.data.sendresult) { | |||||
needCode = true; | |||||
$("#needCode").show(); | |||||
return; | |||||
} | |||||
if (source == "noLogin") { | if (source == "noLogin") { | ||||
window.location.href = "/SSOSystem/Index"; | window.location.href = "/SSOSystem/Index"; | ||||
} else { | } else { | ||||
@@ -169,7 +184,6 @@ | |||||
} | } | ||||
else | else | ||||
window.location.href = "/Home/Index"; | window.location.href = "/Home/Index"; | ||||
//window.location.href = "/Home/Index"; | |||||
} | } | ||||
} | } | ||||
else if (res.code == 400) { | else if (res.code == 400) { | ||||
@@ -177,8 +191,8 @@ | |||||
lrPage.tip(res.info, true); | lrPage.tip(res.info, true); | ||||
$('#errornum').val(res.data); | $('#errornum').val(res.data); | ||||
if (res.data >= 3) { | if (res.data >= 3) { | ||||
$('#lr_verifycode_input').parent().show(); | |||||
$("#lr_verifycode_img").trigger('click'); | |||||
//$('#lr_verifycode_input').parent().show(); | |||||
//$("#lr_verifycode_img").trigger('click'); | |||||
} | } | ||||
} | } | ||||
else if (res.code == 500) { | else if (res.code == 500) { | ||||
@@ -209,7 +223,75 @@ | |||||
$tip.find('span').html(msg); | $tip.find('span').html(msg); | ||||
$tip.show(); | $tip.show(); | ||||
} | } | ||||
} | |||||
}, | |||||
sendCode: function () { | |||||
if (isSending || hasSendCode) return; | |||||
let phone = $('#lr_username').val() | |||||
if (!phone) { | |||||
lrPage.tip('请输入账户') | |||||
$('#lr_username').focus(); | |||||
return | |||||
} | |||||
lrPage.tip(); | |||||
isSending = true | |||||
$.ajax({ | |||||
url: $.rootUrl + "/Login/LoginSendMessage", | |||||
data: { account: phone }, | |||||
dataType: 'json', | |||||
type: "post", | |||||
success: (res) => { | |||||
isSending = false; | |||||
if (res.code == 200) { | |||||
lrpa.tip('短信已发送') | |||||
hasSendCode = true | |||||
time = 60 | |||||
$('#sendCode').text(`重新发送(${time}s)`) | |||||
timeT = setInterval(() => { | |||||
time-- | |||||
if (time == 0) { | |||||
hasSendCode = false | |||||
clearInterval(timeT) | |||||
timeT = '' | |||||
} | |||||
$('#sendCode').text(`重新发送${time ? '(' + time + 's' + ')' : ''}`) | |||||
}, 1000); | |||||
} else { | |||||
lrPage.tip(res.info) | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
getNeedCode: function () { | |||||
needCode = false; | |||||
$("#needCode").hide(); | |||||
let phone = $('#lr_username').val() | |||||
if (!phone) { | |||||
lrPage.tip('请输入账户') | |||||
$('#lr_username').focus(); | |||||
return | |||||
} | |||||
lrPage.tip(); | |||||
$.ajax({ | |||||
url: $.rootUrl + "/Login/LoginVerify", | |||||
data: { account: phone }, | |||||
dataType: 'json', | |||||
type: "post", | |||||
success: (res) => { | |||||
if (res.code == 200) { | |||||
if (res.data.sendresult) { | |||||
needCode = true; | |||||
$("#needCode").show(); | |||||
} | |||||
} else { | |||||
lrPage.tip(res.info) | |||||
needCode = false; | |||||
$("#needCode").hide(); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
}; | }; | ||||
$(function () { | $(function () { | ||||
lrPage.init(); | lrPage.init(); | ||||
@@ -91,6 +91,14 @@ namespace Learun.Application.WebApi | |||||
if (!isSend.Value) | if (!isSend.Value) | ||||
return Fail("该用户不需要短信登录"); | return Fail("该用户不需要短信登录"); | ||||
var userEntity = userIBLL.GetEntityByMobile(account.account); | var userEntity = userIBLL.GetEntityByMobile(account.account); | ||||
if (userEntity == null) | |||||
{ | |||||
userEntity = userIBLL.GetEntityByAccount(account.account); | |||||
if (userEntity == null) | |||||
{ | |||||
return Fail("请检查登录账号信息"); | |||||
} | |||||
} | |||||
LogEntity logEntity; | LogEntity logEntity; | ||||
var redisKey = $"studentuserlogin_{userEntity.F_Mobile}"; | var redisKey = $"studentuserlogin_{userEntity.F_Mobile}"; | ||||
var msg = redisCache.Read<string>(redisKey); | var msg = redisCache.Read<string>(redisKey); | ||||
@@ -167,8 +175,8 @@ namespace Learun.Application.WebApi | |||||
if (lastsendlog != null) | if (lastsendlog != null) | ||||
{ | { | ||||
var aa = ((DateTime)lastsendlog.F_OperateTime - DateTime.Now).TotalMinutes; | var aa = ((DateTime)lastsendlog.F_OperateTime - DateTime.Now).TotalMinutes; | ||||
//大于30天就要发短信了 | |||||
if (Math.Abs(aa) > 30 * 24 * 60) | |||||
//大于1天就要发短信了 | |||||
if (Math.Abs(aa) > 1 * 24 * 60) | |||||
{ | { | ||||
whethersendsms = true; | whethersendsms = true; | ||||
} | } | ||||
@@ -192,8 +200,8 @@ namespace Learun.Application.WebApi | |||||
if (lastsendlog != null) | if (lastsendlog != null) | ||||
{ | { | ||||
var aa = ((DateTime)lastsendlog.F_OperateTime - DateTime.Now).TotalMinutes; | var aa = ((DateTime)lastsendlog.F_OperateTime - DateTime.Now).TotalMinutes; | ||||
//大于7天就要发短信了 | |||||
if (Math.Abs(aa) > 7 * 24 * 60) | |||||
//大于1天就要发短信了 | |||||
if (Math.Abs(aa) > 1 * 24 * 60) | |||||
{ | { | ||||
whethersendsms = true; | whethersendsms = true; | ||||
} | } | ||||
@@ -204,7 +212,7 @@ namespace Learun.Application.WebApi | |||||
} | } | ||||
} | } | ||||
#endregion | #endregion | ||||
if (studententity == null && teacherentity == null) | |||||
if (studententity == null && teacherentity == null && userEntity.F_SecurityLevel != 1) | |||||
{ | { | ||||
return null; | return null; | ||||
} | } | ||||
@@ -276,7 +276,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
[Column("STATE")] | [Column("STATE")] | ||||
public int? State { get; set; } | public int? State { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 考试类型 | |||||
/// 考试类型(1考试,2考查) | |||||
/// </summary> | /// </summary> | ||||
[Column("EXAMTYPE")] | [Column("EXAMTYPE")] | ||||
public string ExamType { get; set; } | public string ExamType { get; set; } | ||||
@@ -433,6 +433,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
[NotMapped] | [NotMapped] | ||||
public string MoveType { get; set; } | public string MoveType { get; set; } | ||||
/// <summary> | |||||
/// 考试类型 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string ExamType { get; set; } | |||||
} | } | ||||
@@ -1305,11 +1305,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
tableName = queryParam["TableName"].ToString(); | tableName = queryParam["TableName"].ToString(); | ||||
} | } | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.ClassNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); | |||||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.ClassNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,op.ExamType "); | |||||
strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); | strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); | ||||
strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); | strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); | ||||
strSql.Append(" from ( "); | strSql.Append(" from ( "); | ||||
strSql.Append($" select s.AcademicYearNo,s.Semester,s.ClassNo,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($" select s.AcademicYearNo,s.Semester,s.DeptNo,s.MajorNo,s.ClassNo,s.LessonNo,s.LessonName,s.LessonSortNo,s.Grade,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.LessonSortNo='1' "); | strSql.Append(" where 1=1 and s.LessonSortNo='1' "); | ||||
if (!queryParam["AcademicYearNo"].IsEmpty()) | if (!queryParam["AcademicYearNo"].IsEmpty()) | ||||
{ | { | ||||
@@ -1331,11 +1331,13 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | ||||
strSql.Append(" and s.StuNo=@StuNo "); | strSql.Append(" and s.StuNo=@StuNo "); | ||||
} | } | ||||
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb "); | |||||
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.DeptNo,s.MajorNo,s.ClassNo,s.LessonNo,s.LessonName,s.LessonSortNo,s.Grade,s.StuNo,sb.StuName ) as bb "); | |||||
strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); | strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); | ||||
strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); | strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); | ||||
strSql.Append(" left join OpenLessonPlan op on bb.AcademicYearNo=op.AcademicYearNo and bb.Semester=op.Semester and bb.DeptNo=op.DeptNo and bb.MajorNo=op.MajorNo and bb.LessonNo=op.LessonNo and bb.Grade=op.Grade and bb.LessonSortNo=op.LessonSortNo "); | |||||
return this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp); | return this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -1364,7 +1366,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
var xq = queryParam["Semester"].ToString(); | var xq = queryParam["Semester"].ToString(); | ||||
var bj = queryParam["ClassNo"].ToString(); | var bj = queryParam["ClassNo"].ToString(); | ||||
var ssentity = this.BaseRepository("CollegeMIS").FindEntity<StuScoreEntity>(x => x.AcademicYearNo == xn && x.Semester == xq && x.ClassNo == bj); | var ssentity = this.BaseRepository("CollegeMIS").FindEntity<StuScoreEntity>(x => x.AcademicYearNo == xn && x.Semester == xq && x.ClassNo == bj); | ||||
if(ssentity == null) return new List<string>(); | |||||
if (ssentity == null) return new List<string>(); | |||||
var majorNo = ssentity.MajorNo; | var majorNo = ssentity.MajorNo; | ||||
// 虚拟参数 | // 虚拟参数 | ||||
@@ -1372,11 +1374,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
var tableName = "StuScore"; | var tableName = "StuScore"; | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.ClassNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); | |||||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.ClassNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,op.ExamType "); | |||||
strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); | strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); | ||||
strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); | strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); | ||||
strSql.Append(" from ( "); | strSql.Append(" from ( "); | ||||
strSql.Append($" select s.AcademicYearNo,s.Semester,s.ClassNo,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($" select s.AcademicYearNo,s.Semester,s.DeptNo,s.MajorNo,s.ClassNo,s.LessonNo,s.LessonName,s.LessonSortNo,s.Grade,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.LessonSortNo='1' and s.MajorNo='{majorNo}' "); | strSql.Append($" where 1=1 and s.LessonSortNo='1' and s.MajorNo='{majorNo}' "); | ||||
if (!queryParam["AcademicYearNo"].IsEmpty()) | if (!queryParam["AcademicYearNo"].IsEmpty()) | ||||
{ | { | ||||
@@ -1388,14 +1390,15 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | ||||
strSql.Append(" and s.Semester=@Semester "); | strSql.Append(" and s.Semester=@Semester "); | ||||
} | } | ||||
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb "); | |||||
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.DeptNo,s.MajorNo,s.ClassNo,s.LessonNo,s.LessonName,s.LessonSortNo,s.Grade,s.StuNo,sb.StuName ) as bb "); | |||||
strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); | strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); | ||||
strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); | strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); | ||||
strSql.Append(" left join OpenLessonPlan op on bb.AcademicYearNo=op.AcademicYearNo and bb.Semester=op.Semester and bb.DeptNo=op.DeptNo and bb.MajorNo=op.MajorNo and bb.LessonNo=op.LessonNo and bb.Grade=op.Grade and bb.LessonSortNo=op.LessonSortNo "); | |||||
var lst= this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp); | |||||
var gp = lst.GroupBy(x => x.StuNo).Select(x => new { x.Key,TotalScore=x.Sum(a=>a.Score)}).OrderByDescending(x => x.TotalScore); | |||||
var rs=gp.Select(x=>x.Key).ToList(); | |||||
var lst = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp); | |||||
var gp = lst.GroupBy(x => x.StuNo).Select(x => new { x.Key, TotalScore = x.Where(s => s.ExamType == "1").Sum(a => a.Score) }).OrderByDescending(x => x.TotalScore); | |||||
var rs = gp.Select(x => x.Key).ToList(); | |||||
return rs; | return rs; | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -2090,9 +2093,9 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
tableName = queryParam["TableName"].ToString(); | tableName = queryParam["TableName"].ToString(); | ||||
} | } | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.MajorNo,bb.ClassNo,li.StudyScore,ls.LessonSortName,bb.Score,(case when sp.Score>=60 then 60 else sp.score end) as ScoreOfNotPass,(case when spt.Score>=60 then 60 else spt.Score end) as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName "); | |||||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.MajorNo,bb.ClassNo,li.StudyScore,ls.LessonSortName,bb.Score,bb.Remark,(case when sp.Score>=60 then 60 else sp.score end) as ScoreOfNotPass,(case when spt.Score>=60 then 60 else spt.Score end) as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName "); | |||||
strSql.Append(" from ( "); | strSql.Append(" from ( "); | ||||
strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); | |||||
strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,Max(s.Score) as Score,MAX(s.Remark) as Remark from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); | |||||
strSql.Append(" where 1=1 and s.CheckMark='1' "); | strSql.Append(" where 1=1 and s.CheckMark='1' "); | ||||
if (!queryParam["AcademicYearNo"].IsEmpty()) | if (!queryParam["AcademicYearNo"].IsEmpty()) | ||||
{ | { | ||||
@@ -2140,7 +2143,13 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
foreach (var item in temp) | foreach (var item in temp) | ||||
{ | { | ||||
//专业排名 | //专业排名 | ||||
var ml = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.MajorNo == item.MajorNo && x.CheckMark == "1"); | |||||
//var ml = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.MajorNo == item.MajorNo && x.CheckMark == "1"); | |||||
//只计算考试类课程 | |||||
var ml = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>($@"select s.* from StuScore s | |||||
left join OpenLessonPlan p on s.AcademicYearNo=p.AcademicYearNo and s.Semester=p.Semester and s.OpenLessonDeptNo=p.DeptNo | |||||
and s.OpenLessonMajorNo=p.MajorNo and s.Grade=p.Grade and s.LessonNo=p.LessonNo and s.LessonSortNo=p.LessonSortNo | |||||
where s.AcademicYearNo='{item.AcademicYearNo}' and s.Semester='{item.Semester}' and s.LessonSortNo='1' and s.CheckMark='1' and s.MajorNo='{item.MajorNo}' | |||||
and p.ExamType='1'"); | |||||
var mlGroup = ml.GroupBy(x => x.StuNo).Select(x => new | var mlGroup = ml.GroupBy(x => x.StuNo).Select(x => new | ||||
{ | { | ||||
StuNo = x.Key, | StuNo = x.Key, | ||||
@@ -2152,7 +2161,13 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||||
item.RankInMajor = rank + 1; | item.RankInMajor = rank + 1; | ||||
} | } | ||||
//班级排名 | //班级排名 | ||||
var cl = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.ClassNo == item.ClassNo && x.CheckMark == "1"); | |||||
//var cl = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.ClassNo == item.ClassNo && x.CheckMark == "1"); | |||||
//只计算考试类课程 | |||||
var cl = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>($@"select s.* from StuScore s | |||||
left join OpenLessonPlan p on s.AcademicYearNo=p.AcademicYearNo and s.Semester=p.Semester and s.OpenLessonDeptNo=p.DeptNo | |||||
and s.OpenLessonMajorNo=p.MajorNo and s.Grade=p.Grade and s.LessonNo=p.LessonNo and s.LessonSortNo=p.LessonSortNo | |||||
where s.AcademicYearNo='{item.AcademicYearNo}' and s.Semester='{item.Semester}' and s.LessonSortNo='1' and s.CheckMark='1' and s.ClassNo='{item.ClassNo}' | |||||
and p.ExamType='1'"); | |||||
var clGroup = cl.GroupBy(x => x.StuNo).Select(x => new | var clGroup = cl.GroupBy(x => x.StuNo).Select(x => new | ||||
{ | { | ||||
StuNo = x.Key, | StuNo = x.Key, | ||||
@@ -344,6 +344,7 @@ | |||||
}, | }, | ||||
// 获取是否需要验证码 | // 获取是否需要验证码 | ||||
getNeedCode() { | getNeedCode() { | ||||
this.needCode = false | |||||
if (!this.username) return | if (!this.username) return | ||||
this.POST('learun/adms/user/loginverify', { | this.POST('learun/adms/user/loginverify', { | ||||
account: this.username | account: this.username | ||||