Ver código fonte

新生报到管理 生成账号

金隅分支
zhangli 3 anos atrás
pai
commit
4d2a1487e4
10 arquivos alterados com 188 adições e 9 exclusões
  1. +11
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollController.cs
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Report.cshtml
  3. +10
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Report.js
  4. +5
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix/Index.js
  5. +22
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs
  6. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs
  7. +32
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs
  8. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollBLL.cs
  9. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollIBLL.cs
  10. +76
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollService.cs

+ 11
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollController.cs Ver arquivo

@@ -629,7 +629,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
}
}


/// <summary>
/// 生成帐号
/// </summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult Generate()
{
stuEnrollIBLL.GenerateAccout();
return Success("生成成功!");
}

[HttpPost]
[AjaxOnly]


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Report.cshtml Ver arquivo

@@ -57,7 +57,7 @@
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm">
<a id="lr_gen" class="btn btn-default"><i class="fa fa-plug"></i>&nbsp;生成帐号</a>
<a id="lr_generate" class="btn btn-default"><i class="fa fa-plug"></i>&nbsp;生成帐号</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;录入</a>


+ 10
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Report.js Ver arquivo

@@ -201,7 +201,16 @@ var bootstrap = function ($, learun) {
}
});


//生成帐号
$('#lr_generate').on('click', function () {
learun.layerConfirm('是否确认生成帐号?', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Generate', {}, function () {
refreshGirdData();
});
}
});
});
},
// 初始化列表
initGird: function () {


+ 5
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix/Index.js Ver arquivo

@@ -162,12 +162,13 @@
success: function (res) {
if (res.code == 200) {
if (source == "noLogin") {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/Index";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/Index";
} else if (source == "DragNoLogin") {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/DragModelOne";
window.location.href = "/Home/Index";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/SSOSystem/DragModelOne";
} else {
window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index";
window.location.href = "/Home/Index";
//window.location.href = DigitalschoolMisLoginurl + "?F_Account=" + username + "&returnurl=" + Returnurl + "/Home/Index";
}
}
else if (res.code == 400) {


+ 22
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs Ver arquivo

@@ -132,6 +132,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 获取学校Id (根据班级编号)
/// </summary>
/// <param name="classNo"></param>
/// <returns></returns>
public string GetSchoolIdByClassNo(string classNo) {
try
{
return classInfoService.GetSchoolIdByClassNo(classNo);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 提交数据


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs Ver arquivo

@@ -40,6 +40,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
ClassInfoEntity GetClassInfoEntityByClassName(string className);

/// <summary>
/// 根据班级编号获取schoolid
/// </summary>
/// <param name="classNo"></param>
/// <returns></returns>
string GetSchoolIdByClassNo(string classNo);
#endregion

#region 提交数据


+ 32
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs Ver arquivo

@@ -151,6 +151,38 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 获取ClassInfo表实体数据
/// <param name="classNo">班级编号</param>
/// <summary>
/// <returns></returns>
public string GetSchoolIdByClassNo(string classNo)
{
try
{
var sql = $@"select F_SchoolId from CdDept where DeptNo=
(select DeptNo from ClassInfo where ClassNo = '{classNo}')
";
var obj= this.BaseRepository("CollegeMIS").FindObject(sql);//.FindList<ClassInfoEntity>(sql);
if (obj != null)
return obj.ToString();
else
return "";
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}


/// <summary>
/// 获取ClassInfo表实体数据
/// <param name="className">班级名称</param>


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollBLL.cs Ver arquivo

@@ -623,6 +623,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 生成帐号
/// </summary>
public void GenerateAccout()
{
try
{
stuEnrollService.GenerateAccout();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public void AllReport()
{
try


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollIBLL.cs Ver arquivo

@@ -65,6 +65,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
(bool, string) Military(string stuId, bool status, bool payAfter);
void AllMilitary();

void GenerateAccout();
void AllReport();
void AllPhoto();
void AllGetCloth();


+ 76
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollService.cs Ver arquivo

@@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
if (!queryParam["Admissions"].IsEmpty())
{
dp.Add("Admissions", queryParam["Admissions"].ToString() , DbType.String);
dp.Add("Admissions", queryParam["Admissions"].ToString(), DbType.String);
strSql.Append(" AND t.Admissions = @Admissions ");
}
if (!queryParam["DeptNo"].IsEmpty())
@@ -2048,8 +2048,82 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 生成账号
/// </summary>
public void GenerateAccout()
{
Base.AuthorizeModule.UserRelationIBLL userRelationIBLL = new Base.AuthorizeModule.UserRelationBLL();
UserIBLL userIBLL = new UserBLL();
ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
try
{
var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "学生");
//新生报到管理
var stuEnrolllist = BaseRepository("CollegeMIS").FindList<StuEnrollEntity>(m => m.Grade == "20" && m.IsReport == true);
var roleId = Config.GetValue("GenerateStudentsRoleId");
var defaultpwd = Config.GetValue("defaultpwd");
//读取默认密码配置中已启用的密码
var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true);
if (Sys_DefaultPwdConfigEntity != null)
{
defaultpwd = Sys_DefaultPwdConfigEntity.Pwd;
}
var studentList = new List<UserEntity>();
foreach (var tEntity in stuEnrolllist)
{
if (alluserlist.Count(m => m.F_Account == tEntity.IDCard) > 0 || string.IsNullOrEmpty(tEntity.IDCard) || string.IsNullOrEmpty(tEntity.ClassNo))
{
continue;
}
//查询班级Id
var schoolId = classInfoIBLL.GetSchoolIdByClassNo(tEntity.ClassNo);
if (string.IsNullOrEmpty(schoolId))
continue;

var annexesFileEntity = this.BaseRepository().FindEntity<AnnexesFileEntity>(a => a.F_FolderId == tEntity.Photo);
var url = "";
if (annexesFileEntity != null)
{
url = annexesFileEntity.F_FilePath;
url = "/" + url.Substring(url.IndexOf("Resource"));
}


UserEntity userbase = new UserEntity();
userbase.F_Account = tEntity.IDCard;
userbase.F_RealName = tEntity.StuName;
userbase.F_EnCode = tEntity.IDCard;
userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower();
userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url;
userbase.F_Gender = tEntity.Gender.HasValue ? Convert.ToInt32(tEntity.Gender.Value) : 1;
userbase.F_DeleteMark = 0;
userbase.F_EnabledMark = 1;
userbase.F_Mobile = tEntity.FirstMobile;
userbase.F_Description = "学生";
userbase.F_CompanyId = schoolId;
userbase.F_DepartmentId = tEntity.DeptNo;
userbase.F_IdentityCardNo = tEntity.IDCard;
userIBLL.SaveEntity(null, userbase);
studentList.Add(userbase);
}
if (studentList.Any())
{
string s = studentList.Select(m => m.F_UserId).Aggregate((current, userEntity) => current + "," + userEntity);
userRelationIBLL.SaveEntityList2(roleId, 1, s);
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public void SyncDept()
{


Carregando…
Cancelar
Salvar