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
7c5de387
Commit
7c5de387
authored
Feb 14, 2020
by
xukaiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql
parent
4f6fa381
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
185 additions
and
22 deletions
+185
-22
Fmea.java
...n/src/main/java/com/yeejoin/amos/fas/dao/entity/Fmea.java
+45
-0
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+1
-1
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+4
-1
changelog-master.xml
...tart/src/main/resources/db/changelog/changelog-master.xml
+2
-0
fas-1.0.2.xml
...utoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
+106
-0
dbTemplate_fmea.xml
...SysStart/src/main/resources/db/mapper/dbTemplate_fmea.xml
+26
-20
log4j.properties
YeeAmosFireAutoSysStart/src/main/resources/log4j.properties
+1
-0
FireAutoSystem.log.1
logs/FireAutoSystem.log.1
+0
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/Fmea.java
View file @
7c5de387
...
...
@@ -75,6 +75,18 @@ public class Fmea extends BasicEntity {
private
RiskSource
riskSource
;
@Column
(
name
=
"company_leader"
)
private
Integer
companyLeader
;
@Column
(
name
=
"department_leader"
)
private
Integer
departmentLeader
;
@Column
(
name
=
"group_leader"
)
private
Integer
groupLeader
;
@Column
(
name
=
"person_leader"
)
private
Integer
personLeader
;
public
Fmea
()
{
}
...
...
@@ -244,4 +256,36 @@ public class Fmea extends BasicEntity {
public
void
setRpn
(
BigDecimal
rpn
)
{
this
.
rpn
=
rpn
;
}
public
Integer
getCompanyLeader
()
{
return
companyLeader
;
}
public
void
setCompanyLeader
(
Integer
companyLeader
)
{
this
.
companyLeader
=
companyLeader
;
}
public
Integer
getDepartmentLeader
()
{
return
departmentLeader
;
}
public
void
setDepartmentLeader
(
Integer
departmentLeader
)
{
this
.
departmentLeader
=
departmentLeader
;
}
public
Integer
getGroupLeader
()
{
return
groupLeader
;
}
public
void
setGroupLeader
(
Integer
groupLeader
)
{
this
.
groupLeader
=
groupLeader
;
}
public
Integer
getPersonLeader
()
{
return
personLeader
;
}
public
void
setPersonLeader
(
Integer
personLeader
)
{
this
.
personLeader
=
personLeader
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
7c5de387
...
...
@@ -69,7 +69,7 @@ public class FmeaServiceImpl implements IFmeaService {
RiskSource
riskSource
=
iRiskSourceDao
.
findById
(
fmea
.
getRiskSourceId
());
fmea
.
setRiskSource
(
riskSource
);
iFmeaDao
.
save
(
fmea
);
updateRpniInfo
(
fmea
.
getRiskSourceId
());
//
updateRpniInfo(fmea.getRiskSourceId());
});
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
7c5de387
...
...
@@ -1509,7 +1509,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/**
* fmea的更新导致rpn、rpni的值改变
*/
p
ublic
void
notifyRiskSource
(
Long
riskSourceId
)
{
p
rivate
void
notifyRiskSource
(
Long
riskSourceId
)
{
RiskSource
riskSource
=
iRiskSourceDao
.
findById
(
riskSourceId
);
if
(
riskSource
==
null
)
{
return
;
...
...
@@ -1537,6 +1537,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
count
++;
}
}
if
(
count
==
0
){
return
;
}
BigDecimal
averageOidValue
=
totalOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
));
BigDecimal
averageNewOidValue
=
totalNewOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
));
BigDecimal
rpn
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageNewOidValue
);
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/changelog-master.xml
View file @
7c5de387
...
...
@@ -9,6 +9,7 @@
<!--初始化表结构
<include file="fas-init-table.xml" relativeToChangelogFile="true"/>-->
<include
file=
"fas-1.0.1.xml"
relativeToChangelogFile=
"true"
/>
<include
file=
"fas-1.0.2.xml"
relativeToChangelogFile=
"true"
/>
<!-- 系统函数脚本 -->
<include
file=
"fas-sql-task.xml"
relativeToChangelogFile=
"true"
/>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
0 → 100644
View file @
7c5de387
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"rpn"
/>
</not>
</preConditions>
<comment>
f_fmea add column rpn
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `rpn` decimal(10,2) DEFAULT NULL COMMENT '实时rpn';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"new_evaluation_oid"
/>
</not>
</preConditions>
<comment>
f_fmea add column new_evaluation_oid
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `new_evaluation_oid` bigint(20) DEFAULT NULL COMMENT '最新故障频数';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"f_fmea_equipment_point"
/>
</not>
</preConditions>
<comment>
create f_fmea_equipment_point
</comment>
<sql>
CREATE TABLE `f_fmea_equipment_point` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增',
`fmea_id` bigint(20) NOT NULL COMMENT 'fmea编号',
`equipment_point_id` bigint(20) NOT NULL COMMENT '装备指标编号',
`state` tinyint(4) NOT NULL DEFAULT '0' COMMENT '装备指标状态(0:正常;1:告警)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8 COMMENT='fmea和装备指标的关系';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-4"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"f_fmea_point_inputitem"
/>
</not>
</preConditions>
<comment>
create f_fmea_point_inputitem
</comment>
<sql>
CREATE TABLE `f_fmea_point_inputitem` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增',
`fmea_id` bigint(20) NOT NULL COMMENT 'fmea编号',
`point_inputitem_id` bigint(20) NOT NULL COMMENT '检查点和项关系编号',
`state` tinyint(4) NOT NULL DEFAULT '0' COMMENT '检查项状态(0:正常;1:不合格)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=116 DEFAULT CHARSET=utf8 COMMENT='fmea和检查项的关系';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-5"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_risk_level"
columnName=
"top_limit"
/>
</not>
</preConditions>
<comment>
f_risk_level add column top_limit
</comment>
<sql>
ALTER TABLE `f_risk_level` ADD COLUMN `top_limit` decimal(10,2) DEFAULT NULL COMMENT '上限';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-6"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_risk_level"
columnName=
"down_limit"
/>
</not>
</preConditions>
<comment>
f_risk_level add column down_limit
</comment>
<sql>
ALTER TABLE `f_risk_level` ADD COLUMN `down_limit` decimal(10,2) DEFAULT NULL COMMENT '下限';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-7"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_rpn_change_log"
columnName=
"fmea_id"
/>
</not>
</preConditions>
<comment>
f_rpn_change_log add column fmea_id
</comment>
<sql>
ALTER TABLE `f_rpn_change_log` ADD COLUMN `fmea_id` bigint(20) NOT NULL COMMENT 'fmeaId';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea.xml
View file @
7c5de387
...
...
@@ -39,6 +39,10 @@
fm.protection,
fm.disposal,
fm.remark,
fm.company_leader as companyLeader,
fm.department_leader as departmentLeader,
fm.group_leader as groupLeader,
fm.person_leader as personLeader,
rf.`name` AS riskFactorName,
fat.`name` AS accidentTypeName,
fat.id AS accidentTypeId,
...
...
@@ -79,42 +83,44 @@
<select
id=
"getById"
resultType=
"com.yeejoin.amos.fas.dao.entity.Fmea"
>
select
id,
risk_source_id as riskSourceId,
risk_factors_id as riskFactorsId,
evaluation_sid as evaluationSid,
evaluation_oid as evaluationOid,
evaluation_did as evaluationDid,
rpni,
rpn,
a.id,
a.risk_source_id as riskSourceId,
a.risk_factors_id as riskFactorsId,
a.evaluation_sid as evaluationSid,
a.evaluation_oid as evaluationOid,
a.evaluation_did as evaluationDid,
a.new_evaluation_oid as newEvaluationOid,
a.rpni,
a.rpn,
(select coefficient from f_evaluation_model where id = a.evaluation_sid) as sidValue,
(select coefficient from f_evaluation_model where id = a.evaluation_oid) as oidValue,
(select coefficient from f_evaluation_model where id = a.evaluation_did) as didValue,
(select coefficient from f_evaluation_model where id = a.new_evaluation_oid) as newOidValue
from
f_fmea
f_fmea
as a
where
id = #{id}
a.
id = #{id}
</select>
<select
id=
"listByRiskSourceId"
resultType=
"com.yeejoin.amos.fas.dao.entity.Fmea"
>
select
id,
risk_source_id as riskSourceId,
risk_factors_id as riskFactorsId,
evaluation_sid as evaluationSid,
evaluation_oid as evaluationOid,
evaluation_did as evaluationDid,
rpni,
rpn,
a.id,
a.risk_source_id as riskSourceId,
a.risk_factors_id as riskFactorsId,
a.evaluation_sid as evaluationSid,
a.evaluation_oid as evaluationOid,
a.evaluation_did as evaluationDid,
a.new_evaluation_oid as newEvaluationOid,
a.rpni,
a.rpn,
(select coefficient from f_evaluation_model where id = a.evaluation_sid) as sidValue,
(select coefficient from f_evaluation_model where id = a.evaluation_oid) as oidValue,
(select coefficient from f_evaluation_model where id = a.evaluation_did) as didValue,
(select coefficient from f_evaluation_model where id = a.new_evaluation_oid) as newOidValue
from
f_fmea
f_fmea
as a
where
risk_source_id = #{riskSourceId}
a.
risk_source_id = #{riskSourceId}
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/log4j.properties
View file @
7c5de387
...
...
@@ -5,6 +5,7 @@ log4j.logger.org.hibernate=info
log4j.logger.com.mchange
=
info
log4j.logger.org.springframework
=
info
log4j.logger.com.mangofactory
=
info
log4j.logger.com.yeejoin.amos.fas.business.dao.mapper
=
debug
log4j.logger.org.apache
=
info
log4j.logger.com.zaxxer.hikari.pool
=
info
...
...
logs/FireAutoSystem.log.1
0 → 100644
View file @
7c5de387
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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