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
622ed4f0
Commit
622ed4f0
authored
3 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
0f74a71e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
223 additions
and
112 deletions
+223
-112
RB_Duty_Content_ViewModel.cs
Edu.Model/ViewModel/Duty/RB_Duty_Content_ViewModel.cs
+5
-0
DutyModule.cs
Edu.Module.Duty/DutyModule.cs
+12
-1
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+142
-72
RB_Duty_ContentRepository.cs
Edu.Repository/Duty/RB_Duty_ContentRepository.cs
+8
-0
RB_Duty_PlanRepository.cs
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
+8
-0
DutyController.cs
Edu.WebApi/Controllers/Duty/DutyController.cs
+43
-11
DutyPlanController.cs
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
+5
-28
No files found.
Edu.Model/ViewModel/Duty/RB_Duty_Content_ViewModel.cs
View file @
622ed4f0
...
...
@@ -15,5 +15,10 @@ namespace Edu.Model.ViewModel.Duty
/// 页面修改
/// </summary>
public
List
<
string
>
FileList
{
get
;
set
;
}
/// <summary>
/// 值班计划编号【查询使用】
/// </summary>
public
string
QPlanIds
{
get
;
set
;
}
}
}
This diff is collapsed.
Click to expand it.
Edu.Module.Duty/DutyModule.cs
View file @
622ed4f0
...
...
@@ -76,7 +76,7 @@ namespace Edu.Module.Duty
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetDutyItemMod
el
(
RB_Duty_Item_ViewModel
model
)
public
bool
SetDutyItemMod
ule
(
RB_Duty_Item_ViewModel
model
)
{
if
(
model
.
Id
==
0
)
{
...
...
@@ -97,6 +97,17 @@ namespace Edu.Module.Duty
}
}
/// <summary>
/// 根据编号获取值班事项信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Duty_Item_ViewModel
GetDutyItemModule
(
int
Id
)
{
var
model
=
dutyItemRepository
.
GetEntity
<
RB_Duty_Item_ViewModel
>(
Id
);
return
model
;
}
#
endregion
...
...
This diff is collapsed.
Click to expand it.
Edu.Module.Duty/DutyPlanModule.cs
View file @
622ed4f0
This diff is collapsed.
Click to expand it.
Edu.Repository/Duty/RB_Duty_ContentRepository.cs
View file @
622ed4f0
...
...
@@ -39,10 +39,18 @@ WHERE 1=1
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Duty_Content_ViewModel
.
PlanId
),
query
.
PlanId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QPlanIds
))
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Duty_Content_ViewModel
.
PlanId
),
query
.
QPlanIds
);
}
if
(
query
.
PlanShift
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Duty_Content_ViewModel
.
PlanShift
),
query
.
PlanShift
);
}
if
(
query
.
PlanType
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Duty_Content_ViewModel
.
PlanType
),
query
.
PlanType
);
}
}
return
Get
<
RB_Duty_Content_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
...
...
This diff is collapsed.
Click to expand it.
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
View file @
622ed4f0
...
...
@@ -128,6 +128,14 @@ WHERE 1=1 AND A.`Status`=0
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Id
),
query
.
Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QStartDate
))
{
builder
.
AppendFormat
(
@" AND A.{0}>='{1}' "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
),
query
.
QStartDate
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QEndDate
))
{
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
(
" ORDER BY A.Date ASC "
);
...
...
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Duty/DutyController.cs
View file @
622ed4f0
...
...
@@ -229,14 +229,12 @@ namespace Edu.WebApi.Controllers.Duty
return
ApiResult
.
Success
(
data
:
model
);
}
/// <summary>
///
获取班次列表
///
新增修改值班事项
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSetDutyItemModel
()
public
ApiResult
SetDutyItem
()
{
var
query
=
new
RB_Duty_Item_ViewModel
()
{
...
...
@@ -251,10 +249,6 @@ namespace Edu.WebApi.Controllers.Duty
{
return
ApiResult
.
Failed
(
"请输入值班事项名称"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
Shifts
))
{
return
ApiResult
.
Failed
(
"请选择班次"
);
}
if
(!
query
.
ItemType
.
HasValue
||
(
int
)
query
.
ItemType
.
Value
<=
0
)
{
return
ApiResult
.
Failed
(
"请选择值班事项类型"
);
...
...
@@ -263,6 +257,10 @@ namespace Edu.WebApi.Controllers.Duty
{
return
ApiResult
.
Failed
(
"请选择值班事项对应的学校"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
Shifts
))
{
return
ApiResult
.
Failed
(
"请选择班次"
);
}
if
(
query
.
Id
==
0
)
{
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
...
@@ -270,14 +268,48 @@ namespace Edu.WebApi.Controllers.Duty
}
query
.
UpdateBy
=
base
.
UserInfo
.
Id
;
query
.
UpdateTime
=
System
.
DateTime
.
Now
;
bool
retult
=
dutyModule
.
SetDutyItemModule
(
query
);
return
retult
?
ApiResult
.
Success
(
""
)
:
ApiResult
.
Failed
(
""
);
}
bool
retult
=
dutyModule
.
SetDutyItemModel
(
query
);
return
retult
?
ApiResult
.
Success
(
"新增/修改值班事项成功"
)
:
ApiResult
.
Failed
(
"新增/修改值班事项失败"
);
/// <summary>
/// 根据编号获取值班事项
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetDutyItem
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
,
0
);
var
model
=
dutyModule
.
GetDutyItemModule
(
Id
);
var
obj
=
new
object
();
if
(
model
!=
null
&&
model
.
Id
>
0
)
{
List
<
string
>
SchoolList
=
new
List
<
string
>();
List
<
string
>
ShiftList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
model
?.
ItemSchools
))
{
SchoolList
=
Common
.
ConvertHelper
.
StringToFileList
(
model
?.
ItemSchools
);
}
if
(!
string
.
IsNullOrEmpty
(
model
?.
Shifts
))
{
ShiftList
=
Common
.
ConvertHelper
.
StringToFileList
(
model
?.
Shifts
);
}
obj
=
new
{
model
.
Id
,
model
?.
ItemName
,
ItemType
=
(
model
?.
ItemType
??
0
),
model
?.
ItemSchools
,
SchoolList
,
model
?.
Shifts
,
ShiftList
,
};
}
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
/// 删除值班事项
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
622ed4f0
...
...
@@ -97,6 +97,8 @@ namespace Edu.WebApi.Controllers.Duty
var
query
=
new
RB_Duty_Plan_ViewModel
()
{
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
QStartDate
=
base
.
ParmJObj
.
GetStringValue
(
"StartDate"
),
QEndDate
=
base
.
ParmJObj
.
GetStringValue
(
"EndDate"
)
};
query
.
QDutyMan
=
base
.
UserInfo
.
Id
.
ToString
();
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
...
...
@@ -118,17 +120,7 @@ namespace Edu.WebApi.Controllers.Duty
if
(
item
.
PlanDetails
!=
null
&&
item
.
PlanDetails
.
Count
>
0
)
{
//当前值班人员索引
int
currentIndex
=
0
;
var
currentDayNow
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
));
for
(
var
i
=
0
;
i
<
item
.
PlanDetails
.
Count
;
i
++)
{
var
sStartTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
item
.
PlanDetails
[
i
].
StartTime
);
var
sEndTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
item
.
PlanDetails
[
i
].
EndTime
);
if
(
currentDayNow
>=
sStartTime
&&
currentDayNow
<=
sEndTime
&&
item
.
PlanDetails
[
i
].
DutyMan
==
base
.
UserInfo
.
Id
)
{
currentIndex
=
i
;
}
}
int
currentIndex
=
dutyPlanModule
.
CalcCurrentDutyManIndexModule
(
item
.
Date
,
item
.
PlanDetails
,
base
.
UserInfo
.
Id
);
//上一个班次索引
int
previousIndex
=
currentIndex
-
1
;
//下一个班次索引
...
...
@@ -147,21 +139,6 @@ namespace Edu.WebApi.Controllers.Duty
nextModel
=
item
.
PlanDetails
[
nextIndex
];
}
}
var
dutyStartTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
currentModel
.
StartTime
);
var
dutyEndTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
currentModel
.
EndTime
);
if
(
DateTime
.
Now
>
dutyEndTime
)
{
item
.
DutyStatus
=
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
DutyFinished
;
}
else
if
(
DateTime
.
Now
>=
dutyStartTime
&&
DateTime
.
Now
<=
dutyEndTime
)
{
item
.
DutyStatus
=
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
DutyIng
;
}
else
{
item
.
DutyStatus
=
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
NoStart
;
}
result
.
Add
(
new
{
item
.
Id
,
...
...
@@ -175,8 +152,8 @@ namespace Edu.WebApi.Controllers.Duty
ReciveMan
=
nextModel
?.
DutyManName
??
""
,
GiveMan
=
previousModel
?.
DutyManName
??
""
,
item
.
CreateByName
,
item
.
DutyStatus
,
item
.
DutyStatusStr
,
currentModel
.
DutyStatus
,
currentModel
.
DutyStatusStr
,
});
}
pageModel
.
Count
=
rowsCount
;
...
...
This diff is collapsed.
Click to expand it.
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