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 7c6f2663
authored
Nov 22, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(容量消息变更): 发送消息变更后未同时变更调用方, 导致无法发送消息
1 parent
e5a113c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
project-order/src/main/java/com/dituhui/pea/order/scheduler/CalcOrgCapacityScheduler.java
project-order/src/main/java/com/dituhui/pea/order/scheduler/CalcOrgCapacityScheduler.java
View file @
7c6f266
...
...
@@ -151,7 +151,8 @@ public class CalcOrgCapacityScheduler {
double
usedPercentage
=
(
double
)
dto
.
getCapUsed
()
/
dto
.
getCapTotal
();
log
.
info
(
"[calcOneBranch] {}小组容量已使用占比{}"
,
groupId
,
usedPercentage
);
if
(
BigDecimal
.
valueOf
(
usedPercentage
).
compareTo
(
new
BigDecimal
(
"0.8"
))
>=
0
)
{
addCapacityMsg
(
""
,
""
,
groupId
,
LocalDate
.
parse
(
date
,
DateUtil
.
DATE_FORMATTER
),
dto
.
getLayer
());
addCapacityMsg
(
""
,
""
,
groupId
,
LocalDate
.
parse
(
date
,
DateUtil
.
DATE_FORMATTER
),
dto
.
getLayer
(),
dto
.
getLayerId
());
}
}
...
...
@@ -196,14 +197,15 @@ public class CalcOrgCapacityScheduler {
double
usedPercentage
=
(
double
)
dto
.
getCapUsed
()
/
dto
.
getCapTotal
();
log
.
info
(
"[calcOneBranch] {}分部容量已使用占比{}"
,
branchId
,
usedPercentage
);
if
(
BigDecimal
.
valueOf
(
usedPercentage
).
compareTo
(
new
BigDecimal
(
"0.8"
))
>=
0
)
{
addCapacityMsg
(
""
,
branchId
,
""
,
LocalDate
.
parse
(
date
,
DateUtil
.
DATE_FORMATTER
),
dto
.
getLayer
());
addCapacityMsg
(
""
,
branchId
,
""
,
LocalDate
.
parse
(
date
,
DateUtil
.
DATE_FORMATTER
),
dto
.
getLayer
(),
dto
.
getLayerId
());
}
}
}
private
void
addCapacityMsg
(
String
clusterId
,
String
branchId
,
String
groupId
,
LocalDate
targetDate
,
String
layer
)
{
LocalDate
targetDate
,
String
layer
,
String
layerId
)
{
MsgDTO
msgDTO
=
new
MsgDTO
();
msgDTO
.
setType
(
2
);
...
...
@@ -225,10 +227,19 @@ public class CalcOrgCapacityScheduler {
msgBrand
=
group
.
getGroupName
();
msgDTO
.
setGroupId
(
groupId
);
}
msg
=
MessageFormat
.
format
(
msg
,
msgBrand
,
layer
,
DateTimeUtil
.
formatDate
(
targetDate
));
final
String
capacityDate
=
DateTimeUtil
.
formatDate
(
targetDate
);
msg
=
MessageFormat
.
format
(
msg
,
msgBrand
,
layer
,
capacityDate
);
msgDTO
.
setContent
(
msg
);
msgDTO
.
setTag
(
1
);
msgService
.
add
(
msgDTO
);
msgDTO
.
setCapacityLayerId
(
layerId
);
msgDTO
.
setCapacityDate
(
capacityDate
);
try
{
msgService
.
add
(
msgDTO
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"[addCapacityMsg] {}容量消息发送失败, 失败原因:{}"
,
msgBrand
,
ex
.
getMessage
(),
ex
);
}
}
private
void
calcAllTeamByDays
(
String
bdate
,
String
edate
)
{
...
...
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