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
2c8f6023
Commit
2c8f6023
authored
Dec 07, 2024
by
董国亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
youhuajiekou
parent
f145ee10
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
163 additions
and
152 deletions
+163
-152
GreenwaveInducesController.java
...nji/opt/controller/induce/GreenwaveInducesController.java
+20
-18
GreenwaveInducesHistController.java
...opt/controller/induce/GreenwaveInducesHistController.java
+115
-105
InduceHistController.java
...net/wanji/opt/controller/induce/InduceHistController.java
+14
-15
InduceTemplateController.java
...wanji/opt/controller/induce/InduceTemplateController.java
+14
-14
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/induce/GreenwaveInducesController.java
View file @
2c8f6023
...
...
@@ -121,9 +121,11 @@ public class GreenwaveInducesController {
try
{
String
startTime
=
DateUtil
.
format
(
DateUtil
.
parse
(
m
.
getControlOptTimes
().
split
(
"\\|"
)[
0
],
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_SECOND
),
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_TIME
);
String
endTime
=
DateUtil
.
format
(
DateUtil
.
parse
(
m
.
getControlOptTimes
().
split
(
"\\|"
)[
1
],
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_SECOND
),
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_TIME
);
greenwaveDTO
.
setControlOptTimes
(
startTime
.
substring
(
0
,
startTime
.
lastIndexOf
(
":
00"
))+
"-"
+
endTime
.
substring
(
0
,
endTime
.
lastIndexOf
(
":00
"
)));
greenwaveDTO
.
setControlOptTimes
(
startTime
.
substring
(
0
,
startTime
.
lastIndexOf
(
":
"
))+
"-"
+
endTime
.
substring
(
0
,
endTime
.
lastIndexOf
(
":
"
)));
}
catch
(
ParseException
ex
){
ex
.
printStackTrace
();
greenwaveDTO
.
setControlOptTimes
(
m
.
getControlOptTimes
());
}
catch
(
StringIndexOutOfBoundsException
ex
){
ex
.
printStackTrace
();
greenwaveDTO
.
setControlOptTimes
(
m
.
getControlOptTimes
());
}
}
else
{
greenwaveDTO
.
setControlOptTimes
(
m
.
getControlOptTimes
());
...
...
@@ -146,19 +148,19 @@ public class GreenwaveInducesController {
/**
* 根据条件查询记录
*
* @param
G
reenwaveInduces 查询条件
* @param
g
reenwaveInduces 查询条件
* @return JsonViewObject
*/
@ApiOperation
(
value
=
"根据条件查询记录"
,
notes
=
"根据条件查询记录"
,
response
=
JsonViewObject
.
class
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/byCondition"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
getByWhere
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Query
.
class
})
GreenwaveInduces
G
reenwaveInduces
){
JsonViewObject
getByWhere
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Query
.
class
})
GreenwaveInduces
g
reenwaveInduces
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
String
jsonStr
=
JSON
.
toJSONString
(
G
reenwaveInduces
);
String
jsonStr
=
JSON
.
toJSONString
(
g
reenwaveInduces
);
try
{
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
Map
params
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
G
reenwaveInduces
),
Map
.
class
);
Map
params
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
g
reenwaveInduces
),
Map
.
class
);
// Map<String, Object> params = new HashMap<>();
// JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInduces), Map.class).forEach((k,v) -> params.put(StringUtils.camelToCapital(k.toString()).toLowerCase(), v));
List
<
GreenwaveInduces
>
greenwaveInducesList
=
this
.
greenwaveInducesMapper
.
findByMap
(
params
);
...
...
@@ -200,9 +202,11 @@ public class GreenwaveInducesController {
try
{
String
startTime
=
DateUtil
.
format
(
DateUtil
.
parse
(
m
.
getControlOptTimes
().
split
(
"\\|"
)[
0
],
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_SECOND
),
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_TIME
);
String
endTime
=
DateUtil
.
format
(
DateUtil
.
parse
(
m
.
getControlOptTimes
().
split
(
"\\|"
)[
1
],
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_SECOND
),
Constants
.
DATE_FORMAT
.
E_DATE_FORMAT_TIME
);
greenwaveDTO
.
setControlOptTimes
(
startTime
.
substring
(
0
,
startTime
.
lastIndexOf
(
":
00"
))+
"-"
+
endTime
.
substring
(
0
,
endTime
.
lastIndexOf
(
":00
"
)));
greenwaveDTO
.
setControlOptTimes
(
startTime
.
substring
(
0
,
startTime
.
lastIndexOf
(
":
"
))+
"-"
+
endTime
.
substring
(
0
,
endTime
.
lastIndexOf
(
":
"
)));
}
catch
(
ParseException
ex
){
ex
.
printStackTrace
();
greenwaveDTO
.
setControlOptTimes
(
m
.
getControlOptTimes
());
}
catch
(
StringIndexOutOfBoundsException
ex
){
ex
.
printStackTrace
();
greenwaveDTO
.
setControlOptTimes
(
m
.
getControlOptTimes
());
}
}
else
{
greenwaveDTO
.
setControlOptTimes
(
m
.
getControlOptTimes
());
...
...
@@ -219,7 +223,6 @@ public class GreenwaveInducesController {
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
log
.
error
(
"{} getByWhere error,jsonStr:{}"
,
this
.
getClass
().
getSimpleName
(),
jsonStr
,
e
);
}
return
jsonView
;
}
...
...
@@ -235,7 +238,6 @@ public class GreenwaveInducesController {
JsonViewObject
getById
(
@ApiParam
(
value
=
"记录的id"
,
required
=
true
,
example
=
"1"
)
@PathVariable
(
"id"
)
@NotBlank
(
message
=
"查询id不能为空"
)
String
id
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
GreenwaveInduces
GreenwaveInduces
=
this
.
greenwaveInducesService
.
getById
(
id
);
jsonView
.
success
(
GreenwaveInduces
);
...
...
@@ -278,22 +280,22 @@ public class GreenwaveInducesController {
/**
* 新建记录
*
* @param
G
reenwaveInduces
* @param
g
reenwaveInduces
* @return JsonViewObject
*/
@ApiOperation
(
value
=
"新建记录"
,
notes
=
"新建记录"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/creating"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
save
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Create
.
class
})
GreenwaveInduces
G
reenwaveInduces
){
JsonViewObject
save
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Create
.
class
})
GreenwaveInduces
g
reenwaveInduces
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
if
(
G
reenwaveInduces
!=
null
)
{
jsonView
=
this
.
greenwaveInducesService
.
saveOrUpdate
(
G
reenwaveInduces
)?
jsonView
.
success
():
jsonView
.
fail
();
if
(
g
reenwaveInduces
!=
null
)
{
jsonView
=
this
.
greenwaveInducesService
.
saveOrUpdate
(
g
reenwaveInduces
)?
jsonView
.
success
():
jsonView
.
fail
();
}
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
log
.
error
(
"AbstractRestServerImpl save error, jsonStr:{}"
,
JSON
.
toJSONString
(
G
reenwaveInduces
),
e
);
log
.
error
(
"AbstractRestServerImpl save error, jsonStr:{}"
,
JSON
.
toJSONString
(
g
reenwaveInduces
),
e
);
}
return
jsonView
;
}
...
...
@@ -301,21 +303,21 @@ public class GreenwaveInducesController {
/**
* 修改记录
*
* @param
G
reenwaveInduces
* @param
g
reenwaveInduces
* @return
*/
@ApiOperation
(
value
=
"修改记录"
,
notes
=
"修改记录"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/updating"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
update
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
GreenwaveInduces
G
reenwaveInduces
){
JsonViewObject
update
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
GreenwaveInduces
g
reenwaveInduces
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
if
(
G
reenwaveInduces
!=
null
)
{
jsonView
=
this
.
greenwaveInducesService
.
saveOrUpdate
(
G
reenwaveInduces
)?
jsonView
.
success
():
jsonView
.
fail
();
if
(
g
reenwaveInduces
!=
null
)
{
jsonView
=
this
.
greenwaveInducesService
.
saveOrUpdate
(
g
reenwaveInduces
)?
jsonView
.
success
():
jsonView
.
fail
();
}
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"UPDATE_FAILED_MSG"
));
log
.
error
(
"AbstractRestServerImpl update error, jsonStr:{}"
,
JSON
.
toJSONString
(
G
reenwaveInduces
),
e
);
log
.
error
(
"AbstractRestServerImpl update error, jsonStr:{}"
,
JSON
.
toJSONString
(
g
reenwaveInduces
),
e
);
}
return
jsonView
;
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/controller/induce/GreenwaveInducesHistController.java
View file @
2c8f6023
This diff is collapsed.
Click to expand it.
signal-optimize-service/src/main/java/net/wanji/opt/controller/induce/InduceHistController.java
View file @
2c8f6023
...
...
@@ -64,22 +64,21 @@ public class InduceHistController {
/**
* 根据条件查询记录
*
* @param
I
nduceHist 查询条件
* @param
i
nduceHist 查询条件
* @return JsonViewObject
*/
@ApiOperation
(
value
=
"根据条件查询记录"
,
notes
=
"根据条件查询记录"
,
response
=
JsonViewObject
.
class
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/byCondition"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
getByWhere
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Query
.
class
})
InduceHist
I
nduceHist
){
JsonViewObject
getByWhere
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Query
.
class
})
InduceHist
i
nduceHist
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
String
jsonStr
=
JSON
.
toJSONString
(
I
nduceHist
);
String
jsonStr
=
JSON
.
toJSONString
(
i
nduceHist
);
try
{
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
// Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class);
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
);
jsonView
.
success
(
list
);
}
catch
(
Exception
e
)
{
...
...
@@ -144,22 +143,22 @@ public class InduceHistController {
/**
* 新建记录
*
* @param
I
nduceHist
* @param
i
nduceHist
* @return JsonViewObject
*/
@ApiOperation
(
value
=
"新建记录"
,
notes
=
"新建记录"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/creating"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
save
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Create
.
class
})
InduceHist
I
nduceHist
){
JsonViewObject
save
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Create
.
class
})
InduceHist
i
nduceHist
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
if
(
I
nduceHist
!=
null
)
{
jsonView
=
this
.
induceHistService
.
saveOrUpdate
(
I
nduceHist
)?
jsonView
.
success
():
jsonView
.
fail
();
if
(
i
nduceHist
!=
null
)
{
jsonView
=
this
.
induceHistService
.
saveOrUpdate
(
i
nduceHist
)?
jsonView
.
success
():
jsonView
.
fail
();
}
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
log
.
error
(
"AbstractRestServerImpl save error, jsonStr:{}"
,
JSON
.
toJSONString
(
I
nduceHist
),
e
);
log
.
error
(
"AbstractRestServerImpl save error, jsonStr:{}"
,
JSON
.
toJSONString
(
i
nduceHist
),
e
);
}
return
jsonView
;
}
...
...
@@ -167,21 +166,21 @@ public class InduceHistController {
/**
* 修改记录
*
* @param
I
nduceHist
* @param
i
nduceHist
* @return
*/
@ApiOperation
(
value
=
"修改记录"
,
notes
=
"修改记录"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/updating"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
update
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
InduceHist
I
nduceHist
){
JsonViewObject
update
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
InduceHist
i
nduceHist
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
if
(
I
nduceHist
!=
null
)
{
jsonView
=
this
.
induceHistService
.
saveOrUpdate
(
I
nduceHist
)?
jsonView
.
success
():
jsonView
.
fail
();
if
(
i
nduceHist
!=
null
)
{
jsonView
=
this
.
induceHistService
.
saveOrUpdate
(
i
nduceHist
)?
jsonView
.
success
():
jsonView
.
fail
();
}
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"UPDATE_FAILED_MSG"
));
log
.
error
(
"AbstractRestServerImpl update error, jsonStr:{}"
,
JSON
.
toJSONString
(
I
nduceHist
),
e
);
log
.
error
(
"AbstractRestServerImpl update error, jsonStr:{}"
,
JSON
.
toJSONString
(
i
nduceHist
),
e
);
}
return
jsonView
;
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/controller/induce/InduceTemplateController.java
View file @
2c8f6023
...
...
@@ -67,21 +67,21 @@ public class InduceTemplateController {
/**
* 根据条件查询记录
*
* @param
I
nduceTemplate 查询条件
* @param
i
nduceTemplate 查询条件
* @return JsonViewObject
*/
@ApiOperation
(
value
=
"根据条件查询记录"
,
notes
=
"根据条件查询记录"
,
response
=
JsonViewObject
.
class
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/byCondition"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
getByWhere
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Query
.
class
})
InduceTemplate
I
nduceTemplate
){
JsonViewObject
getByWhere
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Query
.
class
})
InduceTemplate
i
nduceTemplate
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
String
jsonStr
=
JSON
.
toJSONString
(
I
nduceTemplate
);
String
jsonStr
=
JSON
.
toJSONString
(
i
nduceTemplate
);
try
{
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
// Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceTemplate), Map.class);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
I
nduceTemplate
),
Map
.
class
).
forEach
((
k
,
v
)
->
params
.
put
(
StringUtils
.
camelToCapital
(
k
.
toString
()).
toLowerCase
(),
v
));
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
nduceTemplate
),
Map
.
class
).
forEach
((
k
,
v
)
->
params
.
put
(
StringUtils
.
camelToCapital
(
k
.
toString
()).
toLowerCase
(),
v
));
List
list
=
this
.
induceTemplateService
.
listByMap
(
params
);
jsonView
.
success
(
list
);
...
...
@@ -147,22 +147,22 @@ public class InduceTemplateController {
/**
* 新建记录
*
* @param
I
nduceTemplate
* @param
i
nduceTemplate
* @return JsonViewObject
*/
@ApiOperation
(
value
=
"新建记录"
,
notes
=
"新建记录"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/creating"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
save
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Create
.
class
})
InduceTemplate
I
nduceTemplate
){
JsonViewObject
save
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Create
.
class
})
InduceTemplate
i
nduceTemplate
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
if
(
I
nduceTemplate
!=
null
)
{
jsonView
=
this
.
induceTemplateService
.
saveOrUpdate
(
I
nduceTemplate
)?
jsonView
.
success
():
jsonView
.
fail
();
if
(
i
nduceTemplate
!=
null
)
{
jsonView
=
this
.
induceTemplateService
.
saveOrUpdate
(
i
nduceTemplate
)?
jsonView
.
success
():
jsonView
.
fail
();
}
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"SAVE_FAILED_MSG"
));
log
.
error
(
"AbstractRestServerImpl save error, jsonStr:{}"
,
JSON
.
toJSONString
(
I
nduceTemplate
),
e
);
log
.
error
(
"AbstractRestServerImpl save error, jsonStr:{}"
,
JSON
.
toJSONString
(
i
nduceTemplate
),
e
);
}
return
jsonView
;
}
...
...
@@ -170,21 +170,21 @@ public class InduceTemplateController {
/**
* 修改记录
*
* @param
I
nduceTemplate
* @param
i
nduceTemplate
* @return
*/
@ApiOperation
(
value
=
"修改记录"
,
notes
=
"修改记录"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/updating"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
JsonViewObject
update
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
InduceTemplate
I
nduceTemplate
){
JsonViewObject
update
(
@ApiParam
(
value
=
"记录的JSON格式字符串"
,
required
=
true
)
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
InduceTemplate
i
nduceTemplate
){
JsonViewObject
jsonView
=
JsonViewObject
.
newInstance
();
long
start
=
System
.
currentTimeMillis
();
try
{
if
(
I
nduceTemplate
!=
null
)
{
jsonView
=
this
.
induceTemplateService
.
saveOrUpdate
(
I
nduceTemplate
)?
jsonView
.
success
():
jsonView
.
fail
();
if
(
i
nduceTemplate
!=
null
)
{
jsonView
=
this
.
induceTemplateService
.
saveOrUpdate
(
i
nduceTemplate
)?
jsonView
.
success
():
jsonView
.
fail
();
}
}
catch
(
Exception
e
)
{
jsonView
.
fail
(
I18nResourceBundle
.
getConstants
(
"UPDATE_FAILED_MSG"
));
log
.
error
(
"AbstractRestServerImpl update error, jsonStr:{}"
,
JSON
.
toJSONString
(
I
nduceTemplate
),
e
);
log
.
error
(
"AbstractRestServerImpl update error, jsonStr:{}"
,
JSON
.
toJSONString
(
i
nduceTemplate
),
e
);
}
return
jsonView
;
}
...
...
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