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
f9bd8555
Commit
f9bd8555
authored
Jul 16, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(bug)bug修复:
1.车用气瓶单位重复处理,按照useCode去重
parent
c60c5e8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+10
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
f9bd8555
...
@@ -118,6 +118,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -118,6 +118,7 @@ import java.util.concurrent.TimeUnit;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
/**
* 装备分类服务实现类
* 装备分类服务实现类
...
@@ -953,8 +954,15 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -953,8 +954,15 @@ public class CommonServiceImpl implements ICommonService {
result
.
forEach
(
x
->
convertAndAddToUnitList
(
x
,
unitList
));
result
.
forEach
(
x
->
convertAndAddToUnitList
(
x
,
unitList
));
}
}
List
<
Map
<
String
,
Object
>>
unitListByType
=
needAuth
?
commonMapper
.
getUnitInfoListByType
(
type
)
:
commonMapper
.
getUnitListByType
(
type
);
List
<
Map
<
String
,
Object
>>
unitListByType
=
needAuth
?
commonMapper
.
getUnitInfoListByType
(
type
)
:
commonMapper
.
getUnitListByType
(
type
);
unitList
.
addAll
(
unitListByType
);
// 数据去重:原因车用气瓶在字典里进行维护,如果维护的单位注册上来,则会出现数据重复,故按照useCode去重
return
unitList
;
return
new
ArrayList
<>(
Stream
.
concat
(
unitList
.
stream
(),
unitListByType
.
stream
()
).
collect
(
Collectors
.
toMap
(
map
->
(
String
)
map
.
get
(
"useCode"
),
// 以 unitCode 作为 key
map
->
map
,
(
existing
,
replacement
)
->
existing
// 如果 key 冲突,保留原有的
)).
values
());
}
}
@Override
@Override
...
...
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