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
8b147012
Commit
8b147012
authored
May 25, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
700413a1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
38 deletions
+55
-38
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+44
-0
RB_Duty_PlanRepository.cs
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
+8
-1
DutyPlanController.cs
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
+2
-0
TimerJobj.cs
Edu.WebApi/Timers/TimerJobj.cs
+1
-37
No files found.
Edu.Module.Duty/DutyPlanModule.cs
View file @
8b147012
...
@@ -1112,5 +1112,49 @@ namespace Edu.Module.Duty
...
@@ -1112,5 +1112,49 @@ namespace Edu.Module.Duty
{
{
return
visitorRepository
.
GetVisitorCountRepository
(
model
);
return
visitorRepository
.
GetVisitorCountRepository
(
model
);
}
}
/// <summary>
/// 更新值班【未值班,值班未打卡】状态
/// </summary>
public
void
UpdateDutyModule
()
{
double
addhours
=
1.5
;
var
list
=
GetDutyPlanPageModule
(
1
,
20
,
out
_
,
new
Model
.
ViewModel
.
Duty
.
RB_Duty_Plan_ViewModel
()
{
QDutyStatus
=
0
,
QEndDate
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
.
AddDays
(
1
))
});
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
foreach
(
var
subItem
in
item
.
PlanDetails
)
{
var
endTime
=
Convert
.
ToDateTime
((
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
subItem
.
EndTime
)).
AddHours
(
addhours
);
if
(
subItem
.
Status
==
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
NoStart
&&
endTime
<
DateTime
.
Now
)
{
UpdateNoDutyModule
(
subItem
.
Id
);
}
}
}
}
var
list2
=
GetDutyPlanPageModule
(
1
,
20
,
out
_
,
new
Model
.
ViewModel
.
Duty
.
RB_Duty_Plan_ViewModel
()
{
QDutyStatus
=
1
,
QEndDate
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
)
});
foreach
(
var
item
in
list2
)
{
foreach
(
var
subItem
in
item
.
PlanDetails
)
{
var
endTime
=
Convert
.
ToDateTime
((
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
subItem
.
EndTime
)).
AddHours
(
addhours
);
if
(
subItem
.
Status
==
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
DutyIng
&&
endTime
<
DateTime
.
Now
)
{
UpdateDutyFinishedModule
(
subItem
.
Id
);
}
}
}
}
}
}
}
}
Edu.Repository/Duty/RB_Duty_PlanRepository.cs
View file @
8b147012
...
@@ -118,7 +118,14 @@ WHERE 1=1
...
@@ -118,7 +118,14 @@ WHERE 1=1
builder
.
AppendFormat
(
@" AND A.{0}<'{1}' "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
),
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
));
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
));
if
(
query
.
IsFinish
==
1
)
{
builder
.
AppendFormat
(
@" ORDER BY A.{0} DESC "
,
nameof
(
RB_Duty_Plan_ViewModel
.
Date
));
}
else
{
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
();
return
GetPage
<
RB_Duty_Plan_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
}
...
...
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
8b147012
...
@@ -56,6 +56,7 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -56,6 +56,7 @@ namespace Edu.WebApi.Controllers.Duty
query
.
SchoolIdList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"School_Ids"
));
query
.
SchoolIdList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"School_Ids"
));
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
List
<
object
>
result
=
new
List
<
object
>();
List
<
object
>
result
=
new
List
<
object
>();
dutyPlanModule
.
UpdateDutyModule
();
var
list
=
dutyPlanModule
.
GetDutyPlanPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
dutyPlanModule
.
GetDutyPlanPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
...
@@ -108,6 +109,7 @@ namespace Edu.WebApi.Controllers.Duty
...
@@ -108,6 +109,7 @@ namespace Edu.WebApi.Controllers.Duty
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetMyDutyPlanPage
()
public
ApiResult
GetMyDutyPlanPage
()
{
{
dutyPlanModule
.
UpdateDutyModule
();
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Duty_Plan_ViewModel
()
var
query
=
new
RB_Duty_Plan_ViewModel
()
{
{
...
...
Edu.WebApi/Timers/TimerJobj.cs
View file @
8b147012
...
@@ -101,45 +101,9 @@ namespace Edu.WebApi.Timers
...
@@ -101,45 +101,9 @@ namespace Edu.WebApi.Timers
/// <param name="e"></param>
/// <param name="e"></param>
public
static
void
DealDuty
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
public
static
void
DealDuty
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
{
double
addhours
=
1.5
;
if
(
Interlocked
.
Exchange
(
ref
inTimer2
,
1
)
==
0
)
if
(
Interlocked
.
Exchange
(
ref
inTimer2
,
1
)
==
0
)
{
{
var
list
=
dutyPlanModule
.
GetDutyPlanPageModule
(
1
,
20
,
out
_
,
new
Model
.
ViewModel
.
Duty
.
RB_Duty_Plan_ViewModel
()
dutyPlanModule
.
UpdateDutyModule
();
{
QDutyStatus
=
0
,
QEndDate
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
.
AddDays
(
1
))
});
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
foreach
(
var
subItem
in
item
.
PlanDetails
)
{
var
endTime
=
Convert
.
ToDateTime
((
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
subItem
.
EndTime
)).
AddHours
(
addhours
);
if
(
subItem
.
Status
==
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
NoStart
&&
endTime
<
DateTime
.
Now
)
{
dutyPlanModule
.
UpdateNoDutyModule
(
subItem
.
Id
);
}
}
}
}
var
list2
=
dutyPlanModule
.
GetDutyPlanPageModule
(
1
,
20
,
out
_
,
new
Model
.
ViewModel
.
Duty
.
RB_Duty_Plan_ViewModel
()
{
QDutyStatus
=
1
,
QEndDate
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
)
});
foreach
(
var
item
in
list2
)
{
foreach
(
var
subItem
in
item
.
PlanDetails
)
{
var
endTime
=
Convert
.
ToDateTime
((
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
+
" "
+
subItem
.
EndTime
)).
AddHours
(
addhours
);
if
(
subItem
.
Status
==
Common
.
Enum
.
Duty
.
DutyStatusEnum
.
DutyIng
&&
endTime
<
DateTime
.
Now
)
{
dutyPlanModule
.
UpdateDutyFinishedModule
(
subItem
.
Id
);
}
}
}
Interlocked
.
Exchange
(
ref
inTimer2
,
0
);
Interlocked
.
Exchange
(
ref
inTimer2
,
0
);
}
}
}
}
...
...
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