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
c11bb108
Commit
c11bb108
authored
Nov 25, 2020
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:修改将本地风险模型推送到远程同步机制
parent
9825e3d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+20
-16
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
c11bb108
...
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -45,6 +46,9 @@ import io.swagger.annotations.ApiParam;
@Api
(
tags
=
"风险点API"
)
public
class
RiskSourceController
extends
BaseController
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
RiskSourceController
.
class
);
private
final
static
String
IS_RISK_AREA
=
"TRUE"
;
@Autowired
IRiskFactorService
iRiskFactorService
;
...
...
@@ -116,8 +120,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取风险点树型结构"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getRiskSourceTress
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
return
CommonResponseUtil
.
success
(
getRiskSourcesTree
(
riskSources
));
}
...
...
@@ -126,12 +130,12 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
value
=
"远程同步"
,
notes
=
"将本地 风险模型推送到远程同步"
)
@PutMapping
(
value
=
"/synToEquipManage"
)
public
CommonResponse
synToEquipManage
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
if
(!
riskSourceService
.
isSynEquipManage
())
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
if
(!
riskSourceService
.
isSynEquipManage
())
{
return
CommonResponseUtil
.
failure
(
"同步功能未开启"
);
}
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
)
.
stream
().
filter
(
source
->
IS_RISK_AREA
.
equalsIgnoreCase
(
source
.
getIsRegion
())).
collect
(
Collectors
.
toList
())
;
String
synMsg
=
riskSourceService
.
synToEquipManage
(
getAppKey
(),
getProduct
(),
getToken
(),
SUCCESS
,
getRiskSourcesTree
(
riskSources
));
if
(
synMsg
!=
null
)
{
return
CommonResponseUtil
.
failure
(
synMsg
);
...
...
@@ -149,8 +153,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取区域树型结构"
,
notes
=
"获取区域树型结构"
)
@RequestMapping
(
value
=
"/regionTress"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getRegionTress
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
return
CommonResponseUtil
.
success
(
getRegionTree
(
riskSources
));
}
...
...
@@ -184,8 +188,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"统计级别为1的风险点下面"
,
notes
=
"获取风险点树型结构"
)
@RequestMapping
(
value
=
"/riskSourceStatistics"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
riskSourceStatistics
()
throws
Exception
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
List
<
RiskSourceTreeResponse
>
treeRiskSources
=
getRiskSourcesTree
(
riskSources
);
return
CommonResponseUtil
.
success
(
riskSourceStatistics
(
treeRiskSources
));
...
...
@@ -554,7 +558,7 @@ public class RiskSourceController extends BaseController {
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
@RequestParam
Integer
pageNumber
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
@RequestParam
Integer
pageSize
)
{
try
{
Page
<
Map
<
String
,
Object
>>
list
=
riskSourceService
.
listFmeaPointInputitem
(
getToken
(),
getProduct
(),
getAppKey
(),
fmeaId
,
pageNumber
,
pageSize
);
Page
<
Map
<
String
,
Object
>>
list
=
riskSourceService
.
listFmeaPointInputitem
(
getToken
(),
getProduct
(),
getAppKey
(),
fmeaId
,
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
list
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -638,9 +642,9 @@ public class RiskSourceController extends BaseController {
@RequestMapping
(
value
=
"/data/patroldata"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
postPatrolData
(
@RequestBody
ProtalDataRo
protalData
)
throws
Exception
{
log
.
info
(
"上传巡检数据"
+
JSONObject
.
toJSONString
(
protalData
));
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
riskSourceService
.
processProtalData
(
getToken
(),
getProduct
(),
getAppKey
(),
protalData
,
compCode
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
riskSourceService
.
processProtalData
(
getToken
(),
getProduct
(),
getAppKey
(),
protalData
,
compCode
);
return
CommonResponseUtil
.
success
();
}
...
...
@@ -714,8 +718,8 @@ public class RiskSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取危险因素树二级节点"
,
notes
=
"获取危险因素树二级节点"
)
@RequestMapping
(
value
=
"/riskSourceSecondLevel"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRiskSourceSecondLevel
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
return
CommonResponseUtil
.
success
(
riskSourceService
.
queryRiskSourceSecondLevel
(
compCode
));
}
...
...
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