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
5f7ea357
Commit
5f7ea357
authored
Jul 08, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(core): 使用新的UnitTypeNewEnum替换旧的UnitTypeEnum
parent
cd66077f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
6 deletions
+77
-6
UnitTypeNewEnum.java
...mos/boot/module/statistics/api/enums/UnitTypeNewEnum.java
+72
-0
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+5
-6
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/UnitTypeNewEnum.java
0 → 100644
View file @
5f7ea357
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
enums
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
org.springframework.util.ObjectUtils
;
import
java.util.HashMap
;
import
java.util.Map
;
@AllArgsConstructor
@Getter
public
enum
UnitTypeNewEnum
{
/**
* *注册单位类型
*/
sydw
(
"使用单位"
,
"1232"
,
"use"
),
czdw
(
"充装单位"
,
"1231"
,
"license"
),
jydw
(
"检验单位"
,
"1233"
,
"license"
),
jcdw
(
"检测单位"
,
"1233"
,
"license"
),
azgzwxdw
(
"安装改造维修单位"
,
"1234"
,
"license"
),
zzdw
(
"制造单位"
,
"1236"
,
"license"
),
sjdw
(
"设计单位"
,
"1235"
,
"license"
),
grzt
(
"个人主体"
,
"6599"
,
"use"
);
private
String
name
;
private
String
code
;
private
String
type
;
public
static
Map
<
String
,
String
>
getName
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getCode
=
new
HashMap
<>();
static
{
for
(
UnitTypeNewEnum
e
:
UnitTypeNewEnum
.
values
())
{
getName
.
put
(
e
.
code
,
e
.
name
);
getCode
.
put
(
e
.
name
,
e
.
code
);
}
}
public
static
JSONArray
getAll
()
{
JSONArray
jsonArray
=
new
JSONArray
();
for
(
UnitTypeNewEnum
e
:
UnitTypeNewEnum
.
values
())
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
e
.
name
);
jsonObject
.
put
(
"value"
,
e
.
name
);
jsonObject
.
put
(
"key"
,
e
.
code
);
jsonArray
.
add
(
jsonObject
);
}
return
jsonArray
;
}
public
static
JSONArray
getUnitTypeByType
(
String
category
)
{
if
(
ObjectUtils
.
isEmpty
(
category
))
{
return
getAll
();
}
JSONArray
jsonArray
=
new
JSONArray
();
for
(
UnitTypeNewEnum
e
:
UnitTypeNewEnum
.
values
())
{
if
(
e
.
type
.
equals
(
category
))
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
e
.
name
);
jsonObject
.
put
(
"value"
,
e
.
name
);
jsonObject
.
put
(
"key"
,
e
.
code
);
jsonArray
.
add
(
jsonObject
);
}
}
return
jsonArray
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
5f7ea357
...
...
@@ -254,7 +254,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if
(
k
.
equals
(
"unitCategory"
))
{
if
(!
ObjectUtils
.
isEmpty
(
v
)
&&
((
JSONArray
)
v
).
size
()
==
1
)
{
String
category
=
((
JSONArray
)
v
).
get
(
0
).
toString
();
JSONArray
unitTypeByType
=
UnitTypeEnum
.
getUnitTypeByType
(
category
);
JSONArray
unitTypeByType
=
UnitType
New
Enum
.
getUnitTypeByType
(
category
);
List
<
String
>
list
=
unitTypeByType
.
stream
().
map
(
e
->
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
)).
get
(
"value"
).
toString
()).
collect
(
Collectors
.
toList
());
list
.
forEach
(
item
->
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
item
+
"*"
)).
minimumShouldMatch
(
1
));
}
...
...
@@ -507,7 +507,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if
(
k
.
equals
(
"unitCategory"
))
{
if
(!
ObjectUtils
.
isEmpty
(
v
)
&&
((
JSONArray
)
v
).
size
()
==
1
)
{
String
category
=
((
JSONArray
)
v
).
get
(
0
).
toString
();
JSONArray
unitTypeByType
=
UnitTypeEnum
.
getUnitTypeByType
(
category
);
JSONArray
unitTypeByType
=
UnitType
New
Enum
.
getUnitTypeByType
(
category
);
List
<
String
>
list
=
unitTypeByType
.
stream
().
map
(
e
->
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
)).
get
(
"value"
).
toString
()).
collect
(
Collectors
.
toList
());
list
.
forEach
(
item
->
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
"unitType.keyword"
,
"*"
+
item
+
"*"
)).
minimumShouldMatch
(
1
));
}
...
...
@@ -892,7 +892,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
BigDecimal
getPipeLength
(
BoolQueryBuilder
boolMust
,
SearchSourceBuilder
builder
)
{
SearchRequest
request
=
new
SearchRequest
();
BigDecimal
pipeLong
=
BigDecimal
.
ZERO
;
// boolMust.must(QueryBuilders.termQuery("EQU_LIST_CODE", "8000"));
builder
.
query
(
boolMust
);
builder
.
from
(
0
);
builder
.
size
(
10000000
);
...
...
@@ -1569,7 +1568,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
queryUnitType
(
String
type
)
{
return
UnitTypeEnum
.
getUnitTypeByType
(
type
);
return
UnitType
New
Enum
.
getUnitTypeByType
(
type
);
}
public
JSONObject
queryCompanySearchData
(
String
type
)
{
...
...
@@ -1577,7 +1576,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
//获取企业分类
result
.
put
(
"unitCategory"
,
getUnitCategory
());
//获取企业类型
result
.
put
(
"unitType"
,
UnitTypeEnum
.
getUnitTypeByType
(
type
));
result
.
put
(
"unitType"
,
UnitType
New
Enum
.
getUnitTypeByType
(
type
));
//获取企业等级
result
.
put
(
"regulatoryLabels"
,
deployDictionary
(
dataDictionaryService
.
getByType
(
"QYBQ"
)));
...
...
@@ -1729,7 +1728,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
//获取企业分类
result
.
put
(
"unitCategory"
,
getUnitCategory
());
//获取企业类型
result
.
put
(
"unitType"
,
UnitTypeEnum
.
getUnitTypeByType
(
type
));
result
.
put
(
"unitType"
,
UnitType
New
Enum
.
getUnitTypeByType
(
type
));
return
result
;
}
...
...
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