Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
893a37bc
"...operation_platform.git" did not exist on "c7f2ac8905ad7d9f3caf10af60a6daf4eb2f8835"
Commit
893a37bc
authored
Apr 07, 2025
by
zhuxiang
Browse files
当前月只可查看上个月的数据
parent
d04dcfd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/service/impl/ReportDataInfoServiceImpl.java
View file @
893a37bc
...
@@ -45,7 +45,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
...
@@ -45,7 +45,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
// 获取当前日期
// 获取当前日期
LocalDate
now
=
LocalDate
.
now
();
LocalDate
now
=
LocalDate
.
now
();
// 获取当前月份(1 到 12)
// 获取当前月份(1 到 12)
int
currentMonth
=
now
.
getMonthValue
();
int
currentMonth
=
now
.
getMonthValue
()
-
1
;
reportDataInfoDTO
.
setMonth
(
currentMonth
);
reportDataInfoDTO
.
setMonth
(
currentMonth
);
return
baseMapper
.
queryList
(
reportDataInfoDTO
);
return
baseMapper
.
queryList
(
reportDataInfoDTO
);
}
}
...
...
src/main/java/com/ruzhoukj/sms/service/impl/UserPerformanceServiceImpl.java
View file @
893a37bc
...
@@ -25,11 +25,14 @@ public class UserPerformanceServiceImpl extends ServiceImpl<UserPerformanceDao,
...
@@ -25,11 +25,14 @@ public class UserPerformanceServiceImpl extends ServiceImpl<UserPerformanceDao,
@Override
@Override
public
List
<
UserPerformanceVO
>
queryList
(
UserPerformanceDTO
userPerformanceDTO
)
{
public
List
<
UserPerformanceVO
>
queryList
(
UserPerformanceDTO
userPerformanceDTO
)
{
//获取当前年月
//获取当前年月
// 获取当前日期
LocalDate
now
=
LocalDate
.
now
();
LocalDate
now
=
LocalDate
.
now
();
// 获取上个月的日期
LocalDate
lastMonth
=
now
.
minusMonths
(
1
);
// 格式化为 "yyyy-MM"
// 格式化为 "yyyy-MM"
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
String
curren
tYearMonth
=
now
.
format
(
formatter
);
String
las
tYearMonth
=
lastMonth
.
format
(
formatter
);
userPerformanceDTO
.
setPerformanceDate
(
curren
tYearMonth
);
userPerformanceDTO
.
setPerformanceDate
(
las
tYearMonth
);
return
baseMapper
.
queryList
(
userPerformanceDTO
);
return
baseMapper
.
queryList
(
userPerformanceDTO
);
}
}
}
}
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