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
36fc4f68
Commit
36fc4f68
authored
Dec 03, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 绿波子区指标
parent
ee9a9ccb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
11 deletions
+102
-11
GreenBeltDirEnum.java
...ain/java/net/wanji/opt/common/enums/GreenBeltDirEnum.java
+30
-0
StrategyGreenBeltController.java
...opt/synthesis/controller/StrategyGreenBeltController.java
+9
-5
GreenBeltAreaIndexVO.java
...va/net/wanji/opt/synthesis/pojo/GreenBeltAreaIndexVO.java
+32
-0
StrategyGreenBeltService.java
...wanji/opt/synthesis/service/StrategyGreenBeltService.java
+2
-1
StrategyGreenBeltServiceImpl.java
.../synthesis/service/impl/StrategyGreenBeltServiceImpl.java
+25
-3
GreenwaveRealtimePO.java
...ava/net/wanji/databus/dao/entity/GreenwaveRealtimePO.java
+2
-0
GreenwaveRealtimeMapper.java
...net/wanji/databus/dao/mapper/GreenwaveRealtimeMapper.java
+2
-2
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/common/enums/GreenBeltDirEnum.java
0 → 100644
View file @
36fc4f68
package
net
.
wanji
.
opt
.
common
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
net.wanji.common.utils.tool.StringUtils
;
/**
* @author duanruiming
* @date 2024/12/03 19:14
*/
@Getter
@AllArgsConstructor
public
enum
GreenBeltDirEnum
{
E2W
(
"e2w"
,
"东向西"
),
W2E
(
"w2e"
,
"西向东"
),
N2S
(
"n2s"
,
"北向南"
),
S2N
(
"s2n"
,
"南向北"
);
private
String
code
;
private
String
desc
;
public
static
String
getDesc
(
String
code
)
{
for
(
GreenBeltDirEnum
dirEnum
:
GreenBeltDirEnum
.
values
())
{
if
(
StringUtils
.
equalsIgnoreCase
(
code
,
dirEnum
.
getCode
()))
{
return
dirEnum
.
getDesc
();
}
}
return
""
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyGreenBeltController.java
View file @
36fc4f68
...
@@ -5,14 +5,18 @@ import io.swagger.annotations.ApiOperation;
...
@@ -5,14 +5,18 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
io.swagger.annotations.ApiResponses
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.
databus.dao.entity.GreenwaveRealtimeP
O
;
import
net.wanji.
opt.synthesis.pojo.GreenBeltAreaIndexV
O
;
import
net.wanji.opt.synthesis.service.impl.StrategyGreenBeltServiceImpl
;
import
net.wanji.opt.synthesis.service.impl.StrategyGreenBeltServiceImpl
;
import
net.wanji.opt.vo.*
;
import
net.wanji.opt.vo.GreenBeltChartVO
;
import
org.springframework.web.bind.annotation.*
;
import
net.wanji.opt.vo.GreenBeltInfoVO
;
import
net.wanji.opt.vo.GreenBeltStopTimesQueueLengthVO
;
import
net.wanji.opt.vo.HotspotCrossVO
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.MediaType
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -58,7 +62,7 @@ public class StrategyGreenBeltController {
...
@@ -58,7 +62,7 @@ public class StrategyGreenBeltController {
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
HotspotCrossVO
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
HotspotCrossVO
.
class
),
})
})
public
JsonViewObject
greenBeltAreaIndex
(
Integer
greenId
)
throws
Exception
{
public
JsonViewObject
greenBeltAreaIndex
(
Integer
greenId
)
throws
Exception
{
Green
waveRealtimeP
O
result
=
strategyGreenBeltService
.
greenBeltAreaIndex
(
greenId
);
Green
BeltAreaIndexV
O
result
=
strategyGreenBeltService
.
greenBeltAreaIndex
(
greenId
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
}
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/GreenBeltAreaIndexVO.java
0 → 100644
View file @
36fc4f68
package
net
.
wanji
.
opt
.
synthesis
.
pojo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/12/03 18:59
*/
@Data
@ApiModel
(
"绿波干线子区返回参数"
)
public
class
GreenBeltAreaIndexVO
{
@ApiModelProperty
(
"子区状态"
)
private
Integer
status
;
@ApiModelProperty
(
"优化策略"
)
private
String
strategyName
;
@ApiModelProperty
(
"绿波方向详情"
)
private
List
<
DirDetail
>
dirDetail
;
@Data
public
static
class
DirDetail
{
@ApiModelProperty
(
"绿波名称"
)
private
String
dirName
;
@ApiModelProperty
(
"行程时间"
)
private
Integer
travelTime
;
@ApiModelProperty
(
"停车次数"
)
private
Double
StopTimes
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/StrategyGreenBeltService.java
View file @
36fc4f68
package
net
.
wanji
.
opt
.
synthesis
.
service
;
package
net
.
wanji
.
opt
.
synthesis
.
service
;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
net.wanji.opt.synthesis.pojo.GreenBeltAreaIndexVO
;
import
net.wanji.opt.vo.GreenBeltChartVO
;
import
net.wanji.opt.vo.GreenBeltChartVO
;
import
net.wanji.opt.vo.GreenBeltStopTimesQueueLengthVO
;
import
net.wanji.opt.vo.GreenBeltStopTimesQueueLengthVO
;
...
@@ -15,5 +16,5 @@ public interface StrategyGreenBeltService {
...
@@ -15,5 +16,5 @@ public interface StrategyGreenBeltService {
GreenBeltChartVO
selectChart
(
Integer
greenId
,
Date
queryDate
);
GreenBeltChartVO
selectChart
(
Integer
greenId
,
Date
queryDate
);
List
<
GreenBeltStopTimesQueueLengthVO
>
greenBeltStopTimeQueueLength
(
Integer
greenId
);
List
<
GreenBeltStopTimesQueueLengthVO
>
greenBeltStopTimeQueueLength
(
Integer
greenId
);
Green
waveRealtimeP
O
greenBeltAreaIndex
(
Integer
greenId
);
Green
BeltAreaIndexV
O
greenBeltAreaIndex
(
Integer
greenId
);
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyGreenBeltServiceImpl.java
View file @
36fc4f68
...
@@ -12,8 +12,10 @@ import net.wanji.databus.dao.entity.GreenwaveHistPO;
...
@@ -12,8 +12,10 @@ import net.wanji.databus.dao.entity.GreenwaveHistPO;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
net.wanji.databus.dao.mapper.GreenwaveHistMapper
;
import
net.wanji.databus.dao.mapper.GreenwaveHistMapper
;
import
net.wanji.databus.dao.mapper.GreenwaveRealtimeMapper
;
import
net.wanji.databus.dao.mapper.GreenwaveRealtimeMapper
;
import
net.wanji.opt.common.enums.GreenBeltDirEnum
;
import
net.wanji.opt.dao.mapper.StrategyGreenOptHistMapper
;
import
net.wanji.opt.dao.mapper.StrategyGreenOptHistMapper
;
import
net.wanji.opt.po.StrategyGreenOptHistEntity
;
import
net.wanji.opt.po.StrategyGreenOptHistEntity
;
import
net.wanji.opt.synthesis.pojo.GreenBeltAreaIndexVO
;
import
net.wanji.opt.synthesis.service.StrategyGreenBeltService
;
import
net.wanji.opt.synthesis.service.StrategyGreenBeltService
;
import
net.wanji.opt.vo.GreenBeltChartVO
;
import
net.wanji.opt.vo.GreenBeltChartVO
;
import
net.wanji.opt.vo.GreenBeltInfoVO
;
import
net.wanji.opt.vo.GreenBeltInfoVO
;
...
@@ -41,9 +43,29 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
...
@@ -41,9 +43,29 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
GreenwaveRealtimeMapper
greenwaveRealtimeMapper
;
GreenwaveRealtimeMapper
greenwaveRealtimeMapper
;
@Override
@Override
public
GreenwaveRealtimePO
greenBeltAreaIndex
(
Integer
greenId
)
{
public
GreenBeltAreaIndexVO
greenBeltAreaIndex
(
Integer
greenId
)
{
GreenwaveRealtimePO
greenwaveRealtimePO
=
greenwaveRealtimeMapper
.
selectById
(
greenId
);
LambdaQueryWrapper
<
GreenwaveRealtimePO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
return
greenwaveRealtimePO
;
queryWrapper
.
eq
(
GreenwaveRealtimePO:
:
getGreenId
,
greenId
);
List
<
GreenwaveRealtimePO
>
realtimePOS
=
greenwaveRealtimeMapper
.
selectList
(
queryWrapper
);
GreenBeltAreaIndexVO
greenBeltAreaIndexVO
=
new
GreenBeltAreaIndexVO
();
Integer
status
=
1
;
if
(!
CollectionUtils
.
isEmpty
(
realtimePOS
))
{
List
<
GreenBeltAreaIndexVO
.
DirDetail
>
dirDetails
=
new
ArrayList
<>();
for
(
GreenwaveRealtimePO
realtimePO
:
realtimePOS
)
{
GreenBeltAreaIndexVO
.
DirDetail
dirDetail
=
new
GreenBeltAreaIndexVO
.
DirDetail
();
String
roadDirection
=
realtimePO
.
getRoadDirection
();
dirDetail
.
setDirName
(
GreenBeltDirEnum
.
getDesc
(
roadDirection
));
dirDetail
.
setTravelTime
(
realtimePO
.
getTrvalTime
());
dirDetail
.
setStopTimes
(
realtimePO
.
getStopTimes
());
status
=
status
>=
realtimePO
.
getStatus
()
?
status
:
realtimePO
.
getStatus
();
dirDetails
.
add
(
dirDetail
);
}
greenBeltAreaIndexVO
.
setDirDetail
(
dirDetails
);
greenBeltAreaIndexVO
.
setStatus
(
status
);
greenBeltAreaIndexVO
.
setStrategyName
(
"绿波带"
);
}
return
greenBeltAreaIndexVO
;
}
}
@Override
@Override
...
...
wj-databus/src/main/java/net/wanji/databus/dao/entity/GreenwaveRealtimePO.java
View file @
36fc4f68
...
@@ -2,6 +2,7 @@ package net.wanji.databus.dao.entity;
...
@@ -2,6 +2,7 @@ package net.wanji.databus.dao.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
@@ -12,6 +13,7 @@ import java.util.Date;
...
@@ -12,6 +13,7 @@ import java.util.Date;
@Data
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@TableName
(
"t_greenwave_realtime"
)
public
class
GreenwaveRealtimePO
{
public
class
GreenwaveRealtimePO
{
/** 绿波ID */
/** 绿波ID */
@ApiModelProperty
(
name
=
"id"
,
notes
=
""
)
@ApiModelProperty
(
name
=
"id"
,
notes
=
""
)
...
...
wj-databus/src/main/java/net/wanji/databus/dao/mapper/GreenwaveRealtimeMapper.java
View file @
36fc4f68
package
net
.
wanji
.
databus
.
dao
.
mapper
;
package
net
.
wanji
.
databus
.
dao
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
feign.Param
;
import
feign.Param
;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
net.wanji.databus.dao.entity.GreenwaveRealtimePO
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -12,9 +13,8 @@ import java.util.List;
...
@@ -12,9 +13,8 @@ import java.util.List;
* @date 2022/10/31 11:03
* @date 2022/10/31 11:03
*/
*/
@Repository
@Repository
public
interface
GreenwaveRealtimeMapper
{
public
interface
GreenwaveRealtimeMapper
extends
BaseMapper
<
GreenwaveRealtimePO
>
{
GreenwaveRealtimePO
selectById
(
Integer
id
);
GreenwaveRealtimePO
selectById
(
Integer
id
);
int
insertBatch
(
@Param
(
"list"
)
List
<
GreenwaveRealtimePO
>
list
);
int
insertBatch
(
@Param
(
"list"
)
List
<
GreenwaveRealtimePO
>
list
);
int
deleteOne
(
@Param
(
"greenId"
)
Integer
greenId
);
int
deleteOne
(
@Param
(
"greenId"
)
Integer
greenId
);
...
...
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