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
b3862d90
Commit
b3862d90
authored
Jan 29, 2021
by
zhengjiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
bd4d32c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+11
-0
IFmeaDao.java
...om/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
+3
-0
RiskFactorServiceImpl.java
...amos/fas/business/service/impl/RiskFactorServiceImpl.java
+6
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
b3862d90
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.fas.business.controller;
import
java.util.HashMap
;
import
java.util.List
;
import
com.yeejoin.amos.fas.business.dao.repository.IFmeaDao
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -49,6 +51,9 @@ public class RiskModelController extends BaseController {
@Autowired
private
IFmeaService
fmeaService
;
@Autowired
private
IFmeaDao
iFmeaDao
;
@Permission
@ApiOperation
(
value
=
"根据父类编号获取子类风险点类型"
,
notes
=
"根据父类编号获取子类风险点类型"
)
@GetMapping
(
value
=
"/riskSource/getChildTypeByPid"
)
...
...
@@ -159,6 +164,12 @@ public class RiskModelController extends BaseController {
@RequestMapping
(
value
=
"/fmea/editFmea"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
editFmea
(
@ApiParam
(
value
=
"Fmea模型对象"
,
required
=
true
)
@RequestBody
List
<
Fmea
>
params
)
{
try
{
params
.
forEach
(
param
->
{
int
i
=
iFmeaDao
.
checkIdAndName
(
param
.
getRiskSourceId
(),
param
.
getRiskFactorsId
());
if
(
i
>
0
){
throw
new
YeeException
(
"危险因素重复"
);
}
});
AgencyUserModel
user
=
getUserInfo
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"user_id"
,
user
.
getUserId
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
View file @
b3862d90
...
...
@@ -48,4 +48,7 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
@Query
(
value
=
"select * from `f_fmea` where id in ?1"
,
nativeQuery
=
true
)
List
<
Fmea
>
findAllByRiskSourceIds
(
List
<
Long
>
ids
);
@Query
(
value
=
"select count(1) from `f_fmea` where risk_source_id = ?1 and risk_factors_id = ?2"
,
nativeQuery
=
true
)
int
checkIdAndName
(
Long
sId
,
Long
nId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskFactorServiceImpl.java
View file @
b3862d90
...
...
@@ -14,6 +14,8 @@ import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
...
...
@@ -44,14 +46,18 @@ public class RiskFactorServiceImpl implements IRiskFactorService {
long
total
=
riskFactorMapper
.
countPageData
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
riskFactorMapper
.
queryRiskFactorPage
(
param
);
if
(!
CollectionUtils
.
isEmpty
(
content
)){
List
<
DictionarieValueModel
>
typeNameList
=
Systemctl
.
dictionarieClient
.
dictValues
(
"INDUSTRY_TYPE"
).
getResult
();
Map
<
String
,
String
>
typeName
=
typeNameList
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
Set
<
String
>
userIds
=
new
HashSet
<>();
Set
<
String
>
deptIds
=
new
HashSet
<>();
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
map
.
put
(
"typeName"
,
typeName
.
get
(
map
.
get
(
"type"
)));
String
userId
=
String
.
valueOf
(
map
.
get
(
"createBy"
));
String
deptId
=
String
.
valueOf
(
map
.
get
(
"deptId"
));
userIds
.
add
(
userId
);
deptIds
.
add
(
deptId
);
}
userIds
.
remove
(
null
);
userIds
.
remove
(
""
);
...
...
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