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
d7045f76
Commit
d7045f76
authored
Jul 22, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.业务全过程增加单位过滤
parent
331af1fa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
45 deletions
+36
-45
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+26
-35
EquipTechParamPipelineMapper.java
...t/module/ymt/api/mapper/EquipTechParamPipelineMapper.java
+2
-2
EquipTechParamPipelineMapper.xml
...rc/main/resources/mapper/EquipTechParamPipelineMapper.xml
+8
-8
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/DPStatisticsServiceImpl.java
View file @
d7045f76
...
...
@@ -100,7 +100,6 @@ public class DPStatisticsServiceImpl {
private
final
static
String
REGION_NAME
=
"regionName"
;
@Autowired
private
EquipmentCategoryMapper
equipmentCategoryMapper
;
...
...
@@ -239,56 +238,48 @@ public class DPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
getCenterMapCountDataForGlobal
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
// 1.气瓶数量统计
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
dpFilterParamDto
);
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
orgCode
);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this
.
staticsCenterMapCountDataForEquip
(
result
,
dpFilterParamDto
,
cylinderNum
);
this
.
staticsCenterMapCountDataForEquip
(
result
,
cylinderNum
,
orgCode
);
//2.压力管道长度统计
this
.
staticsCenterMapCountDataForPipeline
(
result
,
dpFilterParamDto
);
this
.
staticsCenterMapCountDataForPipeline
(
result
,
orgCode
);
//3.单位数量统计
this
.
staticsCenterMapCountDataForCompany
(
result
,
dpFilterParamDto
);
this
.
staticsCenterMapCountDataForCompany
(
result
,
orgCode
);
//4.人员数量统计
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
);
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
,
orgCode
);
return
result
;
}
p
ublic
Map
<
String
,
Object
>
getCenterMapOverviewData
(
DPFilterParamDto
dpFilterParamDto
)
{
p
rivate
Map
<
String
,
Object
>
getCenterMapOverviewData
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
// 1.气瓶数量统计
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
dpFilterParamDto
);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this
.
staticsCenterMapCountDataForEquip
(
result
,
dpFilterParamDto
,
cylinderNum
);
//2.压力管道长度统计
this
.
staticsCenterMapCountDataForPipeline
(
result
,
dpFilterParamDto
);
//3.人员数量统计
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
);
String
orgCode
=
this
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
// 0. 气瓶数量统计
long
cylinderNum
=
this
.
staticsCenterMapCountDataForCylinder
(
result
,
orgCode
);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this
.
staticsCenterMapCountDataForEquip
(
result
,
cylinderNum
,
orgCode
);
// 2. 压力管道长度统计
this
.
staticsCenterMapCountDataForPipeline
(
result
,
orgCode
);
// 3. 人员数量统计
this
.
staticsCenterMapCountDataForPerson
(
result
,
dpFilterParamDto
,
orgCode
);
return
result
;
}
private
void
staticsCenterMapCountDataForPerson
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
)
{
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
orgCode
=
commonMapper
.
getOrgCodeByCompanyCode
(
dpFilterParamDto
.
getCityCode
());
private
void
staticsCenterMapCountDataForPerson
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
String
orgCode
)
{
if
(
orgCode
==
null
)
{
result
.
put
(
DPMapStatisticsItemEnum
.
OPERATORS
.
getCode
(),
0
);
return
;
}
regionCodeOrgCodeMap
.
put
(
dpFilterParamDto
.
getCityCode
(),
orgCode
);
}
Long
num
=
userInfoMapper
.
countUserByPostAndAreaCode
(
orgCode
,
"6552"
,
dpFilterParamDto
.
getCityCode
());
result
.
put
(
DPMapStatisticsItemEnum
.
OPERATORS
.
getCode
(),
num
);
}
private
void
staticsCenterMapCountDataForCompany
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
)
{
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
orgCode
=
commonMapper
.
getOrgCodeByCompanyCode
(
dpFilterParamDto
.
getCityCode
());
private
void
staticsCenterMapCountDataForCompany
(
Map
<
String
,
Object
>
result
,
String
orgCode
)
{
if
(
orgCode
==
null
)
{
setDefaultCompanyCountData
(
result
);
return
;
}
regionCodeOrgCodeMap
.
put
(
dpFilterParamDto
.
getCityCode
(),
orgCode
);
}
List
<
CountDto
>
countDtos
=
enterpriseInfoMapper
.
countByUnitTypeAndOrgCode
(
orgCode
);
result
.
put
(
DPMapStatisticsItemEnum
.
USERS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_USE
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
result
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MAINTENANCE
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
...
...
@@ -296,13 +287,13 @@ public class DPStatisticsServiceImpl {
result
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_FILLING
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
}
private
long
staticsCenterMapCountDataForCylinder
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
)
{
private
long
staticsCenterMapCountDataForCylinder
(
Map
<
String
,
Object
>
result
,
String
orgCode
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"
USE_PLACE_CODE"
,
"*"
+
dpFilterParamDto
.
getCityCode
()
+
"*"
));
//
按照管辖机构
区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"
ORG_BRANCH_CODE.keyword"
,
orgCode
+
"*"
));
// 设备类别精确查询气瓶
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_CATEGORY_CODE"
,
EQU_CATEGORY_CYLINDER
));
// 纳管状态为已纳管
...
...
@@ -318,8 +309,8 @@ public class DPStatisticsServiceImpl {
return
num
;
}
private
void
staticsCenterMapCountDataForPipeline
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
)
{
String
length
=
techParamsPipelineMapper
.
sumPipeLengthBy
Area
(
dpFilterParamDto
.
getCityCode
()
);
private
void
staticsCenterMapCountDataForPipeline
(
Map
<
String
,
Object
>
result
,
String
orgCode
)
{
String
length
=
techParamsPipelineMapper
.
sumPipeLengthBy
OrgCode
(
orgCode
);
BigDecimal
lengthDecimal
=
new
BigDecimal
(
length
);
if
(
lengthDecimal
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
length
=
lengthDecimal
.
divide
(
new
BigDecimal
(
"1000"
),
3
,
RoundingMode
.
HALF_UP
).
toPlainString
();
...
...
@@ -328,12 +319,12 @@ public class DPStatisticsServiceImpl {
}
private
void
staticsCenterMapCountDataForEquip
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
long
cylinderNum
)
{
private
void
staticsCenterMapCountDataForEquip
(
Map
<
String
,
Object
>
result
,
long
cylinderNum
,
String
orgCode
)
{
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"
USE_PLACE_CODE"
,
"*"
+
dpFilterParamDto
.
getCityCode
()
+
"*"
));
//
按照管辖机构
区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"
ORG_BRANCH_CODE.keyword"
,
orgCode
+
"*"
));
// 纳管状态为已纳管
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
true
));
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/EquipTechParamPipelineMapper.java
View file @
d7045f76
...
...
@@ -16,8 +16,8 @@ public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamP
/**
* 统计压力管道长度
*
* @param
cityCode 区域code
* @param
orgCode 区域code对应的管辖机构
* @return 数量
*/
String
sumPipeLengthBy
Area
(
String
city
Code
);
String
sumPipeLengthBy
OrgCode
(
String
org
Code
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/EquipTechParamPipelineMapper.xml
View file @
d7045f76
...
...
@@ -25,7 +25,7 @@
WHERE
RECORD = #{record}
</select>
<select
id=
"sumPipeLengthBy
Area
"
resultType=
"java.lang.String"
>
<select
id=
"sumPipeLengthBy
OrgCode
"
resultType=
"java.lang.String"
>
select
COALESCE(round(sum(p."PIPE_LENGTH"), 2),0) as PIPE_LENGTH
from
...
...
@@ -33,18 +33,18 @@
(
SELECT
ri."RECORD",
concat(ui.PROVINCE,'#', ui.CITY,'#', ui.COUNTY) as areaCode
FROM "idx_biz_jg_register_info" ri,
idx_biz_jg_use_info ui
si."ORG_BRANCH_CODE" as orgBranchCode
FROM
"idx_biz_jg_register_info" ri,
idx_biz_jg_use_info ui,
idx_biz_jg_supervision_info si
where
ri."EQU_LIST" = '8000'
and ri."RECORD" = ui."RECORD"
and ui."PROVINCE"
<![CDATA[<>]]>
''
and ui."CITY"
<![CDATA[<>]]>
''
and ui."COUNTY"
<![CDATA[<>]]>
''
and ui.IS_INTO_MANAGEMENT =true
and ri."RECORD" = si."RECORD"
) a
where
p."RECORD" = a."RECORD" and a.
areaCode like concat('%',#{city
Code}, '%')
p."RECORD" = a."RECORD" and a.
orgBranchCode like concat(#{org
Code}, '%')
</select>
</mapper>
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