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
May 07, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
0f74a71e
Expand all
Show 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
...
@@ -15,5 +15,10 @@ namespace Edu.Model.ViewModel.Duty
/// 页面修改
/// 页面修改
/// </summary>
/// </summary>
public
List
<
string
>
FileList
{
get
;
set
;
}
public
List
<
string
>
FileList
{
get
;
set
;
}
/// <summary>
/// 值班计划编号【查询使用】
/// </summary>
public
string
QPlanIds
{
get
;
set
;
}
}
}
}
}
Edu.Module.Duty/DutyModule.cs
View file @
622ed4f0
...
@@ -76,7 +76,7 @@ namespace Edu.Module.Duty
...
@@ -76,7 +76,7 @@ namespace Edu.Module.Duty
/// </summary>
/// </summary>
/// <param name="model"></param>
/// <param name="model"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
SetDutyItemMod
el
(
RB_Duty_Item_ViewModel
model
)
public
bool
SetDutyItemMod
ule
(
RB_Duty_Item_ViewModel
model
)
{
{
if
(
model
.
Id
==
0
)
if
(
model
.
Id
==
0
)
{
{
...
@@ -97,6 +97,17 @@ namespace Edu.Module.Duty
...
@@ -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
#
endregion
...
...
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
...
@@ -39,10 +39,18 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Duty_Content_ViewModel
.
PlanId
),
query
.
PlanId
);
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
)
if
(
query
.
PlanShift
>
0
)
{
{
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Duty_Content_ViewModel
.
PlanShift
),
query
.
PlanShift
);
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
();
return
Get
<
RB_Duty_Content_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
...
...
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
View file @
622ed4f0
...
@@ -128,6 +128,14 @@ WHERE 1=1 AND A.`Status`=0
...
@@ -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
);
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
(
" GROUP BY A.Id,A.Date,C.SName,A.CreateBy,A.School_Id "
);
builder
.
AppendFormat
(
" ORDER BY A.Date ASC "
);
builder
.
AppendFormat
(
" ORDER BY A.Date ASC "
);
...
...
Edu.WebApi/Controllers/Duty/DutyController.cs
View file @
622ed4f0
...
@@ -229,14 +229,12 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -229,14 +229,12 @@ namespace Edu.WebApi.Controllers.Duty
return
ApiResult
.
Success
(
data
:
model
);
return
ApiResult
.
Success
(
data
:
model
);
}
}
/// <summary>
/// <summary>
///
获取班次列表
///
新增修改值班事项
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetSetDutyItemModel
()
public
ApiResult
SetDutyItem
()
{
{
var
query
=
new
RB_Duty_Item_ViewModel
()
var
query
=
new
RB_Duty_Item_ViewModel
()
{
{
...
@@ -251,10 +249,6 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -251,10 +249,6 @@ namespace Edu.WebApi.Controllers.Duty
{
{
return
ApiResult
.
Failed
(
"请输入值班事项名称"
);
return
ApiResult
.
Failed
(
"请输入值班事项名称"
);
}
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
Shifts
))
{
return
ApiResult
.
Failed
(
"请选择班次"
);
}
if
(!
query
.
ItemType
.
HasValue
||
(
int
)
query
.
ItemType
.
Value
<=
0
)
if
(!
query
.
ItemType
.
HasValue
||
(
int
)
query
.
ItemType
.
Value
<=
0
)
{
{
return
ApiResult
.
Failed
(
"请选择值班事项类型"
);
return
ApiResult
.
Failed
(
"请选择值班事项类型"
);
...
@@ -263,6 +257,10 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -263,6 +257,10 @@ namespace Edu.WebApi.Controllers.Duty
{
{
return
ApiResult
.
Failed
(
"请选择值班事项对应的学校"
);
return
ApiResult
.
Failed
(
"请选择值班事项对应的学校"
);
}
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
Shifts
))
{
return
ApiResult
.
Failed
(
"请选择班次"
);
}
if
(
query
.
Id
==
0
)
if
(
query
.
Id
==
0
)
{
{
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
query
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
@@ -270,12 +268,46 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -270,12 +268,46 @@ namespace Edu.WebApi.Controllers.Duty
}
}
query
.
UpdateBy
=
base
.
UserInfo
.
Id
;
query
.
UpdateBy
=
base
.
UserInfo
.
Id
;
query
.
UpdateTime
=
System
.
DateTime
.
Now
;
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>
...
...
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
622ed4f0
...
@@ -97,6 +97,8 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -97,6 +97,8 @@ namespace Edu.WebApi.Controllers.Duty
var
query
=
new
RB_Duty_Plan_ViewModel
()
var
query
=
new
RB_Duty_Plan_ViewModel
()
{
{
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
QStartDate
=
base
.
ParmJObj
.
GetStringValue
(
"StartDate"
),
QEndDate
=
base
.
ParmJObj
.
GetStringValue
(
"EndDate"
)
};
};
query
.
QDutyMan
=
base
.
UserInfo
.
Id
.
ToString
();
query
.
QDutyMan
=
base
.
UserInfo
.
Id
.
ToString
();
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
...
@@ -118,17 +120,7 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -118,17 +120,7 @@ namespace Edu.WebApi.Controllers.Duty
if
(
item
.
PlanDetails
!=
null
&&
item
.
PlanDetails
.
Count
>
0
)
if
(
item
.
PlanDetails
!=
null
&&
item
.
PlanDetails
.
Count
>
0
)
{
{
//当前值班人员索引
//当前值班人员索引
int
currentIndex
=
0
;
int
currentIndex
=
dutyPlanModule
.
CalcCurrentDutyManIndexModule
(
item
.
Date
,
item
.
PlanDetails
,
base
.
UserInfo
.
Id
);
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
previousIndex
=
currentIndex
-
1
;
int
previousIndex
=
currentIndex
-
1
;
//下一个班次索引
//下一个班次索引
...
@@ -147,21 +139,6 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -147,21 +139,6 @@ namespace Edu.WebApi.Controllers.Duty
nextModel
=
item
.
PlanDetails
[
nextIndex
];
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
result
.
Add
(
new
{
{
item
.
Id
,
item
.
Id
,
...
@@ -175,8 +152,8 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -175,8 +152,8 @@ namespace Edu.WebApi.Controllers.Duty
ReciveMan
=
nextModel
?.
DutyManName
??
""
,
ReciveMan
=
nextModel
?.
DutyManName
??
""
,
GiveMan
=
previousModel
?.
DutyManName
??
""
,
GiveMan
=
previousModel
?.
DutyManName
??
""
,
item
.
CreateByName
,
item
.
CreateByName
,
item
.
DutyStatus
,
currentModel
.
DutyStatus
,
item
.
DutyStatusStr
,
currentModel
.
DutyStatusStr
,
});
});
}
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
Count
=
rowsCount
;
...
...
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