Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a098dffd
authored
Jun 13, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单条容量查询,返回lengend;
1 parent
7f9f686a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityQueryOrderRespDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/CapacityQueryServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/CapacityQueryOrderRespDTO.java
View file @
a098dff
...
...
@@ -18,7 +18,7 @@ public class CapacityQueryOrderRespDTO {
@Data
@Accessors
(
chain
=
true
)
public
static
class
LegendDTO
{
private
int
type
;
private
Integer
type
;
private
String
memo
;
}
...
...
@@ -36,6 +36,6 @@ public class CapacityQueryOrderRespDTO {
private
String
text
;
private
String
begin
;
private
String
end
;
private
int
type
;
private
Integer
type
;
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/CapacityQueryServiceImpl.java
View file @
a098dff
...
...
@@ -83,10 +83,18 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
CapacityQueryOrderRespDTO
capacityQueryRespDTO
=
new
CapacityQueryOrderRespDTO
();
capacityQueryRespDTO
.
setBeginDate
(
reqDTO
.
getBeginDate
()).
setEndDate
(
reqDTO
.
getEndDate
());
capacityQueryRespDTO
.
setCalendar
(
getTeamCaparityByLayerAndDays
(
teamId
,
layer
,
reqDTO
.
getBeginDate
(),
reqDTO
.
getEndDate
()));
capacityQueryRespDTO
.
setLegend
(
getLengends
());
capacityQueryRespDTO
.
setRemark
(
String
.
format
(
"%s-%s"
,
teamId
,
layer
));
return
Result
.
success
(
capacityQueryRespDTO
);
}
private
List
<
CapacityQueryOrderRespDTO
.
LegendDTO
>
getLengends
()
{
List
<
CapacityQueryOrderRespDTO
.
LegendDTO
>
legends
=
new
ArrayList
<>();
legends
.
add
(
new
CapacityQueryOrderRespDTO
.
LegendDTO
().
setType
(
1
).
setMemo
(
"剩余30%以上"
));
legends
.
add
(
new
CapacityQueryOrderRespDTO
.
LegendDTO
().
setType
(
2
).
setMemo
(
"剩余60%以上"
));
legends
.
add
(
new
CapacityQueryOrderRespDTO
.
LegendDTO
().
setType
(
3
).
setMemo
(
"剩余30%以内"
));
return
legends
;
}
@Override
public
Result
<?>
getTeamStatData
(
CapacityStatQueryReqDTO
capacityStatQueryReqDTO
)
{
Page
<?>
stats
=
null
;
...
...
@@ -250,7 +258,7 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
DateTimeFormatter
dateFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
LocalDate
date
=
LocalDate
.
parse
(
day
,
dateFormatter
);
DayOfWeek
weekday
=
date
.
getDayOfWeek
();
return
String
.
format
(
"周%s"
,
weekday
.
getDisplayName
(
TextStyle
.
SHORT
,
Locale
.
CHINA
)
);
return
weekday
.
getDisplayName
(
TextStyle
.
SHORT
,
Locale
.
CHINA
);
}
@lombok
.
Data
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment