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
781882bb
Commit
781882bb
authored
Sep 19, 2024
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务30565 大屏隐患列表后端调整
parent
cde9ccf2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
0 deletions
+122
-0
SafetyProblemTracingDto.java
.../amos/boot/module/jg/api/dto/SafetyProblemTracingDto.java
+9
-0
SafetyProblemTracingMapper.java
...boot/module/jg/api/mapper/SafetyProblemTracingMapper.java
+4
-0
SafetyProblemTracingMapper.xml
.../src/main/resources/mapper/SafetyProblemTracingMapper.xml
+34
-0
JGDPStatisticsController.java
...le/statistcs/biz/controller/JGDPStatisticsController.java
+12
-0
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+63
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/SafetyProblemTracingDto.java
View file @
781882bb
...
@@ -139,4 +139,13 @@ public class SafetyProblemTracingDto extends BaseDto {
...
@@ -139,4 +139,13 @@ public class SafetyProblemTracingDto extends BaseDto {
@ApiModelProperty
(
value
=
"问题等级code"
)
@ApiModelProperty
(
value
=
"问题等级code"
)
private
String
problemLevelCode
;
private
String
problemLevelCode
;
@ApiModelProperty
(
value
=
"隐患等级(红:隐患状态为未处理、黄:暂无、绿:隐患状态为已处理、灰:暂无)"
)
private
String
hiddenDangersLevel
;
@ApiModelProperty
(
value
=
"设备类别code"
)
private
String
equCategoryCode
;
@ApiModelProperty
(
value
=
"设备类别"
)
private
String
equCategory
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/SafetyProblemTracingMapper.java
View file @
781882bb
...
@@ -24,4 +24,8 @@ public interface SafetyProblemTracingMapper extends BaseMapper<SafetyProblemTrac
...
@@ -24,4 +24,8 @@ public interface SafetyProblemTracingMapper extends BaseMapper<SafetyProblemTrac
Page
<
Map
<
String
,
Object
>>
queryPrincipalUnitByProblemId
(
Page
<
Map
<
String
,
Object
>>
page
,
String
problemId
,
String
sourceTypeCode
);
Page
<
Map
<
String
,
Object
>>
queryPrincipalUnitByProblemId
(
Page
<
Map
<
String
,
Object
>>
page
,
String
problemId
,
String
sourceTypeCode
);
List
<
Map
<
String
,
Object
>>
queryOutOfMaintenanceRecord
();
List
<
Map
<
String
,
Object
>>
queryOutOfMaintenanceRecord
();
List
<
String
>
getBusinessType
(
@Param
(
"sourceTypeCode"
)
String
sourceTypeCode
);
List
<
Map
<
String
,
Object
>>
getBusinessCount
(
@Param
(
"sourceTypeCode"
)
String
sourceTypeCode
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/SafetyProblemTracingMapper.xml
View file @
781882bb
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.SafetyProblemTracingDto"
>
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.SafetyProblemTracingDto"
>
select
select
spt.*,
spt.*,
case when spt."problem_status_code" = '0' then '红'
else '绿' end hiddenDangersLevel,
(select extend::json->>'pic' from cb_data_dictionary where type = 'ISSUE_TYPE' and code = spt.problem_type_code) problemTypePic
(select extend::json->>'pic' from cb_data_dictionary where type = 'ISSUE_TYPE' and code = spt.problem_type_code) problemTypePic
from tzs_safety_problem_tracing spt
from tzs_safety_problem_tracing spt
<where>
<where>
...
@@ -46,6 +48,9 @@
...
@@ -46,6 +48,9 @@
<if
test=
"problemModel.principalUnitType != null and problemModel.principalUnitType != ''"
>
<if
test=
"problemModel.principalUnitType != null and problemModel.principalUnitType != ''"
>
and spt.principal_unit_type = #{problemModel.principalUnitType}
and spt.principal_unit_type = #{problemModel.principalUnitType}
</if>
</if>
<if
test=
"problemModel.hiddenDangersLevel != null and problemModel.hiddenDangersLevel != ''"
>
and spt.problem_status_code = #{problemModel.hiddenDangersLevel}
</if>
<if
test=
"problemModel.regionCode != null and problemModel.regionCode != ''"
>
<if
test=
"problemModel.regionCode != null and problemModel.regionCode != ''"
>
and spt.region_code like CONCAT(#{problemModel.regionCode}, '%')
and spt.region_code like CONCAT(#{problemModel.regionCode}, '%')
</if>
</if>
...
@@ -126,4 +131,33 @@
...
@@ -126,4 +131,33 @@
spt.sequence_nbr = #{problemId}
spt.sequence_nbr = #{problemId}
) t WHERE t.sourceTypeCode = #{sourceTypeCode}
) t WHERE t.sourceTypeCode = #{sourceTypeCode}
</select>
</select>
<select
id=
"getBusinessType"
resultType=
"java.lang.String"
>
SELECT
problem_type
FROM
tzs_safety_problem_tracing
where
is_delete = '0'
<if
test=
"sourceTypeCode != null and sourceTypeCode != ''"
>
and source_type_code = #{sourceTypeCode}
</if>
GROUP BY problem_type
</select>
<select
id=
"getBusinessCount"
resultType=
"java.util.Map"
>
SELECT
source_type sourceType,
COUNT ( 1 ) num,
problem_type problemType,
problem_status_code problemStatusCode
FROM
tzs_safety_problem_tracing
WHERE
is_delete = '0'
<if
test=
"sourceTypeCode != null and sourceTypeCode != ''"
>
and source_type_code = #{sourceTypeCode}
</if>
GROUP BY
problem_type,
problem_status_code;
</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/JGDPStatisticsController.java
View file @
781882bb
...
@@ -502,6 +502,18 @@ public class JGDPStatisticsController {
...
@@ -502,6 +502,18 @@ public class JGDPStatisticsController {
}
}
/**
/**
* 隐患列表分组等级柱状折线图
*
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/safety-problem-tracing/chart/dp"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"隐患列表分组等级柱状折线图"
,
notes
=
"隐患列表分组等级柱状折线图"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getProblemChart
(
@RequestBody
(
required
=
false
)
SafetyProblemTracingDto
problemModel
)
{
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getProblemChart
(
problemModel
));
}
/**
* 列表分页查询-大屏监督管理使用
* 列表分页查询-大屏监督管理使用
*
*
* @param current 当前页
* @param current 当前页
...
...
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/JGDPStatisticsServiceImpl.java
View file @
781882bb
...
@@ -3249,4 +3249,67 @@ public class JGDPStatisticsServiceImpl {
...
@@ -3249,4 +3249,67 @@ public class JGDPStatisticsServiceImpl {
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
return
jgUseRegistrationManageMapper
.
getRecords
(
page
,
dto
,
orgCode
);
return
jgUseRegistrationManageMapper
.
getRecords
(
page
,
dto
,
orgCode
);
}
}
public
Map
<
String
,
Object
>
getProblemChart
(
SafetyProblemTracingDto
problemModel
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
String
sourceTypeCode
=
problemModel
.
getSourceTypeCode
();
List
<
String
>
xdata
=
safetyProblemTracingMapper
.
getBusinessType
(
sourceTypeCode
);
if
(
ObjectUtils
.
isEmpty
(
xdata
)){
return
resultMap
;
}
List
<
Map
<
String
,
Object
>>
countMap
=
safetyProblemTracingMapper
.
getBusinessCount
(
sourceTypeCode
);
List
<
String
>
redCount
=
new
ArrayList
<>();
List
<
String
>
yellowCount
=
new
ArrayList
<>();
List
<
String
>
greenCount
=
new
ArrayList
<>();
List
<
String
>
greyCount
=
new
ArrayList
<>();
List
<
String
>
stationRates
=
new
ArrayList
<>();
xdata
.
forEach
(
r
->
{
List
<
Map
<
String
,
Object
>>
redList
=
countMap
.
stream
().
filter
(
map
->
map
.
get
(
"problemType"
).
equals
(
r
)
&&
"0"
.
equals
(
map
.
get
(
"problemStatusCode"
).
toString
())).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
greenList
=
countMap
.
stream
().
filter
(
map
->
map
.
get
(
"problemType"
).
equals
(
r
)
&&
"1"
.
equals
(
map
.
get
(
"problemStatusCode"
).
toString
())).
collect
(
Collectors
.
toList
());
String
red
=
ObjectUtils
.
isEmpty
(
redList
)
?
"0"
:
redList
.
get
(
0
).
get
(
"num"
).
toString
();
String
green
=
ObjectUtils
.
isEmpty
(
greenList
)
?
"0"
:
greenList
.
get
(
0
).
get
(
"num"
).
toString
();
redCount
.
add
(
red
);
greenCount
.
add
(
green
);
yellowCount
.
add
(
"0"
);
greyCount
.
add
(
"0"
);
Long
problemSum
=
Long
.
valueOf
(
red
)
+
Long
.
valueOf
(
green
);
BigDecimal
percent
=
(
new
BigDecimal
(
Double
.
valueOf
(
green
)
*
100
).
divide
(
new
BigDecimal
(
problemSum
.
doubleValue
()),
2
,
RoundingMode
.
HALF_UP
));
stationRates
.
add
(
percent
.
toString
());
});
Set
<
Map
<
String
,
String
>>
legendData
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"redCount"
);
map
.
put
(
"value"
,
"红"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"yellowCount"
);
map
.
put
(
"value"
,
"黄"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"greenCount"
);
map
.
put
(
"value"
,
"绿"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"greyCount"
);
map
.
put
(
"value"
,
"灰"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
map
.
put
(
"dataKey"
,
"stationRate"
);
map
.
put
(
"value"
,
"闭环率"
);
map
.
put
(
"chartType"
,
"line"
);
}
legendData
.
add
(
map
);
}
resultMap
.
put
(
"legendData"
,
legendData
);
resultMap
.
put
(
"xdata"
,
xdata
);
resultMap
.
put
(
"redCount"
,
redCount
);
resultMap
.
put
(
"yellowCount"
,
yellowCount
);
resultMap
.
put
(
"greenCount"
,
greenCount
);
resultMap
.
put
(
"greyCount"
,
greyCount
);
resultMap
.
put
(
"stationRate"
,
stationRates
);
return
resultMap
;
}
}
}
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