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
eaeed283
Commit
eaeed283
authored
Jul 24, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安全追溯大屏提交
1.当前区域数据统计 2.当前区域子区域数据统计 3.当月问题列表(主体类型、问题类型、问题时间、操作) 4.当年问题等级分类统计 5.按问题类型排名top 10 6.当年下级区域问题闭环率排名 7.按问题类型排名top10
parent
b8349350
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
18 deletions
+171
-18
IssueMainBodyEnum.java
.../amos/boot/module/common/api/enums/IssueMainBodyEnum.java
+0
-2
IssueTypeEnum.java
...join/amos/boot/module/common/api/enums/IssueTypeEnum.java
+16
-11
DPStatisticsMapper.java
...s/boot/module/cylinder/api/mapper/DPStatisticsMapper.java
+5
-1
DPStatisticsMapper.xml
...nder-api/src/main/resources/mapper/DPStatisticsMapper.xml
+38
-0
CylinderStatisticsController.java
...nder/flc/biz/controller/CylinderStatisticsController.java
+24
-0
CylinderAreaDataServiceImpl.java
...der/flc/biz/service/impl/CylinderAreaDataServiceImpl.java
+88
-4
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/enums/IssueMainBodyEnum.java
View file @
eaeed283
...
...
@@ -15,8 +15,6 @@ public enum IssueMainBodyEnum {
COMPANY
(
"企业"
,
"2"
),
//设备
EQUIPMENT
(
"设备"
,
"3"
),
//气瓶
CYLINDER
(
"气瓶"
,
"4"
),
;
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/IssueTypeEnum.java
View file @
eaeed283
...
...
@@ -10,13 +10,13 @@ import java.util.List;
@Getter
public
enum
IssueTypeEnum
{
//检验超期(设备)
CHECK_OVERDUE_EQUMENT
(
"检验超期"
,
"2"
,
"3"
),
CHECK_OVERDUE_EQUMENT
(
"检验超期"
,
"2"
,
"3
,4
"
),
//维保超期(设备)
MAINTENANCE_OVERDUE_EQUMENT
(
"维保超期"
,
"1"
,
"3"
),
//资质超期(设备)
QUALIFICATION_OVERDUE_EQUMENT
(
"资质超期"
,
"3"
,
"3"
),
//检验不合格(设备)
CHECK_UNQUALIFIED_EQUMENT
(
"检验不合格"
,
"4"
,
"3"
),
CHECK_UNQUALIFIED_EQUMENT
(
"检验不合格"
,
"4"
,
"3
,4
"
),
//超设计使用年限(设备)
DESIGN_OVERDUE_EQUMENT
(
"超设计使用年限"
,
"5"
,
"3"
),
//电梯困人(设备)
...
...
@@ -33,16 +33,12 @@ public enum IssueTypeEnum {
LICENSE_EXPIRY_PERSON
(
"许可临期"
,
"11"
,
"1"
),
//许可超期(个人)
LICENSE_OVERDUE_PERSON
(
"许可超期"
,
"12"
,
"1"
),
//许可超期(气瓶)
LICENSE_OVERDUE_CYLINDER
(
"许可超期"
,
"13"
,
"4"
),
//检验超期(气瓶)
CHECK_OVERDUE_CYLINDER
(
"检验超期"
,
"14"
,
"4"
),
//检验不合格(气瓶)
CHECK_UNQUALIFIED_CYLINDER
(
"检验不合格"
,
"15"
,
"4"
),
//操作人员资质超期(气瓶)
OPERATOR_QUALIFICATION_OVERDUE_CYLINDER
(
"操作人员资质超期"
,
"1
6"
,
"1
"
),
OPERATOR_QUALIFICATION_OVERDUE_CYLINDER
(
"操作人员资质超期"
,
"1
3"
,
"4
"
),
//充装异常(气瓶)
CHARGE_EXCEPTION_CYLINDER
(
"充装异常"
,
"17"
,
"4"
),
CHARGE_EXCEPTION_CYLINDER
(
"充装异常"
,
"14"
,
"4"
),
//许可超期(设备,气瓶)
LICENSE_OVERDUE
(
"许可超期"
,
"14"
,
"3,4"
),
...
...
@@ -68,10 +64,19 @@ public enum IssueTypeEnum {
return
list
;
}
public
static
String
getNameByCode
(
String
code
)
{
for
(
IssueTypeEnum
testEnum
:
EnumSet
.
allOf
(
IssueTypeEnum
.
class
))
{
if
(
testEnum
.
getCode
().
equals
(
code
)){
return
testEnum
.
getName
();
}
}
return
null
;
}
public
static
List
<
String
>
getEnumNameListByMainBody
(
String
mainBody
)
{
List
<
String
>
list
=
new
ArrayList
<>();
for
(
IssueTypeEnum
testEnum
:
EnumSet
.
allOf
(
IssueTypeEnum
.
class
))
{
if
(
mainBody
.
equals
(
testEnum
.
getMainBody
()
)){
if
(
testEnum
.
getMainBody
().
contains
(
mainBody
)){
list
.
add
(
testEnum
.
getName
());
}
}
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/api/mapper/DPStatisticsMapper.java
View file @
eaeed283
...
...
@@ -17,7 +17,7 @@ public interface DPStatisticsMapper {
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"status"
)
String
status
);
List
<
Map
<
String
,
Object
>>
selectByOrgAndProblemType
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"enumNameList"
)
List
<
String
>
enumNameList
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"sourceType"
)
String
sourceType
);
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"sourceType"
)
String
sourceType
,
@Param
(
"equipType"
)
String
equipType
);
List
<
Map
<
String
,
Object
>>
getIssueCountByMonth
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"year"
)
String
year
,
@Param
(
"status"
)
String
status
);
List
<
Map
<
String
,
Object
>>
getIssueCountByDate
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"year"
)
String
year
,
@Param
(
"status"
)
String
status
);
...
...
@@ -34,5 +34,9 @@ public interface DPStatisticsMapper {
List
<
Map
<
String
,
Object
>>
issueCompanyTop
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"time"
)
String
time
);
List
<
Map
<
String
,
Object
>>
issueChildrenCityCountTop
(
@Param
(
"orgCodes"
)
List
<
String
>
orgCodes
,
@Param
(
"now"
)
String
now
,
@Param
(
"status"
)
String
status
);
List
<
Map
<
String
,
Object
>>
issueCountTopByProblemType
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"status"
)
String
status
);
List
<
EquipQuestionNumCountDto
>
queryEquipQuestionList
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamDto
);
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/resources/mapper/DPStatisticsMapper.xml
View file @
eaeed283
...
...
@@ -35,6 +35,9 @@
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND problem_time
>
= #{startDate}
AND source_type = #{sourceType}
<if
test=
"null != equipType"
>
AND equip_list_code = #{equipType}
</if>
AND problem_type IN
<foreach
collection=
"enumNameList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
...
...
@@ -149,6 +152,41 @@
COUNT DESC
LIMIT 10
</select>
<select
id=
"issueChildrenCityCountTop"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ),
governing_body_org_code AS orgCode
FROM
tzs_safety_problem_tracing
WHERE
DATE_FORMAT(problem_time,'%Y')
>
= #{now}
AND
<foreach
collection=
"orgCodes"
item=
"orgCode"
separator=
"OR"
open=
"("
close=
")"
>
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
</foreach>
<if
test=
"null != status"
>
AND problem_status_code = #{status}
</if>
GROUP BY
governing_body_org_code
</select>
<select
id=
"issueCountTopByProblemType"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ),
problem_type_code AS problemTypeCode
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
<if
test=
"null != status"
>
AND problem_status_code = #{status}
</if>
GROUP BY
problem_type_code
ORDER BY
COUNT DESC
LIMIT 10
</select>
<select
id=
"queryEquipQuestionList"
resultType=
"com.yeejoin.amos.boot.module.cylinder.api.dto.EquipQuestionNumCountDto"
>
select
bb."USE_ORG_CODE",
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/controller/CylinderStatisticsController.java
View file @
eaeed283
...
...
@@ -237,4 +237,28 @@ public class CylinderStatisticsController {
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getEquipQuestionList
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"当年下级区域问题闭环率排名"
)
@PostMapping
(
value
=
"/issueChildrenCityCountTop"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
issueChildrenCityCountTop
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
}
List
<
Map
<
String
,
Object
>>
result
=
service
.
issueChildrenCityCountTop
(
regionCode
.
toString
());
return
ResponseHelper
.
buildResponse
(
result
);
};
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"按问题类型排名top 10"
)
@PostMapping
(
value
=
"/issueCountTopByProblemType"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
issueCountTopByProblemType
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
}
List
<
Map
<
String
,
Object
>>
result
=
service
.
issueCountTopByProblemType
(
regionCode
.
toString
());
return
ResponseHelper
.
buildResponse
(
result
);
};
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderAreaDataServiceImpl.java
View file @
eaeed283
...
...
@@ -872,7 +872,7 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
String
orgCode
=
getAndSetOrgCode
(
cityCode
);
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"3"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
());
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
()
,
null
);
list
.
stream
().
forEach
(
t
->{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
...
...
@@ -891,7 +891,7 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
String
orgCode
=
getAndSetOrgCode
(
cityCode
);
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"2"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
COMPANY
.
getName
());
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
COMPANY
.
getName
()
,
null
);
list
.
stream
().
forEach
(
t
->{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
...
...
@@ -923,7 +923,7 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
String
orgCode
=
getAndSetOrgCode
(
cityCode
);
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"1"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
PERSON
.
getName
());
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
PERSON
.
getName
()
,
null
);
list
.
stream
().
forEach
(
t
->{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
...
...
@@ -944,7 +944,7 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
String
orgCode
=
getAndSetOrgCode
(
cityCode
);
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"4"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
CYLINDER
.
getName
()
);
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
(),
"2300"
);
list
.
stream
().
forEach
(
t
->{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
...
...
@@ -1151,4 +1151,87 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
}
return
resultList
;
}
public
List
<
Map
<
String
,
Object
>>
issueChildrenCityCountTop
(
String
cityCode
)
throws
Exception
{
List
<
RegionModel
>
regionModels
=
setRegionIfRootParent
(
cityCode
);
List
<
Integer
>
regionCodeList
=
regionModels
.
stream
().
map
(
m
->
m
.
getRegionCode
()).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
orgCodeAndCompanyCodesByCompanyCodes
=
statisticsMapper
.
getOrgCodeAndCompanyCodesByCompanyCodes
(
regionCodeList
);
List
<
String
>
orgCodes
=
orgCodeAndCompanyCodesByCompanyCodes
.
stream
().
map
(
m
->
m
.
get
(
"orgCode"
)).
collect
(
Collectors
.
toList
());
String
now
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy"
));
Map
<
String
,
String
>
orgCodeAndCompanyCodesMap
=
new
HashMap
<>();
orgCodeAndCompanyCodesByCompanyCodes
.
stream
().
forEach
(
t
->{
orgCodeAndCompanyCodesMap
.
put
(
t
.
get
(
"companyCode"
),
t
.
get
(
"orgCode"
));
});
List
<
Map
<
String
,
Object
>>
allIssueCount
=
statisticsMapper
.
issueChildrenCityCountTop
(
orgCodes
,
now
,
null
);
List
<
Map
<
String
,
Object
>>
endIssueCount
=
statisticsMapper
.
issueChildrenCityCountTop
(
orgCodes
,
now
,
"1"
);
Map
<
String
,
Object
>
allIssuedataMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
endIssuedataMap
=
new
HashMap
<>();
allIssueCount
.
stream
().
forEach
(
t
->{
allIssuedataMap
.
put
(
t
.
get
(
"orgCode"
).
toString
(),
t
.
get
(
"count"
));
});
endIssueCount
.
stream
().
forEach
(
t
->{
endIssuedataMap
.
put
(
t
.
get
(
"orgCode"
).
toString
(),
t
.
get
(
"count"
));
});
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
for
(
RegionModel
regionModel
:
regionModels
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
AtomicInteger
allCount
=
new
AtomicInteger
();
AtomicInteger
endCount
=
new
AtomicInteger
();
map
.
put
(
"region"
,
regionModel
.
getRegionName
());
if
(
StringUtils
.
isNotBlank
(
orgCodeAndCompanyCodesMap
.
get
(
regionModel
.
getRegionCode
()+
""
))){
allIssuedataMap
.
forEach
((
k
,
v
)->{
if
(
k
.
startsWith
(
orgCodeAndCompanyCodesMap
.
get
(
regionModel
.
getRegionCode
()+
""
))){
if
(
null
!=
v
){
allCount
.
addAndGet
(
Integer
.
valueOf
(
v
+
""
));
}
}
});
}
if
(
StringUtils
.
isNotBlank
(
orgCodeAndCompanyCodesMap
.
get
(
regionModel
.
getRegionCode
()+
""
))){
endIssuedataMap
.
forEach
((
k
,
v
)->{
if
(
k
.
startsWith
(
orgCodeAndCompanyCodesMap
.
get
(
regionModel
.
getRegionCode
()+
""
))){
if
(
null
!=
v
){
endCount
.
addAndGet
(
Integer
.
valueOf
(
v
+
""
));
}
}
});
}
if
(
allCount
.
get
()
!=
0
)
{
map
.
put
(
"rate"
,
new
DecimalFormat
(
"0.00"
).
format
(
Double
.
parseDouble
(
endCount
+
""
)
/
(
Double
.
parseDouble
(
allCount
.
get
()+
""
))));
}
else
{
map
.
put
(
"rate"
,
"0.00"
);
}
resultList
.
add
(
map
);
}
resultList
.
sort
(
Comparator
.
comparing
(
m
->
Double
.
valueOf
(
m
.
get
(
"rate"
)+
""
),
Comparator
.
reverseOrder
()));
for
(
int
i
=
0
;
i
<
resultList
.
size
();
i
++){
resultList
.
get
(
i
).
put
(
"sequenceNbr"
,(
i
+
1
)+
""
);
}
return
resultList
;
}
public
List
<
Map
<
String
,
Object
>>
issueCountTopByProblemType
(
String
cityCode
)
{
String
orgCode
=
getAndSetOrgCode
(
cityCode
);
List
<
Map
<
String
,
Object
>>
allList
=
statisticsMapper
.
issueCountTopByProblemType
(
orgCode
,
null
);
List
<
Map
<
String
,
Object
>>
endList
=
statisticsMapper
.
issueCountTopByProblemType
(
orgCode
,
"1"
);
Map
<
String
,
Object
>
endIssuedataMap
=
new
HashMap
<>();
endList
.
stream
().
forEach
(
t
->{
endIssuedataMap
.
put
(
t
.
get
(
"problemTypeCode"
).
toString
(),
t
.
get
(
"count"
));
});
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
allList
.
size
();
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
IssueTypeEnum
.
getNameByCode
(
allList
.
get
(
i
).
get
(
"problemTypeCode"
).
toString
()));
map
.
put
(
"count"
,
allList
.
get
(
i
).
get
(
"count"
));
if
(
null
!=
endIssuedataMap
.
get
(
allList
.
get
(
i
).
get
(
"problemTypeCode"
).
toString
())){
map
.
put
(
"rate"
,
new
DecimalFormat
(
"0.00"
).
format
(
Double
.
parseDouble
(
endIssuedataMap
.
get
(
allList
.
get
(
i
).
get
(
"problemTypeCode"
).
toString
())+
""
)
/
(
Double
.
parseDouble
(
allList
.
get
(
i
).
get
(
"count"
)+
""
))));
}
resultList
.
add
(
map
);
}
return
resultList
;
}
}
\ No newline at end of file
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