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
f5f46dc1
Commit
f5f46dc1
authored
Feb 09, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 绿波诱导查询30天内的历史;
parent
681a0346
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
InduceHistController.java
...net/wanji/opt/controller/induce/InduceHistController.java
+15
-2
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/induce/InduceHistController.java
View file @
f5f46dc1
...
@@ -10,10 +10,12 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
...
@@ -10,10 +10,12 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.common.framework.rest.Page
;
import
net.wanji.common.framework.rest.Page
;
import
net.wanji.common.framework.rest.ValidationGroups
;
import
net.wanji.common.framework.rest.ValidationGroups
;
import
net.wanji.common.utils.tool.DateUtil
;
import
net.wanji.common.utils.tool.StringUtils
;
import
net.wanji.common.utils.tool.StringUtils
;
import
net.wanji.opt.dto.induce.InduceDTO
;
import
net.wanji.opt.dto.induce.InduceDTO
;
import
net.wanji.opt.entity.InduceHist
;
import
net.wanji.opt.entity.InduceHist
;
import
net.wanji.opt.service.induce.InduceHistService
;
import
net.wanji.opt.service.induce.InduceHistService
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -79,8 +81,19 @@ public class InduceHistController {
...
@@ -79,8 +81,19 @@ public class InduceHistController {
// Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class);
// Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
induceHist
),
Map
.
class
).
forEach
((
k
,
v
)
->
params
.
put
(
StringUtils
.
camelToCapital
(
k
.
toString
()).
toLowerCase
(),
v
));
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
induceHist
),
Map
.
class
).
forEach
((
k
,
v
)
->
params
.
put
(
StringUtils
.
camelToCapital
(
k
.
toString
()).
toLowerCase
(),
v
));
List
list
=
this
.
induceHistService
.
listByMap
(
params
);
List
<
InduceHist
>
list
=
this
.
induceHistService
.
listByMap
(
params
);
jsonView
.
success
(
list
);
List
<
InduceHist
>
result
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
for
(
InduceHist
hist
:
list
)
{
Date
createTime
=
hist
.
getCreateTime
();
Date
date
=
DateUtil
.
addDay
(
DateUtil
.
StringToDate
(
new
Date
()),
-
30
);
if
(
createTime
.
before
(
date
))
{
continue
;
}
result
.
add
(
hist
);
}
}
jsonView
.
success
(
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getByWhere error,jsonStr:{}"
,
this
.
getClass
().
getSimpleName
(),
jsonStr
,
e
);
log
.
error
(
"{} getByWhere error,jsonStr:{}"
,
this
.
getClass
().
getSimpleName
(),
jsonStr
,
e
);
...
...
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