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
ded93519
Commit
ded93519
authored
Mar 08, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
67ba5b67
fad4219a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
DiagnoServiceImpl.java
...in/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
+9
-1
CrossIdAndLocationVO.java
.../src/main/java/net/wanji/opt/vo/CrossIdAndLocationVO.java
+2
-0
GlobalExceptionHandler.java
...on/framework/exceptionhandler/GlobalExceptionHandler.java
+9
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/DiagnoServiceImpl.java
View file @
ded93519
...
@@ -138,6 +138,9 @@ public class DiagnoServiceImpl implements DiagnoService {
...
@@ -138,6 +138,9 @@ public class DiagnoServiceImpl implements DiagnoService {
startLocation
.
add
(
startLonLat
[
1
]);
startLocation
.
add
(
startLonLat
[
1
]);
crossIdAndLocationVO
.
setLocation
(
startLocation
);
crossIdAndLocationVO
.
setLocation
(
startLocation
);
}
}
// 关联路口wkt
String
wkt
=
ridInfo
.
getWkt
();
crossIdAndLocationVO
.
setWkt
(
wkt
);
CrossDataRealtimePO
crossDataRealtimePO
=
crossDataRealtimeMapper
.
selectByCrossId
(
startCrossId
);
CrossDataRealtimePO
crossDataRealtimePO
=
crossDataRealtimeMapper
.
selectByCrossId
(
startCrossId
);
if
(
crossDataRealtimePO
==
null
)
{
if
(
crossDataRealtimePO
==
null
)
{
throw
new
RuntimeException
(
"没有该路口实时数据"
);
throw
new
RuntimeException
(
"没有该路口实时数据"
);
...
@@ -308,7 +311,12 @@ public class DiagnoServiceImpl implements DiagnoService {
...
@@ -308,7 +311,12 @@ public class DiagnoServiceImpl implements DiagnoService {
CrossInfoPO
crossInfoPO
=
crossInfoMapper
.
selectById
(
crossId
);
CrossInfoPO
crossInfoPO
=
crossInfoMapper
.
selectById
(
crossId
);
optEffectVO
.
setCrossName
(
crossInfoPO
.
getName
());
optEffectVO
.
setCrossName
(
crossInfoPO
.
getName
());
List
<
CrossSchemeOptLogPO
>
maxList
=
crossSchemeOptLogMapper
.
selectMaxByCrossId
(
crossId
);
List
<
CrossSchemeOptLogPO
>
maxList
=
crossSchemeOptLogMapper
.
selectMaxByCrossId
(
crossId
);
CrossSchemeOptLogPO
crossSchemeOptLogPO
=
maxList
.
get
(
0
);
CrossSchemeOptLogPO
crossSchemeOptLogPO
=
null
;
try
{
crossSchemeOptLogPO
=
maxList
.
get
(
0
);
}
catch
(
IndexOutOfBoundsException
e
)
{
throw
new
RuntimeException
(
"优化日志数据库中无此路口记录"
);
}
String
dataExtend
=
crossSchemeOptLogPO
.
getDataExtend
();
String
dataExtend
=
crossSchemeOptLogPO
.
getDataExtend
();
OptDataExtend
optDataExtend
=
gson
.
fromJson
(
dataExtend
,
OptDataExtend
.
class
);
OptDataExtend
optDataExtend
=
gson
.
fromJson
(
dataExtend
,
OptDataExtend
.
class
);
optEffectVO
.
setSceneName
(
optDataExtend
.
getSceneName
());
optEffectVO
.
setSceneName
(
optDataExtend
.
getSceneName
());
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/CrossIdAndLocationVO.java
View file @
ded93519
...
@@ -23,4 +23,6 @@ public class CrossIdAndLocationVO {
...
@@ -23,4 +23,6 @@ public class CrossIdAndLocationVO {
List
<
Double
>
location
;
List
<
Double
>
location
;
@ApiModelProperty
(
value
=
"路口状态:0正常;1失衡;2拥堵;3溢出"
)
@ApiModelProperty
(
value
=
"路口状态:0正常;1失衡;2拥堵;3溢出"
)
Integer
realtimeStatus
;
Integer
realtimeStatus
;
@ApiModelProperty
(
name
=
"空间对象"
,
notes
=
"空间对象"
)
private
String
wkt
;
}
}
wj-common/src/main/java/net/wanji/common/framework/exceptionhandler/GlobalExceptionHandler.java
View file @
ded93519
...
@@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import
net.wanji.common.framework.exception.FeignServiceException
;
import
net.wanji.common.framework.exception.FeignServiceException
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.FieldError
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
...
@@ -121,6 +122,14 @@ public class GlobalExceptionHandler {
...
@@ -121,6 +122,14 @@ public class GlobalExceptionHandler {
return
JsonViewObject
.
newInstance
().
fail
(
"feign远程服务调用异常!位置在:"
+
errorMessage
);
return
JsonViewObject
.
newInstance
().
fail
(
"feign远程服务调用异常!位置在:"
+
errorMessage
);
}
}
/**
* 输入值与数据类型不匹配
*/
@ExceptionHandler
(
value
=
HttpMessageNotReadableException
.
class
)
public
JsonViewObject
httpMessageNotReadableExceptionHandler
()
{
return
JsonViewObject
.
newInstance
().
fail
(
"输入值与数据类型不匹配"
);
}
/**
/**
* 处理其他异常
* 处理其他异常
*/
*/
...
...
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