Commit ea044bd0 authored by 黄奎's avatar 黄奎

页面修改

parent fa51cb3e
......@@ -1124,81 +1124,81 @@ namespace Edu.Module.User
/// <param name="receiveId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public string SetUserLeaveStudentCareOf(int userId, int receiveId, UserInfo userInfo)
{
var eModel = accountModule.GetEmployeeInfo(userId);
var reModel = accountModule.GetEmployeeInfo(receiveId);
if (eModel == null || reModel == null) { return "转交人不存在"; }
if (reModel.IsLeave != 1) { return "转交人非在职状态,无法交接"; }
//获取学员负责人 / 服务人员
var list = studentRepository.GetUserStudentCareOf(userId, userInfo.Group_Id);
if (list.Any())
{
//查询所有的服务人员
var alist = student_AssistRepository.GetUserStudentAssistCareOf(userId, userInfo.Group_Id);
var trans = studentRepository.DbTransaction;
try
{
foreach (var item in list)
{
bool flag = true;
if (item.CreateBy == userId) {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Student_ViewModel.CreateBy), receiveId}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Student_ViewModel.StuId),
FiledValue = item.StuId,
OperatorEnum =OperatorEnum.Equal
}
};
flag = studentRepository.Update(keyValues, wheres, trans);
}
if (flag) {
var clist = alist.Where(x => x.StuId == item.StuId).ToList();
foreach (var qitem in clist) {
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Student_Assist_Extend.AssistId),receiveId},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Student_Assist_Extend.Id),
FiledValue = qitem.Id,
OperatorEnum =OperatorEnum.Equal
}
};
flag = student_AssistRepository.Update(keyValues, wheres, trans);
}
}
if (flag) {
//插入日志
student_LogRepository.Insert(new Model.Entity.Customer.RB_Student_Log()
{
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
CreateType = 1,
Group_Id = userInfo.Group_Id,
LogContent = "离职转交客人负责人与服务人员,由【" + eModel.EmployeeName + "(" + userId + ")" + "】转交给【" + reModel.EmployeeName + "(" + receiveId + ")" + "】",
LogId = 0,
LogTitle = "离职转交学员",
LogType = Common.Enum.Log.StudentLogTypeEnum.BasicInfo,
StuId = item.StuId
}, trans);
}
}
studentRepository.DBSession.Commit();
}
catch (Exception ex)
{
LogHelper.Write(ex, "SetUserLeaveStudentCareOf");
studentRepository.DBSession.Rollback();
return "学员转交出错了,请联系管理员";
}
}
return "";
}
//public string SetUserLeaveStudentCareOf(int userId, int receiveId, UserInfo userInfo)
//{
// var eModel = accountModule.GetEmployeeInfo(userId);
// var reModel = accountModule.GetEmployeeInfo(receiveId);
// if (eModel == null || reModel == null) { return "转交人不存在"; }
// if (reModel.IsLeave != 1) { return "转交人非在职状态,无法交接"; }
// //获取学员负责人 / 服务人员
// var list = studentRepository.GetUserStudentCareOf(userId, userInfo.Group_Id);
// if (list.Any())
// {
// //查询所有的服务人员
// var alist = student_AssistRepository.GetUserStudentAssistCareOf(userId, userInfo.Group_Id);
// var trans = studentRepository.DbTransaction;
// try
// {
// foreach (var item in list)
// {
// bool flag = true;
// if (item.CreateBy == userId) {
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Student_ViewModel.CreateBy), receiveId}
// };
// List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName = nameof(RB_Student_ViewModel.StuId),
// FiledValue = item.StuId,
// OperatorEnum =OperatorEnum.Equal
// }
// };
// flag = studentRepository.Update(keyValues, wheres, trans);
// }
// if (flag) {
// var clist = alist.Where(x => x.StuId == item.StuId).ToList();
// foreach (var qitem in clist) {
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Student_Assist_Extend.AssistId),receiveId},
// };
// List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName = nameof(RB_Student_Assist_Extend.Id),
// FiledValue = qitem.Id,
// OperatorEnum =OperatorEnum.Equal
// }
// };
// flag = student_AssistRepository.Update(keyValues, wheres, trans);
// }
// }
// if (flag) {
// //插入日志
// student_LogRepository.Insert(new Model.Entity.Customer.RB_Student_Log()
// {
// CreateBy = userInfo.Id,
// CreateTime = DateTime.Now,
// CreateType = 1,
// Group_Id = userInfo.Group_Id,
// LogContent = "离职转交客人负责人与服务人员,由【" + eModel.EmployeeName + "(" + userId + ")" + "】转交给【" + reModel.EmployeeName + "(" + receiveId + ")" + "】",
// LogId = 0,
// LogTitle = "离职转交学员",
// LogType = Common.Enum.Log.StudentLogTypeEnum.BasicInfo,
// StuId = item.StuId
// }, trans);
// }
// }
// studentRepository.DBSession.Commit();
// }
// catch (Exception ex)
// {
// LogHelper.Write(ex, "SetUserLeaveStudentCareOf");
// studentRepository.DBSession.Rollback();
// return "学员转交出错了,请联系管理员";
// }
// }
// return "";
//}
#endregion
}
......
......@@ -311,13 +311,19 @@ namespace Edu.Module.User
TeacherAccountId = TeacherAccountId
});
}
var detailsList = teacher_Assessment_DetailsRepository.GetTeacherAssessmentDetailsListRepository(new RB_Teacher_Assessment_Details_Extend()
var detailsList = new List<RB_Teacher_Assessment_Details_Extend>();
if (extModel != null && extModel.Id > 0)
{
TeacherAssessmentId = (extModel?.Id ?? 0),
CreateBy = userInfo.Id,
CheckType = CheckType
});
detailsList = teacher_Assessment_DetailsRepository.GetTeacherAssessmentDetailsListRepository(new RB_Teacher_Assessment_Details_Extend()
{
TeacherAssessmentId = (extModel?.Id ?? 0),
CreateBy = userInfo.Id,
CheckType = CheckType
});
}
var typeList = GetAssessmentTypeListModule(new RB_Assessment_Type_Extend() { });
var maxOptionList = new List<SubtypeItem>();
int maxLength = 0;
......@@ -353,7 +359,10 @@ namespace Edu.Module.User
List<object> subList = new List<object>();
foreach (var subItem in item.SubtypeList)
{
var tempDetail = detailsList.Where(qitem => qitem.AssessmentTypeId == item.Id && qitem.AssessmentSubTypeId == subItem.Id && qitem.CheckType == CheckType)?.FirstOrDefault();
var tempDetail = detailsList.Where(qitem =>
qitem.AssessmentTypeId == item.Id
&& qitem.AssessmentSubTypeId == subItem.Id
&& qitem.CheckType == CheckType)?.FirstOrDefault();
List<object> optionList = new List<object>();
foreach (var tItem in subItem.OptionList)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment