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
3287f94c
Commit
3287f94c
authored
Mar 06, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
43ec3fe6
8a49774a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
828 additions
and
403 deletions
+828
-403
Fmea.java
...n/src/main/java/com/yeejoin/amos/fas/dao/entity/Fmea.java
+24
-12
FmeaEquipmentPoint.java
...a/com/yeejoin/amos/fas/dao/entity/FmeaEquipmentPoint.java
+12
-0
FmeaPointInputitem.java
...a/com/yeejoin/amos/fas/dao/entity/FmeaPointInputitem.java
+12
-0
RiskFactorController.java
...in/amos/fas/business/controller/RiskFactorController.java
+78
-89
RiskLevelController.java
...oin/amos/fas/business/controller/RiskLevelController.java
+80
-89
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+4
-2
FmeaEquipmentPointMapper.java
...mos/fas/business/dao/mapper/FmeaEquipmentPointMapper.java
+2
-2
ImpEquipMapper.java
.../yeejoin/amos/fas/business/dao/mapper/ImpEquipMapper.java
+2
-1
Node3dVoMapper.java
.../yeejoin/amos/fas/business/dao/mapper/Node3dVoMapper.java
+1
-1
RemoteRuleServer.java
...com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
+48
-52
AppMessagePushService.java
...eejoin/amos/fas/business/jpush/AppMessagePushService.java
+79
-0
JPushTypeEnum.java
...va/com/yeejoin/amos/fas/business/jpush/JPushTypeEnum.java
+57
-0
PushMsgParam.java
...ava/com/yeejoin/amos/fas/business/jpush/PushMsgParam.java
+94
-0
FmeaBindParam.java
...va/com/yeejoin/amos/fas/business/param/FmeaBindParam.java
+10
-0
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+6
-2
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+60
-60
Node3dVoServiceImpl.java
...n/amos/fas/business/service/impl/Node3dVoServiceImpl.java
+10
-3
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+0
-0
IFmeaService.java
...yeejoin/amos/fas/business/service/intfc/IFmeaService.java
+23
-40
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+5
-5
Node3dVoService.java
...join/amos/fas/business/service/intfc/Node3dVoService.java
+1
-1
RiskSourceRo.java
...yeejoin/amos/fas/business/service/model/RiskSourceRo.java
+7
-0
RiskSourceRuleRo.java
...oin/amos/fas/business/service/model/RiskSourceRuleRo.java
+62
-0
RsDataQueue.java
.../java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
+12
-6
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+2
-1
fas-1.0.2.xml
...utoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
+73
-0
fas_create_table.sql
...src/main/resources/db/changelog/init/fas_create_table.sql
+1
-1
dbTemplate_fmea.xml
...SysStart/src/main/resources/db/mapper/dbTemplate_fmea.xml
+4
-0
dbTemplate_fmea_equipment_point.xml
...n/resources/db/mapper/dbTemplate_fmea_equipment_point.xml
+11
-3
dbTemplate_fmea_point_inputitem.xml
...n/resources/db/mapper/dbTemplate_fmea_point_inputitem.xml
+4
-1
dbTemplate_impt_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_impt_equip.xml
+6
-4
dbTemplate_node3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_node3d.xml
+32
-27
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+1
-1
pom.xml
pom.xml
+5
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/Fmea.java
View file @
3287f94c
...
...
@@ -68,6 +68,9 @@ public class Fmea extends BasicEntity {
@Column
(
name
=
"risk_source_id"
)
private
Long
riskSourceId
;
@Column
(
name
=
"risk_level_id"
)
private
Long
riskLevelId
;
private
BigDecimal
rpni
;
@Lob
...
...
@@ -76,16 +79,16 @@ public class Fmea extends BasicEntity {
private
RiskSource
riskSource
;
@Column
(
name
=
"company_leader"
)
private
Integer
companyLeader
;
private
Long
companyLeader
;
@Column
(
name
=
"department_leader"
)
private
Integer
departmentLeader
;
private
Long
departmentLeader
;
@Column
(
name
=
"group_leader"
)
private
Integer
groupLeader
;
private
Long
groupLeader
;
@Column
(
name
=
"person_leader"
)
private
Integer
personLeader
;
private
Long
personLeader
;
@Column
(
name
=
"identify_user"
)
private
Integer
identifyUser
;
...
...
@@ -263,35 +266,35 @@ public class Fmea extends BasicEntity {
this
.
rpn
=
rpn
;
}
public
Integer
getCompanyLeader
()
{
public
Long
getCompanyLeader
()
{
return
companyLeader
;
}
public
void
setCompanyLeader
(
Integer
companyLeader
)
{
public
void
setCompanyLeader
(
Long
companyLeader
)
{
this
.
companyLeader
=
companyLeader
;
}
public
Integer
getDepartmentLeader
()
{
public
Long
getDepartmentLeader
()
{
return
departmentLeader
;
}
public
void
setDepartmentLeader
(
Integer
departmentLeader
)
{
public
void
setDepartmentLeader
(
Long
departmentLeader
)
{
this
.
departmentLeader
=
departmentLeader
;
}
public
Integer
getGroupLeader
()
{
public
Long
getGroupLeader
()
{
return
groupLeader
;
}
public
void
setGroupLeader
(
Integer
groupLeader
)
{
public
void
setGroupLeader
(
Long
groupLeader
)
{
this
.
groupLeader
=
groupLeader
;
}
public
Integer
getPersonLeader
()
{
public
Long
getPersonLeader
()
{
return
personLeader
;
}
public
void
setPersonLeader
(
Integer
personLeader
)
{
public
void
setPersonLeader
(
Long
personLeader
)
{
this
.
personLeader
=
personLeader
;
}
...
...
@@ -310,4 +313,12 @@ public class Fmea extends BasicEntity {
public
void
setIdentifyMethod
(
String
identifyMethod
)
{
this
.
identifyMethod
=
identifyMethod
;
}
public
Long
getRiskLevelId
()
{
return
riskLevelId
;
}
public
void
setRiskLevelId
(
Long
riskLevelId
)
{
this
.
riskLevelId
=
riskLevelId
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FmeaEquipmentPoint.java
View file @
3287f94c
...
...
@@ -24,6 +24,9 @@ public class FmeaEquipmentPoint extends BasicEntity {
@Column
(
name
=
"state"
)
private
Integer
state
;
@Column
(
name
=
"important_equipment_id"
)
private
Long
importantEquipmentId
;
public
Long
getEquipmentPointId
()
{
return
equipmentPointId
;
}
...
...
@@ -47,4 +50,12 @@ public class FmeaEquipmentPoint extends BasicEntity {
public
void
setState
(
Integer
state
)
{
this
.
state
=
state
;
}
public
Long
getImportantEquipmentId
()
{
return
importantEquipmentId
;
}
public
void
setImportantEquipmentId
(
Long
importantEquipmentId
)
{
this
.
importantEquipmentId
=
importantEquipmentId
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FmeaPointInputitem.java
View file @
3287f94c
...
...
@@ -27,6 +27,8 @@ public class FmeaPointInputitem extends BasicEntity {
private
Long
inputItemId
;
private
Long
riskSourceId
;
public
Long
getPointInputitemId
()
{
return
PointInputitemId
;
}
...
...
@@ -59,4 +61,13 @@ public class FmeaPointInputitem extends BasicEntity {
public
Long
getInputItemId
()
{
return
inputItemId
;
}
@Transient
public
Long
getRiskSourceId
()
{
return
riskSourceId
;
}
public
void
setRiskSourceId
(
Long
riskSourceId
)
{
this
.
riskSourceId
=
riskSourceId
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskFactorController.java
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
...
...
@@ -21,89 +9,90 @@ import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.entity.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api/riskFactor"
)
@Api
(
"危险因素api"
)
public
class
RiskFactorController
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RiskFactorController
.
class
);
@Autowired
IRiskFactorService
iRiskFactorService
;
/**
* 危险因素分页查询
*
* @param id
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"危险因素查询"
,
notes
=
"危险因素查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskFactorPage
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
CommonPageable
commonPageable
)
{
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
Page
<
HashMap
<
String
,
Object
>>
list
=
iRiskFactorService
.
queryRiskFactorPage
(
param
);
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 危险因素查询,不分页
*
* @param id
* @return
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"危险因素查询不分页"
,
notes
=
"危险因素查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskFactor
()
{
List
<
RiskFactor
>
list
=
iRiskFactorService
.
queryRiskFactor
();
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 危险因素新增及维护
* @param param
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"危险因素新增及维护"
,
notes
=
"危险因素新增及维护"
)
@RequestMapping
(
value
=
"/editRiskFactor"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"危险因素对象"
,
required
=
true
)
@RequestBody
RiskFactor
param
)
{
try
{
Long
count
=
iRiskFactorService
.
countRepeatData
(
param
);
if
(
count
>
0
)
{
return
CommonResponseUtil
.
failure
(
"危险因素名称重复:"
+
param
.
getName
());
}
User
user
=
getUserInfo
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
());
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"dept_id"
,
user
.
getDepartment
()
==
null
?
"0"
:
user
.
getDepartment
().
getId
());
map
.
put
(
"param"
,
param
);
iRiskFactorService
.
editRiskFactor
(
map
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"危险因素编辑失败:"
+
e
.
getMessage
());
}
}
/**
* 危险因素删除(支持批量)
* @param param
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除危险因素"
,
notes
=
"删除危险因素"
)
@RequestMapping
(
value
=
"/deleteRiskFactorById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteRiskFactorById
(
@ApiParam
(
value
=
"危险因素ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
try
{
iRiskFactorService
.
detRiskFactor
(
param
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
()+
",危险因素删除失败"
);
}
}
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RiskFactorController
.
class
);
@Autowired
IRiskFactorService
iRiskFactorService
;
/**
* 危险因素分页查询
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"危险因素查询"
,
notes
=
"危险因素查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskFactorPage
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
CommonPageable
commonPageable
)
{
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
Page
<
HashMap
<
String
,
Object
>>
list
=
iRiskFactorService
.
queryRiskFactorPage
(
param
);
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 危险因素查询,不分页
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"危险因素查询不分页"
,
notes
=
"危险因素查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskFactor
()
{
List
<
RiskFactor
>
list
=
iRiskFactorService
.
queryRiskFactor
();
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 危险因素新增及维护
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"危险因素新增及维护"
,
notes
=
"危险因素新增及维护"
)
@RequestMapping
(
value
=
"/editRiskFactor"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"危险因素对象"
,
required
=
true
)
@RequestBody
RiskFactor
param
)
{
try
{
Long
count
=
iRiskFactorService
.
countRepeatData
(
param
);
if
(
count
>
0
)
{
return
CommonResponseUtil
.
failure
(
"危险因素名称重复:"
+
param
.
getName
());
}
User
user
=
getUserInfo
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
());
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"dept_id"
,
user
.
getDepartment
()
==
null
?
"0"
:
user
.
getDepartment
().
getId
());
map
.
put
(
"param"
,
param
);
iRiskFactorService
.
editRiskFactor
(
map
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"危险因素编辑失败:"
+
e
.
getMessage
());
}
}
/**
* 危险因素删除(支持批量)
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除危险因素"
,
notes
=
"删除危险因素"
)
@RequestMapping
(
value
=
"/deleteRiskFactorById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deleteRiskFactorById
(
@ApiParam
(
value
=
"危险因素ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
try
{
iRiskFactorService
.
detRiskFactor
(
param
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
()
+
",危险因素删除失败"
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskLevelController.java
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
...
...
@@ -22,88 +9,92 @@ import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import
com.yeejoin.amos.op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.op.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.security.entity.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api/riskLevel"
)
@Api
(
"风险等级api"
)
public
class
RiskLevelController
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RiskLevelController
.
class
);
@Autowired
IRiskLevelService
iRiskLevelService
;
/**
* 风险等级分页查询
*
* @param id
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险等级查询"
,
notes
=
"风险等级查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskLevelPage
(
@ApiParam
(
value
=
"查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
CommonPageable
commonPageable
)
{
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
Page
<
HashMap
<
String
,
Object
>>
list
=
iRiskLevelService
.
queryRiskLevelPage
(
param
);
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 风险等级查询,不分页
*
* @param id
* @return
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"风险等级查询不分页"
,
notes
=
"风险等级查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskLevel
(
@ApiParam
(
value
=
"模型id"
,
required
=
false
)
@RequestParam
(
required
=
false
)
Long
id
)
{
List
<
RiskLevel
>
list
=
iRiskLevelService
.
queryRiskLevel
(
id
);
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 风险等级新增及维护
* @param param
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险等级新增及维护"
,
notes
=
"风险等级新增及维护"
)
@RequestMapping
(
value
=
"/editRiskLevel"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"风险等级对象"
,
required
=
true
)
@RequestBody
RiskLevel
param
)
{
try
{
Long
count
=
iRiskLevelService
.
countRepeatData
(
param
);
if
(
count
>
0
)
{
return
CommonResponseUtil
.
failure
(
"风险等级重复:"
+
param
.
getLevel
()
+
"级"
);
}
User
user
=
getUserInfo
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
());
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"param"
,
param
);
iRiskLevelService
.
editRiskLevel
(
map
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"风险等级编辑失败:"
+
e
.
getMessage
());
}
}
/**
* 风险等级删除(支持批量)
* @param param
* @return
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除风险等级"
,
notes
=
"删除风险等级"
)
@RequestMapping
(
value
=
"/deleteRiskLevelById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deletePlanById
(
@ApiParam
(
value
=
"风险等级ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
try
{
iRiskLevelService
.
detRiskLevel
(
param
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
()+
",风险等级删除失败"
);
}
}
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RiskLevelController
.
class
);
@Autowired
IRiskLevelService
iRiskLevelService
;
/**
* 风险等级分页查询
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险等级查询"
,
notes
=
"风险等级查询"
)
@RequestMapping
(
value
=
"/pagelist"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryRiskLevelPage
(
@ApiParam
(
value
=
"查询条件"
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
CommonPageable
commonPageable
)
{
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
Page
<
HashMap
<
String
,
Object
>>
list
=
iRiskLevelService
.
queryRiskLevelPage
(
param
);
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 风险等级查询,不分页
*/
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"风险等级查询不分页"
,
notes
=
"风险等级查询不分页"
)
@RequestMapping
(
value
=
"/all-list"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskLevel
(
@ApiParam
(
value
=
"模型id"
)
@RequestParam
(
required
=
false
)
Long
id
)
{
List
<
RiskLevel
>
list
=
iRiskLevelService
.
queryRiskLevel
(
id
);
return
CommonResponseUtil
.
success
(
list
);
}
/**
* 风险等级新增及维护
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"风险等级新增及维护"
,
notes
=
"风险等级新增及维护"
)
@RequestMapping
(
value
=
"/editRiskLevel"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"风险等级对象"
,
required
=
true
)
@RequestBody
RiskLevel
param
)
{
try
{
Long
count
=
iRiskLevelService
.
countRepeatData
(
param
);
if
(
count
>
0
)
{
return
CommonResponseUtil
.
failure
(
"风险等级重复:"
+
param
.
getLevel
()
+
"级"
);
}
User
user
=
getUserInfo
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"org_code"
,
user
.
getCompany
().
getCompCode
());
map
.
put
(
"user_id"
,
user
.
getId
());
map
.
put
(
"param"
,
param
);
iRiskLevelService
.
editRiskLevel
(
map
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"风险等级编辑失败:"
+
e
.
getMessage
());
}
}
/**
* 风险等级删除(支持批量)
*/
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"删除风险等级"
,
notes
=
"删除风险等级"
)
@RequestMapping
(
value
=
"/deleteRiskLevelById"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
deletePlanById
(
@ApiParam
(
value
=
"风险等级ID"
,
required
=
true
)
@RequestBody
Long
[]
param
)
{
try
{
iRiskLevelService
.
detRiskLevel
(
param
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
e
.
getMessage
()
+
",风险等级删除失败"
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
3287f94c
...
...
@@ -535,9 +535,10 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
value
=
"查询设备指标"
,
notes
=
"查询设备指标"
)
@GetMapping
(
value
=
"/listEquipmentPointById"
)
public
CommonResponse
listEquipmentPointById
(
@RequestParam
Long
fmeaId
,
@RequestParam
Long
importantEquipId
,
@RequestParam
Long
equimentId
,
@RequestParam
(
required
=
false
)
String
equipmentPointName
)
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
listEquipmentPointById
(
fmeaId
,
equimentId
,
equipmentPointName
));
return
CommonResponseUtil
.
success
(
riskSourceService
.
listEquipmentPointById
(
fmeaId
,
importantEquipId
,
equimentId
,
equipmentPointName
));
}
@Authorization
(
ingore
=
true
)
...
...
@@ -569,7 +570,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"上传巡检数据"
,
notes
=
"上传巡检数据"
)
@RequestMapping
(
value
=
"/data/patroldata"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postPatrolData
(
@RequestBody
ProtalDataRo
protalData
)
throws
Exception
{
return
CommonResponseUtil
.
success
(
riskSourceService
.
processProtalData
(
protalData
));
riskSourceService
.
processProtalData
(
protalData
);
return
CommonResponseUtil
.
success
();
}
@Authorization
(
ingore
=
true
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FmeaEquipmentPointMapper.java
View file @
3287f94c
...
...
@@ -8,7 +8,7 @@ import java.util.Map;
public
interface
FmeaEquipmentPointMapper
extends
BaseMapper
{
void
deleteByFmeaIdAndEquipmentPointIds
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"equipmentPointIds"
)
List
<
Long
>
equipmentPointIds
);
void
deleteByFmeaIdAndEquipmentPointIds
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"
importantEquipId"
)
Long
importantEquipId
,
@Param
(
"
equipmentPointIds"
)
List
<
Long
>
equipmentPointIds
);
void
deleteByFmeaIds
(
Long
[]
fmeaIds
);
...
...
@@ -22,7 +22,7 @@ public interface FmeaEquipmentPointMapper extends BaseMapper {
List
<
Long
>
listEquipmentPointIdsByEquipmentId
(
Long
equipmentId
);
List
<
Map
<
String
,
Object
>>
listEquipmentPoint
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"equipmentId"
)
Long
equipmentId
,
@Param
(
"equipmentPointName"
)
String
equipmentPointName
);
List
<
Map
<
String
,
Object
>>
listEquipmentPoint
(
@Param
(
"fmeaId"
)
Long
fmeaId
,
@Param
(
"
importantEquipId"
)
Long
importantEquipId
,
@Param
(
"
equipmentId"
)
Long
equipmentId
,
@Param
(
"equipmentPointName"
)
String
equipmentPointName
);
List
<
FmeaEquipmentPoint
>
listByEquipmentPointId
(
Long
equipmentPointId
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ImpEquipMapper.java
View file @
3287f94c
...
...
@@ -11,8 +11,9 @@ public interface ImpEquipMapper extends BaseMapper {
String
queryProtectObjNames
(
@Param
(
"fireEquipmentId"
)
Long
fireEquipmentId
);
List
<
Map
>
getEquipPage
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"pageSize"
)
Integer
pageSize
);
Long
getEquipPageCount
(
@Param
(
"name"
)
String
name
);
Long
getEquipPageCount
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/Node3dVoMapper.java
View file @
3287f94c
...
...
@@ -19,7 +19,7 @@ public interface Node3dVoMapper extends BaseMapper {
/**
* 风险点数据同步--更新
*/
Integer
incrementalUpdateRiskSource
(
@Param
(
"rsId"
)
Long
rsId
);
Integer
incrementalUpdateRiskSource
(
@Param
(
"rsId"
)
Long
rsId
,
@Param
(
"frequency"
)
Integer
frequency
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
View file @
3287f94c
...
...
@@ -2,24 +2,26 @@ package com.yeejoin.amos.fas.business.feign;
import
com.yeejoin.amos.fas.business.service.model.BasicsRo
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus
;
import
com.yeejoin.amos.
op.core.common.response.CommonResponse
;
import
com.yeejoin.amos.
fas.business.service.model.RiskSourceRuleRo
;
import
com.yeejoin.amos.op.core.util.ApplicationConfig
;
import
com.yeejoin.amos.op.core.util.Constants
;
import
com.yeejoin.amos.op.core.util.JSONUtil
;
import
org.codehaus.jackson.JsonParseException
;
import
org.codehaus.jackson.map.JsonMappingException
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.*
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
*
* <pre>
* 规则模型系统远程调用
* </pre>
...
...
@@ -28,95 +30,89 @@ import java.util.Map;
* @version $Id: RemoteRuleServer.java, v 0.1 2019年5月7日 下午5:52:21 amos Exp $
*/
@Service
(
"remoteRuleServer"
)
public
class
RemoteRuleServer
{
public
class
RemoteRuleServer
{
@Autowired
private
ApplicationConfig
applicationConfig
;
private
final
RestTemplate
restTemplate
;
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RemoteRuleServer
.
class
);
private
ObjectMapper
objectMapper
=
new
ObjectMapper
();
public
RemoteRuleServer
()
{
public
RemoteRuleServer
()
{
this
.
restTemplate
=
new
RestTemplate
();
}
/**
*
* <pre>
* 触发规则
* </pre>
*
* @param resFact 触发规则对象
* @param packageId 规范规则包
* @return
* 触发风险点规则
*/
public
Object
fireRule
(
BasicsRo
resFact
,
String
packageId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"resFact"
,
JSONUtil
.
toJson
(
resFact
));
public
Object
fireRule
(
RiskSourceRuleRo
riskSourceRuleRo
,
String
packageId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
String
data
=
JSONUtil
.
toJson
(
riskSourceRuleRo
);
log
.
info
(
data
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"className"
,
r
esFact
.
getClass
().
getName
());
map
.
put
(
"className"
,
r
iskSourceRuleRo
.
getClass
().
getName
());
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteRuleUrl"
);
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>
>(
map
,
headers
);
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<>(
map
,
headers
);
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"urule/rule/fireRule"
,
HttpMethod
.
POST
,
formEntity
,
String
.
class
);
responseEntity
.
getBody
();
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
)
)
{
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
)
)
{
log
.
info
(
"调用规则服务成功,请求参数:"
+
formEntity
.
toString
());
return
commonResponse
.
get
(
"dataList"
);
}
return
null
;
}
/**
*
* <pre>
* 触发规则流
* </pre>
*
* @param resFact 触发规则对象
* @param resFact
触发规则对象
* @param packageId 规范规则包
* @param processId 规则流id
* @return
*/
public
Object
fireRuleFlow
(
BasicsRo
resFact
,
String
packageId
,
String
processId
)
throws
Exception
{
public
Object
fireRuleFlow
(
BasicsRo
resFact
,
String
packageId
,
String
processId
)
throws
Exception
{
String
data
=
JSONUtil
.
toJson
(
resFact
);
log
.
info
(
"调用规则请求====================>"
+
data
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"resFact"
,
JSONUtil
.
toJson
(
resFact
)
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"processId"
,
processId
);
map
.
put
(
"className"
,
resFact
.
getClass
().
getName
());
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteRuleUrl"
);
HttpHeaders
headers
=
new
HttpHeaders
();
MediaType
type
=
MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>>(
map
,
headers
);
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"urule/rule/fireRuleFlow"
,
HttpMethod
.
POST
,
formEntity
,
String
.
class
);
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
)
)
{
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
))
{
return
commonResponse
.
get
(
"dataList"
);
}
return
null
;
}
public
Object
autoProcessContingency
(
ContingencyDeviceStatus
contingencyDeviceStatus
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
public
Object
autoProcessContingency
(
ContingencyDeviceStatus
contingencyDeviceStatus
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
String
url
=
applicationConfig
.
getParamValueStr
(
"params.remoteRuleUrl"
);
// String url = "http://172.16.10.70:8080/";
...
...
@@ -128,20 +124,19 @@ public class RemoteRuleServer
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>>(
map
,
headers
);
String
urlParams
=
"batchNo=%s&stepCode=%s&buttonCode=%s&confirm=%s&contingencyPlanId=%s&stepState=%s"
;
String
.
format
(
urlParams
,
contingencyDeviceStatus
.
getButtonCode
(),
contingencyDeviceStatus
.
getStepCode
(),
contingencyDeviceStatus
.
getConfirm
(),
contingencyDeviceStatus
.
getContingencyPlanId
(),
contingencyDeviceStatus
.
getStepState
());
contingencyDeviceStatus
.
getButtonCode
(),
contingencyDeviceStatus
.
getStepCode
(),
contingencyDeviceStatus
.
getConfirm
(),
contingencyDeviceStatus
.
getContingencyPlanId
(),
contingencyDeviceStatus
.
getStepState
());
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"/api/timeline/fire?"
+
urlParams
,
HttpMethod
.
PUT
,
formEntity
,
String
.
class
);
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
)
)
{
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
))
{
return
commonResponse
.
get
(
"dataList"
);
}
return
null
;
}
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/jpush/AppMessagePushService.java
0 → 100644
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
jpush
;
import
cn.jpush.api.JPushClient
;
import
cn.jpush.api.push.model.Platform
;
import
cn.jpush.api.push.model.PushPayload
;
import
cn.jpush.api.push.model.audience.Audience
;
import
cn.jpush.api.push.model.notification.Notification
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
AppMessagePushService
{
protected
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AppMessagePushService
.
class
);
@Value
(
"${params.isPush}"
)
private
String
isPush
;
private
static
final
String
APP_KEY
=
"1b3f7b961200f4b236811dfe"
;
private
static
final
String
MASTER_SECRET
=
"8b650e645fb3a43c96be02b2"
;
private
static
JPushClient
jpushClient
=
new
JPushClient
(
MASTER_SECRET
,
APP_KEY
);
public
void
sendMessage
(
List
<
PushMsgParam
>
responses
)
{
try
{
if
(
responses
!=
null
&&
"true"
.
equals
(
isPush
))
{
for
(
PushMsgParam
response
:
responses
)
{
PushPayload
payload
=
buildPushPayload
(
response
);
jpushClient
.
sendPush
(
payload
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"极光推送异常"
,
e
);
}
}
private
PushPayload
buildPushPayload
(
PushMsgParam
response
)
{
if
(
JPushTypeEnum
.
ALL
.
getCode
().
equals
(
response
.
getType
()))
{
return
PushPayload
.
newBuilder
()
.
setPlatform
(
Platform
.
android
())
.
setAudience
(
Audience
.
all
())
.
setNotification
(
Notification
.
android
(
response
.
getContent
(),
response
.
getSubject
(),
response
.
getExtras
()))
.
build
();
}
else
if
(
JPushTypeEnum
.
TAG
.
getCode
().
equals
(
response
.
getType
()))
{
return
PushPayload
.
newBuilder
()
.
setPlatform
(
Platform
.
android
())
.
setAudience
(
Audience
.
tag
(
response
.
getRecivers
()))
.
setNotification
(
Notification
.
android
(
response
.
getContent
(),
response
.
getSubject
(),
response
.
getExtras
()))
.
build
();
}
else
{
return
PushPayload
.
newBuilder
()
.
setPlatform
(
Platform
.
android
())
.
setAudience
(
Audience
.
alias
(
response
.
getRecivers
()))
.
setNotification
(
Notification
.
android
(
response
.
getContent
(),
response
.
getSubject
(),
response
.
getExtras
()))
.
build
();
}
}
public
void
sendMessage
(
PushMsgParam
response
)
{
try
{
if
(
null
!=
response
&&
"true"
.
equals
(
isPush
))
{
PushPayload
payload
=
PushPayload
.
newBuilder
().
setPlatform
(
Platform
.
android
())
.
setAudience
(
Audience
.
all
())
.
setNotification
(
Notification
.
android
(
response
.
getContent
(),
response
.
getSubject
(),
response
.
getExtras
()))
.
build
();
jpushClient
.
sendPush
(
payload
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"极光推送异常"
,
e
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/jpush/JPushTypeEnum.java
0 → 100644
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
jpush
;
/**
* JPush 推送类型
* @author maoying
*
*/
public
enum
JPushTypeEnum
{
ALL
(
"广播"
,
"1"
),
TAG
(
"标签"
,
"2"
),
ALIAS
(
"别名"
,
"3"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
private
JPushTypeEnum
(
String
name
,
String
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
static
JPushTypeEnum
getEnum
(
String
code
)
{
JPushTypeEnum
jPushTypeEnum
=
null
;
for
(
JPushTypeEnum
type:
JPushTypeEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
jPushTypeEnum
=
type
;
break
;
}
}
return
jPushTypeEnum
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/jpush/PushMsgParam.java
0 → 100644
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
jpush
;
import
java.util.List
;
import
java.util.Map
;
public
class
PushMsgParam
{
/**
* 标题
*/
private
String
subject
;
/**
* 消息内容
*/
private
String
content
;
/**
* 邮件地址
*/
private
String
[]
emails
;
/**
* jpush接收人
*/
private
List
<
String
>
recivers
;
//
/**
* jpush参数传递
*/
Map
<
String
,
String
>
extras
;
/**
* jpush发送类型:1:广播;2:标签;3:别名
*/
private
String
type
=
"3"
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
List
<
String
>
getRecivers
()
{
return
recivers
;
}
public
void
setRecivers
(
List
<
String
>
recivers
)
{
this
.
recivers
=
recivers
;
}
public
Map
<
String
,
String
>
getExtras
()
{
return
extras
;
}
public
void
setExtras
(
Map
<
String
,
String
>
extras
)
{
this
.
extras
=
extras
;
}
public
String
getSubject
()
{
return
subject
;
}
public
void
setSubject
(
String
subject
)
{
this
.
subject
=
subject
;
}
public
String
[]
getEmails
()
{
return
emails
;
}
public
void
setEmails
(
String
[]
emails
)
{
this
.
emails
=
emails
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/param/FmeaBindParam.java
View file @
3287f94c
...
...
@@ -14,6 +14,8 @@ public class FmeaBindParam {
private
List
<
Long
>
pointInputitemIds
;
private
Long
importantEquipmentId
;
public
Long
getFmeaId
()
{
return
fmeaId
;
}
...
...
@@ -53,4 +55,12 @@ public class FmeaBindParam {
public
void
setEquipmentId
(
Long
equipmentId
)
{
this
.
equipmentId
=
equipmentId
;
}
public
Long
getImportantEquipmentId
()
{
return
importantEquipmentId
;
}
public
void
setImportantEquipmentId
(
Long
importantEquipmentId
)
{
this
.
importantEquipmentId
=
importantEquipmentId
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
3287f94c
...
...
@@ -138,13 +138,17 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Override
public
Page
<
Equipment
>
queryImpEquip
(
List
<
DaoCriteria
>
criterias
,
CommonPageable
commonPageable
)
{
String
name
=
""
;
String
id
=
""
;
for
(
DaoCriteria
criteria
:
criterias
)
{
if
(
criteria
.
getPropertyName
().
equals
(
"name"
))
{
name
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
}
if
(
criteria
.
getPropertyName
().
equals
(
"id"
))
{
id
=
String
.
valueOf
(
criteria
.
getValue
()
!=
null
?
criteria
.
getValue
().
toString
()
:
""
);
}
}
Long
total
=
impEquipMapper
.
getEquipPageCount
(
name
);
List
<
Map
>
content
=
impEquipMapper
.
getEquipPage
(
name
,
commonPageable
.
getOffset
(),
Long
total
=
impEquipMapper
.
getEquipPageCount
(
name
,
id
);
List
<
Map
>
content
=
impEquipMapper
.
getEquipPage
(
name
,
id
,
commonPageable
.
getOffset
(),
commonPageable
.
getPageSize
());
Page
result
=
new
PageImpl
(
content
,
commonPageable
,
total
);
return
result
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
3287f94c
...
...
@@ -89,25 +89,25 @@ public class FmeaServiceImpl implements IFmeaService {
}
public
void
updateRpniInfo
(
Long
riskSourceId
)
{
new
Thread
(()
->
{
String
batchNo
=
UUID
.
randomUUID
().
toString
();
List
<
RiskSource
>
riskSources
=
new
ArrayList
<>();
RiskSource
riskSource
=
this
.
iRiskSourceDao
.
findById
(
riskSourceId
);
riskSources
.
add
(
riskSource
);
try
{
asymbleWithParent
(
batchNo
,
riskSources
,
RiskFactor
.
class
.
getSimpleName
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}).
start
();
}
//
public void updateRpniInfo(Long riskSourceId) {
//
//
//
new Thread(() ->
//
{
//
String batchNo = UUID.randomUUID().toString();
//
//
List<RiskSource> riskSources = new ArrayList<>();
//
//
RiskSource riskSource = this.iRiskSourceDao.findById(riskSourceId);
//
riskSources.add(riskSource);
//
try {
//
asymbleWithParent(batchNo, riskSources, RiskFactor.class.getSimpleName());
//
} catch (Exception e) {
//
e.printStackTrace();
//
}
//
}).start();
//
//
}
@Override
public
int
queryControlObjCount
(
String
[]
ids
)
{
...
...
@@ -119,47 +119,47 @@ public class FmeaServiceImpl implements IFmeaService {
return
0
;
//没有关联对象
}
private
boolean
asymbleWithParent
(
String
bacthNo
,
List
<
RiskSource
>
riskSourceList
,
String
from
)
throws
Exception
{
if
(!
CollectionUtils
.
isEmpty
(
riskSourceList
))
{
for
(
RiskSource
riskSource
:
riskSourceList
)
{
//当前规则
RiskSourceRo
riskSourceRo
=
this
.
transfer
(
bacthNo
,
riskSource
,
from
,
new
BigDecimal
(
0
));
Object
result
=
remoteRuleServer
.
fireRule
(
riskSourceRo
,
"风险管控/riskFactor"
);
BigDecimal
RPNi
=
updateRpn
(
result
,
riskSource
,
null
);
//处理返回结果
//反查 父级风险点,取得处于第二级的父级风险点
findParent
(
bacthNo
,
riskSource
,
RPNi
);
}
}
return
true
;
}
/**
* 查询父节点风险点
*
* @param riskSource
* @param RPNi
* @return
*/
private
BigDecimal
findParent
(
String
bacthNo
,
RiskSource
riskSource
,
BigDecimal
RPNi
)
throws
Exception
{
if
(
riskSource
!=
null
&&
riskSource
.
getId
()
!=
0
&&
RPNi
.
doubleValue
()
!=
0
)
{
RiskSource
parent
=
this
.
iRiskSourceDao
.
findOne
(
riskSource
.
getParentId
());
if
(
null
!=
parent
)
{
RiskSourceRo
parentRiskResource
=
this
.
transfer
(
bacthNo
,
parent
,
"child"
,
RPNi
);
Object
result
=
remoteRuleServer
.
fireRule
(
parentRiskResource
,
"风险管控/riskFactorParent"
);
updateRpn
(
result
,
parent
,
RPNi
);
if
(
parent
.
getParentId
()
!=
0
)
this
.
findParent
(
bacthNo
,
parent
,
RPNi
);
}
}
return
RPNi
;
}
//
private boolean asymbleWithParent(String bacthNo, List<RiskSource> riskSourceList, String from) throws Exception {
//
if (!CollectionUtils.isEmpty(riskSourceList)) {
//
for (RiskSource riskSource : riskSourceList) {
//
//当前规则
//
RiskSourceRo riskSourceRo = this.transfer(bacthNo, riskSource, from, new BigDecimal(0));
//
//
Object result = remoteRuleServer.fireRule(riskSourceRo, "风险管控/riskFactor");
//
BigDecimal RPNi = updateRpn(result, riskSource, null);
//
//处理返回结果
//
//
//反查 父级风险点,取得处于第二级的父级风险点
//
findParent(bacthNo, riskSource, RPNi);
//
}
//
}
//
return true;
//
}
//
/**
//
* 查询父节点风险点
//
*
//
* @param riskSource
//
* @param RPNi
//
* @return
//
*/
//
private BigDecimal findParent(String bacthNo, RiskSource riskSource,
//
BigDecimal RPNi) throws Exception {
//
if (riskSource != null && riskSource.getId() != 0 && RPNi.doubleValue() != 0) {
//
RiskSource parent = this.iRiskSourceDao.findOne(riskSource.getParentId());
//
if (null != parent) {
//
RiskSourceRo parentRiskResource = this.transfer(bacthNo, parent, "child", RPNi);
//
Object result = remoteRuleServer.fireRule(parentRiskResource, "风险管控/riskFactorParent");
//
updateRpn(result, parent, RPNi);
//
//
if (parent.getParentId() != 0)
//
this.findParent(bacthNo, parent, RPNi);
//
}
//
}
//
//
return RPNi;
//
}
private
RiskSourceRo
transfer
(
String
bacthNo
,
RiskSource
riskSource
,
String
from
,
BigDecimal
rpni
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/Node3dVoServiceImpl.java
View file @
3287f94c
...
...
@@ -81,7 +81,7 @@ public class Node3dVoServiceImpl implements Node3dVoService {
result
=
node3dVoMapper
.
incrementalUpdateImpEqumt
(
null
);
break
;
case
DATATYPE_RISKSOURCE:
result
=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
);
result
=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
);
break
;
case
DATATYPE_FIRECAR:
result
=
node3dVoMapper
.
incrementalUpdateFireCar
(
null
);
...
...
@@ -119,7 +119,7 @@ public class Node3dVoServiceImpl implements Node3dVoService {
break
;
case
DATATYPE_RISKSOURCE:
result
+=
node3dVoMapper
.
incrementalCreateRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateRiskSource
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
);
result
+=
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
);
break
;
case
DATATYPE_FIRECAR:
...
...
@@ -158,7 +158,7 @@ public class Node3dVoServiceImpl implements Node3dVoService {
//风险点
result
+=
node3dVoMapper
.
incrementalCreateRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalCreateRiskSource
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
);
result
+=
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
)==
null
?
0
:
node3dVoMapper
.
incrementalUpdateRiskSource
(
null
,
null
);
result
+=
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
)==
null
?
0
:
node3dVoMapper
.
incrementalDeleteRiskSource
(
null
);
//消防车
...
...
@@ -182,6 +182,13 @@ public class Node3dVoServiceImpl implements Node3dVoService {
return
result
;
}
@Override
public
Integer
updateByRiskSourceId
(
Long
riskSourceId
,
Integer
frequency
)
{
Integer
result
=
0
;
result
=
node3dVoMapper
.
incrementalUpdateRiskSource
(
riskSourceId
,
frequency
);
return
result
;
}
@Async
@Override
public
Integer
syncData
(
Callable
<
Integer
>
callable
)
throws
Exception
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
3287f94c
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFmeaService.java
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.HashMap
;
import
java.util.List
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
org.springframework.data.domain.Page
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.op.core.common.query.DaoCriteria
;
import
java.util.HashMap
;
public
interface
IFmeaService
{
/**
* 维护Fmea模型
*
* @param map
* @return
*/
void
editFmea
(
HashMap
<
String
,
Object
>
map
);
/**
* 根据ID删除Fmea
*
* @param fmeaIds
*/
void
deleteFmea
(
Long
[]
fmeaIds
);
/**
* 分页查询Fmea
*
* @param criterias
* @param commonPageable
* @return
*/
Page
<
HashMap
<
String
,
Object
>>
queryFmeaList
(
CommonPageInfoParam
param
);
void
updateRpniInfo
(
Long
riskSourceId
);
/**
* 查询关联的关联对象个数
*
* @param ids
* @return count 关联对象个数
*/
/**
* 维护Fmea模型
*/
void
editFmea
(
HashMap
<
String
,
Object
>
map
);
/**
* 根据ID删除Fmea
*/
void
deleteFmea
(
Long
[]
fmeaIds
);
/**
* 分页查询Fmea
*/
Page
<
HashMap
<
String
,
Object
>>
queryFmeaList
(
CommonPageInfoParam
param
);
//
// void updateRpniInfo(Long riskSourceId);
/**
* 查询关联的关联对象个数
*/
int
queryControlObjCount
(
String
[]
ids
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
3287f94c
...
...
@@ -59,7 +59,7 @@ public interface IRiskSourceService {
*/
Page
queryEquimentRelation
(
CommonPageable
commonPageable
,
String
equipmentId
,
String
fname
);
List
<
Map
<
String
,
Object
>>
listEquipmentPointById
(
Long
fmeaId
,
Long
equipmentId
,
String
equipmentPointName
);
List
<
Map
<
String
,
Object
>>
listEquipmentPointById
(
Long
fmeaId
,
Long
importantEquipId
,
Long
equipmentId
,
String
equipmentPointName
);
Page
<
Map
<
String
,
Object
>>
listFmeaPointInputitem
(
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
);
...
...
@@ -72,7 +72,7 @@ public interface IRiskSourceService {
boolean
processTaskData
(
ProtalDataRo
taskData
)
throws
Exception
;
boolean
processProtalData
(
ProtalDataRo
protalData
)
throws
Exception
;
void
processProtalData
(
ProtalDataRo
protalData
)
throws
Exception
;
RiskSourceTreeResponse
queryRiskSourceDetailById
(
Long
id
);
...
...
@@ -107,9 +107,9 @@ public interface IRiskSourceService {
Integer
getChildTypeByPid
(
Long
riskSourceId
);
void
notifyFmeaFromAbnormal
(
Long
fmeaId
);
void
notifyFmeaFromAbnormal
(
Long
fmeaId
,
String
notifyType
);
void
notifyFmeaFromUpdate
(
Long
fmeaId
);
void
notifyFmeaFromUpdate
(
Long
fmeaId
,
String
nofityType
);
void
notifyRiskSource
(
Long
riskSourceId
);
void
notifyRiskSource
(
Long
riskSourceId
,
String
notifyType
,
String
jpushTarget
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/Node3dVoService.java
View file @
3287f94c
...
...
@@ -50,7 +50,7 @@ public interface Node3dVoService {
*/
Integer
wholeIncremental
();
Integer
updateByRiskSourceId
(
Long
riskSourceId
,
Integer
frequency
);
Integer
syncData
(
Callable
<
Integer
>
callable
)
throws
Exception
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/RiskSourceRo.java
View file @
3287f94c
...
...
@@ -70,6 +70,13 @@ public class RiskSourceRo extends BasicsRo {
private
String
riskState
;
//风险点状态
private
BigDecimal
rg
;
/**
* up、down、no
*/
private
String
levelChangeType
;
public
String
getRiskState
()
{
return
riskState
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/RiskSourceRuleRo.java
0 → 100644
View file @
3287f94c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
java.math.BigDecimal
;
public
class
RiskSourceRuleRo
extends
BasicsRo
{
/**
* patrol、equipment、update、delete
*/
private
String
notifyType
;
private
Long
id
;
private
BigDecimal
rpnr
;
private
BigDecimal
rpni
;
/**
* up、down、no
*/
private
String
levelChangeType
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
BigDecimal
getRpnr
()
{
return
rpnr
;
}
public
void
setRpnr
(
BigDecimal
rpnr
)
{
this
.
rpnr
=
rpnr
;
}
public
BigDecimal
getRpni
()
{
return
rpni
;
}
public
void
setRpni
(
BigDecimal
rpni
)
{
this
.
rpni
=
rpni
;
}
public
String
getLevelChangeType
()
{
return
levelChangeType
;
}
public
void
setLevelChangeType
(
String
levelChangeType
)
{
this
.
levelChangeType
=
levelChangeType
;
}
public
String
getNotifyType
()
{
return
notifyType
;
}
public
void
setNotifyType
(
String
notifyType
)
{
this
.
notifyType
=
notifyType
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
View file @
3287f94c
...
...
@@ -52,8 +52,12 @@ public class RsDataQueue {
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"update"
));
}
public
void
addAbnormalMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"abnormal"
));
public
void
addPatrolMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"patrol"
));
}
public
void
addEquipmentMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"equipment"
));
}
public
void
addDeleteMessage
(
Long
riskSourceId
)
{
...
...
@@ -68,12 +72,14 @@ public class RsDataQueue {
if
(
riskSourceService
!=
null
)
{
String
from
=
fmeaMessage
.
getNorifyFrom
();
Long
handId
=
fmeaMessage
.
getHandId
();
if
(
from
.
equals
(
"abnormal"
))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
);
if
(
from
.
equals
(
"patrol"
))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
}
else
if
(
from
.
equals
(
"equipment"
))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
}
else
if
(
from
.
equals
(
"update"
))
{
riskSourceService
.
notifyFmeaFromUpdate
(
handId
);
riskSourceService
.
notifyFmeaFromUpdate
(
handId
,
from
);
}
else
if
(
from
.
equals
(
"delete"
))
{
riskSourceService
.
notifyRiskSource
(
handId
);
riskSourceService
.
notifyRiskSource
(
handId
,
from
,
null
);
}
}
}
catch
(
Exception
e
)
{
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
3287f94c
...
...
@@ -80,7 +80,7 @@ params.xssSecurity = false
#rule
#params.remoteRuleUrl=http://172.16.3.3:8080/
params.remoteRuleUrl
=
http://
172.16.10.91:
8080/
params.remoteRuleUrl
=
http://
magintursh.xicp.net:1
8080/
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
#redis database index
...
...
@@ -103,3 +103,4 @@ linux.img.path = /
file.uploadUrl
=
D:
\\
upload
\\
files
\\
#picture read
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
params.isPush
=
true
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
View file @
3287f94c
...
...
@@ -102,6 +102,66 @@
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-8"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"risk_level_id"
/>
</not>
</preConditions>
<comment>
f_fmea add column risk_level_id
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `risk_level_id` bigint(20) DEFAULT NULL COMMENT '风险等级id';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-9"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"company_leader"
/>
</not>
</preConditions>
<comment>
f_fmea add column company_leader
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `company_leader` bigint(20) DEFAULT NULL COMMENT '公司负责人';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-10"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"department_leader"
/>
</not>
</preConditions>
<comment>
f_fmea add column department_leader
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `department_leader` bigint(20) DEFAULT NULL COMMENT '部门负责人';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-11"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"group_leader"
/>
</not>
</preConditions>
<comment>
f_fmea add column group_leader
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `group_leader` bigint(20) DEFAULT NULL COMMENT '班组负责人';
</sql>
</changeSet>
<changeSet
author=
"xukaiqiang"
id=
"1557134646002-12"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea"
columnName=
"person_leader"
/>
</not>
</preConditions>
<comment>
f_fmea add column person_leader
</comment>
<sql>
ALTER TABLE `f_fmea` ADD COLUMN `person_leader` bigint(20) DEFAULT NULL COMMENT '个人负责人';
</sql>
</changeSet>
<changeSet
author=
"tianbo"
id=
"1582104676000-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
...
...
@@ -205,4 +265,16 @@
</sql>
</changeSet>
<changeSet
author=
"tianbo"
id=
"1583068193000-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_fmea_equipment_point"
columnName=
"important_equipment_id"
/>
</not>
</preConditions>
<comment>
f_fmea_equipment_point add column important_equipment_id
</comment>
<sql>
ALTER TABLE `f_fmea_equipment_point` ADD COLUMN `important_equipment_id` bigint(20) NOT NULL COMMENT '所属重点设备id';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/init/fas_create_table.sql
View file @
3287f94c
...
...
@@ -176,7 +176,7 @@ CREATE TABLE `f_fmea` (
`create_date`
datetime
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`create_by`
int
(
11
)
DEFAULT
'0'
COMMENT
'创建者'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'F
EM
A表'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'F
ME
A表'
;
-- ----------------------------
-- Table structure for f_preplan_picture
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea.xml
View file @
3287f94c
...
...
@@ -102,6 +102,10 @@
a.evaluation_oid as evaluationOid,
a.evaluation_did as evaluationDid,
a.new_evaluation_oid as newEvaluationOid,
a.company_leader as companyLeader,
a.department_leader as departmentLeader,
a.person_leader as personLeader,
a.group_leader as groupLeader,
a.rpni,
a.rpn,
(select coefficient from f_evaluation_model where id = a.evaluation_sid) as sidValue,
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea_equipment_point.xml
View file @
3287f94c
...
...
@@ -8,6 +8,7 @@
f_fmea_equipment_point
where
fmea_id = #{fmeaId}
and important_equipment_id = #{importantEquipId}
and
equipment_point_id in
<foreach
collection=
"equipmentPointIds"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
...
...
@@ -28,12 +29,14 @@
insert into f_fmea_equipment_point
(
fmea_id,
important_equipment_id,
equipment_point_id
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.fmeaId},
#{item.importantEquipmentId},
#{item.equipmentPointId}
)
</foreach>
...
...
@@ -62,18 +65,21 @@
select
c.fmea_id as fmeaId,
a.id as equipmentId,
group_concat(
b.name
) as equipmentPointNames,
group_concat(
concat( b.NAME, '##', c.state ) SEPARATOR
<![CDATA[ '\n' ]]>
) as equipmentPointNames,
a.name as equipmentName,
a.code as equipmentCode
a.code as equipmentCode,
d.name AS importantEquipName,
d.id AS importantEquipId
from
f_fire_equipment as a
left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id
left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id
LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id
where
c.fmea_id = #{fmeaId}
group by b.fire_equipment_id
group by b.fire_equipment_id
,c.important_equipment_id
limit #{offset},#{limit}
</select>
...
...
@@ -113,6 +119,8 @@
d.equipment_point_id = a.id
and
d.fmea_id = #{fmeaId}
and
d.important_equipment_id = #{importantEquipId}
) isBound
from
f_fire_equipment_point as a
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea_point_inputitem.xml
View file @
3287f94c
...
...
@@ -102,11 +102,14 @@
a.fmea_id as fmeaId,
a.point_inputitem_id as pointInputitemId,
a.state,
b.input_item_id as inputItemId
b.input_item_id as inputItemId,
c.risk_source_id
from
f_fmea_point_inputitem as a
left join
p_point_inputitem as b on a.point_inputitem_id = b.id
left join
f_fmea as c on a.fmea_id = c.id
where
b.point_id = #{pointId}
and
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_impt_equip.xml
View file @
3287f94c
...
...
@@ -37,9 +37,10 @@
FROM
f_equipment eq
left join f_risk_source frs on frs.id = eq.risk_source_id
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"name!=null"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
</trim>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"name !=null and name != ''"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
<if
test=
"id != null and id != ''"
>
and eq.id = #{id}
</if>
</trim>
order by eq.id
<choose>
<when
test=
"pageSize==-1"
></when>
...
...
@@ -53,7 +54,8 @@
FROM
f_equipment eq
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"name!=null"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
<if
test=
"name !=null and name != ''"
>
and (eq.name like concat(concat("%",#{name}),"%") or eq.code like concat(concat("%",#{name}),"%"))
</if>
<if
test=
"id != null and id != ''"
>
and eq.id = #{id}
</if>
</trim>
</select>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_node3d.xml
View file @
3287f94c
...
...
@@ -30,7 +30,8 @@
(select rl.`level` from f_risk_level rl where rl.id = rs.risk_level_id)data_level,
rs.`code` data_code,
null protect_obj_name,
null route_name
null route_name,
0 frequency
from f_risk_source rs
where
<choose>
...
...
@@ -41,7 +42,7 @@
not EXISTS(select 1 from toip_biz_node3dvo bn where bn.type = 'riskSource' and bn.oid = rs.`id`) ;
</otherwise>
</choose>
</select>
<select
id=
"incrementalDeleteRiskSource"
resultType=
"java.lang.Integer"
>
...
...
@@ -77,34 +78,10 @@
);
</otherwise>
</choose>
</select>
<select
id=
"incrementalUpdateRiskSource"
resultType=
"java.lang.Integer"
>
UPDATE
toip_biz_node3dvo AS bn
JOIN f_risk_source AS rs
ON bn.oid = rs.id
SET
bn.config = CONCAT('{"isIndoor":',CASE rs.is_indoor WHEN 1 THEN 'true' WHEN 0 THEN 'false' END,',"belongObjModel":"floor_',rs.floor3d,'"}'),
bn.org_code = rs.org_code,
bn.position = CASE WHEN (ISNULL(rs.position3d) || LENGTH(trim(rs.position3d))
<![CDATA[<]]>
1) THEN NULL ELSE CONCAT('{"x":',substring_index(rs.position3d,',', 1),',"y":',substring_index(substring_index(rs.position3d,',', -2), ',', 1),',"z":',substring_index(rs.position3d,',', -1),'}') END,
bn.data_level = (select rl.`level` from f_risk_level rl where rl.id = rs.risk_level_id),
bn.data_code = rs.`code`,
bn.display_name = rs.`name`
WHERE
bn.type = 'riskSource'
<if
test=
"rsId !=null"
>
and rs.id = #{rsId}
</if>
</select>
<select
id=
"incrementalCreateFierEqumt"
resultType=
"java.lang.Integer"
>
INSERT INTO toip_biz_node3dvo
select
...
...
@@ -153,7 +130,35 @@
fe.equip_classify in (0,2,3) and not EXISTS(select 1 from toip_biz_node3dvo bn where bn.type in ('fireEquipment','video','monitorEquipment') and bn.oid = fe.`id`) ;
</otherwise>
</choose>
</select>
<select
id=
"incrementalUpdateRiskSource"
resultType=
"java.lang.Integer"
>
UPDATE
toip_biz_node3dvo AS bn
JOIN f_risk_source AS rs
ON bn.oid = rs.id
SET
bn.config = CONCAT('{"isIndoor":',CASE rs.is_indoor WHEN 1 THEN 'true' WHEN 0 THEN 'false' END,',"belongObjModel":"floor_',rs.floor3d,'"}'),
bn.org_code = rs.org_code,
bn.position = CASE WHEN (ISNULL(rs.position3d) || LENGTH(trim(rs.position3d))
<![CDATA[<]]>
1) THEN NULL ELSE CONCAT('{"x":',substring_index(rs.position3d,',', 1),',"y":',substring_index(substring_index(rs.position3d,',', -2), ',', 1),',"z":',substring_index(rs.position3d,',', -1),'}') END,
bn.data_level = (select rl.`level` from f_risk_level rl where rl.id = rs.risk_level_id),
bn.data_code = rs.`code`,
bn.display_name = rs.`name`,
<if
test=
"frequency != null"
>
bn.frequency = #{frequency},
</if>
bn.node_state = rs.rpn
WHERE
bn.type = 'riskSource'
<if
test=
"rsId !=null"
>
and rs.id = #{rsId}
</if>
</select>
<select
id=
"incrementalDeleteFierEqumt"
resultType=
"java.lang.Integer"
>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
3287f94c
...
...
@@ -375,7 +375,7 @@
FROM
f_risk_source rs
WHERE
EXISTS
(
id in
(
SELECT
pi.risk_source_id
FROM
...
...
pom.xml
View file @
3287f94c
...
...
@@ -220,6 +220,11 @@
<artifactId>
commons-jexl
</artifactId>
<version>
2.1.1
</version>
</dependency>
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jpush-client
</artifactId>
<version>
3.3.10
</version>
</dependency>
</dependencies>
<dependencyManagement>
...
...
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