Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
0783e5a6
Commit
0783e5a6
authored
Jun 01, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 控制模式与运行模式优化
parent
94b36411
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
43 deletions
+56
-43
Constants.java
...rc/main/java/net/wanji/utc/common/constant/Constants.java
+49
-30
HkRunningStatusServiceImpl.java
.../service/runninginfo/impl/HkRunningStatusServiceImpl.java
+5
-13
SignalStatusTask.java
...ce/src/main/java/net/wanji/utc/task/SignalStatusTask.java
+2
-0
No files found.
signal-utc-service/src/main/java/net/wanji/utc/common/constant/Constants.java
View file @
0783e5a6
...
@@ -6,12 +6,31 @@ import org.springframework.stereotype.Component;
...
@@ -6,12 +6,31 @@ import org.springframework.stereotype.Component;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
@Component
@Component
@SuppressWarnings
(
"all"
)
@SuppressWarnings
(
"all"
)
public
class
Constants
{
public
class
Constants
{
/**
* 信号机运行模式
*/
public
static
final
Map
<
String
,
String
>
controlModeMap
=
new
ConcurrentHashMap
<>();
/**
* 运行状态和WEB控制模式转换
*/
public
static
final
Map
<
String
,
Integer
>
runModeControlMap
=
new
HashMap
<>();
static
{
runModeControlMap
.
put
(
"2"
,
4
);
runModeControlMap
.
put
(
"3"
,
2
);
runModeControlMap
.
put
(
"4"
,
3
);
runModeControlMap
.
put
(
"9"
,
5
);
runModeControlMap
.
put
(
"11"
,
1
);
}
/**
/**
* 厂商接口地址
* 厂商接口地址
*/
*/
...
@@ -126,6 +145,7 @@ public class Constants {
...
@@ -126,6 +145,7 @@ public class Constants {
public
static
ConcurrentHashMap
<
String
,
List
<
CrossLanesVo
>>
getTelesemeLaneRealMap
()
{
public
static
ConcurrentHashMap
<
String
,
List
<
CrossLanesVo
>>
getTelesemeLaneRealMap
()
{
return
telesemeLaneRealMap
;
return
telesemeLaneRealMap
;
}
}
/*记录当前用户*/
/*记录当前用户*/
public
static
ThreadLocal
<
String
>
current_user_id
=
ThreadLocal
.
withInitial
(()
->
""
);
public
static
ThreadLocal
<
String
>
current_user_id
=
ThreadLocal
.
withInitial
(()
->
""
);
//gisc-develop 工作流事务全局标识,默认不开启
//gisc-develop 工作流事务全局标识,默认不开启
...
@@ -135,19 +155,19 @@ public class Constants {
...
@@ -135,19 +155,19 @@ public class Constants {
//日志消息名称关键字
//日志消息名称关键字
public
static
final
String
BP_LOG
=
"log"
;
public
static
final
String
BP_LOG
=
"log"
;
//数据扩展表关键字
//数据扩展表关键字
public
static
final
String
TABLE_RELATION
=
"_relation"
;
public
static
final
String
TABLE_RELATION
=
"_relation"
;
public
final
class
MessageES
{
public
final
class
MessageES
{
public
static
final
String
MESSAGE_HISTORY
=
"message_history"
;
public
static
final
String
MESSAGE_HISTORY
=
"message_history"
;
public
static
final
String
MESSAGE_CONSUME_HISTORY
=
"message_consume_history"
;
public
static
final
String
MESSAGE_CONSUME_HISTORY
=
"message_consume_history"
;
public
static
final
String
MESSAGE_FILTER_HISTORY
=
"message_filter_history"
;
public
static
final
String
MESSAGE_FILTER_HISTORY
=
"message_filter_history"
;
}
}
public
final
class
WebsocketMessage
{
public
final
class
WebsocketMessage
{
public
static
final
String
NEW_UNREAD_MESSAGE
=
""
;
public
static
final
String
NEW_UNREAD_MESSAGE
=
""
;
public
static
final
String
GET_UNREAD_COUNT
=
""
;
public
static
final
String
GET_UNREAD_COUNT
=
""
;
public
static
final
String
GET_READ_MESSAGE
=
""
;
public
static
final
String
GET_READ_MESSAGE
=
""
;
public
static
final
String
GET_UNREAD_MESSAGE
=
""
;
public
static
final
String
GET_UNREAD_MESSAGE
=
""
;
}
}
...
@@ -249,8 +269,8 @@ public class Constants {
...
@@ -249,8 +269,8 @@ public class Constants {
public
static
final
String
CLI_IC_ROLE_BUSINESSACCOUNT_RLAT
=
"CLI_IC_ROLE_BUSINESSACCOUNT_RLAT.csv"
;
public
static
final
String
CLI_IC_ROLE_BUSINESSACCOUNT_RLAT
=
"CLI_IC_ROLE_BUSINESSACCOUNT_RLAT.csv"
;
public
static
final
String
CLI_DEV_MENU
=
"CLI_DEV_MENU.csv"
;
public
static
final
String
CLI_DEV_MENU
=
"CLI_DEV_MENU.csv"
;
public
static
final
String
MAN_MSG_TOPIC_FILTER_ITEM_RLAT
=
"MAN_MSG_TOPIC_FILTER_ITEM_RLAT.csv"
;
public
static
final
String
MAN_MSG_TOPIC_FILTER_ITEM_RLAT
=
"MAN_MSG_TOPIC_FILTER_ITEM_RLAT.csv"
;
public
static
final
String
MAN_DEV_PLUGIN_PARAM
=
"MAN_DEV_PLUGIN_PARAM.csv"
;
public
static
final
String
MAN_DEV_PLUGIN_PARAM
=
"MAN_DEV_PLUGIN_PARAM.csv"
;
}
}
public
final
class
BpmExport
{
public
final
class
BpmExport
{
...
@@ -290,6 +310,7 @@ public class Constants {
...
@@ -290,6 +310,7 @@ public class Constants {
//导出组件版本表
//导出组件版本表
public
static
final
String
COMPONENT_VERSION
=
"CLI_DEV_COMPONENT_VERSION.csv"
;
public
static
final
String
COMPONENT_VERSION
=
"CLI_DEV_COMPONENT_VERSION.csv"
;
}
}
/**
/**
* 系统基础服务路径
* 系统基础服务路径
*/
*/
...
@@ -345,7 +366,7 @@ public class Constants {
...
@@ -345,7 +366,7 @@ public class Constants {
//基础数据
//基础数据
public
static
final
String
MODEL_BASE_DATA
=
"design/basedata/"
;
public
static
final
String
MODEL_BASE_DATA
=
"design/basedata/"
;
//服务接口
//服务接口
public
static
final
String
MODEL_DEV_SERVICE
=
"develop/service/"
;
public
static
final
String
MODEL_DEV_SERVICE
=
"develop/service/"
;
//基础设置
//基础设置
public
static
final
String
MODEL_CONFIG_DATA
=
"design/config/"
;
public
static
final
String
MODEL_CONFIG_DATA
=
"design/config/"
;
//MSP
//MSP
...
@@ -373,10 +394,9 @@ public class Constants {
...
@@ -373,10 +394,9 @@ public class Constants {
public
static
final
String
DEVICE_API
=
"api/device/"
;
public
static
final
String
DEVICE_API
=
"api/device/"
;
}
}
public
final
class
ServiceDevPathPrefix
{
public
final
class
ServiceDevPathPrefix
{
/**
/**
* 数据库接口
* 数据库接口
*/
*/
...
@@ -384,9 +404,8 @@ public class Constants {
...
@@ -384,9 +404,8 @@ public class Constants {
/**
/**
* 服务接口接口
* 服务接口接口
*
*/
*/
public
static
final
String
DEV_API_INTERFACE
=
"sgw/apiInterface"
;
public
static
final
String
DEV_API_INTERFACE
=
"sgw/apiInterface"
;
/**
/**
* dev 注册服务
* dev 注册服务
...
@@ -396,14 +415,14 @@ public class Constants {
...
@@ -396,14 +415,14 @@ public class Constants {
/**
/**
* vt 矢量栅格服务
* vt 矢量栅格服务
*/
*/
public
static
final
String
DEV_VT_SERVICE
=
"develop/vt/"
;
public
static
final
String
DEV_VT_SERVICE
=
"develop/vt/"
;
}
}
/**
/**
* 数据能力标签,元数据驱动的核心代码
* 数据能力标签,元数据驱动的核心代码
*/
*/
public
final
class
DataTag
{
public
final
class
DataTag
{
/**
/**
* geometry
* geometry
...
@@ -426,13 +445,13 @@ public class Constants {
...
@@ -426,13 +445,13 @@ public class Constants {
* --
* --
* edit
* edit
*/
*/
public
static
final
String
DATA_TAG_EXPORT
=
"export"
;
public
static
final
String
DATA_TAG_EXPORT
=
"export"
;
public
static
final
String
DATA_TAG_GEOMETRY
=
"geometry"
;
public
static
final
String
DATA_TAG_GEOMETRY
=
"geometry"
;
public
static
final
String
DATA_TAG_NEST
=
"nest"
;
public
static
final
String
DATA_TAG_NEST
=
"nest"
;
public
static
final
String
DATA_TAG_HOOK
=
"hook"
;
public
static
final
String
DATA_TAG_HOOK
=
"hook"
;
public
static
final
String
DATA_TAG_CACHE
=
"cache"
;
public
static
final
String
DATA_TAG_CACHE
=
"cache"
;
public
static
final
String
DATA_TAG_PUBLISH
=
"publish"
;
public
static
final
String
DATA_TAG_PUBLISH
=
"publish"
;
public
static
final
String
DATA_TAG_EDIT
=
"edit"
;
public
static
final
String
DATA_TAG_EDIT
=
"edit"
;
}
}
/**
/**
...
@@ -694,7 +713,7 @@ public class Constants {
...
@@ -694,7 +713,7 @@ public class Constants {
public
static
final
String
ORACLE
=
"oracle"
;
public
static
final
String
ORACLE
=
"oracle"
;
public
static
final
String
BEYONDB
=
"beyondb"
;
public
static
final
String
BEYONDB
=
"beyondb"
;
public
static
final
String
POSTGRESQL
=
"postgresql"
;
public
static
final
String
POSTGRESQL
=
"postgresql"
;
public
static
final
String
SQLSERVER
=
"sqlserver"
;
public
static
final
String
SQLSERVER
=
"sqlserver"
;
}
}
/**
/**
...
@@ -1090,7 +1109,7 @@ public class Constants {
...
@@ -1090,7 +1109,7 @@ public class Constants {
public
static
final
String
DB_REDIS
=
"redis"
;
public
static
final
String
DB_REDIS
=
"redis"
;
public
static
final
String
DB_WEBSOCKET
=
"websocket"
;
public
static
final
String
DB_WEBSOCKET
=
"websocket"
;
public
static
final
String
DB_WEBSERVICE
=
"webservice"
;
public
static
final
String
DB_WEBSERVICE
=
"webservice"
;
public
static
final
String
DB_MONGODB
=
"mongo"
;
public
static
final
String
DB_MONGODB
=
"mongo"
;
}
}
public
static
final
class
TableRestfulConstants
{
public
static
final
class
TableRestfulConstants
{
...
@@ -1120,11 +1139,11 @@ public class Constants {
...
@@ -1120,11 +1139,11 @@ public class Constants {
public
static
final
String
BETWEEN_OPERATION
=
"between"
;
public
static
final
String
BETWEEN_OPERATION
=
"between"
;
public
static
final
String
PAGE_SIZE
=
"pageSize"
;
public
static
final
String
PAGE_SIZE
=
"pageSize"
;
public
static
final
String
PAGE_NUM
=
"pageNum"
;
public
static
final
String
PAGE_NUM
=
"pageNum"
;
public
static
final
String
ORDER
=
"order"
;
public
static
final
String
ORDER
=
"order"
;
public
static
final
String
IN_OPERATION
=
"in"
;
public
static
final
String
IN_OPERATION
=
"in"
;
public
static
final
String
DESC_OPERATION
=
"DESC"
;
public
static
final
String
DESC_OPERATION
=
"DESC"
;
public
static
final
String
ASC_OPERATION
=
"ASC"
;
public
static
final
String
ASC_OPERATION
=
"ASC"
;
public
static
final
String
LIKE_OPERATION
=
"like"
;
public
static
final
String
LIKE_OPERATION
=
"like"
;
}
}
...
@@ -1194,7 +1213,7 @@ public class Constants {
...
@@ -1194,7 +1213,7 @@ public class Constants {
/**
/**
*
路网数据更新状态
* 路网数据更新状态
*/
*/
public
final
class
DataConstants
{
public
final
class
DataConstants
{
// 数据状态 0继承,1删除,2增加,3修改
// 数据状态 0继承,1删除,2增加,3修改
...
...
signal-utc-service/src/main/java/net/wanji/utc/service/runninginfo/impl/HkRunningStatusServiceImpl.java
View file @
0783e5a6
...
@@ -9,10 +9,7 @@ import lombok.RequiredArgsConstructor;
...
@@ -9,10 +9,7 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.databus.po.SignalStatusLogPO
;
import
net.wanji.databus.po.SignalStatusLogPO
;
import
net.wanji.databus.vo.BaseCrossInfo
;
import
net.wanji.databus.vo.BaseCrossInfo
;
import
net.wanji.databus.vo.LightsStatusVO
;
import
net.wanji.utc.common.constant.Constants
;
import
net.wanji.utc.common.constant.Constants
;
import
net.wanji.utc.common.constant.RedisKeyConst
;
import
net.wanji.utc.common.typeenum.HkControlModeEnum
;
import
net.wanji.utc.service.runninginfo.HkRunningStatusService
;
import
net.wanji.utc.service.runninginfo.HkRunningStatusService
;
import
net.wanji.utc.util.PathUtil
;
import
net.wanji.utc.util.PathUtil
;
import
net.wanji.utc.util.RedisUtil
;
import
net.wanji.utc.util.RedisUtil
;
...
@@ -64,17 +61,12 @@ public class HkRunningStatusServiceImpl implements HkRunningStatusService {
...
@@ -64,17 +61,12 @@ public class HkRunningStatusServiceImpl implements HkRunningStatusService {
// if (hasFault == 0) {
// if (hasFault == 0) {
po
.
setFaultType
(
hasFault
);
po
.
setFaultType
(
hasFault
);
// }
// }
// 从Redis中查询控制类型
Map
<
String
,
String
>
controlModeMap
=
Constants
.
controlModeMap
;
String
lightsStatusVOStr
=
redisUtil
.
getHash
(
RedisKeyConst
.
KEY_PREFIX
+
RedisKeyConst
.
LIGHTS_STATUS
,
Map
<
String
,
Integer
>
runModeControlMap
=
Constants
.
runModeControlMap
;
baseCrossInfo
.
getManufacturerCode
()
+
Constants
.
SEPARATOR_UNDER_LINE
+
po
.
getSignalId
());
if
(!
controlModeMap
.
isEmpty
()
&&
!
runModeControlMap
.
isEmpty
())
{
LightsStatusVO
lightsStatusVO
=
JSON
.
parseObject
(
lightsStatusVOStr
,
LightsStatusVO
.
class
);
String
currentControl
=
controlModeMap
.
get
(
baseCrossInfo
.
getCrossId
());
Integer
controlType
=
1
;
po
.
setControlType
(
runModeControlMap
.
get
(
currentControl
));
if
(
Objects
.
nonNull
(
lightsStatusVO
))
{
String
runMode
=
lightsStatusVO
.
getRunMode
();
int
runModeInt
=
Integer
.
parseInt
(
runMode
);
controlType
=
HkControlModeEnum
.
getCodeByHkCode
(
runModeInt
);
}
}
po
.
setControlType
(
controlType
);
result
.
add
(
po
);
result
.
add
(
po
);
}
}
}
}
...
...
signal-utc-service/src/main/java/net/wanji/utc/task/SignalStatusTask.java
View file @
0783e5a6
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.databus.po.SignalStatusLogPO
;
import
net.wanji.databus.po.SignalStatusLogPO
;
import
net.wanji.databus.vo.LightsStatusVO
;
import
net.wanji.databus.vo.LightsStatusVO
;
import
net.wanji.utc.common.constant.Constants
;
import
net.wanji.utc.service.runninginfo.HkLightsStatusService
;
import
net.wanji.utc.service.runninginfo.HkLightsStatusService
;
import
net.wanji.utc.service.runninginfo.SignalStatusService
;
import
net.wanji.utc.service.runninginfo.SignalStatusService
;
import
net.wanji.utc.websocket.RealTimeDataWebSocket
;
import
net.wanji.utc.websocket.RealTimeDataWebSocket
;
...
@@ -83,6 +84,7 @@ public class SignalStatusTask {
...
@@ -83,6 +84,7 @@ public class SignalStatusTask {
}
else
if
(
StringUtils
.
equals
(
lightsStatusVO
.
getRunMode
(),
"11"
))
{
}
else
if
(
StringUtils
.
equals
(
lightsStatusVO
.
getRunMode
(),
"11"
))
{
runModeTimeMap
.
remove
(
crossIdStr
);
runModeTimeMap
.
remove
(
crossIdStr
);
}
}
Constants
.
controlModeMap
.
putIfAbsent
(
crossId
,
lightsStatusVO
.
getRunMode
());
try
{
try
{
webSocket
.
sendInfo
(
JSONObject
.
toJSONString
(
lightsStatusVOS
,
SerializerFeature
.
WriteMapNullValue
),
crossIdStr
);
webSocket
.
sendInfo
(
JSONObject
.
toJSONString
(
lightsStatusVOS
,
SerializerFeature
.
WriteMapNullValue
),
crossIdStr
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
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