Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
fd60f358
Commit
fd60f358
authored
Sep 05, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
立方米问题处理
parent
948fe4d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
UnitTransformUtil.java
...m/yeejoin/equipmanage/common/utils/UnitTransformUtil.java
+9
-7
SupervisionConfigureController.java
...quipmanage/controller/SupervisionConfigureController.java
+1
-1
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+2
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/UnitTransformUtil.java
View file @
fd60f358
...
...
@@ -152,7 +152,7 @@ public class UnitTransformUtil {
map
.
put
(
"unit"
,
"M"
);
return
map
;
}
public
static
Map
<
String
,
Object
>
transformValuesLFM
(
String
currentValue
,
String
currentUnit
,
String
volum
e
)
{
public
static
Map
<
String
,
Object
>
transformValuesLFM
(
String
currentValue
,
String
currentUnit
,
String
minValue
,
String
maxValu
e
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
UnitEnum
.
LFM
.
getKey
().
equalsIgnoreCase
(
currentUnit
)
||
UnitEnum
.
LFM
.
getName
().
equals
(
currentUnit
))
{
BigDecimal
nowVal
=
new
BigDecimal
(
0
);
...
...
@@ -163,18 +163,20 @@ public class UnitTransformUtil {
map
.
put
(
"nowValue"
,
"--"
);
}
// status 中 0 表示过低;1 表示正常;2 表示过高
if
(
StringUtil
.
isNotEmpty
(
currentValue
)
&&
!
"--"
.
equals
(
currentValue
)
&&
StringUtil
.
isNotEmpty
(
volume
)
&&
!
"--"
.
equals
(
volume
)
&&
StringUtil
.
isNotEmpty
(
currentUnit
))
{
if
(
nowVal
.
compareTo
(
new
BigDecimal
(
volume
))
==
1
)
{
if
(
StringUtil
.
isNotEmpty
(
minValue
)
&&
!
"--"
.
equals
(
minValue
)
&&
StringUtil
.
isNotEmpty
(
maxValue
)
&&
!
"--"
.
equals
(
maxValue
)
&&
!
"null"
.
equalsIgnoreCase
(
minValue
)
&&
!
"null"
.
equalsIgnoreCase
(
maxValue
))
{
if
(
nowVal
.
compareTo
(
new
BigDecimal
(
minValue
))
<
0
)
{
map
.
put
(
"status"
,
"0"
);
map
.
put
(
"abs"
,
nowVal
.
divide
(
new
BigDecimal
(
maxValue
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
));
}
else
if
(
nowVal
.
compareTo
(
new
BigDecimal
(
maxValue
))
>
0
)
{
// 当前值大于最大值
map
.
put
(
"status"
,
"2"
);
map
.
put
(
"abs"
,
100
);
}
else
if
(
nowVal
.
compareTo
(
new
BigDecimal
(
volum
e
))
==
0
)
{
}
else
if
(
nowVal
.
compareTo
(
new
BigDecimal
(
maxValu
e
))
==
0
)
{
map
.
put
(
"status"
,
"1"
);
map
.
put
(
"abs"
,
100
);
}
else
{
map
.
put
(
"status"
,
"1"
);
map
.
put
(
"abs"
,
nowVal
.
divide
(
new
BigDecimal
(
volum
e
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
));
map
.
put
(
"abs"
,
nowVal
.
divide
(
new
BigDecimal
(
maxValu
e
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
));
}
}
else
{
map
.
put
(
"status"
,
"--"
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java
View file @
fd60f358
...
...
@@ -249,7 +249,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
if
(
UnitEnum
.
LFM
.
getKey
().
equalsIgnoreCase
(
String
.
valueOf
(
m
.
get
(
"unit"
)))
||
UnitEnum
.
LFM
.
getName
().
equals
(
String
.
valueOf
(
m
.
get
(
"unit"
))))
{
transResult
=
UnitTransformUtil
.
transformValuesLFM
(
String
.
valueOf
(
m
.
get
(
"nowLevel"
)),
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"
volume
"
)));
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"
minLevel"
)),
String
.
valueOf
(
m
.
get
(
"maxLevel
"
)));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
fd60f358
...
...
@@ -115,7 +115,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"minLevel"
)),
String
.
valueOf
(
m
.
get
(
"maxLevel"
)));
if
(
UnitEnum
.
LFM
.
getKey
().
equalsIgnoreCase
(
String
.
valueOf
(
m
.
get
(
"unit"
)))
||
UnitEnum
.
LFM
.
getName
().
equals
(
String
.
valueOf
(
m
.
get
(
"unit"
))))
{
transResult
=
UnitTransformUtil
.
transformValuesLFM
(
String
.
valueOf
(
m
.
get
(
"value"
)),
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"
volume
"
)));
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"
minLevel"
)),
String
.
valueOf
(
m
.
get
(
"maxLevel
"
)));
}
m
.
put
(
"value"
,
transResult
.
get
(
"nowValue"
));
if
(
StringUtil
.
isNotEmpty
(
IndexStatusEnum
.
getEnumByKey
(
String
.
valueOf
(
transResult
.
get
(
"status"
)))))
{
...
...
@@ -167,7 +167,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
if
(
UnitEnum
.
LFM
.
getKey
().
equalsIgnoreCase
(
String
.
valueOf
(
m
.
get
(
"unit"
)))
||
UnitEnum
.
LFM
.
getName
().
equals
(
String
.
valueOf
(
m
.
get
(
"unit"
))))
{
transResult
=
UnitTransformUtil
.
transformValuesLFM
(
String
.
valueOf
(
m
.
get
(
"nowLevel"
)),
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"
volume
"
)));
String
.
valueOf
(
m
.
get
(
"unit"
)),
String
.
valueOf
(
m
.
get
(
"
minLevel"
)),
String
.
valueOf
(
m
.
get
(
"maxLevel
"
)));
}
if
(
StringUtil
.
isNotEmpty
(
IndexStatusEnum
.
getEnumByKey
(
String
.
valueOf
(
transResult
.
get
(
"status"
)))))
{
...
...
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