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
e5636366
Commit
e5636366
authored
Feb 24, 2020
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加查询危险因素关联对象个数接口
parent
9b2de18a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
6 deletions
+31
-6
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+7
-6
IFmeaDao.java
...om/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
+6
-0
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+10
-0
IFmeaService.java
...yeejoin/amos/fas/business/service/intfc/IFmeaService.java
+8
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
e5636366
...
@@ -22,12 +22,7 @@ import org.slf4j.LoggerFactory;
...
@@ -22,12 +22,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
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.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -170,4 +165,10 @@ public class RiskModelController extends BaseController {
...
@@ -170,4 +165,10 @@ public class RiskModelController extends BaseController {
Page
<
HashMap
<
String
,
Object
>>
fmeaList
=
fmeaService
.
queryFmeaList
(
param
);
Page
<
HashMap
<
String
,
Object
>>
fmeaList
=
fmeaService
.
queryFmeaList
(
param
);
return
CommonResponseUtil
.
success
(
fmeaList
);
return
CommonResponseUtil
.
success
(
fmeaList
);
}
}
@ApiOperation
(
value
=
"Fmea是否关联对象查询"
,
notes
=
"Fmea是否关联对象查询"
)
@GetMapping
(
value
=
"/fmea/{ids}/controlObjCount"
)
public
CommonResponse
queryFmeaControlObj
(
@ApiParam
(
value
=
"fmea ids"
)
@PathVariable
(
value
=
"ids"
,
required
=
true
)
String
[]
ids
)
{
return
CommonResponseUtil
.
success
(
fmeaService
.
queryControlObjCount
(
ids
));
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
View file @
e5636366
...
@@ -38,4 +38,10 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
...
@@ -38,4 +38,10 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
Fmea
findById
(
Long
id
);
Fmea
findById
(
Long
id
);
@Query
(
value
=
"SELECT count(1) FROM `f_fmea_point_inputitem` WHERE fmea_id in ?1"
,
nativeQuery
=
true
)
int
countAssociatedInputItemByIds
(
String
[]
ids
);
@Query
(
value
=
"SELECT count(1) FROM `f_fmea_equipment_point` WHERE fmea_id in ?1"
,
nativeQuery
=
true
)
int
countAssociatedEquipPointByIds
(
String
[]
ids
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
e5636366
...
@@ -109,6 +109,16 @@ public class FmeaServiceImpl implements IFmeaService {
...
@@ -109,6 +109,16 @@ public class FmeaServiceImpl implements IFmeaService {
}
}
@Override
public
int
queryControlObjCount
(
String
[]
ids
)
{
int
count1
=
iFmeaDao
.
countAssociatedEquipPointByIds
(
ids
);
int
count2
=
iFmeaDao
.
countAssociatedInputItemByIds
(
ids
);
if
(
count1
>
0
||
count2
>
0
)
{
return
count1
+
count2
;
}
return
0
;
//没有关联对象
}
private
boolean
asymbleWithParent
(
String
bacthNo
,
List
<
RiskSource
>
riskSourceList
,
String
from
)
throws
Exception
{
private
boolean
asymbleWithParent
(
String
bacthNo
,
List
<
RiskSource
>
riskSourceList
,
String
from
)
throws
Exception
{
if
(!
CollectionUtils
.
isEmpty
(
riskSourceList
))
{
if
(!
CollectionUtils
.
isEmpty
(
riskSourceList
))
{
for
(
RiskSource
riskSource
:
riskSourceList
)
{
for
(
RiskSource
riskSource
:
riskSourceList
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFmeaService.java
View file @
e5636366
...
@@ -38,4 +38,12 @@ public interface IFmeaService {
...
@@ -38,4 +38,12 @@ public interface IFmeaService {
void
updateRpniInfo
(
Long
riskSourceId
);
void
updateRpniInfo
(
Long
riskSourceId
);
/**
* 查询关联的关联对象个数
*
* @param ids
* @return count 关联对象个数
*/
int
queryControlObjCount
(
String
[]
ids
);
}
}
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