Ver código fonte

家长账号添加测试

master
zhangli 3 anos atrás
pai
commit
1da9155ca8
8 arquivos alterados com 98 adições e 25 exclusões
  1. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs
  2. +26
    -17
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/FormOfStudent.js
  3. +10
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js
  5. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs
  6. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs
  7. +30
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs
  8. +8
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs Ver arquivo

@@ -176,6 +176,9 @@ namespace Learun.Application.Organization
case "1": case "1":
strSql.Append(" AND t.F_Description='学生' "); strSql.Append(" AND t.F_Description='学生' ");
break; break;
case "2":
strSql.Append(" AND t.F_Description='家长' ");
break;
} }
} }
if (!string.IsNullOrEmpty(keyword)) if (!string.IsNullOrEmpty(keyword))


+ 26
- 17
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/FormOfStudent.js Ver arquivo

@@ -46,7 +46,7 @@ var bootstrap = function ($, learun) {
label: '手机号码', name: 'Mobile', width: 100, align: 'left' label: '手机号码', name: 'Mobile', width: 100, align: 'left'
, edit: { , edit: {
type: 'input', type: 'input',
} }
}, },
{ {
@@ -154,37 +154,46 @@ var bootstrap = function ($, learun) {
if (!$('body').lrValidform()) { if (!$('body').lrValidform()) {
return false; return false;
} }
var flag = true;
//家庭成员: //家庭成员:
var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas');
$.each(familyList, function (i, item) { $.each(familyList, function (i, item) {
//身份证号的验证
if (!IsUserCard(item.IdCard)) {//身份证错误
learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!");
if (!item.Name) {
flag = false;
learun.alert.warning("家庭成员的姓名不可空!");
return false; return false;
} }
//手机号验证 //手机号验证
if (!item.Mobile) { if (!item.Mobile) {
flag = false;
learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!"); learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!");
return false; return false;
} }
else if(!IsMobile){
else if (!IsMobile(item.Mobile)) {
flag = false;
learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!"); learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!");
return false; return false;
} }
});

var postData = {};
postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData());
postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas'));
postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas'));

$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
//身份证号的验证
if (!item.IdCard || !IsUserCard(item.IdCard)) {//身份证错误
flag = false;
learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!");
return false;
} }
}); });
if (flag) {
var postData = {};
postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData());
postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas'));
postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas'));

$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
}
}; };
page.init(); page.init();
} }


+ 10
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs Ver arquivo

@@ -29,7 +29,15 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers




#region 获取视图 #region 获取视图

/// <summary>
/// 家长用户管理
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult FamilyIndex()
{
return View();
}
[HttpGet] [HttpGet]
public ActionResult StudentIndex() public ActionResult StudentIndex()
{ {
@@ -90,7 +98,7 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
/// <param name="keyword">关键字</param> /// <param name="keyword">关键字</param>
/// <param name="companyId">公司主键</param> /// <param name="companyId">公司主键</param>
/// <param name="departmentId">部门主键</param> /// <param name="departmentId">部门主键</param>
/// <param name="tp">0 教师 1学生</param>
/// <param name="tp">0 教师 1学生 2家长</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[AjaxOnly] [AjaxOnly]


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js Ver arquivo

@@ -319,7 +319,7 @@ var bootstrap = function ($, learun) {
param = param || {}; param = param || {};
param.companyId = companyId; param.companyId = companyId;
param.departmentId = departmentId; param.departmentId = departmentId;
param.tp = "1";
param.tp = "2";
$('#gridtable').jfGridSet('reload', param); $('#gridtable').jfGridSet('reload', param);
} }
}; };


+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs Ver arquivo

@@ -199,6 +199,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
} }
} }


public string GetSchoolIdByDeptNo(string deptno)
{
try
{
return cdDeptService.GetSchoolIdByDeptNo(deptno);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion #endregion


} }


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

@@ -55,5 +55,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration


IEnumerable<CdDeptEntity> GetListBySchoolId(string schoolId); IEnumerable<CdDeptEntity> GetListBySchoolId(string schoolId);
IEnumerable<CdDeptEntity> GetAllList(); IEnumerable<CdDeptEntity> GetAllList();
string GetSchoolIdByDeptNo(string deptno);
} }
} }

+ 30
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs Ver arquivo

@@ -250,5 +250,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
} }
} }
} }


/// <summary>
/// 获取ClassInfo表实体数据
/// <param name="className">班级名称</param>
/// <summary>
/// <returns></returns>
public string GetSchoolIdByDeptNo(string deptno)
{
try
{
string sql = $@"select F_SchoolId from [dbo].[CdDept] where deptno='{deptno}'";
var obj = this.BaseRepository("CollegeMIS").FindObject(sql);
if (obj == null)
return "";
else
return obj.ToString();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
} }
} }

+ 8
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs Ver arquivo

@@ -900,6 +900,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
} }
} }
db.Commit(); db.Commit();

//家长生成账号
GenerateAccoutForStuFamily(entity, stuInfoFreshFamilyList);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -924,7 +927,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{ {
UserRelationIBLL userRelationIBLL = new UserRelationBLL(); UserRelationIBLL userRelationIBLL = new UserRelationBLL();
UserIBLL userIBLL = new UserBLL(); UserIBLL userIBLL = new UserBLL();
ClassInfoIBLL classInfoIBLL = new ClassInfoBLL();
CdDeptIBLL cdDeptIBLL = new CdDeptBLL();
try try
{ {
var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(m => m.CheckMark != "0"); var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(m => m.CheckMark != "0");
@@ -940,13 +943,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var studentList = new List<UserEntity>(); var studentList = new List<UserEntity>();
foreach (var fEntity in stuInfoFreshFamilyList) foreach (var fEntity in stuInfoFreshFamilyList)
{ {
if (string.IsNullOrEmpty(fEntity.Mobile) && alluserlist.Count(m => m.F_Account == fEntity.Mobile) > 0)
if (string.IsNullOrEmpty(fEntity.Mobile) || alluserlist.Count(m => m.F_Account == fEntity.Mobile)>0)
{ {
continue; continue;
} }
//获取schoolid ClassNo
var schoolid= classInfoIBLL.GetSchoolIdByClassNo(entity.ClassNo);
if(string.IsNullOrEmpty((schoolid)))
//获取schoolid DeptNo
var schoolid = cdDeptIBLL.GetSchoolIdByDeptNo(entity.DeptNo);
if (string.IsNullOrEmpty((schoolid)))
continue; continue;


UserEntity userbase = new UserEntity(); UserEntity userbase = new UserEntity();


Carregando…
Cancelar
Salvar