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
665c7783
Commit
665c7783
authored
Mar 01, 2021
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除配置文件webstock地址引用
parent
5a519749
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
85 deletions
+70
-85
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+0
-6
RemoteWebSocketServer.java
...eejoin/amos/fas/business/feign/RemoteWebSocketServer.java
+62
-62
DataRefreshServiceImpl.java
...mos/fas/business/service/impl/DataRefreshServiceImpl.java
+3
-5
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+3
-5
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+0
-2
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+1
-3
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+1
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
665c7783
...
@@ -760,12 +760,6 @@ public class ContingencyAction implements CustomerAction {
...
@@ -760,12 +760,6 @@ public class ContingencyAction implements CustomerAction {
ContingencyPlanInstance
contingencyPlanInstance
=
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
actionName
,
"DEFAULT"
,
""
,
"OPERATE"
,
""
);
ContingencyPlanInstance
contingencyPlanInstance
=
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
actionName
,
"DEFAULT"
,
""
,
"OPERATE"
,
""
);
Toke
toke
=
remoteSecurityService
.
getServerToken
();
Toke
toke
=
remoteSecurityService
.
getServerToken
();
// Toke toke = cacheMap.getValue(TOKE);
// if (toke == null) {
// toke = remoteSecurityService.come();
// Long times = (long) (20 * 24 * 60 * 60);
// cacheMap.setex(TOKE, toke, times);
// }
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
try
{
try
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteWebSocketServer.java
View file @
665c7783
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
//
package com.yeejoin.amos.fas.business.feign;
//
import
java.util.HashMap
;
//
import java.util.HashMap;
import
java.util.Map
;
//
import java.util.Map;
//
import
org.codehaus.jackson.map.ObjectMapper
;
//
import org.codehaus.jackson.map.ObjectMapper;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
//
import org.springframework.beans.factory.annotation.Value;
import
org.springframework.http.HttpEntity
;
//
import org.springframework.http.HttpEntity;
import
org.springframework.http.HttpHeaders
;
//
import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpMethod
;
//
import org.springframework.http.HttpMethod;
import
org.springframework.http.MediaType
;
//
import org.springframework.http.MediaType;
import
org.springframework.http.ResponseEntity
;
//
import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Service
;
//
import org.springframework.stereotype.Service;
import
org.springframework.web.client.RestTemplate
;
//
import org.springframework.web.client.RestTemplate;
//
import
com.yeejoin.amos.fas.business.util.Constants
;
//
import com.yeejoin.amos.fas.business.util.Constants;
//
//
//
@Service
(
"remoteWebSocketServer"
)
//
@Service("remoteWebSocketServer")
public
class
RemoteWebSocketServer
{
//
public class RemoteWebSocketServer {
/*@Autowired
//
/*@Autowired
private ApplicationConfig applicationConfig;*/
//
private ApplicationConfig applicationConfig;*/
//
@Value
(
"${params.remoteWebsocketUrl}"
)
//
@Value("${params.remoteWebsocketUrl}")
private
String
remoteWebsocketUrl
;
//
private String remoteWebsocketUrl;
//
private
final
RestTemplate
restTemplate
;
//
private final RestTemplate restTemplate;
//
private
ObjectMapper
objectMapper
=
new
ObjectMapper
();
//
private ObjectMapper objectMapper = new ObjectMapper();
public
RemoteWebSocketServer
()
//
public RemoteWebSocketServer()
{
//
{
this
.
restTemplate
=
new
RestTemplate
();
//
this.restTemplate = new RestTemplate();
}
//
}
//
//
public
Object
sendMessage
(
String
path
,
String
message
)
throws
Exception
//
public Object sendMessage(String path, String message) throws Exception
{
//
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
//
Map<String, String> map = new HashMap<String, String>();
map
.
put
(
"filter"
,
null
);
//
map.put("filter", null);
map
.
put
(
"message"
,
message
);
//
map.put("message", message);
map
.
put
(
"path"
,
path
);
//
map.put("path", path);
String
url
=
remoteWebsocketUrl
;
//
String url =remoteWebsocketUrl;
HttpHeaders
headers
=
new
HttpHeaders
();
//
HttpHeaders headers = new HttpHeaders();
MediaType
type
=
MediaType
//
MediaType type = MediaType
.
parseMediaType
(
"application/json; charset=UTF-8"
);
//
.parseMediaType("application/json; charset=UTF-8");
headers
.
setContentType
(
type
);
//
headers.setContentType(type);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
//
headers.add("Accept", MediaType.APPLICATION_JSON.toString());
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>>(
map
,
headers
);
//
HttpEntity<Map<String, String>> formEntity = new HttpEntity<Map<String, String>>(map, headers);
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"/generic/sendMessage"
,
//
ResponseEntity responseEntity = restTemplate.exchange(url + "/generic/sendMessage",
HttpMethod
.
POST
,
formEntity
,
String
.
class
);
//
HttpMethod.POST, formEntity, String.class);
//
responseEntity
.
getBody
();
//
responseEntity.getBody();
Map
commonResponse
=
objectMapper
.
readValue
(
responseEntity
.
getBody
().
toString
(),
Map
.
class
);
//
Map commonResponse = objectMapper.readValue(responseEntity.getBody().toString(),Map.class);
if
(
commonResponse
!=
null
&&
commonResponse
.
get
(
"result"
).
equals
(
Constants
.
RESULT_SUCCESS
)
)
//
if (commonResponse != null && commonResponse.get("result").equals(Constants.RESULT_SUCCESS) )
{
//
{
return
commonResponse
.
get
(
"dataList"
);
//
return commonResponse.get("dataList");
}
//
}
return
null
;
//
return null;
}
//
}
}
//
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/DataRefreshServiceImpl.java
View file @
665c7783
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
import
com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -21,8 +19,8 @@ public class DataRefreshServiceImpl implements IDataRefreshService {
...
@@ -21,8 +19,8 @@ public class DataRefreshServiceImpl implements IDataRefreshService {
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
DataRefreshServiceImpl
.
class
);
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
DataRefreshServiceImpl
.
class
);
@Autowired
//
@Autowired
private
RemoteWebSocketServer
remoteWebSocketServer
;
//
private RemoteWebSocketServer remoteWebSocketServer;
@Override
@Override
public
void
refreshViewData
(
String
dataType
)
{
public
void
refreshViewData
(
String
dataType
)
{
...
@@ -51,7 +49,7 @@ public class DataRefreshServiceImpl implements IDataRefreshService {
...
@@ -51,7 +49,7 @@ public class DataRefreshServiceImpl implements IDataRefreshService {
private
void
notifyDataRefresh
(
Map
<
String
,
Object
>
param
)
{
private
void
notifyDataRefresh
(
Map
<
String
,
Object
>
param
)
{
try
{
try
{
remoteWebSocketServer
.
sendMessage
(
"3dViewMessage"
,
JSON
.
toJSONString
(
param
));
//
remoteWebSocketServer.sendMessage("3dViewMessage", JSON.toJSONString(param));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"通知前端数据刷新失败-->"
+
JSON
.
toJSONString
(
param
));
log
.
error
(
"通知前端数据刷新失败-->"
+
JSON
.
toJSONString
(
param
));
log
.
error
(
"通知前端数据刷新失败-->"
+
e
.
getMessage
());
log
.
error
(
"通知前端数据刷新失败-->"
+
e
.
getMessage
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
665c7783
...
@@ -83,7 +83,6 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
...
@@ -83,7 +83,6 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import
com.yeejoin.amos.fas.business.dao.repository.IRpnChangeLogDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRpnChangeLogDao
;
import
com.yeejoin.amos.fas.business.feign.IEquipManageFeign
;
import
com.yeejoin.amos.fas.business.feign.IEquipManageFeign
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer
;
import
com.yeejoin.amos.fas.business.jpush.AppMessagePushService
;
import
com.yeejoin.amos.fas.business.jpush.AppMessagePushService
;
import
com.yeejoin.amos.fas.business.jpush.JPushTypeEnum
;
import
com.yeejoin.amos.fas.business.jpush.JPushTypeEnum
;
import
com.yeejoin.amos.fas.business.jpush.PushMsgParam
;
import
com.yeejoin.amos.fas.business.jpush.PushMsgParam
;
...
@@ -187,8 +186,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -187,8 +186,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// @Autowired
// @Autowired
// IFireEquipmentDataDao iFireEquipmentDataDao;
// IFireEquipmentDataDao iFireEquipmentDataDao;
@Autowired
//
@Autowired
private
RemoteWebSocketServer
remoteWebSocketServer
;
//
private RemoteWebSocketServer remoteWebSocketServer;
@Autowired
@Autowired
private
IEquipmentService
equipmentService
;
private
IEquipmentService
equipmentService
;
...
@@ -1056,8 +1055,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1056,8 +1055,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
map
.
put
(
"id"
,
param
.
getPointCode
());
map
.
put
(
"id"
,
param
.
getPointCode
());
Map
<
String
,
Map
<
String
,
Object
>>
riskSourceMap
=
new
HashMap
();
Map
<
String
,
Map
<
String
,
Object
>>
riskSourceMap
=
new
HashMap
();
riskSourceMap
.
put
(
"equipments"
,
map
);
//这个需要确认下
riskSourceMap
.
put
(
"equipments"
,
map
);
//这个需要确认下
remoteWebSocketServer
.
sendMessage
(
"equipmentMode"
,
JSON
.
toJSONString
(
riskSourceMap
));
// remoteWebSocketServer.sendMessage("equipmentMode", JSON.toJSONString(riskSourceMap));
// // 推送设备状态信息
// // 推送设备状态信息
// Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(param.getPointCode());
// Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(param.getPointCode());
// String topic = String.format("/%s/%s/%s", serviceName, stationName, "data/refresh/monitorData");
// String topic = String.format("/%s/%s/%s", serviceName, stationName, "data/refresh/monitorData");
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
665c7783
...
@@ -19,8 +19,6 @@ spring.datasource.hikari.maxLifetime = 1765000
...
@@ -19,8 +19,6 @@ spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size
=
10
spring.datasource.hikari.maximum-pool-size
=
10
spring.datasource.testWhileIdle
=
true
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
#ws
params.remoteWebsocketUrl
=
http://172.16.11.36:10600/
#redis
#redis
spring.redis.database
=
0
spring.redis.database
=
0
spring.redis.host
=
172.16.3.100
spring.redis.host
=
172.16.3.100
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
665c7783
...
@@ -19,9 +19,7 @@ spring.datasource.hikari.maximum-pool-size = 10
...
@@ -19,9 +19,7 @@ spring.datasource.hikari.maximum-pool-size = 10
spring.datasource.testWhileIdle
=
true
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
#rule
#redis
params.remoteWebsocketUrl
=
http://station-websocket:10600/
spring.redis.database
=
1
spring.redis.database
=
1
spring.redis.host
=
amos-redis
spring.redis.host
=
amos-redis
spring.redis.port
=
6379
spring.redis.port
=
6379
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
665c7783
...
@@ -17,8 +17,7 @@ spring.datasource.hikari.maxLifetime = 1765000
...
@@ -17,8 +17,7 @@ spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size
=
10
spring.datasource.hikari.maximum-pool-size
=
10
spring.datasource.testWhileIdle
=
true
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
#ws
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
#redis
#redis
spring.redis.database
=
1
spring.redis.database
=
1
spring.redis.host
=
127.0.0.1
spring.redis.host
=
127.0.0.1
...
...
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