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
ccbb6df3
Commit
ccbb6df3
authored
Nov 16, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
扣分问题处理
parent
4ee4e972
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
PersonQrCodeController.java
...t/module/jxiop/biz/controller/PersonQrCodeController.java
+11
-4
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+19
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PersonQrCodeController.java
View file @
ccbb6df3
...
...
@@ -27,6 +27,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -284,8 +285,11 @@ public class PersonQrCodeController extends BaseController {
item
.
put
(
"name"
,
name
);
item
.
put
(
"faultInfo"
,
"该存在缺陷或者告警"
);
item
.
put
(
"faultLevel"
,
"严重"
);
if
(!
Objects
.
isNull
(
score
))
{
item
.
put
(
"mark"
,
new
BigDecimal
(
100
).
subtract
(
score
));
if
(!
Objects
.
isNull
(
score
)
&&
equipYardByPageCount
!=
0
)
{
BigDecimal
divide
=
new
BigDecimal
(
100
).
subtract
(
score
).
divide
(
BigDecimal
.
valueOf
(
equipYardByPageCount
),
10
,
2
);
BigDecimal
bigDecimal
=
divide
.
setScale
(
PersonBasicServiceImpl
.
getNonZeroDecimalPlaces
(
divide
),
RoundingMode
.
HALF_UP
);
item
.
put
(
"mark"
,
bigDecimal
);
}
});
resultList
.
setRecords
(
equipYardByPage
);
...
...
@@ -300,8 +304,11 @@ public class PersonQrCodeController extends BaseController {
item
.
put
(
"name"
,
name
);
item
.
put
(
"faultInfo"
,
"该任务超时"
);
item
.
put
(
"faultLevel"
,
"严重"
);
if
(!
Objects
.
isNull
(
score
))
{
item
.
put
(
"mark"
,
new
BigDecimal
(
100
).
subtract
(
score
));
if
(!
Objects
.
isNull
(
score
)
&&
jobYardByPageCount
!=
0
)
{
BigDecimal
divide
=
new
BigDecimal
(
100
).
subtract
(
score
).
divide
(
BigDecimal
.
valueOf
(
jobYardByPageCount
),
10
,
2
);
BigDecimal
bigDecimal
=
divide
.
setScale
(
PersonBasicServiceImpl
.
getNonZeroDecimalPlaces
(
divide
),
RoundingMode
.
HALF_UP
);
item
.
put
(
"mark"
,
bigDecimal
);
}
});
resultList
.
setRecords
(
jobYardByPage
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
ccbb6df3
...
...
@@ -23,6 +23,7 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -128,8 +129,10 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
item
.
put
(
"name"
,
name
);
item
.
put
(
"faultInfo"
,
"证书不全或临期"
);
item
.
put
(
"faultLevel"
,
"严重"
);
if
(!
Objects
.
isNull
(
score
))
{
item
.
put
(
"mark"
,
new
BigDecimal
(
100
).
subtract
(
score
));
if
(!
Objects
.
isNull
(
score
)
&&
count
!=
0
)
{
BigDecimal
divide
=
new
BigDecimal
(
100
).
subtract
(
score
).
divide
(
BigDecimal
.
valueOf
(
count
),
10
,
2
);
BigDecimal
bigDecimal
=
divide
.
setScale
(
getNonZeroDecimalPlaces
(
divide
),
RoundingMode
.
HALF_UP
);
item
.
put
(
"mark"
,
bigDecimal
);
}
});
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>();
...
...
@@ -140,6 +143,20 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
return
mapPage
;
}
public
static
int
getNonZeroDecimalPlaces
(
BigDecimal
number
)
{
String
str
=
number
.
stripTrailingZeros
().
toPlainString
();
int
index
=
str
.
indexOf
(
"."
);
if
(
index
<
0
)
{
return
0
;
}
for
(
int
i
=
index
+
1
;
i
<
str
.
length
();
i
++)
{
if
(
str
.
charAt
(
i
)
!=
'0'
)
{
return
i
-
index
;
}
}
return
0
;
}
public
Map
<
String
,
Object
>
getPersonDetailInfoByObjectId
(
String
objectId
)
{
Map
<
String
,
Object
>
resultMap
=
personBasicMapper
.
getPersonDetailInfoByObjectId
(
objectId
);
return
resultMap
;
...
...
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