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
9e1f6b59
Commit
9e1f6b59
authored
Aug 24, 2022
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加物联报表--月分析报表生成pdf接口
parent
0852cbf5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
226 additions
and
1 deletion
+226
-1
WordTemplateTypeEum.java
...yeejoin/equipmanage/common/enums/WordTemplateTypeEum.java
+4
-1
ChartsUtils.java
...ava/com/yeejoin/equipmanage/common/utils/ChartsUtils.java
+0
-0
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+21
-0
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+13
-0
IFireFightingSystemService.java
...ejoin/equipmanage/service/IFireFightingSystemService.java
+3
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+0
-0
iotMonthReport.ftl
...ot-system-equip/src/main/resources/ftl/iotMonthReport.ftl
+0
-0
systemIndex.json
...oot-system-equip/src/main/resources/json/systemIndex.json
+15
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+170
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/WordTemplateTypeEum.java
View file @
9e1f6b59
...
@@ -12,7 +12,10 @@ public enum WordTemplateTypeEum {
...
@@ -12,7 +12,10 @@ public enum WordTemplateTypeEum {
*/
*/
resume
(
"简历"
,
"jianli.ftl"
),
resume
(
"简历"
,
"jianli.ftl"
),
firePatrolReport
(
"消防巡查报表"
,
"FirePatrolReport.ftl"
),
firePatrolReport
(
"消防巡查报表"
,
"FirePatrolReport.ftl"
),
fireAutoSysManageReport
(
"消防自动化综合管理报表"
,
"fireAutoSysManageReport.ftl"
);
fireAutoSysManageReport
(
"消防自动化综合管理报表"
,
"fireAutoSysManageReport.ftl"
),
iotMonthReport
(
"物联报表-月分析报表"
,
"iotMonthReport.ftl"
);
private
String
label
;
private
String
label
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/ChartsUtils.java
0 → 100644
View file @
9e1f6b59
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
9e1f6b59
...
@@ -634,4 +634,25 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -634,4 +634,25 @@ public class ConfigureController extends AbstractBaseController {
}
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/iotMonthReport"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"物联报表-月"
,
notes
=
"物联报表-月"
)
public
ResponseModel
equipList
(
@RequestParam
(
value
=
"bizOrgCode"
,
required
=
false
)
String
bizOrgCode
,
@RequestParam
(
value
=
"startDate"
)
String
startDate
,
@RequestParam
(
value
=
"endDate"
)
String
endDate
)
{
if
(
ObjectUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
if
(!
ValidationUtil
.
isEmpty
(
personIdentity
))
{
bizOrgCode
=
personIdentity
.
getBizOrgCode
();
}
}
if
(
ObjectUtils
.
isEmpty
(
bizOrgCode
)){
return
CommonResponseUtil
.
success
(
null
);
}
return
CommonResponseUtil
.
success
(
iFireFightingSystemService
.
iotMonthReport
(
bizOrgCode
,
startDate
,
endDate
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
9e1f6b59
...
@@ -468,4 +468,17 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -468,4 +468,17 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
String
queryByCompanyCode
(
@Param
(
"companyCode"
)
String
companyCode
);
String
queryByCompanyCode
(
@Param
(
"companyCode"
)
String
companyCode
);
List
<
Map
<
String
,
Object
>>
selectSystemByBizOrgCode
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
selectAlarmList
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
"month"
)
String
month
,
@Param
(
"systemId"
)
String
systemId
);
Map
<
String
,
Object
>
selectMonthSummarize
(
@Param
(
"month"
)
String
month
,
@Param
(
"systemId"
)
String
systemId
);
List
<
Map
<
String
,
Object
>>
selectMonthPieChart
(
@Param
(
"systemCode"
)
String
month
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
List
<
Map
<
String
,
Object
>>
selectMonthPieChartTwo
(
@Param
(
"systemCode"
)
String
sysCode
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"indicator"
)
List
<
String
>
indicator
);
List
<
Map
<
String
,
Object
>>
selectMonthPolyline
(
@Param
(
"systemCode"
)
String
sysCode
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
,
@Param
(
"indicator"
)
List
<
String
>
indicator
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IFireFightingSystemService.java
View file @
9e1f6b59
...
@@ -273,4 +273,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
...
@@ -273,4 +273,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
BigScreenVo
getSystemAlarmInfoNum
(
String
companyCode
);
BigScreenVo
getSystemAlarmInfoNum
(
String
companyCode
);
BigScreenVo
getCarInfo
(
String
companyCode
);
BigScreenVo
getCarInfo
(
String
companyCode
);
String
iotMonthReport
(
String
bizOrgCode
,
String
startDate
,
String
endDate
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
9e1f6b59
This diff is collapsed.
Click to expand it.
amos-boot-system-equip/src/main/resources/ftl/iotMonthReport.ftl
0 → 100644
View file @
9e1f6b59
This source diff could not be displayed because it is too large. You can
view the blob
instead.
amos-boot-system-equip/src/main/resources/json/systemIndex.json
0 → 100644
View file @
9e1f6b59
[
{
"code"
:
"92040000"
,
"index"
:
"FireAlarm,Fault,Shield"
},
{
"code"
:
"92990000"
,
"index"
:
"FireAlarm,Fault,Shield"
}
]
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
9e1f6b59
...
@@ -3520,4 +3520,174 @@
...
@@ -3520,4 +3520,174 @@
AND code = #{companyCode}
AND code = #{companyCode}
</if>
</if>
</select>
</select>
<select
id=
"selectSystemByBizOrgCode"
resultType=
"java.util.Map"
>
SELECT ffs.id,ffs.`code`,ffs.system_type as type,ffs.biz_org_name as stationName, ffs.name,wec.code AS typeCode
FROM `f_fire_fighting_system` ffs
LEFT JOIN wl_equipment_category wec
on ffs.system_type = wec.id
WHERE biz_org_code = #{bizOrgCode}
</select>
<select
id=
"selectAlarmList"
resultType=
"java.util.Map"
>
select
a1.*,
(a1.num - a1.alarm_equip_num) as normalEquipNum,
if(a1.num > 0 , concat(ROUND((a1.num - a1.alarm_equip_num)/a1.num,2)*100,'%'), '-') as normalEquipPercent,
if(a1.num > 0 , concat(ROUND(a1.fault_equip_num/a1.num,2)*100,'%'), '-') as faultEquipPercent,
if(a1.num > 0 , concat(ROUND(a1.alarm_equip_num/a1.num,2)*100,'%'), '-') as alarmEquipPercent
from
wl_analysis_report_month a1
where
a1.report_month = #{month} and system_id = #{systemId}
</select>
<select
id=
"selectMonthSummarize"
resultType=
"java.util.Map"
>
SELECT
rs.system_id,
rs.summary_info,
rs.report_date,
rs.report_type
FROM
`wl_analysis_report_summary` rs
where
rs.report_date like concat(#{month},'%')
and rs.report_type = 3
and system_id = #{systemId}
</select>
<select
id=
"selectMonthPieChart"
resultType=
"java.util.Map"
>
SELECT
`name` as `type`,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_type LIKE CONCAT('%','Fault')
and report.index_true_num >0
and report.report_date BETWEEN #{startDate}
and #{endDate}
) as `value`
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where spec.system_id is not null
AND s.code = #{systemCode}
GROUP BY code,s.id, name ORDER BY system_id, code ) a
</select>
<select
id=
"selectMonthPieChartTwo"
resultType=
"java.util.Map"
>
SELECT
ss.alarm_type_name as type,
SUM(index_true_num) as value
from
(
SELECT
rep.alarm_type,
rep.alarm_type_name,
rep.index_true_num
FROM
wl_equipment_alarm_report_day rep,
(
SELECT
s.id as system_id,
equipment.code,
equipment.name
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where spec.system_id is not null
and s.code = #{systemCode}
GROUP BY s.id, code, name ORDER BY s.id, code
) a
where rep.equipment_code = a.code and FIND_IN_SET(a.system_id,rep.system_ids)
<foreach
collection=
"indicator"
item=
"index"
open=
"AND("
separator=
"or"
close=
")"
>
rep.index_type like concat ('%', #{index})
</foreach>
and rep.index_true_num >0
and rep.alarm_type is not null
and rep.report_date BETWEEN #{startDate}
and #{endDate}
) ss
GROUP BY ss.alarm_type_name
</select>
<select
id=
"selectMonthPolyline"
resultType=
"java.util.Map"
>
SELECT * FROM (
SELECT A.name as title, A.date as x, IFNULL(B.num,0) AS y from
(
SELECT * from (
SELECT
DATE( DATE_ADD(#{startDate}, INTERVAL @s DAY ) ) AS date,
'报警总条数' as name,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 0 ) temp ) s1
WHERE
s1.`index`
<
= DATEDIFF(#{endDate},#{startDate})
) A
LEFT JOIN (
SELECT
SUM( report.index_true_num ) AS num,
report.report_date AS reportDate
FROM
wl_equipment_alarm_report_day report
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids)
WHERE report.system_ids is not null
<foreach
collection=
"indicator"
item=
"index"
open=
"AND("
separator=
"or"
close=
")"
>
report.index_type like concat ('%', #{index})
</foreach>
and s.code = #{systemCode}
GROUP BY
report.report_date,
s.id
) B on B.reportDate = A.date
UNION all
SELECT A.name, A.date , IFNULL(B.num,0) AS num from
(
select * from (
SELECT
DATE( DATE_ADD( #{startDate}, INTERVAL @s2 DAY ) ) AS date,
'报警设备总数' as name,
@s2 := @s2 + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s2 := 0 ) temp ) s1
WHERE
s1.`index`
<
= DATEDIFF(#{endDate},#{startDate})
) A
LEFT JOIN (
SELECT
COUNT( distinct(report.equipment_specific_id)) AS num,
report.report_date AS reportDate
FROM
wl_equipment_alarm_report_day report
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids)
WHERE
report.system_ids is not null
and s.code = #{systemCode}
and report.index_true_num >0
<foreach
collection=
"indicator"
item=
"index"
open=
"AND("
separator=
"or"
close=
")"
>
report.index_type like concat ('%', #{index})
</foreach>
GROUP BY
report.report_date,
s.id
) B on B.reportDate = A.date ) C
ORDER BY title,x
</select>
</mapper>
</mapper>
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