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
b1aa0fa1
Commit
b1aa0fa1
authored
Aug 14, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.气瓶问题主题类型统计接口
parent
83d7e740
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
59 deletions
+53
-59
JyjcOpeningApplicationMapper.xml
...rc/main/resources/mapper/JyjcOpeningApplicationMapper.xml
+0
-1
AQZSDPStatisticsMapper.java
.../module/statistics/api/mapper/AQZSDPStatisticsMapper.java
+1
-2
AQZSDPStatisticsMapper.xml
...-api/src/main/resources/mapper/AQZSDPStatisticsMapper.xml
+12
-14
AQZSDPStatisticsController.java
.../statistcs/biz/controller/AQZSDPStatisticsController.java
+5
-5
AQZSDPStatisticsServiceImpl.java
...atistcs/biz/service/impl/AQZSDPStatisticsServiceImpl.java
+35
-37
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcOpeningApplicationMapper.xml
View file @
b1aa0fa1
...
...
@@ -80,7 +80,6 @@
a.unit_code= b.use_unit_code
and a.unit_code=l.unit_code
and l.cert_type_code = a.open_biz_type
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
ORDER BY unitName
</select>
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/AQZSDPStatisticsMapper.java
View file @
b1aa0fa1
...
...
@@ -15,8 +15,7 @@ public interface AQZSDPStatisticsMapper {
String
getOrgCodeByCompanyCode
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
selectByOrgAndMainBody
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"mainBodyNameList"
)
List
<
String
>
mainBodyNameList
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"status"
)
String
status
);
List
<
CountDto
>
selectByOrgAndMainBody
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
filterParamDto
);
List
<
Map
<
String
,
Object
>>
selectByOrgAndProblemType
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"enumNameList"
)
List
<
String
>
enumNameList
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"sourceType"
)
String
sourceType
,
@Param
(
"equipType"
)
String
equipType
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/AQZSDPStatisticsMapper.xml
View file @
b1aa0fa1
...
...
@@ -6,24 +6,22 @@
<select
id=
"getOrgCodeByCompanyCode"
resultType=
"java.lang.String"
>
select org_code from privilege_company where company_code = #{cityCode} limit 1
</select>
<select
id=
"selectByOrgAndMainBody"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ),
source_type AS sourceType
<select
id=
"selectByOrgAndMainBody"
resultType=
"com.yeejoin.amos.boot.biz.common.dto.CountDto"
>
SELECT
COUNT(1) as longValue,
source_type AS keyStr,
problem_status_code as label
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND problem_time
>
= #{startDate}
AND source_type IN
<foreach
collection=
"mainBodyNameList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
<if
test=
"null != status"
>
AND problem_status_code = #{status}
governing_body_org_code LIKE concat (#{orgCode}, '%')
<if
test=
"dto.beginDate !=null and dto.beginDate !=''"
>
and date_ge(CAST(problem_time as date),#{dto.beginDate})
</if>
GROUP BY
source_type
<if
test=
"dto.endDate !=null and dto.endDate !=''"
>
and date_le(CAST(problem_time as date),#{dto.endDate})
</if>
GROUP BY source_type,problem_status_code
</select>
<select
id=
"selectByOrgAndProblemType"
resultType=
"java.util.Map"
>
SELECT COUNT
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/AQZSDPStatisticsController.java
View file @
b1aa0fa1
...
...
@@ -57,12 +57,12 @@ public class AQZSDPStatisticsController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"大屏-安全追溯-左屏-问题类型主体统计"
)
@PostMapping
(
value
=
"/mainBodyCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
mainBodyCount
(
@
RequestBody
Map
<
String
,
Object
>
map
)
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
public
ResponseModel
<
Map
<
String
,
Object
>>
mainBodyCount
(
@
Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
bindingResult
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
bindingResult
.
getFieldErrors
(
);
if
(
!
fieldErrors
.
isEmpty
(
))
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
())
;
}
Map
<
String
,
Object
>
result
=
statisticsService
.
mainBodyCount
(
regionCode
.
toString
()
);
Map
<
String
,
Object
>
result
=
statisticsService
.
mainBodyCount
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
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 @
b1aa0fa1
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum;
import
com.yeejoin.amos.boot.module.common.api.enums.IssueProblemLevelEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.IssueTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemStatusEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.EquipQuestionNumCountDto
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
;
...
...
@@ -316,11 +317,40 @@ public class AQZSDPStatisticsServiceImpl {
countItemDto
.
setJianyanchaoqi
(
"0"
);
}
public
Map
<
String
,
Object
>
mainBodyCount
(
String
cityCode
)
{
public
Map
<
String
,
Object
>
mainBodyCount
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
List
<
Object
>
problemCount
=
new
ArrayList
<>();
List
<
Object
>
problemRate
=
new
ArrayList
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
List
<
String
>
mainBodyNameList
=
IssueMainBodyEnum
.
getEnumNameList
();
// 1.图列设置
List
<
IssueMainBodyEnum
>
mainBodyEnums
=
Arrays
.
asList
(
IssueMainBodyEnum
.
values
());
resultMap
.
put
(
"legendData"
,
buildMainBodyLegendData
());
// 2.x轴设置
resultMap
.
put
(
"xdata"
,
mainBodyEnums
.
stream
().
map
(
IssueMainBodyEnum:
:
getName
).
collect
(
Collectors
.
toList
()));
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
){
return
resultMap
;
}
// 3.y轴数据设置
List
<
CountDto
>
countDtos
=
statisticsMapper
.
selectByOrgAndMainBody
(
orgCode
,
dpFilterParamDto
);
mainBodyEnums
.
forEach
(
e
->{
Long
allProblemNum
=
countDtos
.
stream
().
filter
(
c
->
c
.
getLabel
().
equals
(
e
.
getCode
())).
mapToLong
(
CountDto:
:
getLongValue
).
sum
();
long
handledProblemNum
=
countDtos
.
stream
().
filter
(
c
->
c
.
getLabel
().
equals
(
e
.
getCode
())
&&
c
.
getKeyStr
().
equals
(
SafetyProblemStatusEnum
.
HANDLED
.
getCode
())).
mapToLong
(
CountDto:
:
getLongValue
).
sum
();
BigDecimal
all
=
new
BigDecimal
(
allProblemNum
.
toString
());
BigDecimal
handled
=
new
BigDecimal
(
Long
.
toString
(
handledProblemNum
));
String
percent
=
"0"
;
if
(
all
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
){
percent
=
handled
.
divide
(
all
,
2
,
RoundingMode
.
HALF_UP
).
toPlainString
();
}
problemCount
.
add
(
allProblemNum
);
problemRate
.
add
(
percent
);
});
resultMap
.
put
(
"problemCount"
,
problemCount
);
resultMap
.
put
(
"problemRate"
,
problemRate
);
return
resultMap
;
}
private
List
<
Object
>
buildMainBodyLegendData
()
{
List
<
Object
>
legendDataList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -333,39 +363,7 @@ public class AQZSDPStatisticsServiceImpl {
}
legendDataList
.
add
(
map
);
}
resultMap
.
put
(
"legendData"
,
legendDataList
);
List
<
String
>
xdata
=
new
ArrayList
<>();
List
<
Object
>
problemCount
=
new
ArrayList
<>();
List
<
Object
>
problemRate
=
new
ArrayList
<>();
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
if
(
orgCode
!=
null
){
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndMainBody
(
orgCode
,
mainBodyNameList
,
startDate
,
null
);
list
.
forEach
(
t
->
{
dataMap
.
put
(
t
.
get
(
"sourceType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
}
for
(
int
i
=
0
;
i
<
mainBodyNameList
.
size
();
i
++)
{
if
(
null
!=
dataMap
.
get
(
mainBodyNameList
.
get
(
i
)))
{
problemCount
.
add
(
dataMap
.
get
(
mainBodyNameList
.
get
(
i
)));
List
<
String
>
list1
=
new
ArrayList
<>();
list1
.
add
(
mainBodyNameList
.
get
(
i
));
List
<
Map
<
String
,
Object
>>
maps
=
statisticsMapper
.
selectByOrgAndMainBody
(
orgCode
,
list1
,
startDate
,
"1"
);
if
(
maps
.
size
()
>
0
)
{
problemRate
.
add
(
new
DecimalFormat
(
"0.00"
).
format
(
Double
.
parseDouble
(
maps
.
get
(
0
).
get
(
"count"
).
toString
())
/
Double
.
parseDouble
(
dataMap
.
get
(
mainBodyNameList
.
get
(
i
)).
toString
())));
}
else
{
problemRate
.
add
(
"0"
);
}
}
else
{
problemCount
.
add
(
"0"
);
problemRate
.
add
(
"0"
);
}
xdata
.
add
(
mainBodyNameList
.
get
(
i
));
}
resultMap
.
put
(
"xdata"
,
xdata
);
resultMap
.
put
(
"problemCount"
,
problemCount
);
resultMap
.
put
(
"problemRate"
,
problemRate
);
return
resultMap
;
return
legendDataList
;
}
...
...
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