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
6c6fedb1
Commit
6c6fedb1
authored
Jan 03, 2025
by
zhouleilei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
aab7826e
b326c6f9
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
139 additions
and
70 deletions
+139
-70
pom.xml
signal-optimize-service/pom.xml
+5
-0
EventStatusEnum.java
...main/java/net/wanji/opt/common/enums/EventStatusEnum.java
+3
-2
Double2TwoDecimalPlacesSerializer.java
...t/wanji/opt/config/Double2TwoDecimalPlacesSerializer.java
+4
-1
CrossIndexServiceImpl.java
...ava/net/wanji/opt/service/impl/CrossIndexServiceImpl.java
+14
-5
MainlineEvaluateServiceImpl.java
...t/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
+44
-44
StrategyCrossResultEntity.java
...t/wanji/opt/synthesis/pojo/StrategyCrossResultEntity.java
+5
-2
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+17
-5
MainlineEvaluateBottomCurveVO.java
.../java/net/wanji/opt/vo/MainlineEvaluateBottomCurveVO.java
+1
-1
SignalCommandSyncTask.java
...c/main/java/net/wanji/utc/task/SignalCommandSyncTask.java
+3
-1
DoubleToTwoDecimalPlacesSerializer.java
...ji/databus/config/DoubleToTwoDecimalPlacesSerializer.java
+5
-1
CrossDataRealtimePO.java
...c/main/java/net/wanji/databus/po/CrossDataRealtimePO.java
+29
-8
CrossDirDataRealtimePO.java
...ain/java/net/wanji/databus/po/CrossDirDataRealtimePO.java
+3
-0
CrossLaneDataRealTimePO.java
...in/java/net/wanji/databus/po/CrossLaneDataRealTimePO.java
+3
-0
CrossTurnDataRealtimePO.java
...in/java/net/wanji/databus/po/CrossTurnDataRealtimePO.java
+3
-0
No files found.
signal-optimize-service/pom.xml
View file @
6c6fedb1
...
...
@@ -18,6 +18,11 @@
</properties>
<dependencies>
<!--客户端负载均衡loadbalancer-->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-loadbalancer
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
...
...
signal-optimize-service/src/main/java/net/wanji/opt/common/enums/EventStatusEnum.java
View file @
6c6fedb1
...
...
@@ -16,8 +16,9 @@ public enum EventStatusEnum {
ZERO
(
0
,
"未处理"
),
ONE
(
1
,
"分析中"
),
TWO
(
2
,
"优化中"
),
THREE
(
3
,
"优化中"
),
FOUR
(
4
,
"已结束"
);
THREE
(
3
,
"优化完"
),
// 信控没有已结束,优化完
FOUR
(
4
,
"优化完"
);
private
Integer
code
;
private
String
desc
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/config/Double2TwoDecimalPlacesSerializer.java
View file @
6c6fedb1
...
...
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.JsonSerializer;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
/**
...
...
@@ -17,7 +18,9 @@ public class Double2TwoDecimalPlacesSerializer extends JsonSerializer<Double> {
@Override
public
void
serialize
(
Double
value
,
JsonGenerator
gen
,
SerializerProvider
serializers
)
throws
IOException
{
if
(
value
!=
null
)
{
String
formattedValue
=
df
.
format
(
value
);
// 将 Double 转换为 BigDecimal,避免浮点数精度问题
BigDecimal
bd
=
BigDecimal
.
valueOf
(
value
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
String
formattedValue
=
df
.
format
(
bd
.
doubleValue
());
gen
.
writeString
(
formattedValue
);
}
else
{
gen
.
writeNull
();
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/CrossIndexServiceImpl.java
View file @
6c6fedb1
...
...
@@ -95,9 +95,9 @@ public class CrossIndexServiceImpl implements CrossIndexService {
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
for
(
StrategyCrossResultEntity
entity
:
list
)
{
CrossOptResult
crossOptResult
=
new
CrossOptResult
();
Date
date
=
DateUtil
.
parse
(
entity
.
getIssueTime
(),
"yyyy-MM-dd HH:mm:ss"
);
Date
date
=
entity
.
getIssueTime
();
//Date date = DateUtil.parse(entity.getIssueTime(), "yyyy-MM-dd HH:mm:ss");
crossOptResult
.
setTimeStamp
(
date
);
String
timingPlan
=
entity
.
getTimingPlan
();
Integer
countDown
=
entity
.
getCountDown
();
if
(
entity
.
getCurrentAlgo
()
==
2
)
{
countDown
=
5
;
...
...
@@ -130,9 +130,18 @@ public class CrossIndexServiceImpl implements CrossIndexService {
aiOptResultVO
.
setStrategy
(
currentAlgo
);
// 失衡 均衡调控,其他效率提升
aiOptResultVO
.
setOptMethod
(
Objects
.
equals
(
1
,
currentAlgo
)
?
StrategyControlEnum
.
ONE
.
getMethod
()
:
StrategyControlEnum
.
TWO
.
getMethod
());
// 失衡 优化中,其他,优化完
Integer
optStatus
=
Objects
.
equals
(
1
,
currentAlgo
)
?
OptStatusEnum
.
ONE
.
getCode
()
:
OptStatusEnum
.
TWO
.
getCode
();
aiOptResultVO
.
setOptStatus
(
optStatus
);
// 失衡 优化中,15分钟内,优化中,其他,优化完
aiOptResultVO
.
setOptStatus
(
OptStatusEnum
.
TWO
.
getCode
());
if
(
Objects
.
equals
(
1
,
currentAlgo
))
{
Date
issueTimeDate
=
resultEntity
.
getIssueTime
();
//Date issueTimeDate = DateUtils.parseDate(issueTime);
long
optTime
=
issueTimeDate
.
getTime
();
long
currentTimeMillis
=
System
.
currentTimeMillis
();
long
offset
=
currentTimeMillis
-
optTime
;
if
(
offset
<=
15
*
60
*
1000
)
{
aiOptResultVO
.
setOptStatus
(
OptStatusEnum
.
ONE
.
getCode
());
}
}
aiOptResultVO
.
setOptStatusName
(
Objects
.
equals
(
1
,
currentAlgo
)
?
OptStatusEnum
.
ONE
.
getDesc
()
:
OptStatusEnum
.
TWO
.
getDesc
());
if
(
Objects
.
isNull
(
currentAlgo
))
{
aiOptResultVO
.
setOptStatus
(-
1
);
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
View file @
6c6fedb1
This diff is collapsed.
Click to expand it.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyCrossResultEntity.java
View file @
6c6fedb1
...
...
@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
net.wanji.common.utils.tool.DateUtil
;
import
java.util.Date
;
/**
* @author duanruiming
...
...
@@ -24,10 +27,10 @@ public class StrategyCrossResultEntity {
private
Integer
currentAlgo
;
@TableField
(
"request_time"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
String
requestTime
;
private
Date
requestTime
;
@TableField
(
"issue_time"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
String
issueTime
;
private
Date
issueTime
;
@TableField
(
"response_code"
)
private
Integer
responseCode
;
@TableField
(
"timing_plan"
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
6c6fedb1
...
...
@@ -2,6 +2,7 @@ package net.wanji.opt.synthesis.service.impl;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.excel.util.DateUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
...
...
@@ -189,9 +190,14 @@ public class StrategyControlServiceImpl implements StrategyControlService {
List
<
StrategyControlHistVO
>
results
=
new
ArrayList
<>();
LocalDate
currentDate
=
LocalDate
.
now
();
LocalDateTime
midnight
=
currentDate
.
atStartOfDay
();
// 查询当前绿波历史记录
setGreenOptHist
(
results
,
midnight
,
format
);
setCrossOptHist
(
results
,
midnight
);
try
{
// 查询当前绿波历史记录
setGreenOptHist
(
results
,
midnight
,
format
);
setCrossOptHist
(
results
,
midnight
);
}
catch
(
ParseException
e
)
{
log
.
error
(
"优化策略查询失败:"
,
e
);
JsonViewObject
.
newInstance
().
fail
(
"优化策略查询失败"
);
}
List
<
StrategyControlHistVO
>
sorted
=
results
.
stream
().
sorted
(
Comparator
.
comparing
(
StrategyControlHistVO:
:
getOptTime
).
reversed
()).
collect
(
Collectors
.
toList
());
return
JsonViewObject
.
newInstance
().
success
(
sorted
);
}
...
...
@@ -210,8 +216,14 @@ public class StrategyControlServiceImpl implements StrategyControlService {
histVO
.
setWkt
(
coordinateByCrossId
.
replace
(
"POINT("
,
""
).
replace
(
" "
,
","
).
replace
(
")"
,
""
));
histVO
.
setStrategy
(
resultEntity
.
getCurrentAlgo
());
histVO
.
setStrategyName
(
StrategyCrossAlgoEnum
.
getDescByCode
(
resultEntity
.
getCurrentAlgo
()));
histVO
.
setOptTime
(
resultEntity
.
getIssueTime
());
histVO
.
setResult
(
Objects
.
equals
(
200
,
resultEntity
.
getResponseCode
())
?
"成功"
:
"失败"
);
Date
issueTime
=
resultEntity
.
getIssueTime
();
String
format
=
DateUtils
.
format
(
issueTime
,
"yyyy-MM-dd HH:mm:ss"
);
histVO
.
setOptTime
(
format
);
if
(
resultEntity
.
getCurrentAlgo
()
!=
1
)
{
histVO
.
setResult
(
Objects
.
equals
(
200
,
resultEntity
.
getResponseCode
())
?
"成功"
:
"失败"
);
}
else
{
histVO
.
setResult
(
"成功"
);
}
results
.
add
(
histVO
);
}
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/MainlineEvaluateBottomCurveVO.java
View file @
6c6fedb1
...
...
@@ -20,7 +20,7 @@ public class MainlineEvaluateBottomCurveVO {
private
String
scopeName
;
@ApiModelProperty
(
value
=
"数值"
)
private
Integer
value
;
private
Double
value
;
@ApiModelProperty
(
value
=
"指标时间戳"
)
private
Long
metricTimeStamp
;
...
...
signal-utc-service/src/main/java/net/wanji/utc/task/SignalCommandSyncTask.java
View file @
6c6fedb1
...
...
@@ -105,7 +105,9 @@ public class SignalCommandSyncTask {
List
<
SignalCommandPO
>
sendList
=
new
ArrayList
<>();
sendList
.
addAll
(
insertList
);
sendList
.
addAll
(
updateList
);
sendAlarmKafka
(
sendList
);
if
(!
CollectionUtils
.
isEmpty
(
sendList
))
{
sendAlarmKafka
(
sendList
);
}
}
else
{
log
.
error
(
"从路口灯态缓存获取控制模式在线离线状态为空:{}"
,
crossLightsStatusMap
);
}
...
...
wj-databus/src/main/java/net/wanji/databus/config/DoubleToTwoDecimalPlacesSerializer.java
View file @
6c6fedb1
...
...
@@ -3,8 +3,10 @@ package net.wanji.databus.config;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
/**
...
...
@@ -17,7 +19,9 @@ public class DoubleToTwoDecimalPlacesSerializer extends JsonSerializer<Double> {
@Override
public
void
serialize
(
Double
value
,
JsonGenerator
gen
,
SerializerProvider
serializers
)
throws
IOException
{
if
(
value
!=
null
)
{
String
formattedValue
=
df
.
format
(
value
);
// 将 Double 转换为 BigDecimal,避免浮点数精度问题
BigDecimal
bd
=
BigDecimal
.
valueOf
(
value
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
String
formattedValue
=
df
.
format
(
bd
.
doubleValue
());
gen
.
writeString
(
formattedValue
);
}
else
{
gen
.
writeNull
();
...
...
wj-databus/src/main/java/net/wanji/databus/po/CrossDataRealtimePO.java
View file @
6c6fedb1
...
...
@@ -4,11 +4,11 @@ import com.alibaba.fastjson.annotation.JSONField;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.
annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.
databind.annotation.JsonSerialize
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.omg.CORBA.UNKNOWN
;
import
net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer
;
import
java.util.Date
;
...
...
@@ -39,13 +39,14 @@ public class CrossDataRealtimePO {
* 交通指数(1~10)
*/
@ApiModelProperty
(
value
=
"交通指数(1~10)"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
trafficIndex
;
/**
* 开始时间:yyyy-MM-dd HH;mm:ss
*/
@ApiModelProperty
(
value
=
"开始时间:yyyy-MM-dd HH:mm:ss"
,
notes
=
""
)
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
@ApiModelProperty
(
value
=
"结束时间:yyyy-MM-dd HH:mm:ss"
,
notes
=
""
)
...
...
@@ -71,16 +72,19 @@ public class CrossDataRealtimePO {
* 失衡指数
*/
@ApiModelProperty
(
value
=
"失衡指数"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
unbalanceIndex
;
/**
* 溢出指数
*/
@ApiModelProperty
(
value
=
"溢出指数"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
spilloverIndex
;
/**
* 拥堵指数
*/
@ApiModelProperty
(
value
=
"拥堵指数"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
congestionIndex
;
/**
* 路口失衡方向:1,2,3...
...
...
@@ -106,21 +110,25 @@ public class CrossDataRealtimePO {
* 交通流率/h
*/
@ApiModelProperty
(
value
=
"交通流率/h"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
flowRate
;
/**
* 平均速度(km/h)
*/
@ApiModelProperty
(
value
=
"平均速度(km/h)"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
speed
;
/**
* 最大排队(米)
*/
@ApiModelProperty
(
value
=
"最大排队(米)"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
queueLength
;
/**
* 停车次数(次)
*/
@ApiModelProperty
(
value
=
"停车次数(次)"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
stopTimes
;
/**
* 延误时间(秒)
...
...
@@ -151,11 +159,13 @@ public class CrossDataRealtimePO {
* 红灯清空率
*/
@ApiModelProperty
(
value
=
"红灯清空率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
clearRate
;
/**
* 负载均衡度
*/
@ApiModelProperty
(
value
=
"负载均衡度"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
loadBalance
;
/**
* 平均未清空车辆数量
...
...
@@ -166,25 +176,32 @@ public class CrossDataRealtimePO {
* 绿灯有效利用率
*/
@ApiModelProperty
(
value
=
"绿灯有效利用率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
greenLightEfficiency
;
/**
* 溢流率
*/
@ApiModelProperty
(
value
=
"溢流率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
effusionRate
;
@ApiModelProperty
(
name
=
"不停车率"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"不停车率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
public
Double
noStopRate
;
@ApiModelProperty
(
name
=
"一次停车率"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"一次停车率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
public
Double
oneStopRate
;
@ApiModelProperty
(
name
=
"二次停车率"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"二次停车率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
public
Double
twoStopRate
;
@ApiModelProperty
(
name
=
"三次停车率"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"三次停车率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
public
Double
threeStopRate
;
@ApiModelProperty
(
value
=
"非机动车流量"
,
notes
=
""
)
private
int
nonMotorFlow
;
@ApiModelProperty
(
value
=
"85位速度(km/h)"
,
notes
=
""
)
@TableField
(
value
=
"v_85"
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
double
v85
;
@ApiModelProperty
(
value
=
"大车流量"
,
notes
=
""
)
private
int
trafficFlowA
;
...
...
@@ -193,10 +210,14 @@ public class CrossDataRealtimePO {
@ApiModelProperty
(
value
=
"小车流量"
,
notes
=
""
)
private
int
trafficFlowC
;
@ApiModelProperty
(
value
=
"时间占有率"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
double
timeOccupancy
;
@ApiModelProperty
(
value
=
"空间占有率"
,
notes
=
"平均空间密度(长度占比)"
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
double
vehicleLengthRatioMean
;
/** add 20241123 适配神思数据 */
/**
* add 20241123 适配神思数据
*/
@ApiModelProperty
(
value
=
"执行策略 失衡 2拥堵 3溢出 4死锁 5 空放"
,
notes
=
""
)
private
Integer
strategy
;
@ApiModelProperty
(
value
=
"策略执行持续时间;单位:s"
,
notes
=
""
)
...
...
wj-databus/src/main/java/net/wanji/databus/po/CrossDirDataRealtimePO.java
View file @
6c6fedb1
...
...
@@ -3,9 +3,11 @@ package net.wanji.databus.po;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer
;
import
java.util.Date
;
...
...
@@ -46,6 +48,7 @@ public class CrossDirDataRealtimePO {
@ApiModelProperty
(
name
=
"排队长度(米)"
,
notes
=
""
)
public
Double
queueLength
;
@ApiModelProperty
(
name
=
"停车次数"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
public
Double
stopTimes
;
@ApiModelProperty
(
name
=
"延误时间"
,
notes
=
""
)
public
Integer
delayTime
;
...
...
wj-databus/src/main/java/net/wanji/databus/po/CrossLaneDataRealTimePO.java
View file @
6c6fedb1
...
...
@@ -2,9 +2,11 @@ package net.wanji.databus.po;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer
;
import
java.util.Date
;
...
...
@@ -31,6 +33,7 @@ public class CrossLaneDataRealTimePO {
@ApiModelProperty
(
name
=
"排队长度(米)"
,
notes
=
""
)
private
Double
queueLength
;
@ApiModelProperty
(
name
=
"停车次数"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
private
Double
stopTimes
;
@ApiModelProperty
(
name
=
"延误时间"
,
notes
=
""
)
private
Integer
delayTime
;
...
...
wj-databus/src/main/java/net/wanji/databus/po/CrossTurnDataRealtimePO.java
View file @
6c6fedb1
...
...
@@ -3,9 +3,11 @@ package net.wanji.databus.po;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
net.wanji.databus.config.DoubleToTwoDecimalPlacesSerializer
;
import
java.util.Date
;
...
...
@@ -54,6 +56,7 @@ public class CrossTurnDataRealtimePO {
public
Double
queueLength
;
/** 停车次数(次) */
@ApiModelProperty
(
name
=
"停车次数(次)"
,
notes
=
""
)
@JsonSerialize
(
using
=
DoubleToTwoDecimalPlacesSerializer
.
class
)
public
Double
stopTimes
;
/** 延误时间(秒) */
@ApiModelProperty
(
name
=
"延误时间(秒)"
,
notes
=
""
)
...
...
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