Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
966f9d2f
Commit
966f9d2f
authored
Jul 20, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b923c037
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
24 deletions
+137
-24
DepartmentModule.cs
Edu.Module.User/DepartmentModule.cs
+1
-1
ManagerModule.cs
Edu.Module.User/ManagerModule.cs
+114
-17
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+1
-1
RB_DepartmentRepository.cs
Edu.Repository/User/RB_DepartmentRepository.cs
+1
-1
RB_TeacherRepository.cs
Edu.Repository/User/RB_TeacherRepository.cs
+1
-1
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+19
-3
No files found.
Edu.Module.User/DepartmentModule.cs
View file @
966f9d2f
...
...
@@ -181,7 +181,7 @@ namespace Edu.Module.User
if
(
deptList
!=
null
&&
deptList
.
Count
>
0
)
{
var
firstList
=
new
List
<
RB_Department_ViewModel
>();
if
(
query
.
School_Id
==
0
)
if
(
query
.
School_Id
==
-
1
)
{
firstList
=
deptList
.
Where
(
qitem
=>
qitem
.
ParentId
==
0
&&
qitem
.
School_Id
==
0
).
ToList
();
}
...
...
Edu.Module.User/ManagerModule.cs
View file @
966f9d2f
...
...
@@ -210,13 +210,11 @@ namespace Edu.Module.User
var
deptList
=
departmentRepository
.
GetDepartmentListRepository
(
new
RB_Department_ViewModel
()
{
QDeptIds
=
model
.
Dept_Id
+
","
+
oldModel
.
Dept_Id
});
logContent
+=
string
.
Format
(
",将部门由【{0}】修改为【{1}】。"
,
(
deptList
.
Where
(
qitem
=>
qitem
.
DeptId
==
oldModel
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
),
(
deptList
.
Where
(
qitem
=>
qitem
.
DeptId
==
model
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
));
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
userChangeLogModule
.
SetUserChangeLogModule
(
model
.
CreateBy
,
model
.
Group_Id
,
model
.
School_Id
,
logContent
,
model
.
MId
,
AccountTypeEnum
.
Admin
);
}
//修改账号表
Dictionary
<
string
,
object
>
accountFileds
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -233,7 +231,6 @@ namespace Edu.Module.User
flag
=
managerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Manager_ViewModel
.
MId
),
model
.
MId
));
}
}
return
flag
;
}
...
...
@@ -251,10 +248,8 @@ namespace Edu.Module.User
var
oldModel
=
GetManagerModule
(
model
.
MId
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Manager_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_Manager_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Manager_ViewModel
.
Post_Id
),
model
.
Post_Id
},
};
string
logContent
=
""
;
...
...
@@ -264,7 +259,6 @@ namespace Edu.Module.User
var
postList
=
postRepository
.
GetPostListRepository
(
new
RB_Post_ViewModel
()
{
QPostIds
=
model
.
Post_Id
+
","
+
oldModel
.
Post_Id
});
logContent
+=
string
.
Format
(
",将岗位由【{0}】修改为【{1}】。"
,
(
postList
.
Where
(
qitem
=>
qitem
.
PostId
==
oldModel
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
),
(
postList
.
Where
(
qitem
=>
qitem
.
PostId
==
model
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
));
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
@@ -272,14 +266,11 @@ namespace Edu.Module.User
}
flag
=
managerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Manager_ViewModel
.
MId
),
model
.
MId
));
}
return
flag
;
}
/// <summary>
/// 新增修改管理者
/// 新增修改管理者
离职时间和离职状态
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
...
...
@@ -297,7 +288,6 @@ namespace Edu.Module.User
{
nameof
(
RB_Manager_ViewModel
.
LeaveTime
),
model
.
LeaveTime
},
};
string
logContent
=
""
;
if
(
model
.
LeaveStatus
!=
oldModel
.
LeaveStatus
)
{
logContent
+=
string
.
Format
(
",将在职状态由【{0}】修改为【{1}】。"
,
oldModel
.
LeaveStatus
.
ToName
(),
model
.
LeaveStatus
.
ToName
());
...
...
@@ -306,7 +296,6 @@ namespace Edu.Module.User
{
logContent
+=
string
.
Format
(
",将离职时间由【{0}】修改为【{1}】。"
,
oldModel
?.
LeaveTime
,
model
.
LeaveTime
);
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
...
...
@@ -314,7 +303,6 @@ namespace Edu.Module.User
}
flag
=
managerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Manager_ViewModel
.
MId
),
model
.
MId
));
}
return
flag
;
}
...
...
@@ -419,15 +407,124 @@ namespace Edu.Module.User
/// <summary>
/// 修改员工类型
/// </summary>
/// <param name="
sourceAccountType">
</param>
/// <param name="
targetAccountType">
</param>
/// <param name="
Id">
</param>
/// <param name="
targetAccountType">目标用户类型
</param>
/// <param name="
Id">编号
</param>
/// <param name="
Remark">调整原因
</param>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
SetEmployeeTypeModule
(
AccountTypeEnum
sourceAccountType
,
AccountTypeEnum
targetAccountType
,
int
Id
)
public
virtual
bool
SetEmployeeTypeModule
(
AccountTypeEnum
targetAccountType
,
int
Id
,
string
Remark
)
{
bool
flag
=
false
;
var
model
=
accountRepository
.
GetEmployeeInfo
(
Id
);
if
(
model
!=
null
&&
model
.
Id
>
0
)
{
if
(
targetAccountType
==
AccountTypeEnum
.
Admin
)
{
RB_Manager_ViewModel
manager
=
new
RB_Manager_ViewModel
()
{
MId
=
0
,
MName
=
model
.
EmployeeName
,
MTel
=
model
.
EmployeeTel
,
MHead
=
model
.
UserIcon
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
model
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
,
Status
=
model
.
Status
,
Dept_Id
=
model
.
Dept_Id
,
Post_Id
=
model
.
Post_Id
,
IDCard
=
model
.
IDCard
,
Sex
=
model
.
Sex
,
EntryTime
=
model
.
EntryTime
,
Address
=
model
.
Address
,
BirthDate
=
model
.
BirthDate
,
LeaveStatus
=
model
.
LeaveStatus
,
LeaveTime
=
model
.
LeaveTime
,
Education
=
model
.
Education
,
Email
=
model
.
Email
};
}
else
if
(
targetAccountType
==
AccountTypeEnum
.
Teacher
)
{
RB_Teacher_ViewModel
teacher
=
new
RB_Teacher_ViewModel
()
{
TId
=
0
,
School_Id
=
model
.
School_Id
,
TeacherName
=
model
.
EmployeeName
,
TeacherTel
=
model
.
EmployeeTel
,
TeacherHead
=
model
.
UserIcon
,
TeacherIcon
=
model
.
UserIcon
,
TeacherSay
=
""
,
TeacherIntro
=
""
,
Status
=
model
.
Status
,
AuditStatus
=
AccountStatusEnum
.
Pass
,
AuditRemark
=
""
,
IsShow
=
1
,
IsRecommend
=
0
,
SortNum
=
1
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
model
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
,
Group_Id
=
model
.
Group_Id
,
TeachTag
=
""
,
Dept_Id
=
model
.
Dept_Id
,
Post_Id
=
model
.
Post_Id
,
IDCard
=
model
.
IDCard
,
Sex
=
model
.
Sex
,
EntryTime
=
model
.
EntryTime
,
Address
=
model
.
Address
,
BirthDate
=
model
.
BirthDate
,
LeaveStatus
=
model
.
LeaveStatus
,
LeaveTime
=
model
.
LeaveTime
,
Education
=
model
.
Education
,
BaseStuNum
=
13
,
Email
=
model
.
Email
,
BaseHourFee
=
0
,
Nationality
=
""
,
ForeignersUrl
=
""
,
Specialty
=
"1,2,3,4"
,
BaseHoursEnabled
=
1
,
EnableTime
=
model
.
EnableTime
,
};
}
else
if
(
targetAccountType
==
AccountTypeEnum
.
Assist
)
{
RB_Assist_ViewModel
assist
=
new
RB_Assist_ViewModel
()
{
AId
=
0
,
School_Id
=
model
.
School_Id
,
Teacher_Id
=
0
,
AssistName
=
model
.
EmployeeName
,
AssistTel
=
model
.
EmployeeTel
,
AssistIcon
=
model
.
UserIcon
,
AssistIntro
=
""
,
AuditStatus
=
AccountStatusEnum
.
Pass
,
Status
=
model
.
Status
,
Remark
=
""
,
Group_Id
=
model
.
Group_Id
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
model
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
,
Dept_Id
=
model
.
Dept_Id
,
Post_Id
=
model
.
Post_Id
,
IDCard
=
model
.
IDCard
,
Sex
=
model
.
Sex
,
EntryTime
=
model
.
EntryTime
,
Address
=
model
.
Address
,
BirthDate
=
model
.
BirthDate
,
LeaveStatus
=
model
.
LeaveStatus
,
LeaveTime
=
model
.
LeaveTime
,
Education
=
model
.
Education
,
Email
=
model
.
Email
};
}
}
return
flag
;
}
}
...
...
Edu.Repository/User/RB_AccountRepository.cs
View file @
966f9d2f
...
...
@@ -350,7 +350,7 @@ FROM
{
where
.
AppendFormat
(
" AND B.{0}={1} "
,
nameof
(
Employee_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
School_Id
>
0
)
if
(
query
.
School_Id
>
-
1
)
{
where
.
AppendFormat
(
" AND B.{0}={1} "
,
nameof
(
Employee_ViewModel
.
School_Id
),
query
.
School_Id
);
}
...
...
Edu.Repository/User/RB_DepartmentRepository.cs
View file @
966f9d2f
...
...
@@ -99,7 +99,7 @@ WHERE 1=1
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Department_ViewModel
.
Group_Id
)}
=
{
query
.
Group_Id
}
"
);
}
if
(
query
.
School_Id
>
0
)
if
(
query
.
School_Id
>
=
0
)
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Department_ViewModel
.
School_Id
)}
=
{
query
.
School_Id
}
"
);
}
...
...
Edu.Repository/User/RB_TeacherRepository.cs
View file @
966f9d2f
...
...
@@ -113,7 +113,7 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Teacher_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
School_Id
>
0
)
if
(
query
.
School_Id
>
-
1
)
{
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Teacher_ViewModel
.
School_Id
),
query
.
School_Id
);
}
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
966f9d2f
...
...
@@ -343,7 +343,23 @@ namespace Edu.WebApi.Controllers.User
public
ApiResult
GetTeacherPageList
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Teacher_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Teacher_ViewModel
()
{
TeacherName
=
base
.
ParmJObj
.
GetStringValue
(
"TeacherName"
),
TeacherTel
=
base
.
ParmJObj
.
GetStringValue
(
"TeacherTel"
),
IsShow
=
base
.
ParmJObj
.
GetInt
(
"IsShow"
),
AuditStatus
=
(
AccountStatusEnum
)
base
.
ParmJObj
.
GetInt
(
"AuditStatus"
),
School_Id
=
-
1
,
};
var
schoolId
=
base
.
ParmJObj
.
GetStringValue
(
"School_Id"
);
if
(!
string
.
IsNullOrEmpty
(
schoolId
))
{
Int32
.
TryParse
(
schoolId
,
out
int
NewSchoolId
);
if
(
NewSchoolId
>=
0
)
{
query
.
School_Id
=
NewSchoolId
;
}
}
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
teacherModule
.
GetTeacherPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
...
...
@@ -1539,10 +1555,10 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns>
public
ApiResult
SetEmployeeType
()
{
var
sourceAccountType
=
(
AccountTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"AccountType"
);
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
Remark
=
base
.
ParmJObj
.
GetStringValue
(
"Remark"
);
var
targetAccountType
=
(
AccountTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"TargetAccountType"
);
var
flag
=
managerModule
.
SetEmployeeTypeModule
(
sourceAccountType
,
targetAccountType
,
Id
);
var
flag
=
managerModule
.
SetEmployeeTypeModule
(
targetAccountType
,
Id
,
Remark
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment