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
43869524
Commit
43869524
authored
Sep 09, 2020
by
张展弋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成“换流站系统风险区域数据同步至仓库货位”同步推送功能
parent
9214b0ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
2 deletions
+58
-2
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+18
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+24
-0
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+16
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
43869524
...
...
@@ -15,6 +15,7 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -121,6 +122,23 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
(
getRiskSourcesTree
(
riskSources
));
}
@Permission
@ApiOperation
(
value
=
"远程同步"
,
notes
=
"将本地 风险模型推送到远程同步"
)
@PutMapping
(
value
=
"/synToEquipManage"
)
public
CommonResponse
synToEquipManage
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
if
(!
riskSourceService
.
isSynEquipManage
())
{
return
CommonResponseUtil
.
failure
(
"同步功能未开启"
);
}
List
<
RiskSourceTreeResponse
>
riskSources
=
riskSourceService
.
findRiskSourceTrees
(
compCode
);
String
synMsg
=
riskSourceService
.
synToEquipManage
(
getAppKey
(),
getProduct
(),
getToken
(),
SUCCESS
,
getRiskSourcesTree
(
riskSources
));
if
(
synMsg
!=
null
)
{
return
CommonResponseUtil
.
failure
(
synMsg
);
}
return
CommonResponseUtil
.
success
();
}
/**
* 获取区域树型结构
*
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
43869524
...
...
@@ -276,6 +276,30 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
isSyn
;
}
@Override
public
String
synToEquipManage
(
String
appKey
,
String
product
,
String
token
,
String
success
,
List
<
RiskSourceTreeResponse
>
riskSourcesTree
)
{
// 必须使用树形结构,一条一条的树杈到叶子遍历同步,否则底层节点会因为找不到父节点而同步失败
return
doSynToEquipManage
(
appKey
,
product
,
token
,
success
,
riskSourcesTree
);
}
private
String
doSynToEquipManage
(
String
appKey
,
String
product
,
String
token
,
String
success
,
List
<
RiskSourceTreeResponse
>
riskSourcesTree
)
{
if
(
riskSourcesTree
==
null
)
{
return
null
;
}
String
res
=
null
;
for
(
RiskSourceTreeResponse
rst
:
riskSourcesTree
)
{
res
=
saveToEquipManage
(
appKey
,
product
,
token
,
success
,
rst
.
getId
(),
rst
.
getCode
(),
rst
.
getName
(),
rst
.
getParentId
());
if
(
res
!=
null
)
{
return
res
;
}
res
=
doSynToEquipManage
(
appKey
,
product
,
token
,
success
,
rst
.
getChildren
());
if
(
res
!=
null
)
{
return
res
;
}
}
return
null
;
}
/**
*
* 风险模型新增及维护时远程同步
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
43869524
...
...
@@ -17,7 +17,6 @@ import com.yeejoin.amos.fas.business.service.model.ProtalDataRo;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
...
...
@@ -45,8 +44,23 @@ public interface IRiskSourceService {
* @author 张展弋
* @date 2020-9-8 17:39:32
*/
public
String
saveToEquipManage
(
String
appKey
,
String
product
,
String
token
,
String
success
,
long
id
,
String
saveToEquipManage
(
String
appKey
,
String
product
,
String
token
,
String
success
,
long
id
,
String
code
,
String
name
,
Long
parentId
);
/**
* 将本地 风险模型推送到远程同步
*
* @param appKey
* @param product
* @param token
* @param success
* @param riskSources
* @return String
* @throws <br>
* @author 张展弋
* @date 2020-9-9 15:40:18
*/
String
synToEquipManage
(
String
appKey
,
String
product
,
String
token
,
String
success
,
List
<
RiskSourceTreeResponse
>
riskSourcesTree
);
/**
*
...
...
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