Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeoFlyApi
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GeoFly
GeoFlyApi
Commits
3bf49588
Commit
3bf49588
authored
Apr 22, 2025
by
gdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务统计修改bug
parent
7cdc2a09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
sample/src/main/java/com/dji/sample/wayline/service/impl/WaylineJobServiceImpl.java
+3
-2
No files found.
sample/src/main/java/com/dji/sample/wayline/service/impl/WaylineJobServiceImpl.java
View file @
3bf49588
...
...
@@ -447,7 +447,8 @@ public class WaylineJobServiceImpl implements IWaylineJobService {
if
(
timeType
==
1
)
{
// 按“周”分组
// 输出每周的分组
String
[]
weekLabels
=
{
"前六周"
,
"前五周"
,
"前四周"
,
"前三周"
,
"前两周"
,
"前一周"
,
"本周"
,
"后一周"
,
"后两周"
,
"后三周"
,
"后四周"
,
"后五周"
};
// String[] weekLabels = {"前六周", "前五周", "前四周", "前三周", "前两周", "前一周", "本周", "后一周", "后两周", "后三周", "后四周", "后五周"};
String
[]
weekLabels
=
{
"6 weeks ago"
,
"5 weeks ago"
,
"4 weeks ago"
,
"3 weeks ago"
,
"2 weeks ago"
,
"1 weeks ago"
,
"this week"
,
"1 week later"
,
"2 week later"
,
"3 week later"
,
"4 week later"
,
"5 week later"
};
// 获取当前日期和周的起始日期(周一)
WeekFields
weekFields
=
WeekFields
.
of
(
Locale
.
getDefault
());
// 获取当前地区的周规则
...
...
@@ -465,7 +466,7 @@ public class WaylineJobServiceImpl implements IWaylineJobService {
// 获取每个日期所在的周的起始日期(周一)
LocalDate
startOfCurrentWeek
=
curDate
.
with
(
weekFields
.
dayOfWeek
(),
1
);
// 计算这个周属于第几组,负数为前面几周,正数为后面几周
int
weekIndex
=
(
int
)
startOf
CurrentWeek
.
until
(
startOf
Week
,
java
.
time
.
temporal
.
ChronoUnit
.
WEEKS
);
int
weekIndex
=
(
int
)
startOf
Week
.
until
(
startOfCurrent
Week
,
java
.
time
.
temporal
.
ChronoUnit
.
WEEKS
);
// 确保index在-6到+5之间(即12个周)
if
(
weekIndex
>=
-
6
&&
weekIndex
<=
5
)
{
// 将日期添加到相应的周组
...
...
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