Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
647a3d5f
Commit
647a3d5f
authored
Apr 22, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改报错
parent
84111b74
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
163 additions
and
9 deletions
+163
-9
StatisticsErrorTypeEum.java
...yeejoin/amos/fas/common/enums/StatisticsErrorTypeEum.java
+55
-0
RiskPointRpnChangeBo.java
...om/yeejoin/amos/fas/business/bo/RiskPointRpnChangeBo.java
+43
-0
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+3
-1
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+9
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+36
-7
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+1
-1
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+16
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/StatisticsErrorTypeEum.java
0 → 100644
View file @
647a3d5f
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
/**
* @author suhg
*/
public
enum
StatisticsErrorTypeEum
{
/**
* 风险异常
*/
risk
(
"risk"
,
"风险异常"
),
/**
* 巡检异常
*/
patrol
(
"patrol"
,
"巡检异常"
),
/**
* 设备故障
*/
equip
(
"equip"
,
"设备故障"
),
/**
* 火灾告警
*/
fire
(
"fire"
,
"火灾告警"
);
/**
* 编号
*/
private
String
code
;
/**
* 名称
*/
private
String
name
;
StatisticsErrorTypeEum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/RiskPointRpnChangeBo.java
0 → 100644
View file @
647a3d5f
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
/**
* @author suhg
*/
public
class
RiskPointRpnChangeBo
{
private
Long
id
;
private
String
name
;
private
Long
riskLevelId
;
private
String
changeDate
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Long
getRiskLevelId
()
{
return
riskLevelId
;
}
public
void
setRiskLevelId
(
Long
riskLevelId
)
{
this
.
riskLevelId
=
riskLevelId
;
}
public
String
getChangeDate
()
{
return
changeDate
;
}
public
void
setChangeDate
(
String
changeDate
)
{
this
.
changeDate
=
changeDate
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
647a3d5f
...
...
@@ -83,6 +83,8 @@ public class View3dController extends BaseController {
@ApiOperation
(
value
=
"今日安全指数详情"
,
notes
=
"risk-风险异常,check-巡检异常,equipProblem-设备故障"
)
@GetMapping
(
value
=
"/safetyIndex/detail/{type}"
)
public
CommonResponse
getSafetyIndexDetail
(
@PathVariable
String
type
){
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexDetail
(
type
));
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexDetail
(
type
,
orgCode
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
647a3d5f
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.fas.business.dao.mapper;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
org.apache.ibatis.annotations.Param
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
...
...
@@ -24,4 +26,11 @@ public interface View3dMapper extends BaseMapper{
* @return Long
*/
Long
countCheckException
(
Map
<
String
,
Object
>
param
);
/**
* 今日安全指数详情
* @param params orgCode,date
* @return list
*/
List
<
RiskPointRpnChangeBo
>
getAllErrorRiskPoint
(
Map
<
String
,
Object
>
params
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
647a3d5f
...
...
@@ -3,30 +3,31 @@ package com.yeejoin.amos.fas.business.service.impl;
import
java.math.BigDecimal
;
import
java.util.*
;
import
com.alibaba.fastjson.JSONObject
;
import
com.sun.xml.internal.bind.v2.TODO
;
import
java.util.stream.Collectors
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo
;
import
com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.vo.ErrorContentVo
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.common.enums.RpnChangeTypeEum
;
import
com.yeejoin.amos.fas.common.enums.StatisticsErrorTypeEum
;
import
com.yeejoin.amos.fas.core.common.request.DateUtil
;
import
com.yeejoin.amos.fas.core.util.*
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.dao.mapper.View3dMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -56,6 +57,8 @@ public class View3dServiceImpl implements IView3dService {
private
IWaterResourceDao
iWaterResourceDao
;
@Autowired
private
PatrolMapper
patrolMapper
;
@Autowired
private
IRiskLevelDao
iRiskLevelDao
;
...
...
@@ -206,8 +209,34 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
)
{
return
null
;
public
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
,
String
orgCode
)
{
List
<
SafetyIndexDetailVo
>
resultList
=
Lists
.
newArrayList
();
String
dateStr
=
DateUtil
.
getDateFormat
(
new
Date
(),
DateUtil
.
DATE_DEFAULT_FORMAT
);
if
(
StatisticsErrorTypeEum
.
risk
.
getCode
().
equals
(
type
)){
//1.按照日期+机构,查询出所有风险点
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orgCode"
,
orgCode
);
params
.
put
(
"date"
,
dateStr
);
List
<
RiskPointRpnChangeBo
>
risks
=
view3dMapper
.
getAllErrorRiskPoint
(
params
);
//2.按照 风险等级id进行分组,加工数据
Map
<
Long
,
List
<
RiskPointRpnChangeBo
>>
map
=
risks
.
stream
().
collect
(
Collectors
.
groupingBy
(
RiskPointRpnChangeBo:
:
getRiskLevelId
));
List
<
RiskLevel
>
riskLevelList
=
iRiskLevelDao
.
findAll
();
Map
<
Long
,
String
>
riskLevelMap
=
riskLevelList
.
stream
().
collect
(
Collectors
.
toMap
(
RiskLevel:
:
getId
,
RiskLevel:
:
getName
));
map
.
forEach
((
k
,
v
)->{
SafetyIndexDetailVo
safetyIndexDetailVo
=
new
SafetyIndexDetailVo
();
safetyIndexDetailVo
.
setTypeCode
(
Long
.
toString
(
k
));
safetyIndexDetailVo
.
setTypeName
(
riskLevelMap
.
get
(
k
));
List
<
ErrorContentVo
>
errorContentVoList
=
new
ArrayList
<>();
BeanUtils
.
copyProperties
(
v
,
errorContentVoList
);
safetyIndexDetailVo
.
setContent
(
errorContentVoList
);
resultList
.
add
(
safetyIndexDetailVo
);
});
}
else
if
(
StatisticsErrorTypeEum
.
patrol
.
getCode
().
equals
(
type
)){
}
else
if
(
StatisticsErrorTypeEum
.
equip
.
getCode
().
equals
(
type
)){
}
return
resultList
;
}
private
Long
getCheckExceptionNum
(
String
orgCode
,
String
date
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
647a3d5f
...
...
@@ -48,5 +48,5 @@ public interface IView3dService {
* @param type 详情类型
* @return list
*/
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
);
List
<
SafetyIndexDetailVo
>
getSafetyIndexDetail
(
String
type
,
String
orgCode
);
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
647a3d5f
...
...
@@ -66,4 +66,19 @@
) pt
where #{date} BETWEEN pt.begin_date and pt.end_date
</select>
<select
id=
"getAllErrorRiskPoint"
resultType=
"com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo"
>
SELECT
b.id,
a.`name`,
a.risk_level_id as riskLevelId,
b.create_date as changeDate
FROM
f_risk_source a,
f_rpn_change_log b
WHERE
b.risk_source_id = a.id
AND b.type = '0'
and a.org_code = #{orgCode}
and DATE_FORMAT(b.create_date,'%Y-%m-%d') = #{date}
</select>
</mapper>
\ 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