Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
41ac6cc3
Commit
41ac6cc3
authored
May 17, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据看板2
parent
226693a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
ch-core/src/main/java/com/wwdz/ch/core/consts/DashbordEnum.java
...e/src/main/java/com/wwdz/ch/core/consts/DashbordEnum.java
+26
-14
No files found.
ch-core/src/main/java/com/wwdz/ch/core/consts/DashbordEnum.java
View file @
41ac6cc3
package
com.wwdz.ch.core.consts
;
import
com.wwdz.ch.core.util.TimeUtil
;
import
javafx.util.Pair
;
import
java.util.function.Consumer
;
import
java.util.function.Function
;
import
java.util.function.Supplier
;
public
class
DashbordEnum
{
...
...
@@ -11,22 +10,20 @@ public class DashbordEnum {
* 分销订单状态
*/
public
enum
TypeEnum
{
YESTERDAY
(
1
,
"昨日"
,
TimeUtil:
:
getYesterDayDate
),
CURRENT_WEEK
(
2
,
"本周"
,
TimeUtil:
:
getCurrentWeekDate
),
CURRENT_MONTH
(
3
,
"本月"
,
TimeUtil:
:
getCurrentMonthDate
),
LAST_WEEK
(
4
,
"上周"
,
TimeUtil:
:
getLastWeekDate
),
LAST_MONTH
(
5
,
"上月"
,
TimeUtil:
:
getLastMonthDate
),
YESTERDAY
(
1
,
"昨日"
),
CURRENT_WEEK
(
2
,
"本周"
),
CURRENT_MONTH
(
3
,
"本月"
),
LAST_WEEK
(
4
,
"上周"
),
LAST_MONTH
(
5
,
"上月"
),
;
private
int
code
;
private
String
des
;
private
Supplier
supplier
;
TypeEnum
(
int
code
,
String
des
,
Supplier
supplier
)
{
TypeEnum
(
int
code
,
String
des
)
{
this
.
code
=
code
;
this
.
des
=
des
;
this
.
supplier
=
supplier
;
}
public
static
String
getNameByCode
(
int
code
)
{
...
...
@@ -38,17 +35,32 @@ public class DashbordEnum {
return
null
;
}
public
static
Supplier
getFunctionByCode
(
int
code
)
{
public
static
TypeEnum
getEnumByCode
(
int
code
)
{
for
(
DashbordEnum
.
TypeEnum
typeEnum
:
DashbordEnum
.
TypeEnum
.
values
())
{
if
(
code
==
typeEnum
.
getCode
())
{
return
typeEnum
.
getSupplier
()
;
return
typeEnum
;
}
}
return
null
;
}
public
Supplier
getSupplier
()
{
return
supplier
;
public
Pair
getData
()
{
switch
(
this
)
{
case
YESTERDAY:
return
TimeUtil
.
getYesterDayDate
();
case
CURRENT_WEEK:
return
TimeUtil
.
getCurrentWeekDate
();
case
CURRENT_MONTH:
return
TimeUtil
.
getCurrentMonthDate
();
case
LAST_WEEK:
return
TimeUtil
.
getLastWeekDate
();
case
LAST_MONTH:
return
TimeUtil
.
getLastMonthDate
();
default
:
return
null
;
}
}
public
int
getCode
()
{
...
...
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