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
24dc93aa
Commit
24dc93aa
authored
Jul 19, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏代码提交
1.左侧新增情况 2.新增登记新增设备统计
parent
2e2ae7e2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
263 additions
and
0 deletions
+263
-0
DPFilterParamDto.java
...oin/amos/boot/module/common/api/dto/DPFilterParamDto.java
+5
-0
DPStatisticsMapper.java
...in/amos/boot/module/jg/api/mapper/DPStatisticsMapper.java
+11
-0
DPStatisticsMapper.xml
...e-jg-api/src/main/resources/mapper/DPStatisticsMapper.xml
+108
-0
DPStatisticsController.java
...boot/module/jg/biz/controller/DPStatisticsController.java
+22
-0
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+117
-0
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/DPFilterParamDto.java
View file @
24dc93aa
...
...
@@ -31,4 +31,9 @@ public class DPFilterParamDto {
* 业务类型0告知管理,1使用登记,2变更登记,3停用启用,4注销报废
*/
private
String
businessKey
;
/**
* month , year
*/
private
String
searchType
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/DPStatisticsMapper.java
View file @
24dc93aa
...
...
@@ -56,4 +56,15 @@ public interface DPStatisticsMapper {
List
<
Map
<
String
,
Object
>>
changeUnitEquCount
(
@Param
(
"cityCode"
)
String
cityCode
,
@Param
(
"startTime"
)
String
startTime
);
List
<
Map
<
String
,
Object
>>
vehicleEquCount
(
@Param
(
"cityCode"
)
String
cityCode
,
@Param
(
"startTime"
)
String
startTime
);
List
<
Map
<
String
,
Object
>>
newRegEquCountByMonth
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
newVehicleEquCountByMonth
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
newRegEquCountByYear
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
newVehicleEquCountByYear
(
@Param
(
"cityCode"
)
String
cityCode
);
String
newVehicleCountByYear
(
@Param
(
"cityCode"
)
String
cityCode
);
String
newVehicleCountByMonth
(
@Param
(
"cityCode"
)
String
cityCode
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/DPStatisticsMapper.xml
View file @
24dc93aa
...
...
@@ -415,5 +415,113 @@
jri.equ_category
</select>
<select
id=
"newRegEquCountByMonth"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_use_registration ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.audit_status = '已完成'
INNER JOIN tzs_jg_use_registration_eq te ON te.equip_transfer_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y-%m') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleEquCountByMonth"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
INNER JOIN tzs_jg_vehicle_information_eq te ON te.vehicle_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y-%m') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
ORDER BY
ur.rec_date
</select>
<select
id=
"newRegEquCountByYear"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_use_registration ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.audit_status = '已完成'
INNER JOIN tzs_jg_use_registration_eq te ON te.equip_transfer_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleEquCountByYear"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
INNER JOIN tzs_jg_vehicle_information_eq te ON te.vehicle_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleCountByYear"
resultType=
"String"
>
SELECT COUNT
( 1 )
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleCountByMonth"
resultType=
"String"
>
SELECT COUNT
( 1 )
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y-%m') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m')
ORDER BY
ur.rec_date
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DPStatisticsController.java
View file @
24dc93aa
...
...
@@ -202,4 +202,26 @@ public class DPStatisticsController {
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getRegEquCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"监管大屏-左侧新增情况"
,
notes
=
"监管大屏-左侧新增情况"
)
@PostMapping
(
value
=
"/newRegEquCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
newRegEquCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
newRegEquCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"监管大屏-新增登记新增设备统计"
,
notes
=
"监管大屏-新增登记新增设备统计"
)
@PostMapping
(
value
=
"/newRegCount"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
newRegCount
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
newRegCount
(
dpFilterParamDto
));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
View file @
24dc93aa
...
...
@@ -1275,4 +1275,121 @@ public class DPStatisticsServiceImpl {
return
resultMap
;
}
public
Map
<
String
,
Object
>
newRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"dataKey"
,
"newRegisterEq"
);
map
.
put
(
"value"
,
"新增登记设备"
);
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
legendData
.
add
(
map
);
resultMap
.
put
(
"legendData"
,
legendData
);
List
xDataList
=
new
ArrayList
<>();
List
newRegisterEq
=
new
ArrayList
<>();
Map
<
String
,
Object
>
useCountMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
vehicleCountMap
=
new
HashMap
<>();
if
(
"month"
.
equals
(
dpFilterParamDto
.
getSearchType
())){
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++){
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++){
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getDayOfMonth
();
i
++){
xDataList
.
add
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)+
""
));
}
}
else
if
(
"year"
.
equals
(
dpFilterParamDto
.
getSearchType
())){
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++){
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++){
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getMonth
().
getValue
();
i
++){
xDataList
.
add
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)+
""
));
}
}
Collections
.
reverse
(
xDataList
);
Collections
.
reverse
(
newRegisterEq
);
resultMap
.
put
(
"xData"
,
xDataList
);
resultMap
.
put
(
"newRegisterEq"
,
newRegisterEq
);
return
resultMap
;
}
public
List
<
Map
<
String
,
Object
>>
newRegCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
//年使用登记设备
List
<
Map
<
String
,
Object
>>
useEquCountListYear
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
//年气瓶使用登记设备
List
<
Map
<
String
,
Object
>>
vehicleEquCountListYear
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
//月使用登记设备
List
<
Map
<
String
,
Object
>>
useEquCountListMonth
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
//月气瓶使用登记设备
List
<
Map
<
String
,
Object
>>
vehicleEquCountListMonth
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
//年气瓶使用登记
String
vehicleCountYear
=
dpStatisticsMapper
.
newVehicleCountByYear
(
dpFilterParamDto
.
getCityCode
());
//月气瓶使用登记
String
vehicleCountListMonth
=
dpStatisticsMapper
.
newVehicleCountByMonth
(
dpFilterParamDto
.
getCityCode
());
/**
* [ { "name": "本年新增登记", "value": 52 }, { "name": "本年新增设备", "value": 83 },
* { "name": "本月新增登记", "value": 16 }, { "name": "本月新增设备", "value": 50 } ]
*/
int
useYear
=
0
;
int
useMonth
=
0
;
int
usrEqYear
=
0
;
int
usrEqMonth
=
0
;
//本年新增登记
for
(
int
i
=
0
;
i
<
useEquCountListYear
.
size
()
;
i
++){
useYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
usrEqYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
useYear
+=
StringUtils
.
isBlank
(
vehicleCountYear
)?
0
:
Integer
.
valueOf
(
vehicleCountYear
);
//本年新增设备
for
(
int
i
=
0
;
i
<
vehicleEquCountListYear
.
size
()
;
i
++){
usrEqYear
+=
Integer
.
valueOf
(
vehicleEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
//本月新增登记
for
(
int
i
=
0
;
i
<
useEquCountListMonth
.
size
()
;
i
++){
useMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
usrEqMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
useMonth
+=
StringUtils
.
isBlank
(
vehicleCountListMonth
)?
0
:
Integer
.
valueOf
(
vehicleCountListMonth
);
//本月新增设备
for
(
int
i
=
0
;
i
<
vehicleEquCountListMonth
.
size
()
;
i
++){
usrEqMonth
+=
Integer
.
valueOf
(
vehicleEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
for
(
int
i
=
0
;
i
<
4
;
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"name"
,
"本年新增登记"
);
map
.
put
(
"value"
,
useYear
);
}
else
if
(
i
==
1
){
map
.
put
(
"name"
,
"本年新增设备"
);
map
.
put
(
"value"
,
usrEqYear
);
}
else
if
(
i
==
2
){
map
.
put
(
"name"
,
"本月新增登记"
);
map
.
put
(
"value"
,
useMonth
);
}
else
if
(
i
==
3
){
map
.
put
(
"name"
,
"本月新增设备"
);
map
.
put
(
"value"
,
usrEqMonth
);
}
resultList
.
add
(
map
);
}
return
resultList
;
}
}
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