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
ac6c36d4
Commit
ac6c36d4
authored
Jun 25, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
db754279
b8331bb4
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
409 additions
and
37 deletions
+409
-37
Constants.java
...c/main/java/net/wanji/com/common/constants/Constants.java
+10
-0
CommandResultSign.java
...in/java/net/wanji/com/common/enums/CommandResultSign.java
+3
-3
SectionControlModeEnum.java
...va/net/wanji/com/common/enums/SectionControlModeEnum.java
+38
-0
ControlCommandController.java
...va/net/wanji/com/controller/ControlCommandController.java
+3
-4
CommandResultSign.java
...va/net/wanji/com/netty/commandsign/CommandResultSign.java
+2
-2
SetAlarmInfoService.java
...anji/com/netty/response/impl/set/SetAlarmInfoService.java
+1
-1
SetBaseInfoService.java
...wanji/com/netty/response/impl/set/SetBaseInfoService.java
+1
-1
SetControlInfoService.java
...ji/com/netty/response/impl/set/SetControlInfoService.java
+1
-1
SetDailyPlanInfoService.java
.../com/netty/response/impl/set/SetDailyPlanInfoService.java
+1
-1
SetDetectorInfoService.java
...i/com/netty/response/impl/set/SetDetectorInfoService.java
+1
-1
SetDeviceInfoService.java
...nji/com/netty/response/impl/set/SetDeviceInfoService.java
+1
-1
SetFaultInfoService.java
...anji/com/netty/response/impl/set/SetFaultInfoService.java
+1
-1
SetLightsGroupInfoService.java
...om/netty/response/impl/set/SetLightsGroupInfoService.java
+1
-1
SetPhaseInfoService.java
...anji/com/netty/response/impl/set/SetPhaseInfoService.java
+1
-1
SetPhaseSecurityInfoService.java
.../netty/response/impl/set/SetPhaseSecurityInfoService.java
+1
-1
SetSchedulesInfoService.java
.../com/netty/response/impl/set/SetSchedulesInfoService.java
+1
-1
SetSchemeInfoService.java
...nji/com/netty/response/impl/set/SetSchemeInfoService.java
+1
-1
SetStageInfoService.java
...anji/com/netty/response/impl/set/SetStageInfoService.java
+1
-1
SetTrafficDataInfoService.java
...om/netty/response/impl/set/SetTrafficDataInfoService.java
+1
-1
ControlCommandService.java
...t/wanji/com/service/controller/ControlCommandService.java
+2
-4
DTControlCommandServiceImpl.java
.../service/controller/impl/DTControlCommandServiceImpl.java
+278
-9
DTStaticInfoServiceImpl.java
.../com/service/controller/impl/DTStaticInfoServiceImpl.java
+2
-1
CommonUtils.java
...service/src/main/java/net/wanji/com/util/CommonUtils.java
+57
-0
No files found.
signal-utc-dt-service/src/main/java/net/wanji/com/common/constants/Constants.java
View file @
ac6c36d4
...
@@ -15,6 +15,8 @@ public class Constants {
...
@@ -15,6 +15,8 @@ public class Constants {
public
static
final
String
COMMAND_TAIL
=
"7d"
;
public
static
final
String
COMMAND_TAIL
=
"7d"
;
// 操作类型, 数据对象id替换
// 操作类型, 数据对象id替换
public
static
final
String
COMMAND_COMMON
=
"010001000000010001%s010105%s000000"
;
public
static
final
String
COMMAND_COMMON
=
"010001000000010001%s010105%s000000"
;
public
static
final
String
COMMAND_SET_COMMON
=
"010001000000010001%s%s0105%s"
;
public
static
final
String
COMMAND_CENTER_COMMON
=
"010001000000010001%s010105%s%s"
;
public
static
final
String
COMMAND_HEART_BEAT_QUERY
=
"01000100000001000170"
;
public
static
final
String
COMMAND_HEART_BEAT_QUERY
=
"01000100000001000170"
;
public
static
final
String
COMMAND_HEART_BEAT_REPLY
=
"80"
;
public
static
final
String
COMMAND_HEART_BEAT_REPLY
=
"80"
;
public
static
final
String
COMMAND_QUERY
=
"10"
;
public
static
final
String
COMMAND_QUERY
=
"10"
;
...
@@ -30,6 +32,14 @@ public class Constants {
...
@@ -30,6 +32,14 @@ public class Constants {
public
static
final
String
COMMAND_DEVICE_STATUS
=
"0d01"
;
public
static
final
String
COMMAND_DEVICE_STATUS
=
"0d01"
;
public
static
final
String
COMMAND_RUNNING_STATUS
=
"0d02"
;
public
static
final
String
COMMAND_RUNNING_STATUS
=
"0d02"
;
public
static
final
String
COMMAND_FAULT_LIST
=
"1001"
;
public
static
final
String
COMMAND_FAULT_LIST
=
"1001"
;
public
static
final
String
COMMAND_SET
=
"30"
;
public
static
final
String
COMMAND_SET_REPLY
=
"40"
;
public
static
final
String
COMMAND_CENTER_COMMON_SIGN
=
"1101"
;
public
static
final
String
COMMAND_CENTER_CONTROL_STAGE
=
"11010201"
;
public
static
final
String
COMMAND_CENTER_CONTROL_SCHEME
=
"11010301"
;
public
static
final
String
COMMAND_CENTER_CONTROL_MODEL
=
"11010401"
;
public
static
final
String
COMMAND_CENTER_CHANNEL_MODEL
=
"1201"
;
/**
/**
* 通过发送报文内容,添加报文长度,crc校验,报文头尾
* 通过发送报文内容,添加报文长度,crc校验,报文头尾
...
...
signal-utc-dt-service/src/main/java/net/wanji/com/common/enums/CommandResultSign.java
View file @
ac6c36d4
...
@@ -36,12 +36,12 @@ public enum CommandResultSign {
...
@@ -36,12 +36,12 @@ public enum CommandResultSign {
SET_STAGE_INFO
(
"3006"
,
"setStageInfoService"
),
SET_STAGE_INFO
(
"3006"
,
"setStageInfoService"
),
SET_PHASE_SECURITY_INFO
(
"3007"
,
"setPhaseSecurityInfoService"
),
SET_PHASE_SECURITY_INFO
(
"3007"
,
"setPhaseSecurityInfoService"
),
SET_SCHEME_INFO
(
"3009"
,
"setSchemeInfoService"
),
SET_SCHEME_INFO
(
"3009"
,
"setSchemeInfoService"
),
SET_DAILY_PLAN_INFO
(
"
3011
"
,
"setDailyPlanInfoService"
),
SET_DAILY_PLAN_INFO
(
"
0b0240
"
,
"setDailyPlanInfoService"
),
SET_SCHEDULES_INFO
(
"
3012
"
,
"setSchedulesInfoService"
),
SET_SCHEDULES_INFO
(
"
090240
"
,
"setSchedulesInfoService"
),
SET_TRAFFIC_DATA_INFO
(
"3014"
,
"setTrafficDataInfoService"
),
SET_TRAFFIC_DATA_INFO
(
"3014"
,
"setTrafficDataInfoService"
),
SET_ALARM_INFO
(
"3015"
,
"setAlarmInfoService"
),
SET_ALARM_INFO
(
"3015"
,
"setAlarmInfoService"
),
SET_FAULT_INFO
(
"3016"
,
"setFaultInfoService"
),
SET_FAULT_INFO
(
"3016"
,
"setFaultInfoService"
),
SET_CONTROL_INFO
(
"
4017
"
,
"setControlInfoService"
);
SET_CONTROL_INFO
(
"
110140
"
,
"setControlInfoService"
);
private
String
hexSign
;
private
String
hexSign
;
...
...
signal-utc-dt-service/src/main/java/net/wanji/com/common/enums/SectionControlModeEnum.java
0 → 100644
View file @
ac6c36d4
package
net
.
wanji
.
com
.
common
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.RequiredArgsConstructor
;
import
java.util.Objects
;
/**
* @author duanruiming
* @date 2023/06/21 9:31
*/
@Getter
@AllArgsConstructor
@RequiredArgsConstructor
public
enum
SectionControlModeEnum
{
FIXED_CYCLE
(
1
,
"21"
,
"定周期"
),
GREEN_WAVE
(
2
,
"13"
,
"绿灯"
),
YELLOW_CONTROL
(
3
,
"31"
,
"黄灯"
),
RED_CONTROL
(
4
,
"32"
,
"红灯"
),
CLOSED_CONTROL
(
5
,
"33"
,
"关灯"
),
SELF_CONTROL
(
6
,
"14"
,
"绿闪"
),
FULL_INDUCTION
(
7
,
"31"
,
"黄闪"
),
HALF_INDUCTION
(
8
,
"32"
,
"红闪"
);
private
Integer
wjControl
;
private
String
dtControlHex
;
private
String
message
;
public
static
String
getDtControlMode
(
Integer
wjControlHex
)
{
for
(
ControlModelEnum
value
:
ControlModelEnum
.
values
())
{
if
(
Objects
.
equals
(
wjControlHex
,
value
.
getWjControl
()))
{
return
value
.
getDtControlHex
();
}
}
return
null
;
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/controller/ControlCommandController.java
View file @
ac6c36d4
...
@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
net.wanji.com.common.constants.Constants
;
import
net.wanji.com.service.controller.ControlCommandService
;
import
net.wanji.com.service.controller.ControlCommandService
;
import
net.wanji.common.annotation.aspect.AspectLog
;
import
net.wanji.common.annotation.aspect.AspectLog
;
import
net.wanji.common.enums.BaseEnum
;
import
net.wanji.common.enums.BaseEnum
;
...
@@ -90,7 +89,7 @@ public class ControlCommandController {
...
@@ -90,7 +89,7 @@ public class ControlCommandController {
@ApiOperation
(
value
=
"全红控制-路口全红控制/恢复"
,
notes
=
"全红控制-路口全红控制/恢复"
)
@ApiOperation
(
value
=
"全红控制-路口全红控制/恢复"
,
notes
=
"全红控制-路口全红控制/恢复"
)
@PostMapping
(
"/allRedControl"
)
@PostMapping
(
"/allRedControl"
)
public
JsonViewObject
allRedControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
public
JsonViewObject
allRedControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
return
controlCommandService
.
setSignalControl
(
commandVO
.
getCrossCode
(),
commandVO
.
getCommand
(),
Constants
.
ALL_RED_CONTROL
);
return
controlCommandService
.
setSignalControl
(
commandVO
);
}
}
/**
/**
...
@@ -104,7 +103,7 @@ public class ControlCommandController {
...
@@ -104,7 +103,7 @@ public class ControlCommandController {
@ApiOperation
(
value
=
"黄闪控制-路口黄闪控制/恢复"
,
notes
=
"黄闪控制-路口黄闪控制/恢复"
)
@ApiOperation
(
value
=
"黄闪控制-路口黄闪控制/恢复"
,
notes
=
"黄闪控制-路口黄闪控制/恢复"
)
@PostMapping
(
"/yellowLightControl"
)
@PostMapping
(
"/yellowLightControl"
)
public
JsonViewObject
yellowLightControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
public
JsonViewObject
yellowLightControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
return
controlCommandService
.
setSignalControl
(
commandVO
.
getCrossCode
(),
commandVO
.
getCommand
(),
Constants
.
YELLOW_LIGHT_CONTROL
);
return
controlCommandService
.
setSignalControl
(
commandVO
);
}
}
/**
/**
...
@@ -118,7 +117,7 @@ public class ControlCommandController {
...
@@ -118,7 +117,7 @@ public class ControlCommandController {
@ApiOperation
(
value
=
"关灯控制-路口关灯控制/开灯"
,
notes
=
"关灯控制-路口关灯控制/开灯"
)
@ApiOperation
(
value
=
"关灯控制-路口关灯控制/开灯"
,
notes
=
"关灯控制-路口关灯控制/开灯"
)
@PostMapping
(
"/closeLightControl"
)
@PostMapping
(
"/closeLightControl"
)
public
JsonViewObject
closeLightControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
public
JsonViewObject
closeLightControl
(
@RequestBody
@Validated
ControlCommandVO
commandVO
)
throws
Exception
{
return
controlCommandService
.
setSignalControl
(
commandVO
.
getCrossCode
(),
commandVO
.
getCommand
(),
Constants
.
CLOSE_LIGHT_CONTROL
);
return
controlCommandService
.
setSignalControl
(
commandVO
);
}
}
/**
/**
...
...
signal-utc-dt-service/src/main/java/net/wanji/com/netty/commandsign/CommandResultSign.java
View file @
ac6c36d4
package
net
.
wanji
.
com
.
netty
.
commandsign
;
package
net
.
wanji
.
com
.
netty
.
commandsign
;
import
net.wanji.common.utils.tool
.StringUtils
;
import
org.apache.commons.lang3
.StringUtils
;
/**
/**
* @author duanruiming
* @author duanruiming
...
@@ -12,7 +12,7 @@ public class CommandResultSign {
...
@@ -12,7 +12,7 @@ public class CommandResultSign {
String
sign
=
null
;
String
sign
=
null
;
if
(
StringUtils
.
isNotBlank
(
data
))
{
if
(
StringUtils
.
isNotBlank
(
data
))
{
sign
=
data
.
substring
(
24
,
26
);
sign
=
data
.
substring
(
24
,
26
);
if
(
StringUtils
.
equals
IgnoreCase
(
"80"
,
sign
))
{
if
(
StringUtils
.
equals
(
"80"
,
sign
))
{
return
sign
;
return
sign
;
}
}
sign
=
data
.
substring
(
32
,
36
).
concat
(
sign
);
sign
=
data
.
substring
(
32
,
36
).
concat
(
sign
);
...
...
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetAlarmInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetAlarmInfoService
implements
CommandResponseFactory
{
public
class
SetAlarmInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetBaseInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetBaseInfoService
implements
CommandResponseFactory
{
public
class
SetBaseInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetControlInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetControlInfoService
implements
CommandResponseFactory
{
public
class
SetControlInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetDailyPlanInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetDailyPlanInfoService
implements
CommandResponseFactory
{
public
class
SetDailyPlanInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetDetectorInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetDetectorInfoService
implements
CommandResponseFactory
{
public
class
SetDetectorInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetDeviceInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetDeviceInfoService
implements
CommandResponseFactory
{
public
class
SetDeviceInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetFaultInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetFaultInfoService
implements
CommandResponseFactory
{
public
class
SetFaultInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetLightsGroupInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetLightsGroupInfoService
implements
CommandResponseFactory
{
public
class
SetLightsGroupInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetPhaseInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetPhaseInfoService
implements
CommandResponseFactory
{
public
class
SetPhaseInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetPhaseSecurityInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetPhaseSecurityInfoService
implements
CommandResponseFactory
{
public
class
SetPhaseSecurityInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetSchedulesInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetSchedulesInfoService
implements
CommandResponseFactory
{
public
class
SetSchedulesInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetSchemeInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetSchemeInfoService
implements
CommandResponseFactory
{
public
class
SetSchemeInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetStageInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetStageInfoService
implements
CommandResponseFactory
{
public
class
SetStageInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/netty/response/impl/set/SetTrafficDataInfoService.java
View file @
ac6c36d4
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
public
class
SetTrafficDataInfoService
implements
CommandResponseFactory
{
public
class
SetTrafficDataInfoService
implements
CommandResponseFactory
{
@Override
@Override
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
public
String
getCommandResponse
(
CommandPojo
commandPojo
)
{
return
null
;
return
commandPojo
.
getResponseMsg
()
;
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/com/service/controller/ControlCommandService.java
View file @
ac6c36d4
...
@@ -53,13 +53,11 @@ public interface ControlCommandService extends BeanMarkService{
...
@@ -53,13 +53,11 @@ public interface ControlCommandService extends BeanMarkService{
/**
/**
* 设置信号机控制模式
* 设置信号机控制模式
*
*
* @param code 信号机编号
* @param commandVO 信号机编号
* @param command 指令 1 开 0 关
* @param commandType 命令类型
* @return
* @return
* @throws Exception 异常
* @throws Exception 异常
*/
*/
JsonViewObject
setSignalControl
(
String
code
,
Integer
command
,
Integer
commandType
)
throws
Exception
;
JsonViewObject
setSignalControl
(
ControlCommandVO
commandVO
)
throws
Exception
;
/**
/**
* 恢复时间表
* 恢复时间表
...
...
signal-utc-dt-service/src/main/java/net/wanji/com/service/controller/impl/DTControlCommandServiceImpl.java
View file @
ac6c36d4
This diff is collapsed.
Click to expand it.
signal-utc-dt-service/src/main/java/net/wanji/com/service/controller/impl/DTStaticInfoServiceImpl.java
View file @
ac6c36d4
...
@@ -136,6 +136,7 @@ public class DTStaticInfoServiceImpl implements StaticInfoService {
...
@@ -136,6 +136,7 @@ public class DTStaticInfoServiceImpl implements StaticInfoService {
for
(
PhaseStageInfoPojo
phaseStageInfoPojo
:
phaseStageInfoPojos
)
{
for
(
PhaseStageInfoPojo
phaseStageInfoPojo
:
phaseStageInfoPojos
)
{
if
(
Objects
.
equals
(
phaseStageId
,
phaseStageInfoPojo
.
getPhaseStageId
()))
{
if
(
Objects
.
equals
(
phaseStageId
,
phaseStageInfoPojo
.
getPhaseStageId
()))
{
List
<
Integer
>
phaseList
=
phaseStageInfoPojo
.
getPhaseList
();
List
<
Integer
>
phaseList
=
phaseStageInfoPojo
.
getPhaseList
();
int
ringNo
=
0
;
for
(
Integer
phaseId
:
phaseList
)
{
for
(
Integer
phaseId
:
phaseList
)
{
CrossPhasePO
crossPhasePO
=
new
CrossPhasePO
();
CrossPhasePO
crossPhasePO
=
new
CrossPhasePO
();
crossPhasePO
.
setCrossId
(
crossId
);
crossPhasePO
.
setCrossId
(
crossId
);
...
@@ -144,7 +145,7 @@ public class DTStaticInfoServiceImpl implements StaticInfoService {
...
@@ -144,7 +145,7 @@ public class DTStaticInfoServiceImpl implements StaticInfoService {
++
sort
;
++
sort
;
crossPhasePO
.
setSort
(
sort
);
crossPhasePO
.
setSort
(
sort
);
crossPhasePO
.
setPlanId
(
schemeInfoPojo
.
getSchemeId
());
crossPhasePO
.
setPlanId
(
schemeInfoPojo
.
getSchemeId
());
crossPhasePO
.
setRingNo
(
1
);
crossPhasePO
.
setRingNo
(
++
ringNo
);
crossPhasePO
.
setGroupNo
(
1
);
crossPhasePO
.
setGroupNo
(
1
);
crossPhasePO
.
setPhaseTime
(
phaseStageTime
);
crossPhasePO
.
setPhaseTime
(
phaseStageTime
);
crossPhasePO
.
setControlMode
(
1
);
crossPhasePO
.
setControlMode
(
1
);
...
...
signal-utc-dt-service/src/main/java/net/wanji/com/util/CommonUtils.java
0 → 100644
View file @
ac6c36d4
package
net
.
wanji
.
com
.
util
;
import
cn.hutool.core.util.HexUtil
;
import
freemarker.template.utility.StringUtil
;
/**
* @author duanruiming
* @date 2023/06/20 15:07
*/
public
class
CommonUtils
{
/**
* 将数组转化为16进制字符串
* @param array
* @return
*/
public
static
String
getHex4Array
(
int
[]
array
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
int
i
:
array
)
{
sb
.
append
(
i
);
}
Integer
binary
=
Integer
.
valueOf
(
sb
.
reverse
().
toString
(),
2
);
return
HexUtil
.
toHex
(
binary
);
}
/**
* 将时间转化为16进制 00:00 --> 061E0
* @param time
* @return
*/
public
static
String
getHourMinuteHex
(
String
time
)
{
StringBuffer
sb
=
new
StringBuffer
();
String
[]
split
=
time
.
split
(
":"
);
String
hour
=
String
.
format
(
"%02x"
,
Integer
.
valueOf
(
split
[
0
]));
String
minute
=
String
.
format
(
"%02x"
,
Integer
.
valueOf
(
split
[
1
]));
return
sb
.
append
(
hour
).
append
(
minute
).
toString
();
}
public
static
String
getBinary
(
Integer
param
)
{
int
[]
array
=
new
int
[
64
];
array
[
param
-
1
]
=
1
;
StringBuffer
resultSb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
array
.
length
/
8
;
i
++)
{
StringBuffer
sb
=
new
StringBuffer
();
for
(
int
j
=
0
;
j
<
8
;
j
++)
{
sb
.
append
(
array
[
i
*
8
+
j
]);
}
String
hex
=
String
.
format
(
"%02x"
,
Integer
.
parseInt
(
sb
.
reverse
().
toString
(),
2
));
resultSb
.
insert
(
0
,
hex
);
}
return
StringUtil
.
leftPad
(
resultSb
.
toString
(),
16
,
"0"
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
err
.
println
(
getBinary
(
8
));
}
}
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