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
7a91f501
Commit
7a91f501
authored
Sep 19, 2024
by
李龙阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.使用单位/筛选/添加:行业主管部门
2.使用单位/表头/添加:行业主管部门 3.使用单位/表头/删除:证件类型 4.充装单位/表头/添加:气瓶数量 5.检验检测机构/筛选/添加:业务开通状态
parent
4189ab92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
12 deletions
+109
-12
EnterpriseBizServiceImpl.java
.../statistcs/biz/service/impl/EnterpriseBizServiceImpl.java
+80
-11
TzBaseEnterpriseInfoDto.java
...amos/boot/module/ymt/api/dto/TzBaseEnterpriseInfoDto.java
+11
-0
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+18
-1
No files found.
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/EnterpriseBizServiceImpl.java
View file @
7a91f501
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.enums.UnitTypeEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.EnterpriseBizMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.PageParam
;
...
...
@@ -14,12 +15,23 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.*
;
/**
* @author Administrator
...
...
@@ -35,13 +47,19 @@ public class EnterpriseBizServiceImpl {
private
EnterpriseBizMapper
enterpriseBizMapper
;
private
RestHighLevelClient
restHighLevelClient
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
EnterpriseBizServiceImpl
.
class
);
public
EnterpriseBizServiceImpl
(
RedisUtils
redisUtils
,
StCommonServiceImpl
stCommonService
,
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
,
EnterpriseBizMapper
enterpriseBizMapper
)
{
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
,
EnterpriseBizMapper
enterpriseBizMapper
,
RestHighLevelClient
restHighLevelClient
)
{
this
.
redisUtils
=
redisUtils
;
this
.
stCommonService
=
stCommonService
;
this
.
tzBaseEnterpriseInfoMapper
=
tzBaseEnterpriseInfoMapper
;
this
.
enterpriseBizMapper
=
enterpriseBizMapper
;
this
.
restHighLevelClient
=
restHighLevelClient
;
}
public
IPage
<
TzBaseEnterpriseInfoDto
>
page
(
PageParam
pageParam
,
TzBaseEnterpriseInfoDto
tzBaseEnterpriseInfoDto
)
{
...
...
@@ -54,7 +72,7 @@ public class EnterpriseBizServiceImpl {
}
}
Page
<
TzBaseEnterpriseInfoDto
>
page
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
List
<
JSONObject
>
companyType1
=
this
.
getCompanyType
();
/*
List<JSONObject> companyType1 = this.getCompanyType();
if (!ValidationUtil.isEmpty(companyType1)) {
for (JSONObject jsonObject : companyType1) {
String orgCode = jsonObject.getString("orgCode");
...
...
@@ -62,15 +80,66 @@ public class EnterpriseBizServiceImpl {
orgCodeList.add(orgCode);
}
}
}*/
orgCodeList
.
add
(
"50"
);
// if (tzBaseEnterpriseInfoDto.getCityCode() != null) {
// String orgCode = stCommonService.getAndSetOrgCode(tzBaseEnterpriseInfoDto.getCityCode());
// if (orgCode == null) {
// return page;
// }
// orgCodeList.add(orgCode);
// }
if
(
tzBaseEnterpriseInfoDto
.
getUnitType
().
contains
(
UnitTypeEnum
.
JYJCJG
.
getName
())){
String
jyjcStatus
=
tzBaseEnterpriseInfoDto
.
getJyjcStatus
();
String
[]
array
=
jyjcStatus
.
split
(
"-"
);
tzBaseEnterpriseInfoDto
.
setJyjcStatus
(
array
[
0
]);
if
(
array
.
length
>
1
){
tzBaseEnterpriseInfoDto
.
setJyjcType
(
array
[
1
]);
}
}
if
(
tzBaseEnterpriseInfoDto
.
getCityCode
()
!=
null
)
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
tzBaseEnterpriseInfoDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
return
page
;
IPage
<
TzBaseEnterpriseInfoDto
>
tzBaseEnterpriseInfoDtoIPage
=
tzBaseEnterpriseInfoMapper
.
pageList2
(
page
,
tzBaseEnterpriseInfoDto
,
orgCodeList
);
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfoDtoIPage
.
getRecords
()))
{
logger
.
info
(
"查询到的数据为空"
);
return
tzBaseEnterpriseInfoDtoIPage
;
}
if
(
tzBaseEnterpriseInfoDto
.
getUnitType
().
contains
(
UnitTypeEnum
.
CZDW
.
getName
()))
{
SearchRequest
searchRequest
=
new
SearchRequest
(
"idx_biz_view_jg_all"
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
// 构建查询条件
searchSourceBuilder
.
query
(
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
"2300"
))
// 只统计已纳管设备
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
Boolean
.
TRUE
))
// 按照管辖机构区域信息模糊查询
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCodeList
.
get
(
0
))
+
"*"
))
);
TermsAggregationBuilder
aggregation
=
AggregationBuilders
.
terms
(
"USE_UNIT_CREDIT_CODE"
).
field
(
"USE_UNIT_CREDIT_CODE.keyword"
).
size
(
10
);
searchSourceBuilder
.
aggregation
(
aggregation
);
searchRequest
.
source
(
searchSourceBuilder
);
try
{
// 执行搜索并获取响应
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
// 处理聚合结果
// 这里只是打印出聚合的名称和桶的数量,你需要根据自己的需求来处理这些数据
Terms
terms
=
searchResponse
.
getAggregations
().
get
(
"USE_UNIT_CREDIT_CODE"
);
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<>();
for
(
Terms
.
Bucket
bucket
:
terms
.
getBuckets
())
{
tzBaseEnterpriseInfoDtoIPage
.
getRecords
().
stream
().
filter
(
dto
->
dto
.
getUseUnitCode
().
equals
(
bucket
.
getKeyAsString
())).
forEach
(
newDto
->
{
newDto
.
setGasCount
(
String
.
valueOf
(
bucket
.
getDocCount
()));
});
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询机构:{}下的气瓶数量失败,错误信息:{}"
,
orgCodeList
.
get
(
0
),
e
);
}
orgCodeList
.
add
(
orgCode
);
}
return
tzBaseEnterpriseInfo
Mapper
.
pageList2
(
page
,
tzBaseEnterpriseInfoDto
,
orgCodeList
)
;
return
tzBaseEnterpriseInfo
DtoIPage
;
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/dto/TzBaseEnterpriseInfoDto.java
View file @
7a91f501
...
...
@@ -286,6 +286,8 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"行业主管部门"
)
private
String
industrySupervisor
;
@ApiModelProperty
(
value
=
"行业主管部门名称"
)
private
String
industrySupervisorName
;
private
String
region
;
...
...
@@ -308,4 +310,13 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"单位所在城市Code"
)
private
String
cityCode
;
@ApiModelProperty
(
value
=
"检验检测机构在不同类别(jy,jc)状态"
)
private
String
jyjcStatus
;
@ApiModelProperty
(
value
=
"检验检测机构不同类别(jy,jc)"
)
private
String
jyjcType
;
//充装单位列表展示需要的气瓶数量
private
String
gasCount
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
7a91f501
...
...
@@ -89,9 +89,22 @@
SELECT
*,
CONCAT(province,'/',city,'/',district) AS region,
<if
test=
" tzBaseEnterpriseInfoDto.unitType.indexOf('使用单位')!=-1"
>
(SELECT cdd.name from amos_tzs_biz.cb_data_dictionary cdd WHERE cdd.code = industry_supervisor and cdd.type = 'HYZGBM') AS industrySupervisorName,
</if>
CONCAT(street,'/',address) AS full_address
FROM
tz_base_enterprise_info
amos_tzs_biz.tz_base_enterprise_info
<if
test=
" tzBaseEnterpriseInfoDto.unitType.indexOf('检验检测机构') !=-1 "
>
JOIN (select unit_code,max(accept_date) from tz_jyjc_opening_application
where status = #{tzBaseEnterpriseInfoDto.jyjcStatus}
<if
test=
" tzBaseEnterpriseInfoDto.jyjcType!=null and tzBaseEnterpriseInfoDto.jyjcType!='' "
>
and open_biz_type = #{tzBaseEnterpriseInfoDto.jyjcType}
</if>
group by unit_code,open_biz_type) t1
ON t1.unit_code = unit_code
</if>
<where>
<if
test=
"tzBaseEnterpriseInfoDto.unitType!=null and tzBaseEnterpriseInfoDto.unitType!='' "
>
...
...
@@ -140,6 +153,10 @@
</foreach>
)
</if>
<if
test=
"tzBaseEnterpriseInfoDto.industrySupervisor!=null and tzBaseEnterpriseInfoDto.industrySupervisor!='' "
>
AND industrySupervisor = #{tzBaseEnterpriseInfoDto.industrySupervisor}
</if>
AND is_delete = 0
</where>
order by rec_date desc
...
...
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