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
982b291a
Commit
982b291a
authored
May 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口
parent
cc604b4a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
2 deletions
+90
-2
RB_Duty_Plan_ViewModel.cs
Edu.Model/ViewModel/Duty/RB_Duty_Plan_ViewModel.cs
+5
-2
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+63
-0
RB_Duty_PlanRepository.cs
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
+5
-0
RB_VisitorRepository.cs
Edu.Repository/Duty/RB_VisitorRepository.cs
+4
-0
DutyPlanController.cs
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
+13
-0
No files found.
Edu.Model/ViewModel/Duty/RB_Duty_Plan_ViewModel.cs
View file @
982b291a
...
...
@@ -36,8 +36,6 @@ namespace Edu.Model.ViewModel.Duty
/// </summary>
public
string
QDutyMan
{
get
;
set
;
}
/// <summary>
/// 班次
/// </summary>
...
...
@@ -75,5 +73,10 @@ namespace Edu.Model.ViewModel.Duty
/// 结束日期
/// </summary>
public
string
QEndDate
{
get
;
set
;
}
/// <summary>
/// 是否完成
/// </summary>
public
int
IsFinish
{
get
;
set
;
}
}
}
Edu.Module.Duty/DutyPlanModule.cs
View file @
982b291a
...
...
@@ -508,6 +508,69 @@ namespace Edu.Module.Duty
return
result
;
}
/// <summary>
/// 获取值班详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
object
GetDutyInfoModule
(
int
Id
)
{
object
result
=
new
object
();
var
model
=
GetMyDutyPlanPageModule
(
1
,
1
,
out
_
,
new
RB_Duty_Plan_ViewModel
()
{
Id
=
Id
})?.
FirstOrDefault
();
if
(
model
==
null
)
{
return
result
;
}
//获取所有的值班内容
var
contentList
=
duty_ContentRepository
.
GetDutyContentListRepository
(
new
RB_Duty_Content_ViewModel
()
{
PlanId
=
model
.
Id
});
foreach
(
var
item
in
contentList
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
FileURL
))
{
try
{
item
.
FileList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
item
.
FileURL
);
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetDutyInfoModule_FileList"
);
}
}
}
List
<
object
>
dayList
=
new
List
<
object
>();
foreach
(
var
item
in
model
.
PlanDetails
)
{
//访客列表
var
visitorList
=
GetVisitorPageModule
(
1
,
100000
,
out
_
,
new
RB_Visitor_ViewModel
()
{
PlanId
=
Id
,
CreateBy
=
item
.
DutyMan
});
dayList
.
Add
(
new
{
item
.
Shift
,
item
.
ShiftName
,
item
.
StartTime
,
item
.
EndTime
,
CheckTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
CheckTime
),
FinishTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
FinishTime
),
item
.
DutyMan
,
WorkList
=
contentList
.
Where
(
qitem
=>
qitem
.
PlanShift
==
item
.
Shift
&&
qitem
.
PlanType
==
1
)?.
ToList
(),
//突发事项列表
EmergenciesList
=
contentList
?.
Where
(
qitem
=>
qitem
.
PlanShift
==
item
.
Shift
&&
qitem
.
PlanType
==
3
)?.
ToList
()
??
new
List
<
RB_Duty_Content_ViewModel
>(),
//交接事项
HandoverList
=
contentList
?.
Where
(
qitem
=>
qitem
.
PlanShift
==
item
.
Shift
&&
qitem
.
PlanType
==
2
)?.
ToList
()
??
new
List
<
RB_Duty_Content_ViewModel
>(),
VisitorList
=
visitorList
,
});
}
result
=
new
{
model
?.
Id
,
PlanDate
=
Common
.
ConvertHelper
.
FormatDate
(
model
?.
Date
),
WeekDay
=
Common
.
ConvertHelper
.
GetWeekDay
(
model
?.
Date
),
model
?.
SchoolName
,
DayList
=
dayList
,
};
return
result
;
}
/// <summary>
/// 值班打卡/值班交接
/// </summary>
...
...
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
View file @
982b291a
...
...
@@ -82,6 +82,11 @@ WHERE 1=1
{
builder
.
AppendFormat
(
@" AND A.{0}<='{1} 23:59:59' "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
),
query
.
QEndDate
);
}
//查询已完成的值班
if
(
query
.
IsFinish
==
1
)
{
builder
.
AppendFormat
(
@" AND A.{0}<'{1}' "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
),
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
));
}
}
builder
.
AppendFormat
(
@" ORDER BY A.{0} ASC "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
));
return
GetPage
<
RB_Duty_Plan_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
...
...
Edu.Repository/Duty/RB_VisitorRepository.cs
View file @
982b291a
...
...
@@ -50,6 +50,10 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND (A.{0} LIKE @KeyWord OR A.{1} LIKE @KeyWord OR A.{2} LIKE @KeyWord)"
,
nameof
(
RB_Visitor_ViewModel
.
Name
),
nameof
(
RB_Visitor_ViewModel
.
Tel
),
nameof
(
RB_Visitor_ViewModel
.
WeChatNum
));
parameters
.
Add
(
"KeyWord"
,
"%"
+
query
.
KeyWords
.
Trim
()
+
"%"
);
}
if
(
query
.
CreateBy
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Visitor_ViewModel
.
CreateBy
),
query
.
CreateBy
);
}
}
return
GetPage
<
RB_Visitor_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
982b291a
...
...
@@ -36,6 +36,7 @@ namespace Edu.WebApi.Controllers.Duty
{
QStartDate
=
base
.
ParmJObj
.
GetStringValue
(
"StartDate"
),
QEndDate
=
base
.
ParmJObj
.
GetStringValue
(
"EndDate"
),
IsFinish
=
base
.
ParmJObj
.
GetInt
(
"IsFinish"
),
};
var
dutyManList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"EmployeeIds"
));
if
(
dutyManList
!=
null
&&
dutyManList
.
Count
>
0
)
...
...
@@ -244,6 +245,18 @@ namespace Edu.WebApi.Controllers.Duty
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
/// 获取值班详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetDutyInfo
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
obj
=
dutyPlanModule
.
GetDutyInfoModule
(
Id
);
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
/// 值班打卡/值班交接
/// </summary>
...
...
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