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
d76c738f
Commit
d76c738f
authored
Dec 03, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
6a053fd4
fd29a639
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
899 additions
and
109 deletions
+899
-109
Employee_ViewModel.cs
Edu.Model/ViewModel/User/Employee_ViewModel.cs
+27
-0
RB_Manager_ViewModel.cs
Edu.Model/ViewModel/User/RB_Manager_ViewModel.cs
+5
-0
AccountModule.cs
Edu.Module.User/AccountModule.cs
+33
-2
AssistModule.cs
Edu.Module.User/AssistModule.cs
+154
-30
EmployeeModule.cs
Edu.Module.User/EmployeeModule.cs
+230
-20
ManagerModule.cs
Edu.Module.User/ManagerModule.cs
+164
-22
TeacherModule.cs
Edu.Module.User/TeacherModule.cs
+148
-29
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+25
-0
MessageCore.cs
Edu.ThirdCore/Message/MessageCore.cs
+1
-0
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+111
-5
appsettings.json
Edu.WebApi/appsettings.json
+1
-1
No files found.
Edu.Model/ViewModel/User/Employee_ViewModel.cs
View file @
d76c738f
...
...
@@ -69,6 +69,33 @@ namespace Edu.Model.ViewModel.User
/// 员工编号【查询使用,逗号分隔】
/// </summary>
public
string
QIds
{
get
;
set
;
}
/// <summary>
/// 入职开始时间【查询使用】
/// </summary>
public
string
StartEntryTime
{
get
;
set
;
}
/// <summary>
/// 离职开始时间【查询使用】
/// </summary>
public
string
EndEntryTime
{
get
;
set
;
}
/// <summary>
/// 离职开始时间【查询使用】
/// </summary>
public
string
StartLeaveTime
{
get
;
set
;
}
/// <summary>
/// 离职结束时间【查询使用】
/// </summary>
public
string
EndLeaveTime
{
get
;
set
;
}
/// <summary>
/// 生日开始时间【查询使用,2020-01】
/// </summary>
public
string
StartBirthDate
{
get
;
set
;
}
/// <summary>
/// 生日结束时间【查询使用,2020-01】
/// </summary>
public
string
EndBirthDate
{
get
;
set
;
}
/// <summary>
/// 部门层级
...
...
Edu.Model/ViewModel/User/RB_Manager_ViewModel.cs
View file @
d76c738f
...
...
@@ -50,6 +50,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public
string
PostName
{
get
;
set
;
}
/// <summary>
/// 密码
/// </summary>
public
string
Password
{
get
;
set
;
}
/// <summary>
/// 用户类型(1-管理端,2-讲师,3-助教)
/// </summary>
...
...
Edu.Module.User/AccountModule.cs
View file @
d76c738f
using
Edu.Common.Encrypt
;
using
Edu.AOP.CustomerAttribute
;
using
Edu.Common.Encrypt
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.User
;
using
System
;
...
...
@@ -106,7 +107,7 @@ namespace Edu.Module.User
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
(
bool
reuslt
,
string
newPass
)
SetResetPassword
(
RB_Account_ViewModel
model
)
public
(
bool
reuslt
,
string
newPass
)
SetResetPassword
(
RB_Account_ViewModel
model
)
{
bool
flag
;
//生成随机新密码
...
...
@@ -124,5 +125,35 @@ namespace Edu.Module.User
flag
=
accountRepository
.
Update
(
fileds
,
wheres
);
return
(
flag
,
newPwd
);
}
/// <summary>
/// 重置密码
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
bool
SetBatchResetPassword
(
List
<
RB_Account_ViewModel
>
list
,
string
newPwd
)
{
bool
flag
=
false
;
foreach
(
var
model
in
list
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Account_ViewModel
.
Password
),
Common
.
DES
.
Encrypt
(
newPwd
)}
};
var
wheres
=
new
List
<
WhereHelper
>
{
new
WhereHelper
(
nameof
(
RB_Account_ViewModel
.
AccountId
),
model
.
AccountId
),
new
WhereHelper
(
nameof
(
RB_Account_ViewModel
.
AccountType
),
model
.
AccountType
),
new
WhereHelper
(
nameof
(
RB_Account_ViewModel
.
Group_Id
),
model
.
Group_Id
)
};
flag
=
accountRepository
.
Update
(
fileds
,
wheres
);
}
return
flag
;
}
}
}
\ No newline at end of file
Edu.Module.User/AssistModule.cs
View file @
d76c738f
This diff is collapsed.
Click to expand it.
Edu.Module.User/EmployeeModule.cs
View file @
d76c738f
This diff is collapsed.
Click to expand it.
Edu.Module.User/ManagerModule.cs
View file @
d76c738f
This diff is collapsed.
Click to expand it.
Edu.Module.User/TeacherModule.cs
View file @
d76c738f
This diff is collapsed.
Click to expand it.
Edu.Repository/User/RB_AccountRepository.cs
View file @
d76c738f
...
...
@@ -253,6 +253,31 @@ FROM
{
where2
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
Employee_ViewModel
.
AccountType
),
query
.
AccountTypeStr
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartEntryTime
))
{
where
.
AppendFormat
(
" AND b.{0}>='{1}' "
,
nameof
(
Employee_ViewModel
.
EntryTime
),
query
.
StartEntryTime
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
EndEntryTime
))
{
where
.
AppendFormat
(
" AND b.{0}<='{1} 23:59:59' "
,
nameof
(
Employee_ViewModel
.
EntryTime
),
query
.
EndEntryTime
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartLeaveTime
))
{
where
.
AppendFormat
(
" AND b.{0}>='{1}' "
,
nameof
(
Employee_ViewModel
.
LeaveTime
),
query
.
StartLeaveTime
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
EndLeaveTime
))
{
where
.
AppendFormat
(
" AND b.{0}<='{1} 23:59:59' "
,
nameof
(
Employee_ViewModel
.
LeaveTime
),
query
.
EndLeaveTime
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartBirthDate
)
&&
!
string
.
IsNullOrEmpty
(
query
.
EndBirthDate
))
{
where
.
AppendFormat
(
@"AND (
CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(b.BirthDate,'%m-%d')) >= '{0}'
AND CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(b.BirthDate,'%m-%d')) <= '{1}'
)"
,
query
.
StartBirthDate
,
query
.
EndBirthDate
);
}
}
StringBuilder
builder
=
new
StringBuilder
();
...
...
Edu.ThirdCore/Message/MessageCore.cs
View file @
d76c738f
...
...
@@ -37,6 +37,7 @@ namespace Edu.ThirdCore.Message
{
case
"sms"
:
SendSMS
(
obj
);
break
;
default
:
break
;
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
d76c738f
...
...
@@ -640,7 +640,7 @@ namespace Edu.WebApi.Controllers.User
BirthDate
=
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
BirthDate
),
Education
=
qitem
.
Education
.
ToName
(),
LeaveStatus
=
qitem
.
LeaveStatus
.
ToName
(),
LeaveStatusValue
=
qitem
.
LeaveStatus
,
LeaveStatusValue
=
qitem
.
LeaveStatus
,
qitem
.
Account
,
qitem
.
AccountType
,
qitem
.
IsBirth
,
...
...
@@ -677,10 +677,116 @@ namespace Edu.WebApi.Controllers.User
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
extModel
.
School_Id
=
base
.
UserInfo
.
School_Id
;
//判断手机号码是否存在
bool
existPhoneResult
=
employeeModule
.
ExistPhone
(
extModel
);
if
(
existPhoneResult
)
{
return
ApiResult
.
Failed
(
"手机号码已存在"
);
}
bool
flag
=
employeeModule
.
SetEmployeeModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 修改员工的部门
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
UpdateEmployeeDept
()
{
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
Employee_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
School_Id
=
base
.
UserInfo
.
School_Id
;
bool
flag
=
employeeModule
.
SetEmployeeDeptModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 修改员工的岗位
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
UpdateEmployeePost
()
{
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
Employee_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
extModel
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
School_Id
=
base
.
UserInfo
.
School_Id
;
bool
flag
=
employeeModule
.
SetEmployeePostModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 修改员工的离职信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
UpdateEmployeeLeaveTime
()
{
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
Employee_ViewModel
>>(
RequestParm
.
Msg
.
ToString
());
extModel
.
ForEach
(
x
=>
x
.
UpdateTime
=
DateTime
.
Now
);
extModel
.
ForEach
(
x
=>
x
.
UpdateBy
=
base
.
UserInfo
.
Id
);
extModel
.
ForEach
(
x
=>
x
.
Group_Id
=
base
.
UserInfo
.
Group_Id
);
extModel
.
ForEach
(
x
=>
x
.
CreateBy
=
base
.
UserInfo
.
Id
);
extModel
.
ForEach
(
x
=>
x
.
School_Id
=
base
.
UserInfo
.
School_Id
);
bool
flag
=
employeeModule
.
SetEmployeeLeaveTimeModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 批量重置用户密码信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
BatchResetUserPassword
()
{
List
<
RB_Account_ViewModel
>
viewList
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Account_ViewModel
>>(
RequestParm
.
Msg
.
ToString
());
if
(
viewList
==
null
||
viewList
.
Where
(
x
=>
x
.
AccountType
>
0
).
Count
()
!=
viewList
.
Count
()
||
viewList
.
Where
(
x
=>
x
.
AccountId
>
0
).
Count
()
!=
viewList
.
Count
())
{
return
ApiResult
.
Failed
(
message
:
"参数不合法,请刷新页面重试"
);
}
else
{
bool
result
=
false
;
//生成随机新密码
var
newPwd
=
Common
.
Encrypt
.
PwHelper
.
MakePassword
(
8
);
if
(
int
.
TryParse
(
RequestParm
.
Uid
,
out
int
uid
))
{
viewList
.
ForEach
(
x
=>
x
.
Group_Id
=
UserReidsCache
.
GetUserLoginInfo
(
uid
).
Group_Id
);
result
=
accountModule
.
SetBatchResetPassword
(
viewList
,
newPwd
);
}
else
{
return
ApiResult
.
Failed
(
message
:
"身份信息不合法,请尝试重新登录"
);
}
if
(
result
)
{
return
ApiResult
.
Success
(
$"密码重置成功,用户新密码为【
{
newPwd
}
】,请复制保存"
);
}
else
{
return
ApiResult
.
Failed
(
message
:
"密码重置失败"
);
}
}
}
/// <summary>
/// 获取管理者实体
/// </summary>
...
...
@@ -889,7 +995,7 @@ namespace Edu.WebApi.Controllers.User
var
query
=
new
RB_Post_ViewModel
()
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
RB_Dept_Id
=
base
.
ParmJObj
.
GetInt
(
"RB_Dept_Id"
),
RB_Dept_Id
=
base
.
ParmJObj
.
GetInt
(
"RB_Dept_Id"
),
};
var
list
=
postModule
.
GetPostListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
...
...
@@ -981,7 +1087,7 @@ namespace Edu.WebApi.Controllers.User
qitem
.
PostName
}));
}
/// <summary>
/// 获取部门员工树形列表
/// </summary>
...
...
@@ -989,9 +1095,9 @@ namespace Edu.WebApi.Controllers.User
[
HttpPost
]
public
ApiResult
GetEmployeeAddrBook
()
{
var
query
=
new
RB_Department_ViewModel
()
var
query
=
new
RB_Department_ViewModel
()
{
Group_Id
=
base
.
ParmJObj
.
GetInt
(
"Group_Id"
),
Group_Id
=
base
.
ParmJObj
.
GetInt
(
"Group_Id"
),
};
var
list
=
departmentModule
.
GetDepartmentTreeModule
(
query
,
isQueryEmployee
:
true
);
return
ApiResult
.
Success
(
data
:
list
);
...
...
Edu.WebApi/appsettings.json
View file @
d76c738f
...
...
@@ -12,7 +12,7 @@
},
"JwtSecretKey"
:
"@VIITTOREBORN*2018"
,
"JwtExpirTime"
:
2592000
,
"IsSendMsg"
:
1
,
"IsSendMsg"
:
2
,
"AllowedHosts"
:
"*"
,
"OpenValidation"
:
"False"
,
"UploadSiteUrl"
:
"http://192.168.1.214:8120"
,
...
...
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