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
1dac0fa8
Commit
1dac0fa8
authored
Jul 30, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.气瓶中评调整 增加统计项
parent
bb653fe7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
11 deletions
+127
-11
CylinderStatisticsMapper.java
...odule/statistics/api/mapper/CylinderStatisticsMapper.java
+7
-0
CylinderStatisticsMapper.xml
...pi/src/main/resources/mapper/CylinderStatisticsMapper.xml
+12
-0
CylinderDPStatisticsServiceImpl.java
...tcs/biz/service/impl/CylinderDPStatisticsServiceImpl.java
+108
-11
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/mapper/CylinderStatisticsMapper.java
View file @
1dac0fa8
...
...
@@ -20,4 +20,11 @@ public interface CylinderStatisticsMapper {
* @return 办理率*100
*/
String
queryUserRegisterCertAppPercent
(
@Param
(
"orgCode"
)
String
orgCode
);
/**
* 统计气瓶的办证数量
* @param orgCode 区域对应的公司的orgCode
* @return 办证数量
*/
Long
countForCylinderCertNum
(
String
orgCode
);
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/CylinderStatisticsMapper.xml
View file @
1dac0fa8
...
...
@@ -31,4 +31,16 @@
and supervise_org_code like concat(#{orgCode},'%')
) s2
</select>
<select
id=
"countForCylinderCertNum"
resultType=
"java.lang.Long"
>
SELECT
count(DISTINCT(a.use_unit_credit_code)) as num
FROM
"tzs_jg_use_registration_manage" a,
privilege_company c
where
a.receive_company_code = c.company_code
and a.certificate_status='已登记'
and a.equ_list_code='2000'
and c.org_code like concat(#{orgCode},'%')
</select>
</mapper>
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/CylinderDPStatisticsServiceImpl.java
View file @
1dac0fa8
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto
;
...
...
@@ -228,38 +229,134 @@ public class CylinderDPStatisticsServiceImpl {
return
num
;
}
private
Long
countForCylinderNumForVehicleUsed
(
String
orgCode
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"WHETHER_VEHICLE_CYLINDER.keyword"
,
"1"
));
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
));
// 且在用状态设备
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_STATE"
,
EquimentEnum
.
ZAIYONG
.
getCode
()));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
num
=
response
.
getCount
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
num
;
}
private
List
<
String
>
buildXData
(
List
<
RegionModel
>
regionList
)
{
return
regionList
.
stream
().
map
(
RegionModel:
:
getRegionName
).
collect
(
Collectors
.
toList
());
}
public
Map
<
String
,
Object
>
getCylinderStatisticsDataByCityForTotal
(
DPFilterParamDto
dpFilterParamDto
)
{
String
regionCode
=
dpFilterParamDto
.
getCityCode
();
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
regionCode
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
getCylinderMapCount
(
orgCode
,
result
);
return
result
;
}
private
Map
<
String
,
Object
>
getCylinderMapCount
(
String
orgCode
,
Map
<
String
,
Object
>
result
)
{
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
result
.
put
(
"cylindersCount"
,
this
.
countForCylinderNum
(
orgCode
));
result
.
put
(
"stationCount"
,
cylinderStatisticsMapper
.
countEnterpriseNumForCylinder
(
orgCode
));
result
.
put
(
"operatorCount"
,
cylinderAreaDataMapper
.
getOpertorStatisticsDataByCity
(
Collections
.
singletonList
(
orgCode
)));
// 液化气瓶 (个)
result
.
put
(
"liquefiedGasCount"
,
0L
);
// 车用气瓶 (个)
result
.
put
(
"automotiveGasCount"
,
this
.
countForCylinderNumForVehicleUsed
(
orgCode
));
// 工业气瓶 (个)
result
.
put
(
"industrialGasCount"
,
0L
);
// 使用登记数量
result
.
put
(
"useRegistrationQuantityCount"
,
this
.
countForCylinderCertNum
(
orgCode
));
// 检验临期气瓶数
result
.
put
(
"jylqsbCount"
,
this
.
countForCylinderTemporaryInspect
(
orgCode
));
// 检验超期气瓶数
result
.
put
(
"jycqsbCount"
,
this
.
countForCylinderOverdueInspect
(
orgCode
));
}
else
{
this
.
setDefaultValueIfNoData
(
result
,
"
stationCount"
,
"cylindersCount"
,
"operator
Count"
);
this
.
setDefaultValueIfNoData
(
result
,
"
cylindersCount"
,
"stationCount"
,
"operatorCount"
,
"liquefiedGasCount"
,
"automotiveGasCount"
,
"industrialGasCount"
,
"useRegistrationQuantityCount"
,
"jylqsbCount"
,
"jycqsb
Count"
);
}
return
result
;
}
/**
* 临期检验设备数统计
*
* @param orgCode 过滤条件
* @return 临期设备的数量
*/
private
Long
countForCylinderTemporaryInspect
(
String
orgCode
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
));
// 且在用状态设备
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_STATE"
,
EquimentEnum
.
ZAIYONG
.
getCode
()));
// 且下次检验日期大于等于当天
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
currentDayTime
));
// 且查询 下次检验日期 <= 当前天+30天 极为临期
long
currentDayAfter30DayTime
=
DateUtil
.
offsetDay
(
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
),
30
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
lte
(
currentDayAfter30DayTime
));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
num
=
response
.
getCount
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
num
;
}
/**
* 超期检验设备数统计
*
* @param orgCode 过滤条件
* @return 超期设备的数量
*/
private
Long
countForCylinderOverdueInspect
(
String
orgCode
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 设备类别2300气瓶
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
"2300"
));
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
));
// 在用状态设备
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_STATE"
,
EquimentEnum
.
ZAIYONG
.
getCode
()));
// 查询下次检验日期小于当前天的设备,即为超期检验超期设备
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
now
(),
"yyy-MM-dd"
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
lt
(
currentDayTime
));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
num
=
response
.
getCount
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
num
;
}
private
Long
countForCylinderCertNum
(
String
orgCode
)
{
return
cylinderStatisticsMapper
.
countForCylinderCertNum
(
orgCode
);
}
public
List
<
Map
<
String
,
Object
>>
getCylinderStatisticsDataByCityForMap
(
DPFilterParamDto
dpFilterParamDto
)
throws
Exception
{
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamDto
.
getCityCode
());
return
regionList
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()
+
""
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()
.
toString
()
);
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"regionCode"
,
r
.
getRegionCode
());
item
.
put
(
"regionName"
,
r
.
getRegionName
());
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
item
.
put
(
"stationCount"
,
cylinderStatisticsMapper
.
countEnterpriseNumForCylinder
(
orgCode
));
item
.
put
(
"cylindersCount"
,
this
.
countForCylinderNum
(
orgCode
));
item
.
put
(
"operatorCount"
,
cylinderAreaDataMapper
.
getOpertorStatisticsDataByCity
(
Collections
.
singletonList
(
orgCode
)));
}
else
{
this
.
setDefaultValueIfNoData
(
item
,
"stationCount"
,
"cylindersCount"
,
"operatorCount"
);
}
getCylinderMapCount
(
orgCode
,
item
);
return
item
;
}).
collect
(
Collectors
.
toList
());
}
...
...
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