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
4e704a7f
Commit
4e704a7f
authored
Oct 23, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b03f9d31
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
11 deletions
+98
-11
RB_Manager_ViewModel.cs
Edu.Model/ViewModel/User/RB_Manager_ViewModel.cs
+5
-0
ManagerModule.cs
Edu.Module.User/ManagerModule.cs
+76
-7
StudentModule.cs
Edu.Module.User/StudentModule.cs
+2
-1
RB_ManagerRepository.cs
Edu.Repository/User/RB_ManagerRepository.cs
+2
-1
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+13
-2
No files found.
Edu.Model/ViewModel/User/RB_Manager_ViewModel.cs
View file @
4e704a7f
...
...
@@ -44,5 +44,10 @@ namespace Edu.Model.ViewModel.User
return
Common
.
ConvertHelper
.
StringToList
(
this
.
RoleAuth
);
}
}
/// <summary>
/// 管理者账号
/// </summary>
public
string
ManagerAccount
{
get
;
set
;
}
}
}
Edu.Module.User/ManagerModule.cs
View file @
4e704a7f
using
Edu.Common.Enum
;
using
Edu.AOP.CustomerAttribute
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.User
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
...
...
@@ -16,6 +20,11 @@ namespace Edu.Module.User
/// </summary>
private
readonly
RB_ManagerRepository
managerRepository
=
new
RB_ManagerRepository
();
/// <summary>
/// 账号处理类
/// </summary>
private
readonly
AccountModule
accountModule
=
new
AccountModule
();
/// <summary>
/// 获取管理者列表
/// </summary>
...
...
@@ -74,7 +83,7 @@ namespace Edu.Module.User
/// </summary>
/// <param name="MId"></param>
/// <returns></returns>
public
RB_Manager_ViewModel
GetManagerModule
(
objec
t
MId
)
public
RB_Manager_ViewModel
GetManagerModule
(
in
t
MId
)
{
return
managerRepository
.
GetEntity
<
RB_Manager_ViewModel
>(
MId
);
}
...
...
@@ -85,13 +94,73 @@ namespace Edu.Module.User
/// <param name="MId"></param>
/// <param name="Status"></param>
/// <returns></returns>
public
bool
RemoveManagerModule
(
int
MId
,
int
Status
)
public
bool
RemoveManagerModule
(
int
MId
,
int
Status
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
bool
flag
=
false
;
var
model
=
GetManagerModule
(
MId
);
if
(
model
!=
null
&&
model
.
MId
>
0
)
{
{
nameof
(
RB_Manager_ViewModel
.
Status
),
Status
}
};
bool
flag
=
managerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Manager_ViewModel
.
MId
),
MId
));
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Manager_ViewModel
.
Status
),
Status
}
};
flag
=
managerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Manager_ViewModel
.
MId
),
MId
));
var
accountList
=
accountModule
.
GetAccountListExtModule
(
new
RB_Account_ViewModel
()
{
AccountId
=
model
.
MId
,
Account
=
model
.
MTel
,
AccountType
=
AccountTypeEnum
.
Admin
});
if
(
accountList
!=
null
&&
accountList
.
Count
>
0
)
{
flag
=
accountModule
.
SetAccountStatusModule
(
new
RB_Account_ViewModel
()
{
AccountType
=
AccountTypeEnum
.
Admin
,
AccountId
=
model
.
MId
,
UpdateTime
=
DateTime
.
Now
,
Status
=
(
DateStateEnum
)
Status
});
}
}
return
flag
;
}
/// <summary>
/// 创建管理者账号
/// </summary>
/// <param name="MId"></param>
/// <param name="user"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
bool
CreateManagerAccountModule
(
int
MId
,
UserInfo
user
)
{
bool
flag
=
false
;
var
model
=
GetManagerModule
(
MId
);
if
(
model
!=
null
&&
model
.
MId
>
0
)
{
var
accountList
=
accountModule
.
GetAccountListExtModule
(
new
RB_Account_ViewModel
()
{
Account
=
model
.
MTel
,
AccountType
=
AccountTypeEnum
.
Admin
});
if
(
accountList
==
null
||
(
accountList
!=
null
&&
accountList
.
Count
==
0
))
{
flag
=
accountModule
.
SetAccountModule
(
new
RB_Account_ViewModel
()
{
Account
=
model
.
MTel
,
Password
=
Common
.
DES
.
Encrypt
(
Common
.
Config
.
DefaultPwd
),
AccountType
=
AccountTypeEnum
.
Admin
,
AccountId
=
model
.
MId
,
CreateBy
=
user
.
Id
,
UpdateBy
=
user
.
Id
,
CreateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
Status
=
model
.
Status
,
});
}
}
return
flag
;
}
}
...
...
Edu.Module.User/StudentModule.cs
View file @
4e704a7f
...
...
@@ -139,7 +139,7 @@ namespace Edu.Module.User
/// <param name="StuId"></param>
/// <param name="Status"></param>
/// <returns></returns>
public
bool
RemoveStudentModule
(
int
StuId
,
int
Status
)
public
bool
RemoveStudentModule
(
int
StuId
,
int
Status
)
{
bool
flag
=
false
;
var
model
=
GetStudentModule
(
StuId
);
...
...
@@ -219,6 +219,7 @@ namespace Edu.Module.User
UpdateTime
=
DateTime
.
Now
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
Status
=
model
.
Status
});
}
}
...
...
Edu.Repository/User/RB_ManagerRepository.cs
View file @
4e704a7f
...
...
@@ -68,8 +68,9 @@ WHERE 1=1
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.SName
SELECT A.*,B.SName
,IFNULL(account.Account,'') ManagerAccount
FROM rb_manager AS A LEFT JOIN rb_school AS B ON A.School_Id=B.SId
LEFT JOIN rb_account AS account ON (A.MId=account.AccountId and account.AccountType=1)
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
4e704a7f
...
...
@@ -65,8 +65,7 @@ namespace Edu.WebApi.Controllers.User
RB_Account_ViewModel
viewModel
=
JsonConvert
.
DeserializeObject
<
RB_Account_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
if
(
viewModel
!=
null
&&
viewModel
.
AccountType
>
0
&&
viewModel
.
AccountId
>
0
)
{
int
uid
=
0
;
if
(
int
.
TryParse
(
RequestParm
.
Uid
,
out
uid
))
if
(
int
.
TryParse
(
RequestParm
.
Uid
,
out
int
uid
))
{
viewModel
.
Group_Id
=
UserReidsCache
.
GetUserLoginInfo
(
uid
).
Group_Id
;
var
result
=
accountModule
.
SetResetPassword
(
viewModel
);
...
...
@@ -683,6 +682,18 @@ namespace Edu.WebApi.Controllers.User
var
flag
=
managerModule
.
RemoveManagerModule
(
MId
,
Status
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 创建管理者账号
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CreateManagerAccount
()
{
var
MId
=
base
.
ParmJObj
.
GetInt
(
"MId"
,
0
);
var
flag
=
managerModule
.
CreateManagerAccountModule
(
MId
,
base
.
UserInfo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
\ No newline at end of file
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