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
f27078c3
Commit
f27078c3
authored
Jul 26, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 代码优化
parent
67df2652
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
15 additions
and
34 deletions
+15
-34
SignalStatusController.java
...a/net/wanji/utc/dt/controller/SignalStatusController.java
+0
-5
MessageDecoder.java
...ain/java/net/wanji/utc/dt/netty/codec/MessageDecoder.java
+1
-1
MessageEnCoder.java
...ain/java/net/wanji/utc/dt/netty/codec/MessageEnCoder.java
+1
-1
NettyServerHandler.java
...va/net/wanji/utc/dt/netty/handler/NettyServerHandler.java
+2
-7
LightsInfoPojo.java
.../java/net/wanji/utc/dt/pojo/dtconvert/LightsInfoPojo.java
+0
-4
ControlCommandService.java
.../java/net/wanji/utc/dt/service/ControlCommandService.java
+7
-7
StaticInfoService.java
...main/java/net/wanji/utc/dt/service/StaticInfoService.java
+0
-4
DTControlCommandServiceImpl.java
...anji/utc/dt/service/impl/DTControlCommandServiceImpl.java
+1
-0
DTSignalStatusServiceImpl.java
.../wanji/utc/dt/service/impl/DTSignalStatusServiceImpl.java
+1
-0
DTStaticInfoServiceImpl.java
...et/wanji/utc/dt/service/impl/DTStaticInfoServiceImpl.java
+1
-0
CommonUtils.java
...vice/src/main/java/net/wanji/utc/dt/util/CommonUtils.java
+1
-5
No files found.
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/controller/SignalStatusController.java
View file @
f27078c3
package
net
.
wanji
.
utc
.
dt
.
controller
;
package
net
.
wanji
.
utc
.
dt
.
controller
;
/**
* @author Kent HAN
* @date 2022/12/1 15:07
*/
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponse
;
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/netty/codec/MessageDecoder.java
View file @
f27078c3
...
@@ -16,7 +16,7 @@ public class MessageDecoder extends ByteToMessageDecoder {
...
@@ -16,7 +16,7 @@ public class MessageDecoder extends ByteToMessageDecoder {
*自定义解码器
*自定义解码器
*/
*/
@Override
@Override
protected
void
decode
(
ChannelHandlerContext
ctx
,
ByteBuf
in
,
List
<
Object
>
out
)
throws
Exception
{
protected
void
decode
(
ChannelHandlerContext
ctx
,
ByteBuf
in
,
List
<
Object
>
out
)
{
byte
[]
bytes
=
new
byte
[
in
.
readableBytes
()];
byte
[]
bytes
=
new
byte
[
in
.
readableBytes
()];
in
.
readBytes
(
bytes
);
in
.
readBytes
(
bytes
);
out
.
add
(
HexUtil
.
encodeHexStr
(
bytes
));
out
.
add
(
HexUtil
.
encodeHexStr
(
bytes
));
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/netty/codec/MessageEnCoder.java
View file @
f27078c3
...
@@ -19,7 +19,7 @@ public class MessageEnCoder extends MessageToByteEncoder<String> {
...
@@ -19,7 +19,7 @@ public class MessageEnCoder extends MessageToByteEncoder<String> {
* @throws Exception
* @throws Exception
*/
*/
@Override
@Override
protected
void
encode
(
ChannelHandlerContext
ctx
,
String
msg
,
ByteBuf
out
)
throws
Exception
{
protected
void
encode
(
ChannelHandlerContext
ctx
,
String
msg
,
ByteBuf
out
)
{
out
.
writeBytes
(
AESUtils
.
parseHexStr2Byte
(
msg
));
out
.
writeBytes
(
AESUtils
.
parseHexStr2Byte
(
msg
));
}
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/netty/handler/NettyServerHandler.java
View file @
f27078c3
...
@@ -6,19 +6,17 @@ import io.netty.channel.ChannelHandlerContext;
...
@@ -6,19 +6,17 @@ import io.netty.channel.ChannelHandlerContext;
import
io.netty.channel.SimpleChannelInboundHandler
;
import
io.netty.channel.SimpleChannelInboundHandler
;
import
io.netty.channel.socket.DatagramPacket
;
import
io.netty.channel.socket.DatagramPacket
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.utc.dt.cache.CrossInfoCache
;
import
net.wanji.common.framework.spring.ServiceBeanContext
;
import
net.wanji.databus.po.CrossInfoPO
;
import
net.wanji.utc.dt.cache.netty.NettyMessageCache
;
import
net.wanji.utc.dt.cache.netty.NettyMessageCache
;
import
net.wanji.utc.dt.common.enums.CommandResultSignEnum
;
import
net.wanji.utc.dt.common.enums.CommandResultSignEnum
;
import
net.wanji.utc.dt.netty.commandsign.CommandResultSign
;
import
net.wanji.utc.dt.netty.commandsign.CommandResultSign
;
import
net.wanji.utc.dt.netty.pojo.CommandPojo
;
import
net.wanji.utc.dt.netty.pojo.CommandPojo
;
import
net.wanji.utc.dt.netty.response.CommandResponseFactory
;
import
net.wanji.utc.dt.netty.response.CommandResponseFactory
;
import
net.wanji.utc.dt.pojo.netty.MessageResultPojo
;
import
net.wanji.utc.dt.pojo.netty.MessageResultPojo
;
import
net.wanji.common.framework.spring.ServiceBeanContext
;
import
net.wanji.databus.po.CrossInfoPO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.net.InetSocketAddress
;
import
java.net.InetSocketAddress
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -26,9 +24,6 @@ import java.util.Objects;
...
@@ -26,9 +24,6 @@ import java.util.Objects;
@Component
@Component
public
class
NettyServerHandler
extends
SimpleChannelInboundHandler
<
DatagramPacket
>
{
public
class
NettyServerHandler
extends
SimpleChannelInboundHandler
<
DatagramPacket
>
{
@Resource
private
CrossInfoCache
crossInfoCache
;
/**
/**
* 读取消息
* 读取消息
*
*
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/pojo/dtconvert/LightsInfoPojo.java
View file @
f27078c3
...
@@ -42,8 +42,4 @@ public class LightsInfoPojo {
...
@@ -42,8 +42,4 @@ public class LightsInfoPojo {
}
}
return
turnDir
;
return
turnDir
;
}
}
public
static
void
main
(
String
[]
args
)
{
System
.
err
.
println
(
1
%
4
==
1
);
}
}
}
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/service/ControlCommandService.java
View file @
f27078c3
...
@@ -82,13 +82,13 @@ public interface ControlCommandService {
...
@@ -82,13 +82,13 @@ public interface ControlCommandService {
*/
*/
JsonViewObject
phaseDiffSend
();
JsonViewObject
phaseDiffSend
();
/**
//
/**
* 删除信号机配置参数
//
* 删除信号机配置参数
* 删除信号机配置参数-目前支持相位、方案、计划、日期
//
* 删除信号机配置参数-目前支持相位、方案、计划、日期
*
//
*
* @param delBaseConfigPO
//
* @param delBaseConfigPO
* @return
//
* @return
*/
//
*/
// JsonViewObject delBaseConfig(DelBaseConfigPOfigPO delBaseConfigPO) throws Exception;
// JsonViewObject delBaseConfig(DelBaseConfigPOfigPO delBaseConfigPO) throws Exception;
/**
/**
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/service/StaticInfoService.java
View file @
f27078c3
package
net
.
wanji
.
utc
.
dt
.
service
;
package
net
.
wanji
.
utc
.
dt
.
service
;
import
net.wanji.databus.dao.entity.CrossSchedulesPO
;
import
net.wanji.databus.dao.entity.CrossSchedulesPO
;
import
net.wanji.databus.dto.CrossInfoDTO
;
import
net.wanji.databus.dto.PlanSectionDTO
;
import
net.wanji.databus.dto.PlanSectionDTO
;
import
net.wanji.databus.dto.SchemePhaseLightsDTO
;
import
net.wanji.databus.dto.SchemePhaseLightsDTO
;
import
net.wanji.databus.po.CrossInfoPO
;
import
net.wanji.databus.vo.PlanSectionVO
;
import
net.wanji.databus.vo.PlanSectionVO
;
import
net.wanji.databus.vo.SchemePhaseLightsVO
;
import
net.wanji.databus.vo.SchemePhaseLightsVO
;
...
@@ -13,8 +11,6 @@ import java.util.List;
...
@@ -13,8 +11,6 @@ import java.util.List;
public
interface
StaticInfoService
{
public
interface
StaticInfoService
{
List
<
CrossInfoPO
>
crossBasicInfo
(
CrossInfoDTO
crossInfoDTO
)
throws
Exception
;
SchemePhaseLightsVO
schemePhaseLights
(
SchemePhaseLightsDTO
schemePhaseLightsDTO
)
throws
Exception
;
SchemePhaseLightsVO
schemePhaseLights
(
SchemePhaseLightsDTO
schemePhaseLightsDTO
)
throws
Exception
;
List
<
PlanSectionVO
>
planSection
(
PlanSectionDTO
planSectionDTO
)
throws
Exception
;
List
<
PlanSectionVO
>
planSection
(
PlanSectionDTO
planSectionDTO
)
throws
Exception
;
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/service/impl/DTControlCommandServiceImpl.java
View file @
f27078c3
...
@@ -33,6 +33,7 @@ import java.util.stream.Collectors;
...
@@ -33,6 +33,7 @@ import java.util.stream.Collectors;
@Service
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor
@Slf4j
@Slf4j
@SuppressWarnings
(
"all"
)
public
class
DTControlCommandServiceImpl
implements
ControlCommandService
{
public
class
DTControlCommandServiceImpl
implements
ControlCommandService
{
/**
/**
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/service/impl/DTSignalStatusServiceImpl.java
View file @
f27078c3
...
@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
...
@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
* @date 2023/05/08 17:28
* @date 2023/05/08 17:28
*/
*/
@Service
@Service
@SuppressWarnings
(
"all"
)
public
class
DTSignalStatusServiceImpl
implements
SignalStatusService
{
public
class
DTSignalStatusServiceImpl
implements
SignalStatusService
{
@Override
@Override
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/service/impl/DTStaticInfoServiceImpl.java
View file @
f27078c3
...
@@ -35,6 +35,7 @@ import java.util.stream.Collectors;
...
@@ -35,6 +35,7 @@ import java.util.stream.Collectors;
@Service
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor
@Slf4j
@Slf4j
@SuppressWarnings
(
"all"
)
public
class
DTStaticInfoServiceImpl
implements
StaticInfoService
{
public
class
DTStaticInfoServiceImpl
implements
StaticInfoService
{
private
final
SignalDataCache
signalDataCache
;
private
final
SignalDataCache
signalDataCache
;
...
...
signal-utc-dt-service/src/main/java/net/wanji/utc/dt/util/CommonUtils.java
View file @
f27078c3
...
@@ -4,13 +4,13 @@ import cn.hutool.core.util.HexUtil;
...
@@ -4,13 +4,13 @@ import cn.hutool.core.util.HexUtil;
import
freemarker.template.utility.StringUtil
;
import
freemarker.template.utility.StringUtil
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @author duanruiming
* @author duanruiming
* @date 2023/06/20 15:07
* @date 2023/06/20 15:07
*/
*/
@SuppressWarnings
(
"all"
)
public
class
CommonUtils
{
public
class
CommonUtils
{
/**
/**
...
@@ -87,10 +87,6 @@ public class CommonUtils {
...
@@ -87,10 +87,6 @@ public class CommonUtils {
return
StringUtil
.
leftPad
(
resultSb
.
toString
(),
16
,
"0"
);
return
StringUtil
.
leftPad
(
resultSb
.
toString
(),
16
,
"0"
);
}
}
public
static
void
main
(
String
[]
args
)
{
System
.
err
.
println
(
getBinary4PhaseList
(
Arrays
.
asList
(
5
,
6
,
7
,
8
)));
}
/**
/**
* 将单个参数转化为4位二进制
* 将单个参数转化为4位二进制
*
*
...
...
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