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
af2428c0
Commit
af2428c0
authored
Jan 05, 2025
by
zhouleilei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
控制指令新增日志
parent
87055487
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
50 deletions
+78
-50
ControlCommandStrategyServiceImpl.java
...rvice/control/impl/ControlCommandStrategyServiceImpl.java
+28
-8
CommandFaildTask.java
...ce/src/main/java/net/wanji/utc/task/CommandFaildTask.java
+50
-42
No files found.
signal-utc-service/src/main/java/net/wanji/utc/service/control/impl/ControlCommandStrategyServiceImpl.java
View file @
af2428c0
...
...
@@ -300,6 +300,7 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
ip
=
IpAddressUtil
.
getIpAddress
(
request
);
signalCommandLogPO
.
setIp
(
ip
);
log
.
info
(
"服务器请求返回 信息jsonViewObject:{}"
,
jsonViewObject
);
int
commandResult
=
0
;
if
(
code
==
200
){
commandResult
=
1
;
...
...
@@ -322,7 +323,12 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
signalCommandLogPO
.
setLampTime
(
lampTime
);
}
}
signalCommandLogPOMapper
.
insert
(
signalCommandLogPO
);
int
insert
=
signalCommandLogPOMapper
.
insert
(
signalCommandLogPO
);
if
(
insert
>
0
)
{
log
.
info
(
"定时任务 插入t_signal_command_log成功,crossId = {},commandType = {},time = {},insert = {}"
,
jsonObject
.
getString
(
"crossId"
),
commandType
,
LocalDateTimeUtil
.
formatNow
(
LocalDateTimeUtil
.
TIMEFORMATTER
),
insert
);
}
else
{
log
.
info
(
"定时任务 插入t_signal_command_log失败,crossId = {},commandType = {},time = {},insert = {}"
,
jsonObject
.
getString
(
"crossId"
),
commandType
,
LocalDateTimeUtil
.
formatNow
(
LocalDateTimeUtil
.
TIMEFORMATTER
),
insert
);
}
//排除查询环图接口
if
(
commandType
!=
10
){
LambdaQueryWrapper
<
SignalCommandPO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -332,7 +338,12 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
//插入
SignalCommandPO
signalCommandPO
=
new
SignalCommandPO
();
BeanUtil
.
copyProperties
(
signalCommandLogPO
,
signalCommandPO
);
signalCommandPOMapper
.
insert
(
signalCommandPO
);
int
insert1
=
signalCommandPOMapper
.
insert
(
signalCommandPO
);
if
(
insert1
>
0
)
{
log
.
info
(
"定时任务 插入t_signal_command成功,crossId = {},commandType = {},time = {},insert = {}"
,
jsonObject
.
getString
(
"crossId"
),
commandType
,
LocalDateTimeUtil
.
formatNow
(
LocalDateTimeUtil
.
TIMEFORMATTER
),
insert1
);
}
else
{
log
.
info
(
"定时任务 插入t_signal_command失败,crossId = {},commandType = {},time = {},insert = {}"
,
jsonObject
.
getString
(
"crossId"
),
commandType
,
LocalDateTimeUtil
.
formatNow
(
LocalDateTimeUtil
.
TIMEFORMATTER
),
insert1
);
}
}
else
{
//更新
SignalCommandPO
signalCommandPO
=
signalCommandPOS
.
get
(
0
);
...
...
@@ -343,7 +354,12 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
signalCommandPO
.
setIp
(
ip
);
signalCommandPO
.
setQueryTime
(
queryTime
);
signalCommandPO
.
setUpdateCount
(
0
);
signalCommandPOMapper
.
update
(
signalCommandPO
,
lambdaQueryWrapper
);
int
update
=
signalCommandPOMapper
.
update
(
signalCommandPO
,
lambdaQueryWrapper
);
if
(
update
>
0
)
{
log
.
info
(
"定时任务 更新t_signal_command成功,crossId = {},commandType = {},time = {},update = {}"
,
jsonObject
.
getString
(
"crossId"
),
commandType
,
LocalDateTimeUtil
.
formatNow
(
LocalDateTimeUtil
.
TIMEFORMATTER
),
update
);
}
else
{
log
.
info
(
"定时任务 更新t_signal_command失败,crossId = {},commandType = {},time = {},update = {}"
,
jsonObject
.
getString
(
"crossId"
),
commandType
,
LocalDateTimeUtil
.
formatNow
(
LocalDateTimeUtil
.
TIMEFORMATTER
),
update
);
}
}
}
}
...
...
@@ -367,11 +383,15 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
if
(
StringUtils
.
isBlank
(
crossId
))
{
return
jsonViewObject
.
fail
(
"路口编号不能为空"
);
}
String
manufacturerIdCode
=
crossInfoCache
.
getManufacturerCodeByCrossId
(
crossId
);
if
(
StringUtils
.
equals
(
BasicEnum
.
ManufacturerEnum
.
HK
.
getCode
(),
manufacturerIdCode
))
{
jsonViewObject
=
hkControlCommandService
.
recoverSchedule
(
crossId
);
}
else
{
jsonViewObject
=
wanJiControlCommandService
.
recoverSchedule
(
crossId
);
try
{
String
manufacturerIdCode
=
crossInfoCache
.
getManufacturerCodeByCrossId
(
crossId
);
if
(
StringUtils
.
equals
(
BasicEnum
.
ManufacturerEnum
.
HK
.
getCode
(),
manufacturerIdCode
))
{
jsonViewObject
=
hkControlCommandService
.
recoverSchedule
(
crossId
);
}
else
{
jsonViewObject
=
wanJiControlCommandService
.
recoverSchedule
(
crossId
);
}
}
catch
(
Exception
e
)
{
jsonViewObject
=
JsonViewObject
.
newInstance
().
fail
(
e
.
getMessage
());
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"crossId"
,
crossId
);
...
...
signal-utc-service/src/main/java/net/wanji/utc/task/CommandFaildTask.java
View file @
af2428c0
This diff is collapsed.
Click to expand it.
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