Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
王飞
vehicle-quality-review
Commits
29e4eee9
Commit
29e4eee9
authored
Dec 28, 2023
by
王飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangfei' into 'dev'
Feat See merge request
!15
parents
ed9f0032
38aaca5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
81 deletions
+72
-81
ReviewSceneChangeTaskController.java
...n/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
+7
-7
AjaxResult.java
...rc/main/java/com/ruoyi/common/core/domain/AjaxResult.java
+65
-74
No files found.
quality-review/src/main/java/com/ruoyi/web/ReviewSceneChangeTaskController.java
View file @
29e4eee9
...
...
@@ -2,7 +2,7 @@ package com.ruoyi.web;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.
AjaxResult
;
import
com.ruoyi.common.core.domain.
R
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.bean.BeanUtils
;
...
...
@@ -35,35 +35,35 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"场景变更任务"
,
businessType
=
BusinessType
.
INSERT
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/create"
)
public
AjaxResult
create
(
@Validated
@RequestBody
ReviewSceneChangeTaskCreateRequest
request
)
{
public
R
<
String
>
create
(
@Validated
@RequestBody
ReviewSceneChangeTaskCreateRequest
request
)
{
ReviewSceneChangeTask
reviewSceneChangeTask
=
new
ReviewSceneChangeTask
();
BeanUtils
.
copyBeanProp
(
reviewSceneChangeTask
,
request
);
reviewSceneChangeTaskService
.
create
(
reviewSceneChangeTask
);
return
success
();
return
R
.
ok
();
}
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"审核通过任务"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/pass"
)
public
AjaxResult
pass
(
@Validated
@RequestBody
ReviewSceneChangeTaskPassRequest
request
)
{
public
R
<
String
>
pass
(
@Validated
@RequestBody
ReviewSceneChangeTaskPassRequest
request
)
{
reviewSceneChangeTaskService
.
pass
(
request
.
getTaskId
(),
request
.
getComment
());
return
success
();
return
R
.
ok
();
}
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"审核驳回任务"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/reject"
)
public
AjaxResult
reject
(
@Validated
@RequestBody
ReviewSceneChangeTaskPassRequest
request
)
{
public
R
<
String
>
reject
(
@Validated
@RequestBody
ReviewSceneChangeTaskPassRequest
request
)
{
reviewSceneChangeTaskService
.
reject
(
request
.
getTaskId
(),
request
.
getComment
());
return
success
();
return
R
.
ok
();
}
/**
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
View file @
29e4eee9
package
com
.
ruoyi
.
common
.
core
.
domain
;
import
java.
io.Serializable
;
import
java.
util.HashMap
;
import
java.util.Objects
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.utils.StringUtils
;
/**
* 操作消息提醒
*
*
* @author ruoyi
*/
public
class
AjaxResult
<
T
>
implements
Serializable
public
class
AjaxResult
extends
HashMap
<
String
,
Object
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
数据对象
*/
public
static
final
String
DATA_TAG
=
"data
"
;
/**
状态码
*/
public
static
final
String
CODE_TAG
=
"code
"
;
/**
* 是否成功 true or false
*/
private
boolean
success
;
/** 返回内容 */
public
static
final
String
MSG_TAG
=
"msg"
;
/**
* 状态码
*/
private
int
code
;
/**
* 返回内容
*/
private
String
msg
;
/**
* 数据对象
*/
private
T
data
;
/** 数据对象 */
public
static
final
String
DATA_TAG
=
"data"
;
/**
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
...
...
@@ -47,38 +33,29 @@ public class AjaxResult<T> implements Serializable
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code
错误
码
* @param code
状态
码
* @param msg 返回内容
* @param data 数据对象
*/
public
AjaxResult
(
int
code
,
String
msg
,
T
data
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
if
(
StringUtils
.
isNotNull
(
data
))
{
this
.
data
=
data
;
}
if
(
code
==
HttpStatus
.
SUCCESS
)
{
this
.
success
=
Boolean
.
TRUE
;
}
else
{
this
.
success
=
Boolean
.
FALSE
;
}
public
AjaxResult
(
int
code
,
String
msg
)
{
super
.
put
(
CODE_TAG
,
code
);
super
.
put
(
MSG_TAG
,
msg
);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code
错误
码
* @param code
状态
码
* @param msg 返回内容
* @param data 数据对象
*/
public
AjaxResult
(
int
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
if
(
code
==
HttpStatus
.
SUCCESS
)
{
this
.
success
=
Boolean
.
TRUE
;
}
else
{
this
.
success
=
Boolean
.
FALSE
;
public
AjaxResult
(
int
code
,
String
msg
,
Object
data
)
{
super
.
put
(
CODE_TAG
,
code
);
super
.
put
(
MSG_TAG
,
msg
);
if
(
StringUtils
.
isNotNull
(
data
))
{
super
.
put
(
DATA_TAG
,
data
);
}
}
...
...
@@ -97,7 +74,7 @@ public class AjaxResult<T> implements Serializable
*
* @return 成功消息
*/
public
static
<
U
>
AjaxResult
<
U
>
success
(
U
data
)
public
static
AjaxResult
success
(
Object
data
)
{
return
AjaxResult
.
success
(
"操作成功"
,
data
);
}
...
...
@@ -120,7 +97,7 @@ public class AjaxResult<T> implements Serializable
* @param data 数据对象
* @return 成功消息
*/
public
static
<
U
>
AjaxResult
<
U
>
success
(
String
msg
,
U
data
)
public
static
AjaxResult
success
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
SUCCESS
,
msg
,
data
);
}
...
...
@@ -143,7 +120,7 @@ public class AjaxResult<T> implements Serializable
* @param data 数据对象
* @return 警告消息
*/
public
static
<
U
>
AjaxResult
<
U
>
warn
(
String
msg
,
U
data
)
public
static
AjaxResult
warn
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
WARN
,
msg
,
data
);
}
...
...
@@ -151,7 +128,7 @@ public class AjaxResult<T> implements Serializable
/**
* 返回错误消息
*
* @return
* @return
错误消息
*/
public
static
AjaxResult
error
()
{
...
...
@@ -162,7 +139,7 @@ public class AjaxResult<T> implements Serializable
* 返回错误消息
*
* @param msg 返回内容
* @return
警告
消息
* @return
错误
消息
*/
public
static
AjaxResult
error
(
String
msg
)
{
...
...
@@ -174,9 +151,9 @@ public class AjaxResult<T> implements Serializable
*
* @param msg 返回内容
* @param data 数据对象
* @return
警告
消息
* @return
错误
消息
*/
public
static
<
U
>
AjaxResult
<
U
>
error
(
String
msg
,
U
data
)
public
static
AjaxResult
error
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
ERROR
,
msg
,
data
);
}
...
...
@@ -184,43 +161,57 @@ public class AjaxResult<T> implements Serializable
/**
* 返回错误消息
*
* @param code
响应
码
* @param msg
响应消息
* @return
警告
消息
* @param code
状态
码
* @param msg
返回内容
* @return
错误
消息
*/
public
static
<
U
>
AjaxResult
<
U
>
error
(
int
code
,
String
msg
)
public
static
AjaxResult
error
(
int
code
,
String
msg
)
{
return
new
AjaxResult
(
code
,
msg
);
return
new
AjaxResult
(
code
,
msg
,
null
);
}
/**
*
方便链式调用
*
是否为成功消息
*
* @param key 键
* @param value 值
* @return 数据对象
* @return 结果
*/
@Deprecated
public
AjaxResult
put
(
String
key
,
Object
value
)
{
//super.put(key, value);
return
this
;
public
boolean
isSuccess
()
{
return
Objects
.
equals
(
HttpStatus
.
SUCCESS
,
this
.
get
(
CODE_TAG
));
}
/**
* 是否为
成功
消息
* 是否为
警告
消息
*
* @return 结果
*/
public
boolean
isSuccess
()
{
return
success
;
public
boolean
isWarn
()
{
return
Objects
.
equals
(
HttpStatus
.
WARN
,
this
.
get
(
CODE_TAG
));
}
public
String
getMsg
()
{
return
msg
;
/**
* 是否为错误消息
*
* @return 结果
*/
public
boolean
isError
()
{
return
Objects
.
equals
(
HttpStatus
.
ERROR
,
this
.
get
(
CODE_TAG
));
}
public
Integer
getCode
()
{
return
code
;
/**
* 方便链式调用
*
* @param key 键
* @param value 值
* @return 数据对象
*/
@Override
public
AjaxResult
put
(
String
key
,
Object
value
)
{
super
.
put
(
key
,
value
);
return
this
;
}
}
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