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
80a1c938
Commit
80a1c938
authored
Jul 20, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
966f9d2f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
173 additions
and
102 deletions
+173
-102
ManagerModule.cs
Edu.Module.User/ManagerModule.cs
+169
-100
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+4
-2
No files found.
Edu.Module.User/ManagerModule.cs
View file @
80a1c938
...
@@ -53,6 +53,16 @@ namespace Edu.Module.User
...
@@ -53,6 +53,16 @@ namespace Edu.Module.User
/// </summary>
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 讲师仓储层对象
/// </summary>
private
readonly
RB_TeacherRepository
teacherRepository
=
new
RB_TeacherRepository
();
/// <summary>
/// 助教仓储层对象
/// </summary>
private
readonly
RB_AssistRepository
assistRepository
=
new
RB_AssistRepository
();
/// <summary>
/// <summary>
/// 获取管理者列表
/// 获取管理者列表
/// </summary>
/// </summary>
...
@@ -408,16 +418,45 @@ namespace Edu.Module.User
...
@@ -408,16 +418,45 @@ namespace Edu.Module.User
/// 修改员工类型
/// 修改员工类型
/// </summary>
/// </summary>
/// <param name="targetAccountType">目标用户类型</param>
/// <param name="targetAccountType">目标用户类型</param>
/// <param name="Id">编号</param>
/// <param name="AccountId">编号</param>
/// <param name="AccountType">类型</param>
/// <param name="Remark">调整原因</param>
/// <param name="Remark">调整原因</param>
/// <returns></returns>
/// <returns></returns>
[
TransactionCallHandler
]
[
TransactionCallHandler
]
public
virtual
bool
SetEmployeeTypeModule
(
AccountTypeEnum
targetAccountType
,
int
Id
,
string
Remark
)
public
virtual
bool
SetEmployeeTypeModule
(
AccountTypeEnum
targetAccountType
,
int
AccountId
,
AccountTypeEnum
AccountType
,
string
Remark
)
{
{
bool
flag
=
false
;
bool
flag
=
false
;
var
model
=
accountRepository
.
GetEmployeeInfo
(
Id
);
var
model
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
AccountId
=
AccountId
,
AccountTypeStr
=
((
int
)
AccountType
).
ToString
()
})?.
FirstOrDefault
();
if
(
model
!=
null
&&
model
.
Id
>
0
)
if
(
model
!=
null
&&
model
.
Id
>
0
)
{
{
#
region
删除原来的数据
if
(
model
.
AccountType
==
AccountTypeEnum
.
Admin
)
{
flag
=
managerRepository
.
Delete
(
model
.
AccountId
)
>
0
;
}
else
if
(
model
.
AccountType
==
AccountTypeEnum
.
Teacher
)
{
flag
=
teacherRepository
.
Delete
(
model
.
AccountId
)
>
0
;
}
else
if
(
model
.
AccountType
==
AccountTypeEnum
.
Assist
)
{
flag
=
assistRepository
.
Delete
(
model
.
AccountId
)
>
0
;
}
#
endregion
if
(
flag
)
{
#
region
添加新数据
var
newId
=
0
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Account_ViewModel
.
AccountType
),(
int
)
targetAccountType
}
};
if
(
targetAccountType
==
AccountTypeEnum
.
Admin
)
if
(
targetAccountType
==
AccountTypeEnum
.
Admin
)
{
{
RB_Manager_ViewModel
manager
=
new
RB_Manager_ViewModel
()
RB_Manager_ViewModel
manager
=
new
RB_Manager_ViewModel
()
...
@@ -432,7 +471,7 @@ namespace Edu.Module.User
...
@@ -432,7 +471,7 @@ namespace Edu.Module.User
CreateTime
=
DateTime
.
Now
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
model
.
UpdateBy
,
UpdateBy
=
model
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
Status
=
model
.
Status
,
Status
=
DateStateEnum
.
Normal
,
Dept_Id
=
model
.
Dept_Id
,
Dept_Id
=
model
.
Dept_Id
,
Post_Id
=
model
.
Post_Id
,
Post_Id
=
model
.
Post_Id
,
IDCard
=
model
.
IDCard
,
IDCard
=
model
.
IDCard
,
...
@@ -445,51 +484,58 @@ namespace Edu.Module.User
...
@@ -445,51 +484,58 @@ namespace Edu.Module.User
Education
=
model
.
Education
,
Education
=
model
.
Education
,
Email
=
model
.
Email
Email
=
model
.
Email
};
};
newId
=
managerRepository
.
Insert
(
manager
);
flag
=
newId
>
0
;
manager
.
MId
=
newId
;
fileds
.
Add
(
nameof
(
RB_Account_ViewModel
.
AccountId
),
newId
);
}
}
else
if
(
targetAccountType
==
AccountTypeEnum
.
Teacher
)
else
if
(
targetAccountType
==
AccountTypeEnum
.
Teacher
)
{
{
RB_Teacher_ViewModel
teacher
=
new
RB_Teacher_ViewModel
()
RB_Teacher_ViewModel
teacher
=
new
RB_Teacher_ViewModel
()
{
{
TId
=
0
,
TId
=
0
,
School_Id
=
model
.
School_Id
,
School_Id
=
model
.
School_Id
,
TeacherName
=
model
.
EmployeeName
,
TeacherName
=
model
.
EmployeeName
,
TeacherTel
=
model
.
EmployeeTel
,
TeacherTel
=
model
.
EmployeeTel
,
TeacherHead
=
model
.
UserIcon
,
TeacherHead
=
model
.
UserIcon
,
TeacherIcon
=
model
.
UserIcon
,
TeacherIcon
=
model
.
UserIcon
,
TeacherSay
=
""
,
TeacherSay
=
""
,
TeacherIntro
=
""
,
TeacherIntro
=
""
,
Status
=
model
.
Status
,
Status
=
model
.
Status
,
AuditStatus
=
AccountStatusEnum
.
Pass
,
AuditStatus
=
AccountStatusEnum
.
Pass
,
AuditRemark
=
""
,
AuditRemark
=
""
,
IsShow
=
1
,
IsShow
=
1
,
IsRecommend
=
0
,
IsRecommend
=
0
,
SortNum
=
1
,
SortNum
=
1
,
CreateBy
=
model
.
CreateBy
,
CreateBy
=
model
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
CreateTime
=
DateTime
.
Now
,
UpdateBy
=
model
.
UpdateBy
,
UpdateBy
=
model
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
Group_Id
=
model
.
Group_Id
,
Group_Id
=
model
.
Group_Id
,
TeachTag
=
""
,
TeachTag
=
""
,
Dept_Id
=
model
.
Dept_Id
,
Dept_Id
=
model
.
Dept_Id
,
Post_Id
=
model
.
Post_Id
,
Post_Id
=
model
.
Post_Id
,
IDCard
=
model
.
IDCard
,
IDCard
=
model
.
IDCard
,
Sex
=
model
.
Sex
,
Sex
=
model
.
Sex
,
EntryTime
=
model
.
EntryTime
,
EntryTime
=
model
.
EntryTime
,
Address
=
model
.
Address
,
Address
=
model
.
Address
,
BirthDate
=
model
.
BirthDate
,
BirthDate
=
model
.
BirthDate
,
LeaveStatus
=
model
.
LeaveStatus
,
LeaveStatus
=
model
.
LeaveStatus
,
LeaveTime
=
model
.
LeaveTime
,
LeaveTime
=
model
.
LeaveTime
,
Education
=
model
.
Education
,
Education
=
model
.
Education
,
BaseStuNum
=
13
,
BaseStuNum
=
13
,
Email
=
model
.
Email
,
Email
=
model
.
Email
,
BaseHourFee
=
0
,
BaseHourFee
=
0
,
Nationality
=
""
,
Nationality
=
""
,
ForeignersUrl
=
""
,
ForeignersUrl
=
""
,
Specialty
=
"1,2,3,4"
,
Specialty
=
"1,2,3,4"
,
BaseHoursEnabled
=
1
,
BaseHoursEnabled
=
1
,
EnableTime
=
model
.
EnableTime
,
EnableTime
=
model
.
EnableTime
,
};
};
newId
=
teacherRepository
.
Insert
(
teacher
);
flag
=
newId
>
0
;
teacher
.
TId
=
newId
;
fileds
.
Add
(
nameof
(
RB_Account_ViewModel
.
AccountId
),
newId
);
}
}
else
if
(
targetAccountType
==
AccountTypeEnum
.
Assist
)
else
if
(
targetAccountType
==
AccountTypeEnum
.
Assist
)
{
{
...
@@ -522,7 +568,30 @@ namespace Edu.Module.User
...
@@ -522,7 +568,30 @@ namespace Edu.Module.User
Education
=
model
.
Education
,
Education
=
model
.
Education
,
Email
=
model
.
Email
Email
=
model
.
Email
};
};
newId
=
assistRepository
.
Insert
(
assist
);
flag
=
newId
>
0
;
assist
.
AId
=
newId
;
fileds
.
Add
(
nameof
(
RB_Account_ViewModel
.
AccountId
),
newId
);
}
if
(
fileds
!=
null
&&
fileds
.
Count
>
0
&&
flag
)
{
//更新关联编号
flag
=
accountRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Account_ViewModel
.
Id
),
model
.
Id
));
}
string
logContent
=
Remark
;
if
(
model
.
AccountType
!=
targetAccountType
)
{
logContent
+=
string
.
Format
(
",将在由【{0}】修改为【{1}】。"
,
model
.
AccountType
.
ToName
(),
targetAccountType
.
ToName
());
}
if
(!
string
.
IsNullOrEmpty
(
logContent
))
{
//新增日志
userChangeLogModule
.
SetUserChangeLogModule
(
model
.
CreateBy
,
model
.
Group_Id
,
model
.
School_Id
,
logContent
,
newId
,
targetAccountType
);
}
#
endregion
}
}
}
}
return
flag
;
return
flag
;
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
80a1c938
...
@@ -1555,10 +1555,12 @@ namespace Edu.WebApi.Controllers.User
...
@@ -1555,10 +1555,12 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns>
/// <returns></returns>
public
ApiResult
SetEmployeeType
()
public
ApiResult
SetEmployeeType
()
{
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
AccountId
=
base
.
ParmJObj
.
GetInt
(
"AccountId"
);
var
AccountType
=
(
AccountTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"AccountType"
);
var
Remark
=
base
.
ParmJObj
.
GetStringValue
(
"Remark"
);
var
Remark
=
base
.
ParmJObj
.
GetStringValue
(
"Remark"
);
var
targetAccountType
=
(
AccountTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"TargetAccountType"
);
var
targetAccountType
=
(
AccountTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"TargetAccountType"
);
var
flag
=
managerModule
.
SetEmployeeTypeModule
(
targetAccountType
,
Id
,
Remark
);
var
flag
=
managerModule
.
SetEmployeeTypeModule
(
targetAccountType
,
AccountId
,
AccountType
,
Remark
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
#
endregion
#
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