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
12b47efb
Commit
12b47efb
authored
Feb 09, 2025
by
zhoushiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持按某个方向查询
parent
9abe1678
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
6 deletions
+33
-6
GreenwaveHistRestServer.java
...ava/net/wanji/opt/controller/GreenwaveHistRestServer.java
+3
-2
GreenwaveHistProvider.java
...ain/java/net/wanji/opt/service/GreenwaveHistProvider.java
+1
-1
GreenwaveHistProviderImpl.java
...net/wanji/opt/service/impl/GreenwaveHistProviderImpl.java
+7
-3
GreenwaveHistMapper.xml
...service/src/main/resources/mapper/GreenwaveHistMapper.xml
+22
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/GreenwaveHistRestServer.java
View file @
12b47efb
...
@@ -245,12 +245,13 @@ public class GreenwaveHistRestServer {
...
@@ -245,12 +245,13 @@ public class GreenwaveHistRestServer {
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"2025-01-13 00:00:00"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"2025-01-13 00:00:00"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"2025-01-13 23:59:59"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"截止时间,格式:yyyy-MM-dd HH:mm:ss"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"2025-01-13 23:59:59"
),
@ApiImplicitParam
(
name
=
"objectType"
,
value
=
"统计对象类型 1:方向级指标 2:转向级指标 3:车道级指标 4:路口级指标"
,
required
=
true
,
dataType
=
"Integer"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"objectType"
,
value
=
"统计对象类型 1:方向级指标 2:转向级指标 3:车道级指标 4:路口级指标"
,
required
=
true
,
dataType
=
"Integer"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"directionName"
,
value
=
"方向"
,
required
=
false
,
dataType
=
"Integer"
,
defaultValue
=
"北进口"
),
})
})
@ApiResponses
({
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
CrossLaneDataHistPoExtend
.
class
,
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
CrossLaneDataHistPoExtend
.
class
,
responseHeaders
=
{
@ResponseHeader
(
name
=
"Content-Type"
,
description
=
"application/json"
)})
responseHeaders
=
{
@ResponseHeader
(
name
=
"Content-Type"
,
description
=
"application/json"
)})
})
})
public
JsonViewObject
findGreenWaveCrossObjectIndex
(
String
crossId
,
String
startTime
,
String
endTime
,
String
groupType
,
Integer
objectType
)
{
public
JsonViewObject
findGreenWaveCrossObjectIndex
(
String
crossId
,
String
startTime
,
String
endTime
,
String
groupType
,
Integer
objectType
,
@RequestParam
(
defaultValue
=
""
)
String
directionName
)
{
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
try
{
try
{
...
@@ -258,7 +259,7 @@ public class GreenwaveHistRestServer {
...
@@ -258,7 +259,7 @@ public class GreenwaveHistRestServer {
if
(
Objects
.
equals
(
"5"
,
groupType
))
{
if
(
Objects
.
equals
(
"5"
,
groupType
))
{
list
=
greenwaveHistProvider
.
findCrossAvgIndex
(
crossId
,
startTime
,
endTime
,
groupType
,
objectType
);
list
=
greenwaveHistProvider
.
findCrossAvgIndex
(
crossId
,
startTime
,
endTime
,
groupType
,
objectType
);
}
else
{
}
else
{
list
=
greenwaveHistProvider
.
findCrossObjectIndex
(
crossId
,
startTime
,
endTime
,
groupType
,
objectType
);
list
=
greenwaveHistProvider
.
findCrossObjectIndex
(
crossId
,
startTime
,
endTime
,
groupType
,
objectType
,
directionName
);
}
}
jsonView
.
success
(
list
);
jsonView
.
success
(
list
);
}
catch
(
DubboProviderException
e
)
{
}
catch
(
DubboProviderException
e
)
{
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/GreenwaveHistProvider.java
View file @
12b47efb
...
@@ -103,7 +103,7 @@ public interface GreenwaveHistProvider extends BaseDubboInterface<GreenwaveHist>
...
@@ -103,7 +103,7 @@ public interface GreenwaveHistProvider extends BaseDubboInterface<GreenwaveHist>
* @return
* @return
* @throws DubboProviderException
* @throws DubboProviderException
*/
*/
JSONObject
findCrossObjectIndex
(
String
crossId
,
String
startTime
,
String
endTime
,
String
groupType
,
Integer
objectType
)
throws
DubboProviderException
;
JSONObject
findCrossObjectIndex
(
String
crossId
,
String
startTime
,
String
endTime
,
String
groupType
,
Integer
objectType
,
String
dirName
)
throws
DubboProviderException
;
/**
/**
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/GreenwaveHistProviderImpl.java
View file @
12b47efb
...
@@ -401,14 +401,16 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
...
@@ -401,14 +401,16 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
}
}
@Override
@Override
public
JSONObject
findCrossObjectIndex
(
String
crossId
,
String
startTime
,
String
endTime
,
String
groupType
,
Integer
objectType
)
throws
DubboProviderException
{
public
JSONObject
findCrossObjectIndex
(
String
crossId
,
String
startTime
,
String
endTime
,
String
groupType
,
Integer
objectType
,
String
directionName
)
throws
DubboProviderException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"crossId"
,
crossId
);
params
.
put
(
"crossId"
,
crossId
);
params
.
put
(
"startDate"
,
startTime
);
params
.
put
(
"startDate"
,
startTime
);
params
.
put
(
"endDate"
,
endTime
);
params
.
put
(
"endDate"
,
endTime
);
params
.
put
(
"groupType"
,
groupType
);
params
.
put
(
"groupType"
,
groupType
);
params
.
put
(
"objectType"
,
objectType
);
params
.
put
(
"objectType"
,
objectType
);
if
(
StringUtils
.
isNotBlank
(
directionName
))
{
params
.
put
(
"dir"
,
BaseEnum
.
SignalDirectionEnum
.
getCodeByName
(
directionName
.
substring
(
0
,
directionName
.
indexOf
(
"进口"
))));
}
//存放时段
//存放时段
Set
<
String
>
sortedSet
=
EsDateIndexUtil
.
getTimeGranularityAxis
(
groupType
,
startTime
,
endTime
);
Set
<
String
>
sortedSet
=
EsDateIndexUtil
.
getTimeGranularityAxis
(
groupType
,
startTime
,
endTime
);
//======================================================================================================//
//======================================================================================================//
...
@@ -515,7 +517,9 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
...
@@ -515,7 +517,9 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
}
}
}
}
allList
=
allList
.
stream
().
sorted
(
Comparator
.
comparing
(
o
->
Integer
.
valueOf
(
o
.
get
(
"dirType"
).
toString
()))).
collect
(
Collectors
.
toList
());
allList
=
allList
.
stream
().
sorted
(
Comparator
.
comparing
(
o
->
Integer
.
valueOf
(
o
.
get
(
"dirType"
).
toString
()))).
collect
(
Collectors
.
toList
());
if
(
params
.
get
(
"dir"
)
!=
null
)
{
allList
=
allList
.
stream
().
filter
(
o
->
Objects
.
equals
(
params
.
get
(
"dir"
).
toString
(),
o
.
get
(
"dirType"
).
toString
())).
collect
(
Collectors
.
toList
());
}
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"timeList"
,
sortedSet
);
jsonObject
.
put
(
"timeList"
,
sortedSet
);
jsonObject
.
put
(
"dataList"
,
allList
);
jsonObject
.
put
(
"dataList"
,
allList
);
...
...
signal-optimize-service/src/main/resources/mapper/GreenwaveHistMapper.xml
View file @
12b47efb
...
@@ -361,6 +361,28 @@
...
@@ -361,6 +361,28 @@
<!-- AND start_time >= #{startDate} and start_time < #{endDate} -->
<!-- AND start_time >= #{startDate} and start_time < #{endDate} -->
and batch_time between UNIX_TIMESTAMP(#{startDate}) and UNIX_TIMESTAMP(#{endDate})
and batch_time between UNIX_TIMESTAMP(#{startDate}) and UNIX_TIMESTAMP(#{endDate})
</if>
</if>
<choose>
<!-- 方向级 -->
<when
test=
"objectType==1"
>
<if
test=
"dir !=null and dir !=null"
>
and dir_type = #{dir}
</if>
</when>
<!-- 转向级 -->
<when
test=
"objectType==2"
>
<if
test=
"dir !=null and dir !=null"
>
and t.in_dir = #{dir}
</if>
</when>
<!-- 车道级 -->
<when
test=
"objectType==3"
>
<if
test=
"dir !=null and dir !=null"
>
and t2.dir = #{dir}
</if>
</when>
<otherwise>
</otherwise>
</choose>
) t
) t
<choose>
<choose>
<!-- 方向级 -->
<!-- 方向级 -->
...
...
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