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
e79a8081
Commit
e79a8081
authored
May 25, 2020
by
吴江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规则修改代码适配
parent
1db1a9a1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
34 deletions
+34
-34
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+28
-22
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+2
-4
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+2
-4
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+2
-4
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
e79a8081
...
...
@@ -12,12 +12,8 @@ import java.util.List;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.client.RestTemplate
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
...
...
@@ -26,6 +22,8 @@ import com.yeejoin.amos.fas.business.action.result.message.ActionResultMessage;
import
com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl
;
import
com.yeejoin.amos.fas.business.service.intfc.FireStengthService
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
...
...
@@ -43,11 +41,13 @@ public class ContingencyAction implements CustomerAction {
@Autowired
private
FireStengthService
fireStrengthService
;
private
RestTemplate
restTemplate
=
new
RestTemplate
();
//
private RestTemplate restTemplate = new RestTemplate();
@Value
(
"${bussunis.domain}"
)
private
String
bussunisDomain
;
//
@Value("${bussunis.domain}")
//
private String bussunisDomain ;
@Autowired
private
IRiskSourceService
riskSourceService
;
private
static
Map
<
String
,
String
>
OPERATE_RECORD_ID
=
new
HashMap
<>();
...
...
@@ -289,10 +289,10 @@ public class ContingencyAction implements CustomerAction {
private
boolean
sendButton
(
String
batchNo
,
String
contingencyPlanId
,
String
equipmentId
,
String
actionName
,
String
buttonJson
)
{
String
url
=
bussunisDomain
+
"/api/risksource/contingency/setup"
;
//
String url = bussunisDomain+ "/api/risksource/contingency/setup";
ObjectMapper
objectMapper
=
new
ObjectMapper
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//
Map<String,Object> map = new HashMap<>();
/**
* batchNo
...
...
@@ -306,24 +306,30 @@ public class ContingencyAction implements CustomerAction {
try
{
Map
button
=
objectMapper
.
readValue
(
buttonJson
,
Map
.
class
);
Map
operateInstance
=
(
Map
)((
List
)
button
.
get
(
"operate"
)).
get
(
0
);
map
.
put
(
"batchNo"
,
batchNo
);
map
.
put
(
"actionName"
,
actionName
);
map
.
put
(
"equipmentId"
,
equipmentId
);
map
.
put
(
"stepCode"
,
button
.
get
(
"stepCode"
));
map
.
put
(
"buttonCode"
,
operateInstance
.
get
(
"code"
));
map
.
put
(
"confirm"
,
"CONFIRM"
);
map
.
put
(
"stepState"
,
operateInstance
.
get
(
"stepState"
));
map
.
put
(
"contingencyPlanId"
,
contingencyPlanId
);
HttpEntity
<
Map
>
entity
=
new
HttpEntity
<>(
map
);
restTemplate
.
exchange
(
url
,
HttpMethod
.
POST
,
entity
,
Map
.
class
);
// map.put("batchNo",batchNo);
// map.put("actionName",actionName);
// map.put("equipmentId",equipmentId);
// map.put("stepCode",button.get("stepCode"));
// map.put("buttonCode",operateInstance.get("code"));
// map.put("confirm","CONFIRM");
// map.put("stepState",operateInstance.get("stepState"));
// map.put("contingencyPlanId",contingencyPlanId);
ContingencyDeviceStatus
contingencyDeviceStatus
=
new
ContingencyDeviceStatus
();
contingencyDeviceStatus
.
setActionName
(
actionName
);
contingencyDeviceStatus
.
setButtonCode
(
String
.
valueOf
(
operateInstance
.
get
(
"code"
)));
contingencyDeviceStatus
.
setConfirm
(
"CONFIRM"
);
contingencyDeviceStatus
.
setContingencyPlanId
(
contingencyPlanId
);
contingencyDeviceStatus
.
setEquipmentId
(
equipmentId
);
contingencyDeviceStatus
.
setStepCode
(
String
.
valueOf
(
button
.
get
(
"stepCode"
)));
contingencyDeviceStatus
.
setStepState
(
String
.
valueOf
(
operateInstance
.
get
(
"stepState"
)));
riskSourceService
.
queryContingencyDeviceStatus
(
contingencyDeviceStatus
);
//HttpEntity<Map> entity = new HttpEntity<>(map);
// restTemplate.exchange(url, HttpMethod.POST,entity,Map.class);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
false
;
}
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
e79a8081
...
...
@@ -54,6 +54,4 @@ emqx.user-name=super
emqx.password
=
a123456
Push.fegin.name
=
PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name
=
AMOS-DUTY
bussunis.domain
=
http://172.16.10.183:8083
\ No newline at end of file
dutyMode.fegin.name
=
AMOS-DUTY
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
e79a8081
...
...
@@ -54,6 +54,4 @@ emqx.user-name=super
emqx.password
=
a123456
Push.fegin.name
=
AMOS-PUSH
dutyMode.fegin.name
=
AMOS-DUTY
bussunis.domain
=
http://172.16.10.183:8083
\ No newline at end of file
dutyMode.fegin.name
=
AMOS-DUTY
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
e79a8081
...
...
@@ -54,6 +54,4 @@ emqx.user-name=super
emqx.password
=
a123456
Push.fegin.name
=
PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name
=
AMOS-DUTY
bussunis.domain
=
http://172.16.10.183:8083
\ No newline at end of file
dutyMode.fegin.name
=
AMOS-DUTY
\ No newline at end of file
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