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
9a73b17d
Commit
9a73b17d
authored
Aug 16, 2024
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
气瓶下钻页面功能实现
parent
d6978261
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
491 additions
and
39 deletions
+491
-39
DPFilterParamForDetailDto.java
...boot/module/common/api/dto/DPFilterParamForDetailDto.java
+7
-0
CylinderTypeEnum.java
...ejoin/amos/boot/module/jg/api/enums/CylinderTypeEnum.java
+3
-3
SubTreeDto.java
...ejoin/amos/boot/module/statistics/api/dto/SubTreeDto.java
+18
-0
AnomalyTypeEnum.java
...mos/boot/module/statistics/api/enums/AnomalyTypeEnum.java
+36
-0
CylinderStatisticsMapper.java
...odule/statistics/api/mapper/CylinderStatisticsMapper.java
+6
-0
CylinderStatisticsMapper.xml
...pi/src/main/resources/mapper/CylinderStatisticsMapper.xml
+17
-0
CylinderDPStatisticsController.java
...tistcs/biz/controller/CylinderDPStatisticsController.java
+76
-0
AQZSDPStatisticsServiceImpl.java
...atistcs/biz/service/impl/AQZSDPStatisticsServiceImpl.java
+29
-23
CylinderDPStatisticsServiceImpl.java
...tcs/biz/service/impl/CylinderDPStatisticsServiceImpl.java
+284
-8
CylinderInfoMapper.java
...os/boot/module/ymt/flc/api/mapper/CylinderInfoMapper.java
+6
-2
CylinderInfoMapper.xml
...-ymt-api/src/main/resources/mapper/CylinderInfoMapper.xml
+9
-3
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DPFilterParamForDetailDto.java
View file @
9a73b17d
...
@@ -83,4 +83,11 @@ public class DPFilterParamForDetailDto {
...
@@ -83,4 +83,11 @@ public class DPFilterParamForDetailDto {
*/
*/
private
String
alertTypeCode
;
private
String
alertTypeCode
;
/**
* 气瓶充装异常情况(0:正常,1:异常)
*/
private
String
anomalyType
;
private
String
cylinderVariety
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/CylinderTypeEnum.java
View file @
9a73b17d
...
@@ -7,9 +7,9 @@ import lombok.Getter;
...
@@ -7,9 +7,9 @@ import lombok.Getter;
@AllArgsConstructor
@AllArgsConstructor
public
enum
CylinderTypeEnum
{
public
enum
CylinderTypeEnum
{
CYLINDER
(
"瓶"
,
"2300"
),
CYLINDER
(
"瓶"
,
"2300"
),
SEAMLESS_CYLINDER
(
"无缝气瓶
(车用)
"
,
"2310"
),
SEAMLESS_CYLINDER
(
"无缝气瓶"
,
"2310"
),
WELDED_CYLINDER
(
"焊接气瓶
(车用)
"
,
"2320"
),
WELDED_CYLINDER
(
"焊接气瓶"
,
"2320"
),
SPECIAL_CYLINDER
(
"特种气瓶
(车用)
"
,
"23T0"
);
SPECIAL_CYLINDER
(
"特种气瓶"
,
"23T0"
);
private
final
String
name
;
private
final
String
name
;
private
final
String
code
;
private
final
String
code
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/dto/SubTreeDto.java
0 → 100644
View file @
9a73b17d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author Administrator
*/
@Data
public
class
SubTreeDto
{
private
String
value
;
private
String
title
;
private
List
<
SubTreeDto
>
children
;
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/AnomalyTypeEnum.java
0 → 100644
View file @
9a73b17d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
@AllArgsConstructor
public
enum
AnomalyTypeEnum
{
NORMAL
(
"正常"
,
"0"
),
ABNORMAL
(
"异常"
,
"1"
);
private
String
name
;
private
String
code
;
public
static
Map
<
String
,
String
>
getName
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
getCode
=
new
HashMap
<>();
static
{
for
(
AnomalyTypeEnum
e
:
AnomalyTypeEnum
.
values
())
{
getCode
.
put
(
e
.
name
,
e
.
code
);
getName
.
put
(
e
.
code
,
e
.
name
);
}
}
public
static
AnomalyTypeEnum
getEnumByStatus
(
String
code
)
{
for
(
AnomalyTypeEnum
c
:
AnomalyTypeEnum
.
values
())
{
if
(
c
.
getCode
().
equals
(
code
)){
return
c
;
}
}
return
null
;
}
}
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 @
9a73b17d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -33,4 +35,8 @@ public interface CylinderStatisticsMapper {
...
@@ -33,4 +35,8 @@ public interface CylinderStatisticsMapper {
Long
countDischargeVolumeCount
(
@Param
(
"orgCode"
)
String
orgCode
);
Long
countDischargeVolumeCount
(
@Param
(
"orgCode"
)
String
orgCode
);
Long
countEnterpriseUsed
(
@Param
(
"orgCode"
)
String
orgCode
);
Long
countEnterpriseUsed
(
@Param
(
"orgCode"
)
String
orgCode
);
IPage
<
TzBaseEnterpriseInfoDto
>
getStationRateSubPage
(
IPage
<
TzBaseEnterpriseInfoDto
>
page
,
@Param
(
"companyName"
)
String
companyName
,
@Param
(
"orgCode"
)
String
orgCode
);
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/CylinderStatisticsMapper.xml
View file @
9a73b17d
...
@@ -73,6 +73,23 @@
...
@@ -73,6 +73,23 @@
WHERE
WHERE
E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
</select>
</select>
<select
id=
"getStationRateSubPage"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto"
>
SELECT
*,
CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address
FROM
tz_base_enterprise_info
where
is_delete = '0'
AND unit_type LIKE '%充装单位%'
AND supervise_org_code LIKE CONCAT(#{orgCode},'%')
<if
test=
"companyName != null and companyName != '' "
>
AND use_unit LIKE CONCAT('%',#{companyName},'%')
</if>
order by rec_date desc
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/CylinderDPStatisticsController.java
View file @
9a73b17d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.CylinderDPStatisticsServiceImpl
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.CylinderDPStatisticsServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SubTreeDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.ESCylinderFillingRecordDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -107,4 +114,73 @@ public class CylinderDPStatisticsController extends BaseController {
...
@@ -107,4 +114,73 @@ public class CylinderDPStatisticsController extends BaseController {
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
stationRate
(
dpFilterParamDto
));
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
stationRate
(
dpFilterParamDto
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"区域安全指数排名下钻树节点"
)
@GetMapping
(
value
=
"/securityIndexSubTree"
)
public
ResponseModel
<
List
<
EquipmentCategoryDto
>>
securityIndexSubTree
()
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
securityIndexSubTree
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"区域安全指数排名下钻柱状图"
)
@PostMapping
(
value
=
"/securityIndexSubChart"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
securityIndexSubChart
(
@RequestBody
DPFilterParamDto
dpFilterParamDto
)
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
securityIndexSubChart
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"充装量/卸液量下钻树节点"
)
@GetMapping
(
value
=
"/getFillingSubTree"
)
public
ResponseModel
<
SubTreeDto
>
getFillingSubTree
()
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getFillingSubTree
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"充装量/卸液量下钻柱状图"
)
@PostMapping
(
value
=
"/getFillingSubChart"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getFillingSubChart
(
@RequestBody
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getFillingSubChart
(
dpFilterParamForDetailDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"充装量/卸液量下钻列表"
)
@PostMapping
(
value
=
"/getFillingSubPage"
)
public
ResponseModel
<
Page
<
ESCylinderFillingRecordDto
>>
getFillingSubPage
(
@RequestBody
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getFillingSubPage
(
dpFilterParamForDetailDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"充装量/卸液量下钻气瓶充装异常情况下拉"
)
@GetMapping
(
value
=
"/getFillingSubAnomalyType"
)
public
ResponseModel
<
Object
>
getFillingSubAnomalyType
()
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getFillingSubAnomalyType
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"区域气站对接率下钻树节点"
)
@GetMapping
(
value
=
"/getStationRateSubTree"
)
public
ResponseModel
<
SubTreeDto
>
getStationRateSubTree
()
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getStationRateSubTree
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"区域气站对接率下钻图"
)
@PostMapping
(
value
=
"/getStationRateSubChart"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getStationRateSubChart
(
@RequestBody
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getStationRateSubChart
(
dpFilterParamForDetailDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"区域气站对接率下钻图"
)
@PostMapping
(
value
=
"/getStationRateSubPage"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfoDto
>>
getStationRateSubPage
(
@RequestBody
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
getStationRateSubPage
(
dpFilterParamForDetailDto
));
}
}
}
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/AQZSDPStatisticsServiceImpl.java
View file @
9a73b17d
...
@@ -205,7 +205,7 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -205,7 +205,7 @@ public class AQZSDPStatisticsServiceImpl {
return
result
;
return
result
;
}
}
p
rivate
String
castScore2Percent
(
String
score
)
{
p
ublic
String
castScore2Percent
(
String
score
)
{
BigDecimal
big
=
new
BigDecimal
(
score
);
BigDecimal
big
=
new
BigDecimal
(
score
);
BigDecimal
percent
=
big
.
divide
(
new
BigDecimal
(
"100"
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
percent
=
big
.
divide
(
new
BigDecimal
(
"100"
),
2
,
RoundingMode
.
HALF_UP
);
return
percent
.
toPlainString
();
return
percent
.
toPlainString
();
...
@@ -251,6 +251,31 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -251,6 +251,31 @@ public class AQZSDPStatisticsServiceImpl {
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
getSecurityIndexCountItemDtoMap
(
regionModels
);
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
getSecurityIndexCountItemDtoMap
(
regionModels
);
List
<
Map
<
String
,
String
>>
data
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
data
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
finalData
=
data
;
List
<
Map
<
String
,
String
>>
finalData
=
data
;
this
.
getCitySecurityIndex
(
finalData
,
regionCodeSecurityIndexMap
);
data
=
finalData
.
stream
()
.
filter
(
map
->
map
.
containsKey
(
"value"
))
.
sorted
(
Comparator
.
comparingDouble
(
map
->
{
// 检查并解析值,如果失败则返回Double.MIN_VALUE(或根据需要处理)
try
{
return
Double
.
parseDouble
(
map
.
get
(
"value"
));
}
catch
(
NumberFormatException
e
)
{
// 处理无法解析为double的情况,这里返回Double.MIN_VALUE表示最小
// 或者可以抛出自定义异常,记录日志等
return
Double
.
MIN_VALUE
;
}
}))
.
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
String
>
name
=
data
.
stream
().
map
(
map
->
map
.
get
(
"name"
)).
collect
(
Collectors
.
toList
());
Collections
.
reverse
(
name
);
result
.
put
(
"xdata"
,
name
);
List
<
String
>
value
=
data
.
stream
().
map
(
map
->
map
.
get
(
"value"
)).
collect
(
Collectors
.
toList
());
Collections
.
reverse
(
value
);
result
.
put
(
"ydata"
,
value
);
return
result
;
}
public
void
getCitySecurityIndex
(
List
<
Map
<
String
,
String
>>
finalData
,
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
)
{
/**
/**
* 计算权重,总分100分:
* 计算权重,总分100分:
* 检验超期率、检验合格率、充装检查率、充装检查合格率,占15%
* 检验超期率、检验合格率、充装检查率、充装检查合格率,占15%
...
@@ -261,6 +286,7 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -261,6 +286,7 @@ public class AQZSDPStatisticsServiceImpl {
regionCodeSecurityIndexMap
.
forEach
((
k
,
v
)
->
{
regionCodeSecurityIndexMap
.
forEach
((
k
,
v
)
->
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"name"
,
v
.
getRegionName
());
item
.
put
(
"name"
,
v
.
getRegionName
());
item
.
put
(
"regionCode"
,
v
.
getRegionCode
());
// 许可有效率的加权值
// 许可有效率的加权值
double
xukeWeighted
=
Double
.
parseDouble
(
v
.
getXuke
())
*
weightTen
;
double
xukeWeighted
=
Double
.
parseDouble
(
v
.
getXuke
())
*
weightTen
;
// 使用登记办理率的加权值
// 使用登记办理率的加权值
...
@@ -282,30 +308,10 @@ public class AQZSDPStatisticsServiceImpl {
...
@@ -282,30 +308,10 @@ public class AQZSDPStatisticsServiceImpl {
item
.
put
(
"value"
,
String
.
format
(
"%.2f"
,
totalIndex
));
item
.
put
(
"value"
,
String
.
format
(
"%.2f"
,
totalIndex
));
finalData
.
add
(
item
);
finalData
.
add
(
item
);
});
});
data
=
finalData
.
stream
()
.
filter
(
map
->
map
.
containsKey
(
"value"
))
.
sorted
(
Comparator
.
comparingDouble
(
map
->
{
// 检查并解析值,如果失败则返回Double.MIN_VALUE(或根据需要处理)
try
{
return
Double
.
parseDouble
(
map
.
get
(
"value"
));
}
catch
(
NumberFormatException
e
)
{
// 处理无法解析为double的情况,这里返回Double.MIN_VALUE表示最小
// 或者可以抛出自定义异常,记录日志等
return
Double
.
MIN_VALUE
;
}
}))
.
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
String
>
name
=
data
.
stream
().
map
(
map
->
map
.
get
(
"name"
)).
collect
(
Collectors
.
toList
());
Collections
.
reverse
(
name
);
result
.
put
(
"xdata"
,
name
);
List
<
String
>
value
=
data
.
stream
().
map
(
map
->
map
.
get
(
"value"
)).
collect
(
Collectors
.
toList
());
Collections
.
reverse
(
value
);
result
.
put
(
"ydata"
,
value
);
return
result
;
}
}
private
Map
<
String
,
SecurityIndexCountItemDto
>
getSecurityIndexCountItemDtoMap
(
List
<
RegionModel
>
regionModels
)
{
public
Map
<
String
,
SecurityIndexCountItemDto
>
getSecurityIndexCountItemDtoMap
(
List
<
RegionModel
>
regionModels
)
{
// 多线程处理后,顺序与regionModels的顺序不一致,故生成list
// 多线程处理后,顺序与regionModels的顺序不一致,故生成list
List
<
SecurityIndexCountItemDto
>
countItemDtoList
=
getSecurityIndexCountDtoList
(
regionModels
);
List
<
SecurityIndexCountItemDto
>
countItemDtoList
=
getSecurityIndexCountDtoList
(
regionModels
);
return
countItemDtoList
.
stream
().
collect
(
Collectors
.
toMap
(
SecurityIndexCountItemDto:
:
getRegionCode
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
return
countItemDtoList
.
stream
().
collect
(
Collectors
.
toMap
(
SecurityIndexCountItemDto:
:
getRegionCode
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
...
...
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 @
9a73b17d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SubTreeDto
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.AnomalyTypeEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.ESCylinderFillingRecordDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.CylinderAreaDataMapper
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.CylinderAreaDataMapper
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.CylinderInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.CylinderInfoMapper
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchRequest
;
...
@@ -22,15 +35,20 @@ import org.elasticsearch.client.core.CountRequest;
...
@@ -22,15 +35,20 @@ import org.elasticsearch.client.core.CountRequest;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.SearchHit
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
...
@@ -59,6 +77,9 @@ public class CylinderDPStatisticsServiceImpl {
...
@@ -59,6 +77,9 @@ public class CylinderDPStatisticsServiceImpl {
private
AQZSDPStatisticsMapper
statisticsMapper
;
private
AQZSDPStatisticsMapper
statisticsMapper
;
@Autowired
private
AQZSDPStatisticsServiceImpl
statisticsService
;
/**
/**
* 气瓶图列换算单位上限
* 气瓶图列换算单位上限
*/
*/
...
@@ -387,8 +408,8 @@ public class CylinderDPStatisticsServiceImpl {
...
@@ -387,8 +408,8 @@ public class CylinderDPStatisticsServiceImpl {
List
<
CylinderFillingRecordStatisticsDto
>
fillingRecord
=
new
ArrayList
<>(
0
);
List
<
CylinderFillingRecordStatisticsDto
>
fillingRecord
=
new
ArrayList
<>(
0
);
List
<
CylinderFillingRecordStatisticsDto
>
offloading
=
new
ArrayList
<>(
0
);
List
<
CylinderFillingRecordStatisticsDto
>
offloading
=
new
ArrayList
<>(
0
);
if
(
orgCode
!=
null
){
if
(
orgCode
!=
null
){
fillingRecord
=
cylinderInfoMapper
.
queryFillingRecordByOrgCode
(
orgCode
,
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)));
fillingRecord
=
cylinderInfoMapper
.
queryFillingRecordByOrgCode
(
orgCode
,
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
,
null
);
offloading
=
cylinderInfoMapper
.
queryoffloadingByOrgCode
(
orgCode
,
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)));
offloading
=
cylinderInfoMapper
.
queryoffloadingByOrgCode
(
orgCode
,
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
,
null
);
}
}
Map
<
String
,
String
>
fillingRecordMap
=
fillingRecord
.
stream
().
collect
(
Collectors
.
toMap
(
CylinderFillingRecordStatisticsDto:
:
getTime
,
CylinderFillingRecordStatisticsDto:
:
getFillingQuantity
));
Map
<
String
,
String
>
fillingRecordMap
=
fillingRecord
.
stream
().
collect
(
Collectors
.
toMap
(
CylinderFillingRecordStatisticsDto:
:
getTime
,
CylinderFillingRecordStatisticsDto:
:
getFillingQuantity
));
Map
<
String
,
String
>
offloadingMap
=
offloading
.
stream
().
collect
(
Collectors
.
toMap
(
CylinderFillingRecordStatisticsDto:
:
getTime
,
CylinderFillingRecordStatisticsDto:
:
getOffloadingVolume
));
Map
<
String
,
String
>
offloadingMap
=
offloading
.
stream
().
collect
(
Collectors
.
toMap
(
CylinderFillingRecordStatisticsDto:
:
getTime
,
CylinderFillingRecordStatisticsDto:
:
getOffloadingVolume
));
...
@@ -436,13 +457,267 @@ public class CylinderDPStatisticsServiceImpl {
...
@@ -436,13 +457,267 @@ public class CylinderDPStatisticsServiceImpl {
// 已对接总数(存在充装业务数据的企业则认为已对接)
// 已对接总数(存在充装业务数据的企业则认为已对接)
Long
count
=
cylinderStatisticsMapper
.
countEnterpriseUsed
(
orgCode
);
Long
count
=
cylinderStatisticsMapper
.
countEnterpriseUsed
(
orgCode
);
if
(
totalNum
!=
null
&&
count
!=
null
){
if
(
totalNum
!=
null
&&
count
!=
null
)
{
result
.
put
(
"stationRate"
,
count
.
doubleValue
()/
totalNum
.
doubleValue
());
BigDecimal
percent
=
(
new
BigDecimal
(
count
.
doubleValue
()
*
100
).
divide
(
new
BigDecimal
(
totalNum
.
doubleValue
()),
2
,
RoundingMode
.
HALF_UP
));
}
else
{
result
.
put
(
"stationRate"
,
Double
.
valueOf
(
percent
.
toString
()));
result
.
put
(
"stationRate"
,
0.0
);
}
else
{
result
.
put
(
"stationRate"
,
0.0
);
}
result
.
put
(
"totalNum"
,
totalNum
);
result
.
put
(
"count"
,
count
);
return
result
;
}
public
List
<
EquipmentCategoryDto
>
securityIndexSubTree
()
{
List
<
EquipmentCategoryDto
>
equipmentCategory
=
new
ArrayList
<>();
EquipmentCategoryDto
equipmentCategoryDto
=
new
EquipmentCategoryDto
();
equipmentCategoryDto
.
setCode
(
CylinderTypeEnum
.
CYLINDER
.
getCode
());
equipmentCategoryDto
.
setName
(
"气"
+
CylinderTypeEnum
.
CYLINDER
.
getName
());
equipmentCategory
.
add
(
equipmentCategoryDto
);
return
equipmentCategory
;
}
public
Map
<
String
,
Object
>
securityIndexSubChart
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
dpFilterParamDto
.
getCityCode
());
Map
<
String
,
SecurityIndexCountItemDto
>
regionCodeSecurityIndexMap
=
statisticsService
.
getSecurityIndexCountItemDtoMap
(
regionModels
);
List
<
Map
<
String
,
String
>>
finalData
=
new
ArrayList
<>();
statisticsService
.
getCitySecurityIndex
(
finalData
,
regionCodeSecurityIndexMap
);
List
<
String
>
xdata
=
stCommonService
.
buildXData
(
regionModels
);
List
<
String
>
yData
=
new
ArrayList
<>();
regionModels
.
forEach
(
r
->
{
String
s
=
finalData
.
stream
().
filter
(
e
->
e
.
get
(
"regionCode"
).
equals
(
r
.
getRegionCode
().
toString
())).
collect
(
Collectors
.
toList
()).
get
(
0
).
get
(
"value"
);
yData
.
add
(
s
);
});
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"xdata"
,
xdata
);
result
.
put
(
"ydata"
,
yData
);
return
result
;
}
public
SubTreeDto
getFillingSubTree
()
{
SubTreeDto
subTreeDto
=
new
SubTreeDto
();
subTreeDto
.
setTitle
(
"气"
+
CylinderTypeEnum
.
CYLINDER
.
getName
());
subTreeDto
.
setValue
(
CylinderTypeEnum
.
CYLINDER
.
getCode
());
List
<
SubTreeDto
>
children
=
new
ArrayList
<>();
for
(
CylinderTypeEnum
value
:
CylinderTypeEnum
.
values
())
{
if
(
value
.
getCode
()
!=
CylinderTypeEnum
.
CYLINDER
.
getCode
())
{
SubTreeDto
subTree
=
new
SubTreeDto
();
subTree
.
setTitle
(
value
.
getName
());
subTree
.
setValue
(
value
.
getCode
());
children
.
add
(
subTree
);
}
}
subTreeDto
.
setChildren
(
children
);
return
subTreeDto
;
}
public
Map
<
String
,
Object
>
getFillingSubChart
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
String
>
xdata
=
stCommonService
.
buildXData
(
regionModels
);
List
<
Long
>
fillingQuantitys
=
new
ArrayList
<>();
List
<
Long
>
offloadingVolumes
=
new
ArrayList
<>();
String
startTime
,
endTime
;
if
(
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()))
{
startTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
endTime
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
}
else
{
startTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
();
endTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
();
}
String
cylinderVarietyName
=
CylinderTypeEnum
.
of
(
dpFilterParamForDetailDto
.
getCylinderVariety
());
regionModels
.
forEach
(
r
->
{
long
fillingQuantity
=
cylinderInfoMapper
.
queryFillingRecordByOrgCode
(
r
.
getRegionCode
().
toString
(),
startTime
,
endTime
).
stream
().
map
(
e
->
e
.
getFillingQuantity
()).
collect
(
Collectors
.
toList
()).
stream
().
count
();
long
offloadingVolume
=
cylinderInfoMapper
.
queryoffloadingByOrgCode
(
r
.
getRegionCode
().
toString
(),
startTime
,
endTime
).
stream
().
map
(
e
->
e
.
getOffloadingVolume
()).
collect
(
Collectors
.
toList
()).
stream
().
count
();
fillingQuantitys
.
add
(
fillingQuantity
);
offloadingVolumes
.
add
(
offloadingVolume
);
});
Set
<
Map
<
String
,
String
>>
legendData
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"fillingQuantity"
);
map
.
put
(
"value"
,
"充装量"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
map
.
put
(
"dataKey"
,
"offloadingVolume"
);
map
.
put
(
"value"
,
"卸液量"
);
map
.
put
(
"chartType"
,
"bar"
);
}
legendData
.
add
(
map
);
}
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"xdata"
,
xdata
);
result
.
put
(
"fillingQuantity"
,
fillingQuantitys
);
result
.
put
(
"offloadingVolume"
,
offloadingVolumes
);
result
.
put
(
"legendData"
,
legendData
);
return
result
;
}
public
Page
<
ESCylinderFillingRecordDto
>
getFillingSubPage
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
int
current
=
dpFilterParamForDetailDto
.
getCurrent
();
int
pageSize
=
dpFilterParamForDetailDto
.
getSize
();
Page
<
ESCylinderFillingRecordDto
>
result
=
new
Page
<>(
current
,
pageSize
);
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"cylinder_filling"
);
//通用匹配规则,条件构建
boolean
flag
=
true
;
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
//匹配行政区划
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getCityCode
()))
{
flag
=
false
;
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
wildcardQuery
(
"regionCode"
,
"*"
+
dpFilterParamForDetailDto
.
getCityCode
()
+
"*"
));
boolMust
.
must
(
query
);
}
//匹配气瓶充装异常情况(0:正常,1:异常)
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getAnomalyType
()))
{
flag
=
false
;
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
String
status
=
AnomalyTypeEnum
.
getEnumByStatus
(
dpFilterParamForDetailDto
.
getAnomalyType
()).
getName
();
query
.
must
(
QueryBuilders
.
wildcardQuery
(
"anomalyType"
,
"*"
+
status
+
"*"
));
boolMust
.
must
(
query
);
}
//匹配气瓶类型(0:正常,1:异常)
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getCylinderVariety
()))
{
flag
=
false
;
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
String
cylinderVarietyName
=
CylinderTypeEnum
.
of
(
dpFilterParamForDetailDto
.
getCylinderVariety
());
query
.
must
(
QueryBuilders
.
wildcardQuery
(
"cylinderVarietyName"
,
"*"
+
cylinderVarietyName
+
"*"
));
boolMust
.
must
(
query
);
}
String
fillingStartTime
,
fillingEndTime
;
if
(
ObjectUtils
.
isEmpty
(
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()))
{
fillingStartTime
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 00:00:00"
;
fillingEndTime
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
+
" 23:59:59"
;
}
else
{
fillingStartTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 00:00:00"
;
fillingEndTime
=
dpFilterParamForDetailDto
.
getTimeSearchOne
().
getBeginDate
()
+
" 23:59:59"
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
DateUtils
.
DATE_TIME_PATTERN
);
//充装时间
if
(!
ObjectUtils
.
isEmpty
(
fillingStartTime
)
&&
!
ObjectUtils
.
isEmpty
(
fillingEndTime
)
)
{
flag
=
false
;
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
try
{
query
.
must
(
QueryBuilders
.
rangeQuery
(
"inspectionDateMs"
).
gte
(
sdf
.
parse
(
fillingStartTime
).
getTime
()));
query
.
must
(
QueryBuilders
.
rangeQuery
(
"inspectionDateAfterMS"
).
lte
(
sdf
.
parse
(
fillingEndTime
).
getTime
()));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
boolMust
.
must
(
query
);
}
if
(
flag
)
{
// 搜索全部
boolMust
.
must
(
QueryBuilders
.
matchAllQuery
());
}
builder
.
query
(
boolMust
);
builder
.
sort
(
"inspectionDateMs"
,
SortOrder
.
DESC
);
builder
.
sort
(
"sequenceNbr"
,
SortOrder
.
DESC
);
builder
.
from
((
current
-
1
)
*
pageSize
);
builder
.
size
(
pageSize
);
builder
.
trackTotalHits
(
true
);
request
.
source
(
builder
);
List
<
ESCylinderFillingRecordDto
>
list
=
new
LinkedList
<>();
long
totle
=
0
;
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
SearchHit
hit
:
response
.
getHits
())
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
ESCylinderFillingRecordDto
esCylinderFillingRecordDto1
=
JSONObject
.
toJavaObject
(
jsonObject
.
getJSONObject
(
"sourceAsMap"
),
ESCylinderFillingRecordDto
.
class
);
list
.
add
(
esCylinderFillingRecordDto1
);
}
totle
=
response
.
getInternalResponse
().
hits
().
getTotalHits
().
value
;
result
.
setRecords
(
list
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
result
;
}
public
List
<
Map
<
String
,
Object
>>
getFillingSubAnomalyType
()
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
for
(
AnomalyTypeEnum
value
:
AnomalyTypeEnum
.
values
())
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"value"
,
value
.
getCode
());
map
.
put
(
"label"
,
value
.
getName
());
result
.
add
(
map
);
}
return
result
;
}
public
SubTreeDto
getStationRateSubTree
()
{
SubTreeDto
subTreeDto
=
new
SubTreeDto
();
subTreeDto
.
setTitle
(
"企业类型"
);
subTreeDto
.
setValue
(
""
);
List
<
SubTreeDto
>
children
=
new
ArrayList
<>();
SubTreeDto
subTree
=
new
SubTreeDto
();
subTree
.
setTitle
(
"充装企业"
);
subTree
.
setValue
(
"1231"
);
children
.
add
(
subTree
);
subTreeDto
.
setChildren
(
children
);
return
subTreeDto
;
}
public
Map
<
String
,
Object
>
getStationRateSubChart
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
String
>
xdata
=
stCommonService
.
buildXData
(
regionModels
);
List
<
String
>
counts
=
new
ArrayList
<>();
List
<
String
>
stationRates
=
new
ArrayList
<>();
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
returnList
=
regionList
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
().
toString
());
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"regionCode"
,
r
.
getRegionCode
());
getStationRate
(
orgCode
,
item
);
return
item
;
}).
collect
(
Collectors
.
toList
());
regionModels
.
forEach
(
r
->
{
String
count
=
returnList
.
stream
().
filter
(
e
->
e
.
get
(
"regionCode"
).
toString
().
equals
(
r
.
getRegionCode
().
toString
())).
collect
(
Collectors
.
toList
()).
get
(
0
).
get
(
"totalNum"
).
toString
();
String
stationRate
=
returnList
.
stream
().
filter
(
e
->
e
.
get
(
"regionCode"
).
toString
().
equals
(
r
.
getRegionCode
().
toString
())).
collect
(
Collectors
.
toList
()).
get
(
0
).
get
(
"stationRate"
).
toString
();
counts
.
add
(
count
);
stationRates
.
add
(
stationRate
);
});
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Set
<
Map
<
String
,
String
>>
legendData
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"count"
);
map
.
put
(
"value"
,
"对接企业数量"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
map
.
put
(
"dataKey"
,
"stationRate"
);
map
.
put
(
"value"
,
"对接率"
);
map
.
put
(
"chartType"
,
"line"
);
}
legendData
.
add
(
map
);
}
result
.
put
(
"legendData"
,
legendData
);
result
.
put
(
"xdata"
,
xdata
);
result
.
put
(
"count"
,
counts
);
result
.
put
(
"stationRate"
,
stationRates
);
return
result
;
}
public
IPage
<
TzBaseEnterpriseInfoDto
>
getStationRateSubPage
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
Page
<
TzBaseEnterpriseInfoDto
>
page
=
new
Page
<>(
dpFilterParamForDetailDto
.
getCurrent
(),
dpFilterParamForDetailDto
.
getSize
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
if
(
ObjectUtils
.
isEmpty
(
orgCode
)){
return
null
;
}
}
result
.
put
(
"totalNum"
,
totalNum
);
IPage
<
TzBaseEnterpriseInfoDto
>
result
=
cylinderStatisticsMapper
.
getStationRateSubPage
(
page
,
dpFilterParamForDetailDto
.
getCompanyName
(),
orgCode
);
result
.
put
(
"count"
,
count
);
return
result
;
return
result
;
}
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/flc/api/mapper/CylinderInfoMapper.java
View file @
9a73b17d
...
@@ -89,7 +89,11 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
...
@@ -89,7 +89,11 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
Integer
getInfoTotal
();
Integer
getInfoTotal
();
List
<
CylinderFillingRecordStatisticsDto
>
queryFillingRecordByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"startTime"
)
String
startTime
);
List
<
CylinderFillingRecordStatisticsDto
>
queryFillingRecordByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
List
<
CylinderFillingRecordStatisticsDto
>
queryoffloadingByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"startTime"
)
String
startTime
);
List
<
CylinderFillingRecordStatisticsDto
>
queryoffloadingByOrgCode
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/CylinderInfoMapper.xml
View file @
9a73b17d
...
@@ -347,7 +347,10 @@
...
@@ -347,7 +347,10 @@
tz_base_enterprise_info i
tz_base_enterprise_info i
WHERE
WHERE
i.app_id = f.app_id
i.app_id = f.app_id
AND f.filling_endtime >= concat(#{startTime}, ' 00:00:00')
AND f.filling_endtime
<![CDATA[>=]]>
concat(#{startTime}, ' 00:00:00')
<if
test=
"endTime != null and endTime != '' "
>
AND f.filling_endtime
<![CDATA[<=]]>
concat(#{endTime}, ' 00:00:00')
</if>
AND i.org_code like concat(#{orgCode}, '%')
AND i.org_code like concat(#{orgCode}, '%')
GROUP BY
GROUP BY
filling_time
filling_time
...
@@ -358,13 +361,16 @@
...
@@ -358,13 +361,16 @@
<select
id=
"queryoffloadingByOrgCode"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto"
>
<select
id=
"queryoffloadingByOrgCode"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto"
>
SELECT
SELECT
f.statistics_sync_date filling_time,
f.statistics_sync_date filling_time,
SUM ( f.offloading_volume )
filling_quantity
SUM ( f.offloading_volume )
offloading_volume
FROM
FROM
tz_cylinder_offloading f,
tz_cylinder_offloading f,
tz_base_enterprise_info i
tz_base_enterprise_info i
WHERE
WHERE
i.app_id = f.app_id
i.app_id = f.app_id
AND f.statistics_sync_date >= #{startTime}
AND f.statistics_sync_date
<![CDATA[>=]]>
#{startTime}
<if
test=
"endTime != null and endTime != '' "
>
AND f.statistics_sync_date
<![CDATA[<=]]>
#{endTime}
</if>
AND i.org_code like concat(#{orgCode}, '%')
AND i.org_code like concat(#{orgCode}, '%')
GROUP BY
GROUP BY
filling_time
filling_time
...
...
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