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
0f06e70c
Commit
0f06e70c
authored
Aug 14, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.大屏-安全追溯-问题主体接口调整
parent
27afc1e1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
55 deletions
+52
-55
AQZSDPStatisticsMapper.java
.../module/statistics/api/mapper/AQZSDPStatisticsMapper.java
+2
-2
AQZSDPStatisticsMapper.xml
...-api/src/main/resources/mapper/AQZSDPStatisticsMapper.xml
+10
-5
AQZSDPStatisticsController.java
.../statistcs/biz/controller/AQZSDPStatisticsController.java
+20
-20
AQZSDPStatisticsServiceImpl.java
...atistcs/biz/service/impl/AQZSDPStatisticsServiceImpl.java
+20
-28
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/AQZSDPStatisticsMapper.java
View file @
0f06e70c
...
...
@@ -24,8 +24,8 @@ public interface AQZSDPStatisticsMapper {
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
);
List
<
CountDto
>
selectByOrgAndProblemType
(
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"enumNameList"
)
List
<
String
>
enumNameList
,
@Param
(
"
dto"
)
DPFilterParamDto
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
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/AQZSDPStatisticsMapper.xml
View file @
0f06e70c
...
...
@@ -23,15 +23,20 @@
</if>
GROUP BY source_type,problem_status_code
</select>
<select
id=
"selectByOrgAndProblemType"
resultType=
"
java.util.Map
"
>
SELECT
COUNT
( 1 )
,
problem_type
AS problemType
<select
id=
"selectByOrgAndProblemType"
resultType=
"
com.yeejoin.amos.boot.biz.common.dto.CountDto
"
>
SELECT
COUNT(1) as longValue
,
problem_type
AS keyStr
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND problem_time
>
= #{startDate}
<if
test=
"dto.beginDate !=null and dto.beginDate !=''"
>
and date_ge(CAST(problem_time as date),#{dto.beginDate})
</if>
<if
test=
"dto.endDate !=null and dto.endDate !=''"
>
and date_le(CAST(problem_time as date),#{dto.endDate})
</if>
AND source_type = #{sourceType}
<if
test=
"null != equipType"
>
AND equip_list_code = #{equipType}
...
...
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 @
0f06e70c
...
...
@@ -70,12 +70,12 @@ public class AQZSDPStatisticsController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"大屏-安全追溯-左屏-设备问题近30天统计"
)
@PostMapping
(
value
=
"/equipmentCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
equipmentCount
(
@
RequestBody
Map
<
String
,
Object
>
map
)
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
public
ResponseModel
<
Map
<
String
,
Object
>>
equipmentCount
(
@
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
.
equipmentCount
(
regionCode
.
toString
()
);
Map
<
String
,
Object
>
result
=
statisticsService
.
equipmentCount
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
@@ -83,12 +83,12 @@ public class AQZSDPStatisticsController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"大屏-安全追溯-左屏-企业问题近30天统计"
)
@PostMapping
(
value
=
"/companyCount"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
companyCount
(
@
RequestBody
Map
<
String
,
Object
>
map
)
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
companyCount
(
@
Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
bindingResult
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
bindingResult
.
getFieldErrors
(
);
if
(
!
fieldErrors
.
isEmpty
(
))
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
())
;
}
List
<
Map
<
String
,
Object
>>
result
=
statisticsService
.
companyCount
(
regionCode
.
toString
()
);
List
<
Map
<
String
,
Object
>>
result
=
statisticsService
.
companyCount
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
@@ -96,12 +96,12 @@ public class AQZSDPStatisticsController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"大屏-安全追溯-左屏-人员问题近30天统计"
)
@PostMapping
(
value
=
"/personCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
personCount
(
@
RequestBody
Map
<
String
,
Object
>
map
)
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
public
ResponseModel
<
Map
<
String
,
Object
>>
personCount
(
@
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
.
personCount
(
regionCode
.
toString
()
);
Map
<
String
,
Object
>
result
=
statisticsService
.
personCount
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
@@ -110,12 +110,12 @@ public class AQZSDPStatisticsController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"大屏-安全追溯-左屏-气瓶问题近30天统计"
)
@PostMapping
(
value
=
"/cylinderCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
cylinderCount
(
@
RequestBody
Map
<
String
,
Object
>
map
)
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
public
ResponseModel
<
Map
<
String
,
Object
>>
cylinderCount
(
@
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
.
cylinderCount
(
regionCode
.
toString
()
);
Map
<
String
,
Object
>
result
=
statisticsService
.
cylinderCount
(
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 @
0f06e70c
...
...
@@ -368,19 +368,17 @@ public class AQZSDPStatisticsServiceImpl {
}
public
Map
<
String
,
Object
>
equipmentCount
(
String
cityCode
)
{
public
Map
<
String
,
Object
>
equipmentCount
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
List
<
Object
>
xdata
=
new
ArrayList
<>();
List
<
Object
>
ydata
=
new
ArrayList
<>();
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"3"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
!=
null
){
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
(),
null
);
list
.
forEach
(
t
->
{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
List
<
CountDto
>
countDtos
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
dpFilterParamDto
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
(),
null
);
countDtos
.
forEach
(
t
->
dataMap
.
put
(
t
.
getKeyStr
(),
t
.
getLongValue
()));
}
for
(
int
i
=
0
;
i
<
enumNameList
.
size
();
i
++)
{
xdata
.
add
(
enumNameList
.
get
(
i
));
...
...
@@ -391,17 +389,15 @@ public class AQZSDPStatisticsServiceImpl {
return
resultMap
;
}
public
List
<
Map
<
String
,
Object
>>
companyCount
(
String
cityCode
)
{
public
List
<
Map
<
String
,
Object
>>
companyCount
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"2"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
!=
null
){
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
COMPANY
.
getName
(),
null
);
list
.
forEach
(
t
->
{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
List
<
CountDto
>
countDtos
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
dpFilterParamDto
,
IssueMainBodyEnum
.
COMPANY
.
getName
(),
null
);
countDtos
.
forEach
(
t
->
dataMap
.
put
(
t
.
getKeyStr
(),
t
.
getLongValue
()));
}
for
(
int
i
=
0
;
i
<
enumNameList
.
size
();
i
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -429,19 +425,17 @@ public class AQZSDPStatisticsServiceImpl {
return
resultList
;
}
public
Map
<
String
,
Object
>
personCount
(
String
cityCode
)
{
public
Map
<
String
,
Object
>
personCount
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
List
<
Object
>
xdata
=
new
ArrayList
<>();
List
<
Object
>
ydata
=
new
ArrayList
<>();
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"1"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
!=
null
){
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
PERSON
.
getName
(),
null
);
list
.
forEach
(
t
->
{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
List
<
CountDto
>
countDtos
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
dpFilterParamDto
,
IssueMainBodyEnum
.
PERSON
.
getName
(),
null
);
countDtos
.
forEach
(
t
->
dataMap
.
put
(
t
.
getKeyStr
(),
t
.
getLongValue
()));
}
for
(
int
i
=
0
;
i
<
enumNameList
.
size
();
i
++)
{
xdata
.
add
(
enumNameList
.
get
(
i
));
...
...
@@ -452,19 +446,17 @@ public class AQZSDPStatisticsServiceImpl {
return
resultMap
;
}
public
Map
<
String
,
Object
>
cylinderCount
(
String
cityCode
)
{
public
Map
<
String
,
Object
>
cylinderCount
(
DPFilterParamDto
dpFilterParamDto
)
{
this
.
setDefaultFilter
(
dpFilterParamDto
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
List
<
Object
>
xdata
=
new
ArrayList
<>();
List
<
Object
>
ydata
=
new
ArrayList
<>();
List
<
String
>
enumNameList
=
IssueTypeEnum
.
getEnumNameListByMainBody
(
"4"
);
String
startDate
=
LocalDate
.
now
().
minusDays
(
29
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
cityCode
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
!=
null
){
List
<
Map
<
String
,
Object
>>
list
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
startDate
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
(),
"2300"
);
list
.
forEach
(
t
->
{
dataMap
.
put
(
t
.
get
(
"problemType"
).
toString
(),
t
.
get
(
"count"
).
toString
());
});
List
<
CountDto
>
countDtos
=
statisticsMapper
.
selectByOrgAndProblemType
(
orgCode
,
enumNameList
,
dpFilterParamDto
,
IssueMainBodyEnum
.
EQUIPMENT
.
getName
(),
"2300"
);
countDtos
.
forEach
(
t
->
dataMap
.
put
(
t
.
getKeyStr
(),
t
.
getLongValue
()));
}
for
(
int
i
=
0
;
i
<
enumNameList
.
size
();
i
++)
{
xdata
.
add
(
enumNameList
.
get
(
i
));
...
...
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