Browse Source

手动补卡功能

黑龙江艺术高中职
dao 1 month ago
parent
commit
a80b37661c
1 changed files with 68 additions and 17 deletions
  1. +68
    -17
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs

+ 68
- 17
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs View File

@@ -17,6 +17,7 @@ using System.Web;
using Quanjiang.DigitalScholl.WebLicense;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Newtonsoft.Json;
using Learun.Application.TwoDevelopment.LogisticsManagement;

namespace Learun.Application.Web.Controllers
{
@@ -42,6 +43,7 @@ namespace Learun.Application.Web.Controllers

#region 视图功能

private ADR_RecordIBLL aDR_RecordIBLL = new ADR_RecordBLL();
LR_Base_LogoIBLL baseLogoIbll = new LR_Base_LogoBLL();
public ActionResult GetImg(string code)
{
@@ -435,6 +437,55 @@ namespace Learun.Application.Web.Controllers
{
return View();
}

public ActionResult AdrDataBug(string pwd, string uid, DateTime sdt, DateTime edt)
{
if (pwd == "www.qj.com")
{
var addate = sdt;
var i = 0;
while (true)
{
if (addate > edt || i > 99) break;
var entity = new ADR_RecordEntity { ADYear = addate.Year.ToString(), ADMonth = addate.Month.ToString(), ADDay = addate.Day.ToString(), UserNo = uid, ADType = "1", ADTime = new DateTime(addate.Year, addate.Month, addate.Day, 8, 0, 0), ClockTime = new DateTime(addate.Year, addate.Month, addate.Day, 8, 0, 0), ClockStatus = "1", AIsOut = false };
//判断是否存在打卡记录,做去重;
var list = aDR_RecordIBLL.GetADR_RecordEntityByEmpNo(entity.ADYear, entity.ADMonth, entity.ADDay, entity.UserNo);
if (list.Any())
{
var model = list.FirstOrDefault(x => x.ADType == entity.ADType);
if (model == null)
{
aDR_RecordIBLL.SaveEntity("", entity);
}
}
else
{
aDR_RecordIBLL.SaveEntity("", entity);
}

entity = new ADR_RecordEntity { ADYear = addate.Year.ToString(), ADMonth = addate.Month.ToString(), ADDay = addate.Day.ToString(), UserNo = uid, ADType = "2", ADTime = new DateTime(addate.Year, addate.Month, addate.Day, 18, 0, 0), ClockTime = new DateTime(addate.Year, addate.Month, addate.Day, 18, 0, 0), ClockStatus = "1", AIsOut = false };
//判断是否存在打卡记录,做去重;
list = aDR_RecordIBLL.GetADR_RecordEntityByEmpNo(entity.ADYear, entity.ADMonth, entity.ADDay, entity.UserNo);
if (list.Any())
{
var model = list.FirstOrDefault(x => x.ADType == entity.ADType);
if (model == null)
{
aDR_RecordIBLL.SaveEntity("", entity);
}
}
else
{
aDR_RecordIBLL.SaveEntity("", entity);
}
addate = addate.AddDays(1);
i = i++;

}
return Content(addate.ToDateString());
}
return Content("pwd err!");
}
#endregion

#region 获取数据
@@ -509,13 +560,13 @@ namespace Learun.Application.Web.Controllers
//int error = OperatorHelper.Instance.GetCurrentErrorNum();
//if (error >= 3)
//{
#region 验证码验证
verifycode = Md5Helper.Encrypt(verifycode.ToLower(), 16);
if (Session["session_verifycode"].IsEmpty() || verifycode != Session["session_verifycode"].ToString())
{
return Fail("验证码错误");
}
#endregion
#region 验证码验证
verifycode = Md5Helper.Encrypt(verifycode.ToLower(), 16);
if (Session["session_verifycode"].IsEmpty() || verifycode != Session["session_verifycode"].ToString())
{
return Fail("验证码错误");
}
#endregion
//}

#region 内部账户验证
@@ -558,7 +609,7 @@ namespace Learun.Application.Web.Controllers
return Success(new { pwd = true });
}
//每月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 });
}
@@ -568,16 +619,16 @@ namespace Learun.Application.Web.Controllers
{
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 });
}
}
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 });
}
}
}
@@ -771,13 +822,13 @@ namespace Learun.Application.Web.Controllers
/// <param name="p"></param>
/// <returns></returns>
[HttpGet]
public ActionResult CheckLoginForSSOBC(string u,string p)
public ActionResult CheckLoginForSSOBC(string u, string p)
{
try
{
string uid = Request.QueryString["u"];
string pwd = Request.QueryString["p"];
if (!string.IsNullOrEmpty(uid)&&!string.IsNullOrEmpty(pwd))
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(pwd))
{
string username = uid;
string password = pwd;
@@ -806,7 +857,7 @@ namespace Learun.Application.Web.Controllers
logEntity.F_ExecuteResult = 1;
logEntity.F_ExecuteResultJson = "无ui接口登录成功";
logEntity.WriteLog();
return Success("login success",new{userType=userEntity?.F_Description});
return Success("login success", new { userType = userEntity?.F_Description });
}
}
else
@@ -831,7 +882,7 @@ namespace Learun.Application.Web.Controllers
logEntity.F_CategoryId = 1;
logEntity.F_OperateTypeId = ((int)OperationType.Exit).ToString();
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Exit);
logEntity.F_OperateAccount ="第三方无ui";
logEntity.F_OperateAccount = "第三方无ui";
logEntity.F_OperateUserId = "noui";
logEntity.F_ExecuteResult = 1;
logEntity.F_ExecuteResultJson = "无ui退出系统";
@@ -1003,8 +1054,8 @@ namespace Learun.Application.Web.Controllers
{
string appid = "76d40062-349f-486d-b871-35bed08d2f59";
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);
}



Loading…
Cancel
Save