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
a339a4e5
Commit
a339a4e5
authored
Apr 28, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
308279fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
0 deletions
+76
-0
RB_Duty_Config_ViewModel.cs
Edu.Model/ViewModel/Duty/RB_Duty_Config_ViewModel.cs
+5
-0
DutyModule.cs
Edu.Module.Duty/DutyModule.cs
+26
-0
RB_Duty_ConfigRepository.cs
Edu.Repository/Duty/RB_Duty_ConfigRepository.cs
+39
-0
DutyController.cs
Edu.WebApi/Controllers/Duty/DutyController.cs
+6
-0
No files found.
Edu.Model/ViewModel/Duty/RB_Duty_Config_ViewModel.cs
View file @
a339a4e5
...
...
@@ -24,5 +24,10 @@ namespace Edu.Model.ViewModel.Duty
/// 班次
/// </summary>
public
string
ShiftsName
{
get
;
set
;
}
/// <summary>
/// 值班人员名称
/// </summary>
public
string
EmployeeName
{
get
;
set
;
}
}
}
Edu.Module.Duty/DutyModule.cs
View file @
a339a4e5
...
...
@@ -13,6 +13,10 @@ namespace Edu.Module.Duty
private
readonly
RB_Duty_FrequencyRepository
dutyFrequencyRepository
=
new
RB_Duty_FrequencyRepository
();
private
readonly
RB_Duty_ItemRepository
dutyItemRepository
=
new
RB_Duty_ItemRepository
();
/// <summary>
/// 账号管理处理类对象
/// </summary>
private
readonly
Repository
.
User
.
RB_AccountRepository
accountRepository
=
new
Repository
.
User
.
RB_AccountRepository
();
#
region
值班事项管理
/// <summary>
/// 获取值班事项设置列表
...
...
@@ -96,11 +100,33 @@ namespace Edu.Module.Duty
if
(
list
!=
null
&&
list
.
Any
())
{
string
uids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
EmployeeIds
));
var
userList
=
accountRepository
.
GetEmployeeListRepository
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
{
Group_Id
=
query
.
Group_Id
,
QIds
=
uids
});
foreach
(
var
item
in
list
)
{
string
userNames
=
""
;
foreach
(
var
itemUser
in
item
.
EmployeeIds
.
Split
(
","
))
{
userNames
+=
userList
.
Where
(
x
=>
x
.
Id
.
ToString
()
==
itemUser
).
FirstOrDefault
()?.
EmployeeName
+
"|"
;
}
item
.
EmployeeName
=
userNames
.
TrimEnd
(
'|'
);
}
}
return
list
;
}
/// <summary>
/// 获取值班设置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Duty_Config_ViewModel
>
GetDutyConfigList
(
RB_Duty_Config_ViewModel
query
)
{
return
dutyConfigRepository
.
GetDutyConfigList
(
query
);
}
/// <summary>
/// 删除值班设置
/// </summary>
...
...
Edu.Repository/Duty/RB_Duty_ConfigRepository.cs
View file @
a339a4e5
...
...
@@ -75,5 +75,44 @@ namespace Edu.Repository.Duty
}
return
Get
<
RB_Duty_Config_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取值班设置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Duty_Config_ViewModel
>
GetDutyConfigList
(
RB_Duty_Config_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" SELECT A.* FROM RB_Duty_Config AS A WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Duty_Config_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Duty_Config_ViewModel
.
Id
),
query
.
Id
);
}
if
(
query
.
School_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Duty_Config_ViewModel
.
School_Id
),
query
.
School_Id
);
}
if
(
query
.
Status
>=
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Duty_Config_ViewModel
.
Status
),
(
int
)
query
.
Status
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
MachineCode
))
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Duty_Config_ViewModel
.
MachineCode
),
query
.
MachineCode
);
}
}
return
Get
<
RB_Duty_Config_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Edu.WebApi/Controllers/Duty/DutyController.cs
View file @
a339a4e5
...
...
@@ -406,6 +406,12 @@ namespace Edu.WebApi.Controllers.Duty
{
return
ApiResult
.
Failed
(
"请输入值班机器码"
);
}
var
oldList
=
dutyModule
.
GetDutyConfigList
(
new
RB_Duty_Config_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
MachineCode
=
query
.
MachineCode
});
if
(
oldList
!=
null
&&
oldList
.
Any
(
x
=>
x
.
Id
!=
query
.
Id
))
{
return
ApiResult
.
Failed
(
"机器码已存在"
);
}
if
(
query
.
Id
==
0
)
{
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
...
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