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
8f9b01e2
Commit
8f9b01e2
authored
May 08, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
561a6022
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
12 deletions
+37
-12
RB_Duty_Plan_ViewModel.cs
Edu.Model/ViewModel/Duty/RB_Duty_Plan_ViewModel.cs
+5
-0
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+21
-0
RB_Duty_PlanRepository.cs
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
+2
-2
DutyPlanController.cs
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
+9
-10
No files found.
Edu.Model/ViewModel/Duty/RB_Duty_Plan_ViewModel.cs
View file @
8f9b01e2
...
...
@@ -78,5 +78,10 @@ namespace Edu.Model.ViewModel.Duty
/// 是否完成
/// </summary>
public
int
IsFinish
{
get
;
set
;
}
/// <summary>
/// 详情编号
/// </summary>
public
int
DetailId
{
get
;
set
;
}
}
}
Edu.Module.Duty/DutyPlanModule.cs
View file @
8f9b01e2
...
...
@@ -726,6 +726,27 @@ namespace Edu.Module.Duty
return
currentIndex
;
}
/// <summary>
/// 计算当前值班人员索引
/// </summary>
/// <param name="planDate">值班日期</param>
/// <param name="PlanDetails">值班班次列表</param>
/// <param name="dutyManId">值班人</param>
/// <returns></returns>
public
int
CalcCurrentDutyManIndexModule_V2
(
RB_Duty_Plan_ViewModel
model
)
{
//当前值班人员索引
int
currentIndex
=
0
;
for
(
var
i
=
0
;
i
<
model
.
PlanDetails
.
Count
;
i
++)
{
if
(
model
.
DetailId
==
model
.
PlanDetails
[
i
].
Id
)
{
currentIndex
=
i
;
}
}
return
currentIndex
;
}
/// <summary>
/// 获取值班详情
/// </summary>
...
...
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
View file @
8f9b01e2
...
...
@@ -105,7 +105,7 @@ WHERE 1=1
rowsCount
=
0
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.ID,A.Date,IFNULL(C.SName,'') AS SchoolName,A.CreateBy,A.School_Id
SELECT A.ID,A.Date,IFNULL(C.SName,'') AS SchoolName,A.CreateBy,A.School_Id
,B.Id AS DetailId
FROM RB_Duty_Plan AS A INNER JOIN rb_duty_plandetails AS B ON A.Id=B.PlanId
INNER JOIN rb_school AS C ON A.School_Id=C.SId
WHERE 1=1 AND A.`Status`=0
...
...
@@ -137,7 +137,7 @@ WHERE 1=1 AND A.`Status`=0
builder
.
AppendFormat
(
@" AND A.{0}<='{1} 23:59:59' "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
),
query
.
QEndDate
);
}
}
builder
.
AppendFormat
(
" GROUP BY A.Id,A.Date,C.SName,A.CreateBy,A.School_Id "
);
builder
.
AppendFormat
(
" GROUP BY A.Id,A.Date,C.SName,A.CreateBy,A.School_Id
,B.Id
"
);
builder
.
AppendFormat
(
" ORDER BY A.Date ASC "
);
return
GetPage
<
RB_Duty_Plan_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
...
...
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
8f9b01e2
...
...
@@ -120,8 +120,7 @@ namespace Edu.WebApi.Controllers.Duty
int
currentIndex
=
0
;
if
(
item
.
PlanDetails
!=
null
&&
item
.
PlanDetails
.
Count
>
0
)
{
currentIndex
=
dutyPlanModule
.
CalcCurrentDutyManIndexModule
(
item
.
Date
,
item
.
PlanDetails
,
base
.
UserInfo
.
Id
);
currentIndex
=
dutyPlanModule
.
CalcCurrentDutyManIndexModule_V2
(
item
);
//上一个班次索引
int
previousIndex
=
currentIndex
-
1
;
//下一个班次索引
...
...
@@ -140,16 +139,16 @@ namespace Edu.WebApi.Controllers.Duty
nextModel
=
item
.
PlanDetails
[
nextIndex
];
}
}
string
Give
Man
=
""
;
//交班人
string
Recive
Man
=
""
;
//接班人
if
(
currentIndex
!=
0
)
string
jiaoBan
Man
=
""
;
//交班人
string
jieBan
Man
=
""
;
//接班人
if
(
nextModel
!=
null
&&
nextModel
.
Id
>
0
)
{
GiveMan
=
previous
Model
?.
DutyManName
??
""
;
jieBanMan
=
next
Model
?.
DutyManName
??
""
;
}
if
(
currentIndex
!=
item
.
PlanDetails
.
Count
-
1
)
if
(
previousModel
!=
null
&&
previousModel
.
Id
>
0
)
{
ReciveMan
=
next
Model
?.
DutyManName
??
""
;
jiaoBanMan
=
previous
Model
?.
DutyManName
??
""
;
}
result
.
Add
(
new
{
...
...
@@ -161,8 +160,8 @@ namespace Edu.WebApi.Controllers.Duty
currentModel
.
StartTime
,
currentModel
.
EndTime
,
PlanList
=
currentModel
?.
DutyItemList
??
new
List
<
RB_Duty_Item_ViewModel
>(),
ReciveMan
,
GiveMan
,
ReciveMan
=
jieBanMan
,
GiveMan
=
jiaoBanMan
,
item
.
CreateByName
,
currentModel
.
DutyStatus
,
currentModel
.
DutyStatusStr
,
...
...
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